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 © 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 © 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 © 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 © 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ît Bride</li> -<li>Baligh El Hefni </li> -</ul> -</html>", - info="<html> -<p><b>Copyright © 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ît Bride</li> +<li>Baligh El Hefni </li> +</ul> +</html>", + info="<html> +<p><b>Copyright © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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% to 50%</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 © 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% to 50%</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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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°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 © 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°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 © 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°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 © 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°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 © 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°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 © 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°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 © 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°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 © 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°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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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% to 50%</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 © 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% to 50%</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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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ît Bride </li> -</ul> -</html>", - info="<html> -<p><b>Copyright © 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ît Bride </li> +</ul> +</html>", + info="<html> +<p><b>Copyright © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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ît Bride</li> -<li>Baligh El Hefni </li> -</ul> -</html>", - info="<html> -<p><b>Copyright © 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ît Bride</li> +<li>Baligh El Hefni </li> +</ul> +</html>", + info="<html> +<p><b>Copyright © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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% to 50%</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 © 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% to 50%</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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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°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 © 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°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 © 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°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 © 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°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 © 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°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 © 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°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 © 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°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 © 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°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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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% to 50%</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 © 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% to 50%</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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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échiné </li> -</ul> -</html>", - info="<html> -<p><b>Copyright © 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échiné </li> +</ul> +</html>", + info="<html> +<p><b>Copyright © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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î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 © 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î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ît Bride </li> -</ul> -</html>", - info="<html> -<p><b>Copyright © 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ît Bride </li> +</ul> +</html>", + info="<html> +<p><b>Copyright © 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 © 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 © 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 © 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 © 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 © 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î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 © 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î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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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\"> </a>corresponds to a Catmull-Rom spline and <a name=\"_x0000_i1025\"> </a>t < 0 corresponds to a more “loose” spline. From testing, t=0.5 <a name=\"_x0000_i1025\"> </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 > 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\"> </a>corresponds to a Catmull-Rom spline and <a name=\"_x0000_i1025\"> </a>t < 0 corresponds to a more “loose” spline. From testing, t=0.5 <a name=\"_x0000_i1025\"> </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 > 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 © 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 © 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\"> </a>corresponds to a Catmull-Rom spline and <a name=\"_x0000_i1025\"> </a>t < 0 corresponds to a more “loose” spline. From testing, t=0.5 <a name=\"_x0000_i1025\"> </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 > 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 = [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\"> </a>corresponds to a Catmull-Rom spline and <a name=\"_x0000_i1025\"> </a>t < 0 corresponds to a more “loose” spline. From testing, t=0.5 <a name=\"_x0000_i1025\"> </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 > 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 = [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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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î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 © 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î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 © 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î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 © 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î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 © 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î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 © 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î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 © 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î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 © 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î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 © 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î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 © 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î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 © 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î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 © 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î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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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ît Bride </li> -</ul> -</html>", - info="<html> -<p><b>Copyright © 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ît Bride </li> +</ul> +</html>", + info="<html> +<p><b>Copyright © 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échiné </li> -</ul> -</html>", - info="<html> -<p><b>Copyright © 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échiné </li> +</ul> +</html>", + info="<html> +<p><b>Copyright © 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échiné </li> -</ul> -</html>", - info="<html> -<p><b>Copyright © 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échiné </li> +</ul> +</html>", + info="<html> +<p><b>Copyright © 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échiné </li> -</ul> -</html>", - info="<html> -<p><b>Copyright © 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échiné </li> +</ul> +</html>", + info="<html> +<p><b>Copyright © 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échiné </li> -</ul> -</html>", - info="<html> -<p><b>Copyright © 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échiné </li> +</ul> +</html>", + info="<html> +<p><b>Copyright © 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 © 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 © 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 © 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 © 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 © 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 © 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 © 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},{4