diff --git a/.test/config_new_openmodelica.json b/.test/config_new_openmodelica.json index 8d09d9c9..f47cab1d 100644 --- a/.test/config_new_openmodelica.json +++ b/.test/config_new_openmodelica.json @@ -16,7 +16,7 @@ "libs": { "ThermoSysPro": { "path": "../../ThermoSysPro/package.mo", - "models_filter": "(? 1, "FossilFuelBoiler: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "FossilFuelBoiler: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); + + // ---------------- + // Water/steam side + 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; + + Cws1.Xi = Cws2.Xi; + Xws = Cws1.Xi; + Cws1.SubC = Cws2.SubC; + SubCws = Cws1.SubC; + Qe = Cws1.Q; + Pee = Cws1.P; Hee = Cws1.h; + Pse = Cws2.P; Hse = Cws2.h; -// --------------- -// Combustion side -/* Fuel inlet */ + + // --------------- + // Combustion side + + /* Fuel inlet */ Qcomb = Cfuel.Q; Tcomb = Cfuel.T; XCcomb = Cfuel.Xc; @@ -137,103 +181,175 @@ equation XScomb = Cfuel.Xs; PCIcomb = Cfuel.LHV; Cpcomb = Cfuel.cp; -/* Air inlet */ + + /* 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 */ + + Xea[1:Medium_FlueGases.nXi] = Cair.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Cair.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; + + /* Flue gases outlet */ Qsf = Cfg.Q; Psf = Cfg.P; Hsf = Cfg.h; -/* Mass balance equation for the flue gases */ + + /* Mass balance equation for the flue gases */ 0 = Qcomb + Qea - Qsf; -/* Energy balance equation for the flue gases */ + + /* 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 */ + + /* Fuel power */ Wfuel = Qcomb*PCIcomb; -/* Total incoming power */ + + /* Total incoming power */ Wtot = Qcomb*(Hcomb - Hrcomb + PCIcomb*etacomb) + Qea*(Hea - Hrair); -/* Power exchanged in the boiler */ + + /* Power exchanged in the boiler */ Wboil = Wtot - Qsf*(Hsf - Hrfum) - Wloss; -/* Water/steam specific enthalpy at the outlet */ + + /* Water/steam specific enthalpy at the outlet */ Hse = Wboil/Qe + Hee; -/* Boiler efficiency*/ + + /* Boiler efficiency*/ if (Boiler_efficiency_type == 1) then - eta_boil = 100*Wboil/Wfuel; + eta_boil = 100*Wboil/Wfuel; else - eta_boil = 100*Wboil/Wtot; + eta_boil = 100*Wboil/Wtot; end if; -/* Flue gases composition balance equations */ + + /* 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 */ + + Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Qsf*Cfg.SubC = Qea*Cair.SubC; + SubCfg = Cfg.SubC; + + /* 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 */ + + /* Flue gases pressure losses */ Pea - Psf = deltaPf; deltaPf = Kf*ThermoSysPro.Functions.ThermoSquare(Qsf, eps)/rhof; -/* Water/steam pressure losses */ + + /* Water/steam pressure losses */ Pee - Pse = deltaPe; deltaPe = Ke*ThermoSysPro.Functions.ThermoSquare(Qe, eps)/rhoe; -/* No flow reversal */ + + /* No flow reversal */ Cfg.h = Cfg.h_vol_1; -/* Diffusion power */ + + /* 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); + + /* Air specific enthalpy at the inlet */ + state_air_in = Medium_FlueGases.setState_phX(p=Pea, h=Hea, X=Xea); + Tea = Medium_FlueGases.temperature(state_air_in); + + /* Flue gases tempretaure after combustion */ + Hf = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=Tf, X=Xsf); + state_fg_comb = Medium_FlueGases.setState_phX(p=Pea, h=Hf, X=Xsf); + + /* Flue gases specific enthalpy at the outlet */ + Hsf = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=Tsf, X=Xsf); + state_fg_out = Medium_FlueGases.setState_phX(p=Psf, h=Hsf, X=Xsf); + + /* Flue gases density */ + state_fg_m = Medium_FlueGases.setState_pTX(p=Pea, T=(Tea + Tf)/2, X=Xsf); + rhof = Medium_FlueGases.density(state_fg_m); + 0 = if (XeaO2 > teps) then (XeaO2c - XeaO2) else (XeaO2c - teps); -/* Reference specific enthalpies */ - Hrair = 2501.569e3*XeaH2O; + + /* Reference specific enthalpies */ + /* Air and flue gases reference enthalpies: Medium_FlueGases enthalpy of the same mixture at 0.01 degC, + i.e. the zero of ThermoSysPro.Properties.FlueGases.FlueGases_h used with the lower heating value */ + Hrair = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=273.16, X=Xea); 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})}), + Hrfum = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=273.16, X=Xsf); + + /* Water/steam thermodynamic properties */ + state_ws_m = Medium.setState_phX(p=(Pee + Pse)/2, h=(Hee + Hse)/2, X=Xws); + rhoe = Medium.density(state_ws_m); + + state_ws_out = Medium.setState_phX(p=Pse, h=Hse, X=Xws); + Tse = Medium.temperature(state_ws_out); + + 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 = " Author @@ -244,5 +360,36 @@ Baligh El Hefni ## ThermoSysPro Version 4.2 This component model is documented in Sect. 7.2 of the ThermoSysPro book. "), - 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; \ No newline at end of file + 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/BoundaryConditions/AirHumidity.mo b/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo index b6bc6662..adfb720b 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/AirHumidity.mo @@ -2,17 +2,15 @@ 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")); - 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"; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby Modelica.Media.Interfaces.PartialMixtureMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Real hum0=0.5 "Air humidiy"; + parameter Units.SI.Temperature T0=290 "Fixed fluid temperature"; + +public + 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"; @@ -23,24 +21,30 @@ model AirHumidity "Air humidity" 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 Xo2as(start=0.2) "O2 mass fraction in dry air"; Real Xh2o "H2O mass fraction at the outlet"; - Real Xo2 "O2 mass fraction at the outlet"; - Real Xso2 "SO2 mas fraction at the outlet"; - 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))); + +public + ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_pT pro + annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation= + 0))); + Interfaces.Connectors.FluidInlet C1(redeclare package Medium=Medium) 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(redeclare package Medium=Medium) annotation (Placement(transformation( + extent={{90,-10},{110,10}}, rotation=0))); protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + parameter Integer iN2 = ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"Nitrogen"}); + parameter Integer iO2 = ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"Oxygen"}); + parameter Integer iH2O = ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"Water"}); + parameter Integer iCO2 = ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"Carbondioxide"}); + parameter Integer iSO2 = ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"Sulfurdioxide"}); 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; @@ -54,40 +58,78 @@ equation 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.SubC = C2.SubC; + 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; + + /* O2 mass fraction at the inlet */ + Xo2as = C1.Xi[iO2]; + + /* Temperature at the outlet */ +// T = ThermoSysPro.Properties.FlueGases.FlueGases_T(P, h, 0, Xh2o, Xo2as, 0); + T = Medium.temperature_phX(P,h, C2.Xi); + + /* Flue gas composition at the outlet. The sole constituents for air are O2 and N2 */ + C2.Xi[iSO2] = 0; + C2.Xi[iCO2] = 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 */ + C2.Xi[iH2O] = Xh2o; + C2.Xi[iO2] = Xo2as*(1 - Xh2o); + C2.Xi[iN2] = 1- Xo2as*(1 - Xh2o) - Xh2o; + + /* 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); + + /* H2O density */ + pro = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(ppvap, T, 0); + 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")}), + + /* Air density */ + rho_air = ThermoSysPro.Properties.FlueGases.FlueGases_rho(ppair, T, 0, Xh2o, Xo2as, 0); + + 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 = " Author @@ -97,4 +139,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end AirHumidity; \ No newline at end of file +end AirHumidity; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo b/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo index 8c3172d9..548a40e5 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/PlugA.mo @@ -1,24 +1,34 @@ 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"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + 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 Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); + +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))); + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; + + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C(redeclare package Medium = Medium) 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 */ + + C.SubC = SubC0; + + /* 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 diff --git a/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo b/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo index 533f1f2a..13dd493b 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/PlugB.mo @@ -1,20 +1,19 @@ 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"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + 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))); + Medium.MassFraction X[Medium.nXi] "Fluid mass fraction"; + Medium.ExtraProperty SubC[Medium.nC] "Fluid trace substances"; + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); equation Q = C.Q; P = C.P; @@ -22,15 +21,39 @@ equation 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), + + SubC = C.SubC; + + X = C.Xi; + + 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 = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -41,4 +64,4 @@ Baligh El Hefni Daniel Bouskela ")); -end PlugB; \ No newline at end of file +end PlugB; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo index b9855f7e..d7805d26 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefH.mo @@ -2,16 +2,25 @@ 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"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + 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))); + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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; @@ -25,11 +34,11 @@ equation 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; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; P = C1.P; h = C1.h; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo index 3e991483..6e0dc6ed 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefP.mo @@ -2,16 +2,25 @@ within ThermoSysPro.Fluid.BoundaryConditions; model RefP "Fixed pressure reference" extends ThermoSysPro.Fluid.Interfaces.IconColors; - parameter Units.SI.AbsolutePressure P0 = 1.e5 "Fixed fluid pressure"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + 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))); + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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; @@ -25,11 +34,12 @@ equation 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; + + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; P = C1.P; h = C1.h; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo index 345ab0b1..0506177c 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefQ.mo @@ -2,16 +2,26 @@ 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"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + + 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))); + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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; @@ -25,11 +35,11 @@ equation 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; + + C1.Xi = C2.Xi; + + C1.SubC = C2.SubC; + Q = C1.Q; P = C1.P; h = C1.h; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo new file mode 100644 index 00000000..eb4d6aa8 --- /dev/null +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefSubC.mo @@ -0,0 +1,94 @@ +within ThermoSysPro.Fluid.BoundaryConditions; +model RefSubC "Fixed SubC reference" + extends ThermoSysPro.Fluid.Interfaces.IconColors; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + parameter Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); + + +public + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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.Xi = C2.Xi; + + C1.SubC = C2.SubC; + C1.SubC = SubC0; + + + 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= + "C")}), + 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= + "C")}), + Window( + x=0.06, + y=0.08, + width=0.82, + height=0.65), + Documentation(info = " +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 + ", revisions = " +Authors + +Baligh El Hefni +Daniel Bouskela + + ")); +end RefSubC; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo index 356987a0..a21c5b71 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefT.mo @@ -2,25 +2,28 @@ 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")); + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + + parameter Units.SI.Temperature T0=290 "Fixed fluid temperature"; + +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))); -protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions"; + + + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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; @@ -34,21 +37,67 @@ equation 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; + + C1.Xi = C2.Xi; + + X = C1.Xi; + + C1.SubC = C2.SubC; + 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), + + + /* Computation of the fluid specific enthalpy */ + h = Medium.specificEnthalpy_pTX(p=P, T=ITemperature.signal, X=X); + + 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 = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -60,4 +109,4 @@ Daniel Bouskela "), DymolaStoredErrors); -end RefT; \ No newline at end of file +end RefT; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo b/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo index 6e0e3420..8ee3224a 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/RefXgas.mo @@ -2,38 +2,19 @@ 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"; - 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))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nXi] = Medium.X_default[1:Medium.nXi] "Source mass fraction" annotation (Dialog( + tab="Fluid", + group="Medium")); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{-110,-10},{-90,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement( + transformation(extent={{90,-10},{110,10}}, rotation=0))); + 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; @@ -43,22 +24,56 @@ equation 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), + + C1.Xi = C2.Xi; + C1.SubC = C2.SubC; + + C1.Xi = X0; + + 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})}), + Window( + x=0.06, + y=0.08, + width=0.82, + height=0.65), Documentation(info = " ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 @@ -70,4 +85,4 @@ Daniel Bouskela "), DymolaStoredErrors); -end RefXgas; \ No newline at end of file +end RefXgas; diff --git a/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo b/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo index c274688a..60e34bb9 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/Sink.mo @@ -1,49 +1,42 @@ 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")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + 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"; + +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))); -protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Trace substances"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fraction of the fluid crossing the boundary of the control volume"; + + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C(redeclare package Medium = Medium) 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 */ + + X = C.Xi; + SubC = C.SubC; + + /* Specific enthalpy or temperature */ if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then if option_temperature then ISpecificEnthalpyOrTemperature.signal = T0; @@ -53,10 +46,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); 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")}), diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo index 3341e814..e7b8265c 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkP.mo @@ -1,51 +1,56 @@ 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")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + 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"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Trace substances"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fraction of the fluid crossing the boundary of the control volume"; + + +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"; - 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))); -protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + +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(redeclare package Medium = Medium) 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; + + X = C.Xi; + SubC = C.SubC; + if (cardinality(IPressure) == 0) then IPressure.signal = P0; end if; @@ -60,10 +65,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); 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")}), diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo index d969741d..4f99c8d3 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkPQ.mo @@ -1,54 +1,54 @@ 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")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", + group="Medium")); + 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"; + +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.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))); -protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Trace substances"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "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(redeclare package Medium = Medium) 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 */ + + X = C.Xi; + SubC = C.SubC; + + /* Mass flow */ if (cardinality(IMassFlow) == 0) then IMassFlow.signal = Q0; end if; @@ -68,10 +68,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); 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")}), diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo index 7d209703..6fee15ac 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SinkQ.mo @@ -1,51 +1,57 @@ 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")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + 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"; + + +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.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))); -protected - parameter Integer mode = Integer(region) - 1 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Trace substances"; + Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "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(redeclare package Medium = Medium) 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 */ + + X = C.Xi; + SubC = C.SubC; + + + + /* Mass flow */ if (cardinality(IMassFlow) == 0) then IMassFlow.signal = Q0; end if; @@ -60,10 +66,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X); 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")}), diff --git a/ThermoSysPro/Fluid/BoundaryConditions/Source.mo b/ThermoSysPro/Fluid/BoundaryConditions/Source.mo index 52bc5246..f68e0ea2 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/Source.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/Source.mo @@ -1,64 +1,48 @@ 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)")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + 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 Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nX]= Medium.X_default "Source mass fraction" annotation (Dialog( + tab="Fluid", + group="Medium")); + +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))); -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"; + Units.SI.SpecificEnthalpy h(start=100000) "Fluid specific enthalpy"; + Units.SI.Temperature T(start=300) "Fluid temperature"; + + Interfaces.Connectors.FluidOutlet C(redeclare package Medium = Medium) 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 */ + + C.SubC=SubC0; + + C.Xi = X0[1:Medium.nXi]; + + /* Specific enthalpy or temperature */ if (cardinality(ISpecificEnthalpyOrTemperature) == 0) then if option_temperature then ISpecificEnthalpyOrTemperature.signal = T0; @@ -68,10 +52,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X0); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X0); end if; /* Flow reversal */ if continuous_flow_reversal then diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo index 2593715c..0a8b1799 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SourceP.mo @@ -1,66 +1,62 @@ 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)")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + 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 Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nX]= Medium.X_default "Source mass fraction" annotation (Dialog( + tab="Fluid", + group="Medium")); + +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))); -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"; + 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(redeclare package + Medium = Medium) 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; + + C.SubC=SubC0; + + C.Xi = X0[1:Medium.nXi]; + + if (cardinality(IPressure) == 0) then IPressure.signal = P0; end if; @@ -75,10 +71,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X0); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X0); end if; /* Flow reversal */ if continuous_flow_reversal then diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo index 9e9906f8..d2e784c1 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SourcePQ.mo @@ -1,70 +1,61 @@ 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)")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + 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 Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nX]= Medium.X_default "Source mass fraction" annotation (Dialog( + tab="Fluid", + group="Medium")); + 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"; + +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"; - 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))); -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"; + 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(redeclare package Medium = Medium) 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 */ + + C.SubC=SubC0; + + C.Xi = X0[1:Medium.nXi]; + + /* Mass flow */ if (cardinality(IMassFlow) == 0) then IMassFlow.signal = Q0; end if; @@ -84,10 +75,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X0); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X0); end if; /* Flow reversal */ if continuous_flow_reversal then diff --git a/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo b/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo index 51ac4b98..fbd574bb 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo +++ b/ThermoSysPro/Fluid/BoundaryConditions/SourceQ.mo @@ -1,67 +1,59 @@ 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)")); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + 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 Medium.ExtraProperty SubC0[Medium.nC](quantity=Medium.extraPropertiesNames) = fill(0,Medium.nC) "Source trace substances" annotation (Evaluate=true, Dialog( + tab="Fluid", + group="Medium")); + parameter Medium.ExtraProperty X0[Medium.nX]= Medium.X_default "Source mass fraction" annotation (Dialog( + tab="Fluid", + group="Medium")); + +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"; - 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))); -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"; + 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(redeclare package Medium = Medium) 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 */ + + C.SubC=SubC0; + + C.Xi = X0[1:Medium.nXi]; + + /* Mass flow rate */ if (cardinality(IMassFlow) == 0) then IMassFlow.signal = Q0; end if; @@ -76,10 +68,10 @@ equation end if; if option_temperature then T = ISpecificEnthalpyOrTemperature.signal; - h = ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(P, T, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + h = Medium.specificEnthalpy_pTX(p=P, T=T, X=X0); else h = ISpecificEnthalpyOrTemperature.signal; - T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2); + T = Medium.temperature_phX(p=P, h=h, X=X0); end if; /* Flow reversal */ if continuous_flow_reversal then diff --git a/ThermoSysPro/Fluid/BoundaryConditions/package.order b/ThermoSysPro/Fluid/BoundaryConditions/package.order index 6583266e..fe404a50 100644 --- a/ThermoSysPro/Fluid/BoundaryConditions/package.order +++ b/ThermoSysPro/Fluid/BoundaryConditions/package.order @@ -6,6 +6,7 @@ RefQ RefH RefT RefXgas +RefSubC SourceP SourceQ SourcePQ diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo index 067ac40c..c4396b66 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GTCombustionChamber.mo @@ -1,74 +1,93 @@ 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"; - 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"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + 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 Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; + 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"; 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"; @@ -79,34 +98,33 @@ model GTCombustionChamber "Gas turbine combustion chamber" 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"; - 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))); -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)"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium_FlueGases.ThermodynamicState state_air_in "Air inlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_atom_in "Atomisation compressor inlet state"; + +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(redeclare package Medium = Medium_FlueGases) "Air inlet" + annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" + annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws(redeclare package Medium = Medium) "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 */ + + assert(Medium_FlueGases.nX > 1, "GTCombustionChamber: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "GTCombustionChamber: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); + + /* Fuel inlet */ Qfuel = Cfuel.Q; Tfuel = Cfuel.T; XCfuel = Cfuel.Xc; @@ -115,63 +133,78 @@ equation 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"); + + /* Water inlet */ Cws.diff_res_2 = 0; Cws.diff_on_2 = diffusion; - ftype_ws = Cws.ftype; + Qews = Cws.Q; Hews = Cws.h; -/* Air inlet */ + Xws = Cws.Xi; + SubCws = Cws.SubC; + + /* 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 */ + + Xea[1:Medium_FlueGases.nXi] = Ca.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Ca.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; + + /* 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 */ + + /* Mass balance equation */ 0 = Qea + Qews + Qfuel - Qsf; -/* Energy balance equation */ + + /* 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 */ + + /* Atomisation power */ Pecpat = Pea*(1 - kat); Pscpat = (1 + Xspat)*Pea; Wcpat = Qea*XQat*(Hiscpat - Hecpat)*eta_isc; -/* Heat extracted by the atomisation refrigerant */ + + /* 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 */ + + /* Atomisation power */ Pecpat = Pea; Pscpat = Pea; Wcpat = 0; -/* Heat extracted by the atomisation refrigerant */ + + /* 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 */ + + /* No flow reversal */ Cfg.h = Cfg.h_vol_1; -/* Diffusion power */ + + /* 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; @@ -179,69 +212,146 @@ equation 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 */ + + /* 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); + Hecpat = Medium_FlueGases.specificEnthalpy_pTX(p=Pecpat, T=Tecpat, X=Xea); + state_atom_in = Medium_FlueGases.setState_pTX(p=Pecpat, T=Tecpat, X=Xea); + Secpat = Medium_FlueGases.specificEntropy(state_atom_in); + Hiscpat = Medium_FlueGases.isentropicEnthalpy(p_downstream=Pscpat, refState=state_atom_in); else - Hecpat = 60000; - Secpat = -2000; - Hiscpat = 60000; + Hecpat = 60000; + state_atom_in = Medium_FlueGases.setState_pTX(p=Pecpat, T=Tecpat, X=Xea); + Secpat = -2000; + Hiscpat = 60000; end if; -/* Reference specific enthalpies */ - Hrair = 2501.569e3*XeaH2O; + + /* Reference specific enthalpies */ + /* Air and flue gases reference enthalpies: Medium_FlueGases enthalpy of the same mixture at 0.01 degC, + i.e. the zero of ThermoSysPro.Properties.FlueGases.FlueGases_h used with the lower heating value */ + Hrair = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=273.16, X=Xea); 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); + Hrfg = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=273.16, X=Xsf); + + /* Air specific enthalpy at the inlet */ + Hea = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=Tea, X=Xea); + state_air_in = Medium_FlueGases.setState_pTX(p=Pea, T=Tea, X=Xea); + + /* Flue gases specific enthalpy at the outlet */ + Hsf = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=Tsf, X=Xsf); + state_fg_out = Medium_FlueGases.setState_pTX(p=Psf, T=Tsf, X=Xsf); + + /* Air density at the inlet */ + rhoea = Medium_FlueGases.density(state_air_in); 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); + + /* Flue gases density at the outlet */ + rhosf = Medium_FlueGases.density(state_fg_out); 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 */ + + /* 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 */ + + /* 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 */ + + /* SO2 flue gases mass fraction */ XsfSO2*(Qea + Qews + Qfuel) = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS); -/* Fuel thermal power */ + + Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg.SubC = Ca.SubC; + SubCfg = Cfg.SubC; + + /* Fuel thermal power */ Wfuel = Qfuel*LHVfuel; -/* Combustion air ratio */ + + /* 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 */ + + /* 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 */ + + /* 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")}), + + 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 = " Author @@ -252,4 +362,4 @@ Baligh El Hefni ## ThermoSysPro Version 4.2 This component model is documented in Sect. 8.1 of the ThermoSysPro book. ")); -end GTCombustionChamber; \ No newline at end of file +end GTCombustionChamber; diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo index a04ef380..3a3bab63 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion.mo @@ -1,71 +1,91 @@ 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"; - 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"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + 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 Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; + 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.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"; 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"; @@ -76,89 +96,104 @@ model GenericCombustion "Generic combustion chamber" 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"; - 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))); -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)"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium_FlueGases.ThermodynamicState state_air_in "Air inlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state"; + +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(redeclare package Medium = Medium_FlueGases) "Air inlet" + annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}, + rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" + annotation (Placement(transformation(extent={{-40,80},{-20,100}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws(redeclare package Medium = Medium) "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 */ + + assert(Medium_FlueGases.nX > 1, "GenericCombustion: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "GenericCombustion: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); + + /* 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"); + + /* Water inlet */ Cws.diff_res_2 = 0; Cws.diff_on_2 = diffusion; - ftype_ws = Cws.ftype; + Qews = Cws.Q; Hews = Cws.h; -/* Air inlet */ + Xws = Cws.Xi; + SubCws = Cws.SubC; + + /* 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 */ + + Xea[1:Medium_FlueGases.nXi] = Ca.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Ca.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; + + /* 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 */ + + /* 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; + + /* 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 */ + + /* No flow reversal */ Cfg.h = Cfg.h_vol_1; -/* Diffusion power */ + + /* 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; @@ -166,57 +201,140 @@ equation 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; + + /* Reference specific enthalpies */ + /* Air and flue gases reference enthalpies: Medium_FlueGases enthalpy of the same mixture at 0.01 degC, + i.e. the zero of ThermoSysPro.Properties.FlueGases.FlueGases_h used with the lower heating value */ + Hrair = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=273.16, X=Xea); Hrfuel = 0; Hrws = 2501.569e3; - Hrfg = 2501.569e3*XsfH2O; + Hrfg = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=273.16, X=Xsf); 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); + + /* Air specific enthalpy at the inlet */ + Hea = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=Tea, X=Xea); + state_air_in = Medium_FlueGases.setState_pTX(p=Pea, T=Tea, X=Xea); + + /* Flue gases specific enthalpy at the outlet */ + Hsf = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=Tsf, X=Xsf); + state_fg_out = Medium_FlueGases.setState_pTX(p=Psf, T=Tsf, X=Xsf); + + /* Air density at the inlet */ + rhoea = Medium_FlueGases.density(state_air_in); 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); + + /* Flue gases density at the outlet */ + rhosf = Medium_FlueGases.density(state_fg_out); Vsf = if (rhosf > 0.001) then 1/rhosf else 1/0.1; -/* CO2 flue gases mass fraction */ + + /* 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 */ + + /* 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 */ + + /* SO2 flue gases mass fraction */ XsfSO2*Qsf = (Qea*XeaSO2) + (Qfuel*XSfuel*amSO2/amS); -/* Fuel thermal power */ + + Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg.SubC = Ca.SubC; + SubCfg = Cfg.SubC; + + /* 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 */ + + /* 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")}), + + 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 = " Authors @@ -227,4 +345,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end GenericCombustion; \ No newline at end of file +end GenericCombustion; diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo index ae758232..a0bf3025 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GenericCombustion1D.mo @@ -1,82 +1,102 @@ 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; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + parameter Integer NCEL = 7; - parameter Units.SI.Area Acham = 1 "Average cross-sectional area of the combustion chamber"; - // parameter ThermoSysPro.Units.SI.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 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"; - 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"; + 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 Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; + 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"; - //////////////////////ThermoSysPro.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.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.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"; 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"; @@ -87,40 +107,38 @@ model GenericCombustion1D "Generic combustion chamber 1D" 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"; - 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))); -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)"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium_FlueGases.ThermodynamicState state_air_in "Air inlet thermodynamic state"; + Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state"; + +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(redeclare package Medium = Medium_FlueGases) "Air inlet" + annotation (Placement(transformation(extent={{-10,-100},{10,-80}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" + annotation (Placement(transformation(extent={{-10,80},{10,100}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws(redeclare package Medium = Medium) "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 */ + + assert(Medium_FlueGases.nX > 1, "GenericCombustion1D: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "GenericCombustion1D: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); + + /* Heat transfer */ Cth.W = -Ws; Cth.T = Tpi; -/* Fuel inlet */ + + /* Fuel inlet */ Qfuel = Cfuel.Q; Tfuel = Cfuel.T; XCfuel = Cfuel.Xc; @@ -131,52 +149,66 @@ equation 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"); + + /* Water inlet */ Cws.diff_res_2 = 0; Cws.diff_on_2 = diffusion; - ftype_ws = Cws.ftype; + Qews = Cws.Q; Hews = Cws.h; -/* Air inlet */ + Xws = Cws.Xi; + SubCws = Cws.SubC; + + /* 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 */ + + Xea[1:Medium_FlueGases.nXi] = Ca.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Ca.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; + + /* 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 */ + + /* 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); + + /* 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 */ + + /* No flow reversal */ Cfg.h = Cfg.h_vol_1; -/* Diffusion power */ + + /* 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; @@ -184,66 +216,234 @@ equation 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; + + /* Reference specific enthalpies */ + /* Air and flue gases reference enthalpies: Medium_FlueGases enthalpy of the same mixture at 0.01 degC, + i.e. the zero of ThermoSysPro.Properties.FlueGases.FlueGases_h used with the lower heating value */ + Hrair = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=273.16, X=Xea); Hrfuel = 0; Hrws = 2501.569e3; - Hrfg = 2501.569e3*XsfH2O; + Hrfg = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=273.16, X=Xsf); 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 */ + + /* Air specific enthalpy at the inlet */ + Hea = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=Tea, X=Xea); + state_air_in = Medium_FlueGases.setState_pTX(p=Pea, T=Tea, X=Xea); + + /* Flue gases specific enthalpy at the outlet */ + Hsf = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=Tsf, X=Xsf); + state_fg_out = Medium_FlueGases.setState_pTX(p=Psf, T=Tsf, X=Xsf); + + /* Air density at the inlet */ + rhoea = Medium_FlueGases.density(state_air_in); + Vea = if (rhoea >0.001) then 1/rhoea else 1/1.1; + + /* Flue gases density at the outlet */ + rhosf = Medium_FlueGases.density(state_fg_out); + 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 */ + + /* 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 */ + + /* 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 */ + + Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg.SubC = Ca.SubC; + SubCfg = Cfg.SubC; + + /* 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 */ + + /* 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))); + + /* 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 */ + + /* 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*/ + + /* 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]); + 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")}), + + 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 = " Author @@ -254,4 +454,4 @@ Baligh El Hefni ## ThermoSysPro Version 4.2 This component model is documented in Sect. 8.2 of the ThermoSysPro book. ")); -end GenericCombustion1D; \ No newline at end of file +end GenericCombustion1D; diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo index 9d7a8c67..56463713 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/GridFurnace.mo @@ -1,305 +1,321 @@ -within ThermoSysPro.Fluid.Combustion.CombustionChambers; - +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"; - 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"; - 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))); - 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))); + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + 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)"; + 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 Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; + 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"; + Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions"; + Medium_FlueGases.MassFraction Xeap[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Primary air mass fractions"; + Medium_FlueGases.MassFraction Xeas[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Secondary air mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances"; + Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances"; + Medium.ThermodynamicState state_biomass_water "Water in biomass thermodynamic state"; + Medium.ThermodynamicState state_biomass_water_sat_v "Saturated vapor state of water in biomass"; + Medium.ThermodynamicState state_biomass_water_sat_l "Saturated liquid state of water in biomass"; + Medium.ThermodynamicState state_dried_water "Water vapor state after drying"; + Medium.ThermodynamicState state_water_seal_vapor "Water seal vapor state"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca2(redeclare package Medium = Medium_FlueGases) 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(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{70,20},{90,40}}, rotation=0))); +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca1(redeclare package Medium = Medium_FlueGases) annotation (Placement( + transformation(extent={{-10,-100},{10,-80}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "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 */ + + assert(Medium_FlueGases.nX > 1, "GridFurnace: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "GridFurnace: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); + + /* 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 */ + + /* 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) */ + + /* Fuel inlet (biomass) */ Qeom = Com.Q; Teom = Com.T; PCIom = Com.LHV; @@ -311,67 +327,88 @@ equation 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"); + + /* Cooling water inlet */ 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 */ + Xws = port_eau_refroid.Xi; + SubCws = port_eau_refroid.SubC; + + /* 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 */ + + Xeap[1:Medium_FlueGases.nXi] = Ca1.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xeap[Medium_FlueGases.nX] = 1 - sum(Ca1.Xi); + end if; + XeapCO2 = Xeap[iCO2]; + XeapH2O = Xeap[iH2O]; + XeapO2 = Xeap[iO2]; + XeapSO2 = Xeap[iSO2]; + XeapN2 = Xeap[iN2]; + + /* 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 */ + + Xeas[1:Medium_FlueGases.nXi] = Ca2.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xeas[Medium_FlueGases.nX] = 1 - sum(Ca2.Xi); + end if; + XeasCO2 = Xeas[iCO2]; + XeasH2O = Xeas[iH2O]; + XeasO2 = Xeas[iO2]; + XeasSO2 = Xeas[iSO2]; + XeasN2 = Xeas[iN2]; + + /* 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 */ + + /* Primary air mass flow rates */ X1eap = 1 - X2eap - X3eap; Q1eap = Qeap*X1eap; Q2eap = Qeap*X2eap; Q3eap = Qeap*X3eap; -/* Recirculated flue gases fow rates */ + + /* Recirculated flue gases fow rates */ Qfrecirc = Qsf*Xrecirc; -/* Carbon distribution */ + + /* Carbon distribution */ XCvol2 = XCeom*XCvol; XMACHimb = XCeom*XCimb; XCvol3 = XCeom*(1 - XCvol - XCimb); -//-------------------------------------------------------------------- -// 1st zone : Drying -//------------------ -/* Primary air specific enthalpy at Teap */ + + //-------------------------------------------------------------------- + // 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 */ + + /* Secondary air specific enthalpy at Teas */ Heas = ThermoSysPro.Properties.FlueGases.FlueGases_h(Peap, Teas, XeasCO2, XeasH2O, XeasO2, XeasSO2); -/* Primary air specific enthalpy at T1sfm */ + + /* 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 */ + + /* 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 */ + + /* Mass flow rate of the secondary air / flue gases recirculated mixture */ Qeasm = Qeas + Qfrecirc; -/* Mixture */ + + /* Mixture */ if (Qeasm <= 0) then XeasmO2 = 0; XeasmCO2 = 0; @@ -386,38 +423,62 @@ equation 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 = (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 */ + + /* Specific enthalpy of the water in the biomass */ + state_biomass_water = Medium.setState_pTX( + p=Peap, + T=Teom, + region=mode); + Heauom = Medium.specificEnthalpy(state_biomass_water); + + /* 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; + state_biomass_water_sat_v = Medium.setState_pTX( + p=Psateom, + T=Teom, + region=2); + Hvteom = Medium.specificEnthalpy(state_biomass_water_sat_v); + state_biomass_water_sat_l = Medium.setState_pTX( + p=Psateom, + T=Teom, + region=1); + Hlteom = Medium.specificEnthalpy(state_biomass_water_sat_l); + 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 */ + + /* Specific enthalpy of the water in the biomass */ + state_dried_water = Medium.setState_pTX( + p=Psf, + T=T1sfm, + region=0); + Hs1vom = Medium.specificEnthalpy(state_dried_water); + + /* Specific enthalpy of the biomass at Teom */ Heom = Cpom*(Teom - 273.15); -/* Flue gases formation energy */ + + /* Flue gases formation energy */ Wff = Qeom*(HfCO2*XCeom + HfH2Og*XHeom*9 + HfSO2*XSeom/32.1*64.1 + HfH2Og*XH2Oeom); -/* Pyrolisis power of the biomass */ + + /* 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 */ + + /* 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 */ + + /* Power lost by the combustion gases due to the non-combusiton of C */ Wimbm = Qeom*XCeom*HfCO2*XCimb; -/* Pyrolisis enthalpy */ + + /* Pyrolisis enthalpy */ Hpyr = Wp/(Qeom*(1 - XH2Oeom)); -/* Specific enthalpy of the dry biomasss at the biomass pyrolysis temperature */ + + /* Specific enthalpy of the dry biomasss at the biomass pyrolysis temperature */ H1om = Hpyr + Heom; -/* Mass flow rates at the outlet of zone 1 */ + + /* Mass flow rates at the outlet of zone 1 */ Q1H2O = Qeom*XH2Oeom + Q1eap*XeapH2O + Qerefo; Q1O2 = Q1eap*XeapO2; Q1N2 = Q1eap*XeapN2; @@ -425,7 +486,8 @@ equation Q1SO2 = Q1eap*XeapSO2; Q1g = Q1H2O + Q1O2 + Q1N2 + Q1CO2 + Q1SO2; Q2eom = Qeom*(1 - XH2Oeom); -/* Correction after drying */ + + /* Correction after drying */ PCI1om = PCIom/(1 - XH2Oeom); X1MACHom = XMACHeom/(1 - XH2Oeom); XC1vol2 = XCvol2/(1 - XH2Oeom); @@ -438,19 +500,25 @@ equation X1F = XFeom/(1 - XH2Oeom); X1S = XSeom/(1 - XH2Oeom); X1CEND = XCENDeom/(1 - XH2Oeom); -/* Ashes mass flow rate in the biomass */ + + /* Ashes mass flow rate in the biomass */ Qcendom = XCENDeom*Qeom; -/* Ashes mass fraction in the flue gases */ + + /* Ashes mass fraction in the flue gases */ Xfcend = Qcendom/Qsf; -/* Power captured in zone 1 */ + + /* 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 */ + + //-------------------------------------------------------------------- + // 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 */ + + /* Outgoing mass flow rates */ Q2HCl = 36.5/35.5*Q2eom*X1Cl; Q2HF = 20/19*Q2eom*X1F; Q2SO2 = 64/32*Q2eom*X1S + Q2eap*XeapSO2; @@ -460,109 +528,134 @@ equation 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 */ + + /* Total mass flow rate after combustion */ Q2g = Q2HCl + Q2HF + Q2SO2 + Q2H2O + Q2CO + Q2N2 + Q2O2 + Q2cend + Q2CO2; -/* Correction after combustion */ + + /* 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 */ + + /* 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; + 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 */ + + /* 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 */ + + /* 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 + // 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 */ + + //-------------------------------------------------------------------- + // 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 */ + + /* taux3oc >= 32/12 => all C is transformed into CO2 */ if (taux3oc >= 32/12) then -/* Mass flow rates */ + /* 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 */ + + /* Power released */ P3s = Q3cd*HfCO; P3g = Q3cd*(HfCO2 - HfCO); -/* Enthalpy released */ + + /* 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 */ + + /* 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 */ + /* 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 */ + + /* Power released */ P3s = Q3cd*HfCO; P3g = (12/16*Q3od - Q3cd)*(HfCO2 - HfCO); -/* Enthalpy released */ + + /* Enthalpy released */ H3s = P3s/Q3eom; H3g = P3g/Q3eom; XC2vol31 = XC2vol3; XC2vol4 = XC2vol3; -/* taux3oc < 16/12 => partial oxydation into CO */ + + /* taux3oc < 16/12 => partial oxydation into CO */ else -/* Mass flow rates */ + /* Mass flow rates */ Q3CO2 = 0; Q3CO = 28/16*Q3od; Q3O2 = 0; Q3N2 = Q3eap*XeapN2; Q3H2O = Q3eap*XeapH2O; Q3SO2 = Q3eap*XeapSO2; -/* Power released */ + + /* Power released */ P3s = 12/16*Q3od*HfCO; P3g = 0; -/* Enthalpy released */ + + /* Enthalpy released */ H3s = P3s/Q3eom; H3g = P3g/Q3eom; XC2vol31 = XC2vol3*12/16*taux3oc; XC2vol4 = XC2vol3; - end if; -/* Correction after coke combustion */ +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 */ + + /* 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); + 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 */ + + //-------------------------------------------------------------------- + // 4th zone : Water seal + //---------------------- + + /* Steam mass flow rate generated by the water seal */ if (jointeau == 1) then T4o = TsjeMACH; TsMACH = TsjeMACH; @@ -572,9 +665,12 @@ equation 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; + state_water_seal_vapor = Medium.setState_pTX( + p=Peap, + T=373.15, + region=2); + H4 = Medium.specificEnthalpy(state_water_seal_vapor); + P4v = Q4v*Medium.specificEnthalpy(state_water_seal_vapor); else T4o = 273.15; TsMACH = T3o; @@ -584,23 +680,31 @@ equation P4m = 0; P4h = 0; Q4v = 0; - pro5 = ThermoSysPro.Properties.WaterSteam.IF97.Water_PT(Peap, 373.15, 2); - H4 = pro5.h; + state_water_seal_vapor = Medium.setState_pTX( + p=Peap, + T=373.15, + region=2); + H4 = Medium.specificEnthalpy(state_water_seal_vapor); P4v = 0; end if; -/* Clinker mass flow rate at the outlet */ + + /* Clinker mass flow rate at the outlet */ QsMACH = Q4eom; -/* Clinker LHV at the outlet */ + + /* Clinker LHV at the outlet */ PCIMACH = (Wimbm - Wimbp)/QsMACH; -//-------------------------------------------------------------------- -// 5th zone : Post-combustion -//--------------------------- -/* Excess air of the combustion */ + + //-------------------------------------------------------------------- + // 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 */ + + /* 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; @@ -611,30 +715,36 @@ equation Q5eHF = Q2HF; Q5ecend = Q2cend; Q5eam = Q5eH2O + Q5eCO + Q5eCO2 + Q5eO2 + Q5eN2 + Q5eSO2 + Q5eHCl + Q5eHF + Q5ecend; -/* Oxydation of the CO remaining in zone 5 */ + + /* 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 */ + + /* 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 */ + + /* 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 */ + + /* 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 */ + + /* Power available in the flue gases */ P5s = P5*(1 - Eray5); -/* Flue gases mass fractions at the outlet */ + + /* Flue gases mass fractions at the outlet */ XsfH2O = Q5eH2O/Qsf; XsfCO = Q5sCO/Qsf; XsfCO2 = Q5sCO2/Qsf; @@ -645,18 +755,31 @@ equation XsfHF = Q5eHF/Qsf; XsfCEND = Q5ecend/Qsf; XsfN2 = 1 - (XsfCO2 + XsfH2O + XsfO2 + XsfSO2); -/* Power accumulated by the flue gases in zone 5 */ + Xsf[iN2] = XsfN2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg.SubC = Ca1.SubC; + SubCfg = Cfg.SubC; + + /* Power accumulated by the flue gases in zone 5 */ P5a = Qeasm*Heasm; P5t = P1g + H2g*Q2g + P3 + P4v + P5s + P5a; -/* Power radiated */ + + /* 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 + + /* 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 */ + + /* Ashes volume mass */ rhocend = rhoCENDom; -/* Normal voulme fraction of the volatile ashes */ + + /* Normal voulme fraction of the volatile ashes */ Xcor = 1/(1 - XsfH2O); X5sH2OC = 0; X5sCO2C = XsfCO2*Xcor; @@ -666,9 +789,47 @@ equation 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")}), + + 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 = " Author @@ -679,4 +840,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end GridFurnace; \ No newline at end of file +end GridFurnace; diff --git a/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo b/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo index 78b1c4f1..9d3e24e5 100644 --- a/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo +++ b/ThermoSysPro/Fluid/Combustion/CombustionChambers/PostCombustionGas.mo @@ -1,130 +1,141 @@ -within ThermoSysPro.Fluid.Combustion.CombustionChambers; - +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")); - 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"; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam properties" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium")); + + 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"; + +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=0 "IF97 region. 1:liquid - 2:steam - 4:saturation line - 0:automatic"; + parameter Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition"; + parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition"; + parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition"; + parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition"; + parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition"; + 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"; + 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"; @@ -135,31 +146,28 @@ model PostCombustionGas "Post-combustion" 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"; - 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))); -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)"; + Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions"; + Medium_FlueGases.MassFraction Xef[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases inlet mass fractions"; + Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions"; + Medium.ThermodynamicState state_fuel_water "Water in fuel thermodynamic state"; + +public + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ca(redeclare package Medium = Medium_FlueGases) "Air inlet" + annotation (Placement(transformation(extent={{-60,80},{-40,100}}, rotation= + 0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_FlueGases) "Flue gases outlet" + annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_FlueGases) "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))); 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 */ + + assert(Medium_FlueGases.nX > 1, "PostCombustionGas: Medium_FlueGases must be a gas mixture"); + assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "PostCombustionGas: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide"); + + /* Fuel inlet */ Qec = Cfuel.Q; Tec = Cfuel.T; LHVfuel = Cfuel.LHV; @@ -170,67 +178,87 @@ equation XNfuel = Cfuel.Xn; XSfuel = Cfuel.Xs; Cpfuel = Cfuel.cp; -/* Air inlet */ + + /* 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 */ + + Xea[1:Medium_FlueGases.nXi] = Ca.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xea[Medium_FlueGases.nX] = 1 - sum(Ca.Xi); + end if; + XeaCO2 = Xea[iCO2]; + XeaH2O = Xea[iH2O]; + XeaO2 = Xea[iO2]; + XeaSO2 = Xea[iSO2]; + + /* 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 */ + + Xef[1:Medium_FlueGases.nXi] = Cfg1.Xi; + if Medium_FlueGases.nXi < Medium_FlueGases.nX then + Xef[Medium_FlueGases.nX] = 1 - sum(Cfg1.Xi); + end if; + XefCO2 = Xef[iCO2]; + XefH2O = Xef[iH2O]; + XefO2 = Xef[iO2]; + XefSO2 = Xef[iSO2]; + + /* 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 */ + + // 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 */ + + /* 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 */ + + // Air - flue gases mixing + // - - - - - - - - - - - - + + /* Mass balance equation */ 0 = Qea + Qef - Qmel; -/* Energy balance equation */ + + /* 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 */ + + /* 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 */ + + /* 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 */ + + /* 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; @@ -238,38 +266,52 @@ equation 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 + + /* 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 */ + + // Fuel + // - - + + /* Specific enthalpy of the water in fuel */ + state_fuel_water = Medium.setState_pTX( + p=Pea, + T=Tec, + region=mode); + Hwfuel = Medium.specificEnthalpy(state_fuel_water); + + /* Fuel specific enthalpy */ Hfuel = Cpfuel*(Tec - 273.16); -// Mass flow rates leaving zone 1 -// - - - - - - - - - - - - - - - - + + // 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 */ + + /* After fuel drying */ Q1ec = Qec*(1 - XH2Ofuel); LHVfuel1 = LHVfuel*(1 - XH2Ofuel); X1Cfuel = XCfuel*(1 - XH2Ofuel); @@ -279,43 +321,57 @@ equation 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 */ + + // 2nd zone : Combustion + // --------------------- + + // Stage 1 : Combustion of trace elements + // - - - - - - - - - - - - - - - - - - - - + + /* Oxygen mass flow rate */ Q2eO = Q1ec*X1Ofuel + Qmel*XmelO2; -/* Other exiting mass flow rates */ + + /* 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 */ + + // 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 */ + + /* Oxygen mass flow rate */ Q22O2 = Q2eO - Q1ec*(X1Sfuel/32.06*32.06 + 32/12/2*X1Cfuel); -/* Mass flow rate of H2 produced */ + + /* Mass flow rate of H2 produced */ Q22H2 = Q1ec*(X1Hfuel - 1/35.5*X1Clfuel - 1/19*X1Ffuel); -/* O2 fraction */ + + /* 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 -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - + //--------------- + // 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 */ + + // 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 */ + + /* Composition */ X24O2 = Q23O2/Q24eg; X24SO2 = Q21SO2/Q24eg; X24H2O = Q23H2O/Q24eg; @@ -323,12 +379,15 @@ equation X24CO2 = Q23CO2/Q24eg; X24C = X24CO + X24CO2; X24N2 = 1 - (X24O2 + X24SO2 + X24H2O + X24CO + X24CO2); -/* Equilibrium constant */ + + /* 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 */ + + /* 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 */ + + /* Volume fractions at the inlet of stage 4 */ X24eCOvol = Q23CO/Q24eg/Mm4e/28; X24eCO2vol = Q23CO2/Q24eg/Mm4e/44; X24eH2vol = Q23H2/Q24eg/Mm4e/2; @@ -337,35 +396,42 @@ equation X24eHClvol = Q21HCl/Q24eg/Mm4e/36.5; X24eHFvol = Q21HF/Q24eg/Mm4e/20; X24eSO2vol = Q21SO2/Q24eg/Mm4e/64.06; -/* Reaction progress */ + + /* 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 */ + + /* 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 */ + + /* Molar mass of the outgoing gases */ Mm4s = X24sCOvol*28 + X24sCO2vol*44 + X24sH2vol*2 + X24sH2Ovol*18 + X24eN2vol*28; -/* Mass flow rates */ + + /* 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 -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + //----------------- + // 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; + 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 -// - - - - - - - - - - - - - - - - - - - + + // Stage 4 : Eaquilibrium reaction CO/CO2 + // - - - - - - - - - - - - - - - - - - - Q24eg = Q23H2 + Q21HCl + Q21HF + Q21SO2 + Q23H2O + Q23CO + Q21N2 + Q23O2 + Q23CO2; X24O2 = 0; X24SO2 = 0; @@ -398,13 +464,17 @@ equation Q24H2 = Q23H2; Q24sg = Q24eg; end if; -/* Mass flow rate at the outlet */ + + /* Mass flow rate at the outlet */ Qsf = Q24sg; -/* Power released by the combustion */ + + /* 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 */ + + /* Power released by the combustion in zone 2 */ P2g = (LHVfuel1 - PciCvol)*Q1ec; -/* Composition at the outlet */ + + /* Composition at the outlet */ XsfO2 = Q23O2/Qsf; XsfSO2 = Q21SO2/Qsf; XsfH2O = Q24H2O/Qsf; @@ -413,15 +483,66 @@ equation XsfCO2 = Q24CO2/Qsf; XsfC = XsfCO2 + XsfCO; XsfN2 = 1 - (XsfO2 + XsfSO2 + XsfH2O + XsfCO2 + XsfCO); -/* Power accumukated by the gases in zone 2 */ + Xsf[iN2] = 1 - XsfO2 - XsfH2O - XsfCO2 - XsfSO2; + Xsf[iO2] = XsfO2; + Xsf[iH2O] = XsfH2O; + Xsf[iCO2] = XsfCO2; + Xsf[iSO2] = XsfSO2; + Cfg2.Xi = Xsf[1:Medium_FlueGases.nXi]; + Cfg2.SubC = Cfg1.SubC; + + /* 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 + // 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")}), + + 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 = " Author @@ -431,4 +552,4 @@ Baligh El Hefni ## Copyright © EDF 2002 - 2026 ## ThermoSysPro Version 4.2 ")); -end PostCombustionGas; \ No newline at end of file +end PostCombustionGas; diff --git a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo index 4df33c48..8641c9d9 100644 --- a/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo +++ b/ThermoSysPro/Fluid/Examples/Book/PowerPlants/ConcentratedSolarPowerPlant_PTSC.mo @@ -1,6 +1,8 @@ within ThermoSysPro.Fluid.Examples.Book.PowerPlants; model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plant with PTSC" + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam "Water/steam medium"; + replaceable package Medium_Oil = ThermoSysPro.Properties.Media.Oil_TherminolVP1 "Heat transfer fluid of the solar field"; 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"; @@ -10,11 +12,11 @@ model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plan //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( + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_2(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_3(redeclare package Medium = Medium_Oil, 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))); @@ -24,87 +26,87 @@ model ConcentratedSolarPowerPlant_PTSC "Model of a concentrated solar power plan 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_3(redeclare package Medium = Medium_Oil, inertia = false, dynamic_mass_balance = false, 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_4(redeclare package Medium = Medium_Oil, 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_22(redeclare package Medium = Medium_Oil, inertia = false, dynamic_mass_balance = false, 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_1(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_11(redeclare package Medium = Medium_Oil, inertia = false, dynamic_mass_balance = false, 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( + ThermoSysPro.Fluid.Junctions.SteamDryer Secheur(redeclare package Medium = Medium, xe(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( + ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(redeclare package Medium = Medium, redeclare package Medium_Cooling = Medium, 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), rhom(start = 995.533)) annotation( Placement(transformation(extent = {{116, -51}, {156, -11}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(P0 = 1e5, option_temperature = false) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe(redeclare package Medium = Medium, K = 1e-6, C2(h_vol_1(start = 137765.0)), Pm(start = 5000.53)) 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( + ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss Connection_HQ_Secheur_Ballon(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe(redeclare package Medium = Medium, 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)) 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( + ThermoSysPro.Fluid.Volumes.VolumeC Ballon(redeclare package Medium = Medium, 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))); - 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon(redeclare package Medium = Medium, 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))); - 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValveBallon1(redeclare package Medium = Medium, Cvmax = 10, C1(P(start = 10618800.0), h_vol_2(start = 1127430.0)), C2(h_vol_1(start = 1127430.0)), Pm(start = 9676220.0)) 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePCaloporteur(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe1(redeclare package Medium = Medium, 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)) 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3(redeclare package Medium = Medium, K = 1e-6) 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( + ThermoSysPro.Fluid.Machines.StodolaTurbine Turbine(redeclare package Medium = Medium, W_fric = 1, Cst(fixed = false, start = 6.8e10) = 6.19323e6, Qmax = 0.001, eta_is_min = 0.80, rhos(start = 8.36949), eta_is_nom = 0.92, Pe(fixed = true, start = 8000000), Ps(fixed = false, start = 1800000)) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcran_4(redeclare package Medium = Medium, 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})) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe TubeEcran_44(redeclare package Medium = Medium_Oil, inertia = false, dynamic_mass_balance = false, 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( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump Pompe2(redeclare package Medium = Medium_Oil, 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_2(redeclare package Medium = Medium_Oil, 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteCharge_Huile_1(redeclare package Medium = Medium_Oil, 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( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMp(redeclare package Medium = Medium, W_fric = 1, Cst(fixed = false, start = 8.3e9) = 6.19323e6, Qmax = 0.001, eta_is_min = 0.80, rhos(start = 0.0434309), eta_is_nom = 0.94, Pe(fixed = true, start = 1800000), Ps(fixed = false, start = 5000), 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( + ThermoSysPro.Fluid.Volumes.Tank Tank(redeclare package Medium = Medium_Oil, 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))); - 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( + ThermoSysPro.Fluid.Volumes.VolumeA VolumeMP(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.Volumes.VolumeA VolumeCond(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater Re_1(redeclare package Medium_e = Medium, redeclare package Medium_c = Medium, 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))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss Dp_Re_1(rho(start = 10), h(start = 2400e3), Q(start = 0.1), K = 1e-4, Pm(start = 1800000)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss Dp_Re_1(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.PressureLosses.InvSingularPressureLoss invSingularPressureLoss(redeclare package Medium = Medium) 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss Dp_Cond_2(redeclare package Medium = Medium, 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))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(alpha = 3, P(start = 2300000)) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(redeclare package Medium = Medium_Oil, 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( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier2(redeclare package Medium = Medium_Oil, 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 diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo index 97b4fdb0..42cf4341 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Boiler/TestFossilFuelBoiler.mo @@ -1,21 +1,52 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Boilers.FossilFuelBoiler FossilFuelBoiler( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare package Medium = Medium_FlueGases, + Q0=27., + T0=298.16, + option_temperature=true, + X0={0.757,0.233,0.01,0,0}) annotation( Placement(transformation(extent = {{-110, -50}, {-71, -13}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP ( + redeclare package Medium = Medium_FlueGases, + P0=100000, + T0=386.16, + option_temperature=true) annotation( Placement(transformation(extent = {{68, -51}, {110, -12}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(P0 = 140e5, Q0 = 24., h0 = 600e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + P0=140e5, + Q0=24., + h0=600e3) annotation( Placement(transformation(extent = {{-107, 14}, {-71, 48}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{74, 13}, {110, 49}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(K = 1e-3, rho(start = 932.9612394321883)) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1( + redeclare package Medium = Medium, + K=1e-3, rho( + start=29.766102492862515)) annotation( Placement(transformation(extent = {{57, 25}, {65, 37}}, rotation = 0))); equation connect(sourceQ.C, FossilFuelBoiler.Cair) annotation( 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 6431bcf8..72e09e6b 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_1.mo @@ -1,11 +1,21 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + Q0=0) annotation( Placement(transformation(extent = {{-80, 20}, {-60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink ( + redeclare package Medium = Medium) 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))); 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 259e273c..a8e599a0 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_2.mo @@ -1,11 +1,20 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + Q0=100) annotation( Placement(transformation(extent = {{-80, 20}, {-60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink ( + redeclare package Medium = Medium) 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))); 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 3fe2702b..4b8b0564 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_3.mo @@ -1,15 +1,29 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + P0=300000) annotation( Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP ( + redeclare package Medium = Medium) 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( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, + lambda=0, inertia=true) annotation( Placement(transformation(extent = {{20, 20}, {40, 40}}, rotation = 0))); equation connect(sourceP.C, centrifugalPump.C1) annotation( 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 4e703610..64db9658 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestCentrifugalPump/Scenario_4.mo @@ -1,11 +1,30 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceP( + redeclare package Medium = Medium, + Q0=10, + h0=650e3, + P0=100000) annotation( Placement(transformation(extent = {{-20, 20}, {0, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP ( + redeclare package Medium = Medium) 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo index 409479d1..a03c6b18 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CentrifugalPump/TestStaticCentrifugalPump.mo @@ -1,11 +1,18 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CentrifugalPump; model TestStaticCentrifugalPump - ThermoSysPro.Fluid.Machines.StaticCentrifugalPump StaticCentrifugalPump1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump StaticCentrifugalPump1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-10, -50}, {-30, -30}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.Tank Bache1(ze2 = 10, zs2 = 10) annotation( + ThermoSysPro.Fluid.Volumes.Tank Bache1( + redeclare package Medium = Medium, + ze2=10, + zs2=10) annotation( Placement(transformation(extent = {{-30, 10}, {-10, 30}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1 annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1 ( + redeclare package Medium = Medium) 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo index 2bc706d4..b90b612b 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGTCombustionChamber.mo @@ -1,15 +1,33 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.CombustionChamber; model TestGTCombustionChamber - ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.Sink Puits_Fumees2 ( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) 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( + ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber GTCombustionChamber2( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases) annotation( Placement(transformation(extent = {{-67, -68}, {67, 64}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ2(Q0 = 0, P0 = 15e5, h0 = 300e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ2( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Source_Fumees2( + redeclare package Medium = Medium_FlueGases, + P0=15e5, + Q0=415, + T0=680, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) annotation( Placement(transformation(extent = {{-174, -26}, {-128, 22}}, rotation = 0))); equation connect(GTCombustionChamber2.Cws, sourcePQ2.C) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo index ada1647a..ba5e270f 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/CombustionChamber/TestGenericCombustion1D.mo @@ -1,23 +1,76 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + Q0=609.29, + P0=191000, + T0=524.89, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) annotation( Placement(transformation(extent = {{-44, -98}, {0, -58}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink ( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) annotation( Placement(transformation(extent = {{0, 70}, {44, 112}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water(Q0 = 0, P0 = 100000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourcePQ_Water( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe PipeWaterSteam( + redeclare package Medium = Medium, + Ns=7, + z2=56, + rugosrel=5e-5, + ntubes=403, + L=58, + D=0.0327, + P(start=fill(2.0e7, 9)), + Q(start=fill(486.69, 8)), + h(start=fill(1.8e6, 9)), + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam2( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceEcrans( + redeclare package Medium = Medium, + 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( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo index 67f22a5e..f32465b8 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCombustionTurbine.mo @@ -1,13 +1,30 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.GasTurbine; model TestCombustionTurbine + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + 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( + ThermoSysPro.Fluid.Machines.CombustionTurbine CombustionTurbine( + redeclare package Medium = Medium, + tau_n=0.065, + is_eff_n=is_eff_n1, + Qred=Qred1, + Pe(fixed=true, start=1500000), + Ts(fixed=true, start=830), + Hs(start=769796.2 + Medium.h_offset)) 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceQ1( + redeclare package Medium = Medium, + Q0=430, + T0=1500, + option_temperature=true, + X0={1 - 0.14 - 0.06 - 0.06,0.14,0.06,0.06,0}) annotation( Placement(transformation(extent = {{-106, -10}, {-86, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0 = 1e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1( + redeclare package Medium = Medium, + P0=1e5, + T0=830) 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo index 2bac63a0..5b8320bf 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/GasTurbine/TestCompressor.mo @@ -1,12 +1,28 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.GasTurbine; model TestCompressor + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + 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( + ThermoSysPro.Fluid.Machines.Compressor Compressor( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1( + redeclare package Medium = Medium, + T0=288, + P0=1e5, + Q0=420, + option_temperature=true, + X0={1 - 0.003 - 0.23,0.23,0.003,0,0}) annotation( Placement(transformation(extent = {{-104, -10}, {-84, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(P0 = 15.8e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1( + redeclare package Medium = Medium, + P0=15.8e5) annotation( Placement(transformation(origin = {96, 0}, extent = {{10, -10}, {-10, 10}}, rotation = 180))); equation connect(SourceQ1.C, Compressor.Ce) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo index 16fdf496..75bae660 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/Islanding.mo @@ -1,27 +1,163 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterIn( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterOut( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ( + redeclare package Medium = Medium, + 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))); @@ -31,13 +167,24 @@ model Islanding 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( + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossPurge( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam( + redeclare package Medium = Medium, + 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( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo index d59a3b77..f5b524ce 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/NegativeFlow.mo @@ -1,27 +1,164 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterIn( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterOut( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ( + redeclare package Medium = Medium, + 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))); @@ -31,13 +168,24 @@ model NegativeFlow 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( + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossPurge( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam( + redeclare package Medium = Medium, + 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo index 6cac14b4..fd5f8d0a 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/DynamicWaterHeater/ZeroFlow.mo @@ -1,27 +1,164 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve_eau( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater WaterHeating( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterIn( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossWaterOut( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ( + redeclare package Medium = Medium, + 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))); @@ -31,13 +168,24 @@ model ZeroFlow 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( + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve checkValve( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossPurge( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PressureLoss_Steam( + redeclare package Medium = Medium, + 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo index afbd0a01..1d671d35 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicCondenser.mo @@ -1,34 +1,101 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestDynamicCondenser + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + parameter Real COP1(fixed = false, start = 0.7) "Corrective terme for heat exchange coefficient or Fouling coefficient"; //parameter ThermoSysPro.Units.SI.MassFlowRate QCRF = 20000 "CRF mass flow rate"; //parameter ThermoSysPro.Units.SI.Position z=1.05 "Liquid level in Cavity"; - ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_Eau(h0 = 50000, Q0 = 19000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_Eau( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_vapeur( + redeclare package Medium = Medium, + Q0=310, h0= + 2400e3) annotation( Placement(transformation(extent = {{-192, 144}, {-134, 200}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ Puit_condenseur1(Q0 = 310) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkQ Puit_condenseur1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicCondenser DynamicCondenser( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_Eau( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PressureLoss_VapeurIn( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve Valve_ext( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PressureLoss_VapeurIn_in4( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_Vsup1(Q0=0.00001, + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PressureLoss_EauOut( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.IdealCheckValve PressureLoss_VapeurIn1( + redeclare package Medium = Medium, + 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo index b47a5f16..c3c63222 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicOnePhaseFlowShell.mo @@ -1,11 +1,29 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowPipeShell( + redeclare package Medium = Medium, + inertia=false, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + option_temperature=false, + P0=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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + option_temperature=false, + h0=600e3, + Q(start=500, fixed=false), + 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo index e2049138..78e96e21 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicPlateHeatExchanger.mo @@ -1,15 +1,42 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger echangeurAPlaques1D1( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Ns=5, + Sc(Q(fixed=true, start=1036)), + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + T0=340) 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( + BoundaryConditions.SourceP sourcePQ( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(P0(fixed=false)= + 100000, + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{46, 6}, {66, 26}}, rotation = 0))); - BoundaryConditions.SinkP puitsP3(region = ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.IF97Region.Region_1) annotation( + BoundaryConditions.SinkP puitsP3( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{26, -14}, {46, 6}}, rotation = 0))); equation connect(sourceP2.C, echangeurAPlaques1D1.Ec) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo index 2a9ee684..634bdcad 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestDynamicTwoPhaseFlowPipe.mo @@ -1,11 +1,30 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe1( + redeclare package Medium = Medium, + inertia=false, + L=10, + D=0.03, + dpfCorr( + fixed=false, + start=0.2396333653343408) = 1, + 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, -48}, {40, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(C(Q(fixed = true, start = 1)), option_temperature = false, h0 = 800e3, P0 = 2000000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare package Medium = Medium, + 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo index c168832d..656113a0 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestNTUWaterHeater.mo @@ -1,27 +1,71 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestNTUWaterHeater - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1(Q0 = 1788.90, h0 = 760.83e3, P0 = 8270000) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2 ( + redeclare package Medium = Medium) 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6( + redeclare package Medium = Medium, + K=1e-4) annotation( Placement(transformation(extent = {{-111, -16}, {-91, 4}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss7(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss7( + redeclare package Medium = Medium, + K=1e-4) annotation( Placement(transformation(extent = {{-110, 84}, {-90, 104}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3 annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{136, -75}, {156, -55}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss8(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss8( + redeclare package Medium = Medium, + K=1e-4) annotation( Placement(transformation(extent = {{75, -16}, {95, 4}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss9(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss9( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1( + redeclare package Medium_e = Medium, + redeclare package Medium_c = Medium, + 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=5024, + KPurge=1767, + Sp(h_vol_1(start=780.13e3), h(fixed=true, start=780.13e3)), + lambdaE=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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss10( + redeclare package Medium = Medium, + K=1e-4) annotation( Placement(transformation(extent = {{-110, 35}, {-90, 55}}, rotation = 0))); - BoundaryConditions.SourceQ Drain_inlet1(Q0 = 118.02, h0 = 889.89e3) annotation( + BoundaryConditions.SourceQ Drain_inlet1( + redeclare package Medium = Medium, + Q0=118.02, + h0=889.89e3) annotation( Placement(transformation(extent = {{-174, 35}, {-154, 55}}, rotation = 0))); equation connect(Water_inlet1.C, singularPressureLoss6.C1) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo index f1c40377..9424131b 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestSimpleDynamicCondenser.mo @@ -1,27 +1,61 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestSimpleDynamicCondenser + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceRechauffeurEau( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourcePCaloporteur( + redeclare package Medium = Medium, + Q0=29804.5, h0=113e3) annotation( Placement(transformation(extent = {{-212, 30}, {-172, 68}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1(K = 1e-6) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe3( + redeclare package Medium = Medium, + K=1e-3, + Q(start=192, fixed=false)) 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( + ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur( D=0.018, + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + 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( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo index 56b40d2f..4fd8655c 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticCondenser.mo @@ -1,34 +1,77 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.HeatExchanger; model TestStaticCondenser + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP Puit_condenseur( + redeclare package Medium = Medium, + P0=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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + K=10) annotation( Placement(transformation(extent = {{-100, 80}, {-80, 100}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(K = 10) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1( + redeclare package Medium = Medium, + K=10) annotation( Placement(transformation(extent = {{-100, 40}, {-80, 60}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(K = 10) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3( + redeclare package Medium = Medium, + K=10) annotation( Placement(transformation(extent = {{-40, 140}, {-20, 160}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{100, -100}, {120, -80}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4( + redeclare package Medium = Medium, + K=1e-4) annotation( Placement(transformation(extent = {{98, -15}, {118, 5}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.HeatExchangers.StaticCondenser condenseur( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Source_condenseur( + redeclare package Medium = Medium, + h0=60e3, + C(P(fixed=false, 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2( + redeclare package Medium = Medium, + K=1e-3) annotation( Placement(transformation(extent = {{-101, -15}, {-81, 5}}, rotation = 0))); equation connect(sourceP1.C, singularPressureLoss.C1) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo index 811cbfc9..4439eadd 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/HeatExchanger/TestStaticPlateHeatExchanger.mo @@ -1,25 +1,53 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques1( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Sp=2, + Sc(Q(fixed=true, start=1036.78)), + Hmc(start=220524.0), + Hmf(start=127690.0), + Qf(start=1000.0)) annotation( Placement(transformation(extent = {{-10, 30}, {10, 50}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(T0 = 340) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + T0=340) annotation( Placement(transformation(extent = {{-70, 30}, {-50, 50}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-50, 10}, {-30, 30}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(P0(fixed = false) = 100000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2( + redeclare package Medium = Medium, + P0(fixed=false)= + 100000) annotation( Placement(transformation(extent = {{50, 30}, {70, 50}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3 ( + redeclare package Medium = Medium) 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( + ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger echangeurAPlaques( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Sp=2, + Hmc(start=220524.0), + Hmf(start=127690.0), + Qc(start=1000.0), + Qf(start=1000.0)) annotation( Placement(transformation(extent = {{-10, -34}, {10, -14}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP6(T0 = 340) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP6( + redeclare package Medium = Medium, + T0=340) annotation( Placement(transformation(extent = {{-70, -34}, {-50, -14}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP7 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP7 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-50, -54}, {-30, -34}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP6 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP6 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{50, -34}, {70, -14}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP7 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP7 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{30, -54}, {50, -34}}, rotation = 0))); equation connect(sourceP2.C, echangeurAPlaques1.Ec) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo index 4f31843a..5128fddf 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/InternalCombustionEngine/TestInternalCombustionEngine.mo @@ -1,22 +1,59 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.InternalCombustionEngine; model TestInternalCombustionEngine + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + 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( + BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + Q0=1.9627, + T0=30 + 273.16, + option_temperature=true, + X0={0.765,0.23,0.005,0,0}, + P0=191000) annotation( Placement(transformation(extent = {{111, -79}, {73, -45}}, rotation = 0))); - BoundaryConditions.Sink sink(option_temperature = true) annotation( + BoundaryConditions.Sink sink( + redeclare package Medium = Medium_FlueGases, + 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( + BoundaryConditions.SourcePQ SourcePQ_Water( + redeclare package Medium = Medium, + 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( + Machines.InternalCombustionEngine alternatingEngine( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + 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( + BoundaryConditions.Sink Sink_Water1 (redeclare package Medium = + Medium) annotation( Placement(transformation(extent = {{75, -19}, {111, 15}}, rotation = 0))); - PressureLosses.SingularPressureLoss singularPressureLoss annotation( + PressureLosses.SingularPressureLoss singularPressureLoss ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-63, -8}, {-51, 4}}))); - PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( + PressureLosses.SingularPressureLoss singularPressureLoss1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{51, -9}, {65, 5}}))); equation connect(alternatingEngine.Cair, sourceAir.C) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo index d4f9c7e4..03ad31b4 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestBend.mo @@ -1,11 +1,16 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestBend - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-62, -6}, {-42, 14}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{41, -34}, {61, -14}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.Bend Bend annotation( + ThermoSysPro.Fluid.PressureLosses.Bend Bend ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-8, -6}, {12, 14}}, rotation = 0))); equation connect(Bend.C2, SinkP1.C) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo index f61aedd3..be640f3a 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestCheckValve.mo @@ -1,13 +1,19 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestCheckValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-40, -10}, {-20, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(P0 = 6e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.CheckValve checkValve3 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{0, -10}, {20, 10}}, rotation = 0))); equation connect(sourceP1.C, checkValve3.C1) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo index 19690b16..65b36378 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestControlValve.mo @@ -1,11 +1,18 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestControlValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-64, -10}, {-44, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 ( + redeclare package Medium = Medium) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve ControlValve( + redeclare package Medium = Medium, + 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo index aa077dd4..6f81ce12 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDiaphragm.mo @@ -1,11 +1,16 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestDiaphragm - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-64, -10}, {-44, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{44, -10}, {64, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.Diaphragm Diaphragm annotation( + ThermoSysPro.Fluid.PressureLosses.Diaphragm Diaphragm ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0))); equation connect(Diaphragm.C2, PuitsP1.C) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo index cf5c486d..9d624510 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicCheckValve.mo @@ -1,11 +1,18 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestDynamicCheckValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-38, -10}, {-18, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1(P0 = 6e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP1( + redeclare package Medium = Medium, + P0=6e5) annotation( Placement(transformation(extent = {{42, -10}, {62, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve checkValve(J = 10) annotation( + ThermoSysPro.Fluid.PressureLosses.DynamicCheckValve checkValve( + redeclare package Medium = Medium, + 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo index e1ab8d59..85a4f627 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestDynamicReliefValve.mo @@ -1,19 +1,45 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.PressureLosses.DynamicReliefValve ReliefValve( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe Pipe2( + redeclare package Medium = Medium, + Pm(start=199283), + Q(start=1335.993983016864)) annotation( Placement(transformation(extent = {{40, -20}, {60, 0}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink2 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{80, -20}, {100, 0}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe Pipe1(D = 0.4, Pm(start = 1478795.1075221882)) annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe Pipe1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.Volumes.VolumeD VolumeD1( + redeclare package Medium = Medium, + P(start=298566), h(start= + 72156.6431966866)) annotation( Placement(transformation(extent = {{0, -20}, {20, 0}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP Sink1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{40, 20}, {60, 40}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP ( + redeclare package Medium = Medium) 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}}))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo index 79fba28f..9fb30d4f 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestLumpedStraightPipe.mo @@ -1,11 +1,21 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestLumpedStraightPipe - ThermoSysPro.Fluid.Volumes.Tank tank1(h0 = 2e5) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Volumes.Tank tank1( + redeclare package Medium = Medium, + h0=2e5) annotation( Placement(transformation(extent = {{-50, 16}, {-30, 36}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.Tank tank2(z0 = 10) annotation( + ThermoSysPro.Fluid.Volumes.Tank tank2( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, + 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( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo index 30ff389e..96e761c3 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestPipePressureLoss.mo @@ -1,11 +1,16 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestPipePressureLoss - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-85, -10}, {-65, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{64, -10}, {84, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss annotation( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-40, -53}, {38, 53}}, rotation = 0))); equation connect(pipePressureLoss.C2, PuitsP1.C) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo index f854198e..4fa1d9a7 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestSwitchValve.mo @@ -1,17 +1,24 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestSwitchValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-90, -10}, {-70, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{70, -10}, {90, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SwitchValve SwitchValve annotation( + ThermoSysPro.Fluid.PressureLosses.SwitchValve SwitchValve ( + redeclare package Medium = Medium) 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( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-55, -10}, {-35, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1 annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe perteDP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{34, -10}, {54, 10}}, rotation = 0))); equation connect(pulse.yL, SwitchValve.Ouv) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo index 7208b618..2e7cdd13 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/PressureLoss/TestThreeWayValve.mo @@ -1,13 +1,23 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.PressureLoss; model TestThreeWayValve - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-90, -10}, {-70, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 ( + redeclare package Medium = Medium) 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( + ThermoSysPro.Fluid.PressureLosses.ThreeWayValve threeWayValve( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 ( + redeclare package Medium = Medium) 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo index 36991e2c..1b690853 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SolarCollector/TestFresnelField.mo @@ -1,15 +1,53 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.SolarCollector; model TestFresnelField + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + h0=2000e3, P0=125e5) annotation( Placement(transformation(extent = {{48, -54}, {68, -34}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(Q0 = 11, h0 = 1500e3) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP( + redeclare package Medium = Medium, + 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo index 619cfc2b..61745204 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/SteamTurbine/TestStodolaTurbine.mo @@ -1,11 +1,22 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.SteamTurbine; model TestStodolaTurbine - ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine(Cst = 2e6, eta_is_nom = 0.94) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + 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( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo index 2a569c87..493067aa 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestDynamicDrum.mo @@ -1,25 +1,85 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestDynamicDrum + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + 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( + ThermoSysPro.Fluid.Volumes.DynamicDrum Drum( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe TubeEcranBoucleEvaporatoire( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceQ(h0=1400000, + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo index 92c23447..7ef940e3 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestMixer3.mo @@ -1,25 +1,32 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestMixer3 - ThermoSysPro.Fluid.Junctions.Mixer3 mixer2_2 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Junctions.Mixer3 mixer2_2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-6, -10}, {14, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{34, -10}, {54, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-46, 10}, {-26, 30}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-46, -30}, {-26, -10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Source sourceP2 annotation( + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-86, 10}, {-66, 30}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-86, -30}, {-66, -10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1 ( + redeclare package Medium = Medium) 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-86, -10}, {-66, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-46, -10}, {-26, 10}}, rotation = 0))); equation connect(singularPressureLoss4.C2, mixer2_2.Ce1) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo index 1e2d0a65..a41aa3f4 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestPressurizer.mo @@ -1,23 +1,79 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestPressurizer + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve FeedwaterValve_Spray( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve SteamValve( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.Volumes.Pressurizer pressurizer( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1( + redeclare package Medium = Medium, + 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo index 05a4d4c3..8079dabd 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSplitter3.mo @@ -1,23 +1,32 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestSplitter3 - ThermoSysPro.Fluid.Junctions.Splitter3 splitter3 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Junctions.Splitter3 splitter3 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-16, -10}, {4, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(Q0 = 100, option_temperature = true) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1( + redeclare package Medium = Medium, + Q0=100, + option_temperature=true) annotation( Placement(transformation(extent = {{-96, -10}, {-76, 10}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-56, -10}, {-36, 10}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2 annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{84, 30}, {104, 50}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3 annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{84, -50}, {104, -30}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{44, 30}, {64, 50}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5 (redeclare package Medium = Medium) 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP4 ( + redeclare package Medium = Medium) 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo index 65fb112c..af94442a 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestStaticDrum3.mo @@ -1,27 +1,64 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestStaticDrum3 - ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-30, 1}, {20, 51}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1( + redeclare package Medium = Medium, + K=1e-4, + rho(start=688.4113, displayUnit="g/cm3")) annotation( Placement(transformation(extent = {{38, 7}, {58, 27}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(K = 1e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2( + redeclare package Medium = Medium, + K=1e-4, + rho(start=691.7364, displayUnit="g/cm3")) annotation( Placement(transformation(extent = {{-58, -8}, {-38, 12}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(Q0 = 10) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ( + redeclare package Medium = Medium, + Q0=10) annotation( Placement(transformation(extent = {{74, 7}, {94, 27}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(Q0 = 100, h0 = 1400e3, P0 = 10000000) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI3( + redeclare package Medium = Medium, + K=1e-4, + rho(start=55.45212, displayUnit="g/cm3")) annotation( Placement(transformation(extent = {{38, 52}, {58, 72}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink ( + redeclare package Medium = Medium) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe( + redeclare package Medium = Medium, + inertia=false, + z1=0, + rugosrel=0.0001, + D=0.05, + ntubes=10, + L=10, + z2=10, + P(start={10053832.0,10046967.0,10041924.0,10037550.0,10033392.0,10029237.0,10024966.0,10020505.0,10015807.0,10010839.0,10005576.0,10000000.0}, each displayUnit="bar")) 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( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe( + redeclare package Medium = Medium, + lambda(fixed=false) = 0.03, + D=0.05, + ntubes=10, + L=10, + z1=10, + Q(fixed=false, start=30)) annotation( Placement(transformation(origin = {20, -45}, extent = {{-14, -12}, {14, 12}}, rotation = 270))); - ThermoSysPro.Fluid.Volumes.VolumeA volumeA annotation( + ThermoSysPro.Fluid.Volumes.VolumeA volumeA ( + redeclare package Medium = Medium, + steady_state=false) 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))); diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo index 6b562cd0..3cd16300 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestSteamDryer.mo @@ -1,19 +1,31 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestSteamDryer - ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(eta = 0.9, P(start = 10000000)) annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceQ( + redeclare package Medium = Medium, + P0=10000000, h0= + 2400000) annotation( Placement(transformation(extent = {{-90, -4}, {-70, 16}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-50, -4}, {-30, 16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{70, -4}, {90, 16}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1 (redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{30, -4}, {50, 16}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(K = 1.e-4) annotation( + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3( + redeclare package Medium = Medium, + K=1.e-4) annotation( Placement(transformation(extent = {{30, -44}, {50, -24}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.Sink sink annotation( + ThermoSysPro.Fluid.BoundaryConditions.Sink sink ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{70, -44}, {90, -24}}, rotation = 0))); equation connect(sourceQ.C, singularPressureLoss2.C1) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo index a249d370..13fa209d 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestTank.mo @@ -1,21 +1,31 @@ within ThermoSysPro.Fluid.Examples.Book.SimpleExamples.Volume; model TestTank - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1 annotation( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{30, -50}, {50, -30}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1 annotation( + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-50, 2}, {-30, 22}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{-90, -4}, {-70, 16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{70, -50}, {90, -30}}, rotation = 0))); - ThermoSysPro.Fluid.Volumes.Tank Tank1(z(fixed = false, start = 5)) annotation( + ThermoSysPro.Fluid.Volumes.Tank Tank1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PerteDP2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{30, -4}, {50, 16}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{70, -4}, {90, 16}}, rotation = 0))); equation connect(PerteDP1.C2, PuitsP1.C) annotation( diff --git a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo index f74708d5..c14242cd 100644 --- a/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo +++ b/ThermoSysPro/Fluid/Examples/Book/SimpleExamples/Volume/TestVolumeATh.mo @@ -1,23 +1,42 @@ 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( + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve1( + redeclare package Medium = Medium, + 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve2 ( + redeclare package Medium = Medium) annotation( Placement(transformation(extent = {{28, 2}, {48, 22}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ ( + redeclare package Medium = Medium) 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + option_temperature=false) annotation( Placement(transformation(extent = {{-79, -64}, {-59, -44}}, rotation = 0))); - ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1(L = 0.1, D = 1) annotation( + ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe lumpedStraightPipe1( + redeclare package Medium = Medium, + 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))); diff --git a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo index 7c325cd9..cd5344e9 100644 --- a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo +++ b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_Load_100_50.mo @@ -1,199 +1,201 @@ 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"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam "Water/steam medium"; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases "Flue gases medium"; + parameter Real CstHP(fixed = false, start = 7870372.0) "Stodola's ellipse coefficient HP"; + parameter Real CstMP(fixed = false, start = 250029.328125) "Stodola's ellipse coefficient MP"; + parameter Real CstBP(fixed = false, start = 10565.39453125) "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 Real Encras_SHP1(fixed = false, start = 0.01957226) "Sur HP1: heat exchange fouling coefficient"; + parameter Real Encras_SHP2(fixed = false, start = 0.04979854) "Sur HP2: heat exchange fouling coefficient"; + parameter Real Encras_SHP3(fixed = false, start = 0.06854334) "Sur HP3: heat exchange fouling coefficient"; + parameter Real Encras_EHP1(fixed = false, start = 0.07060027) "Eco HP1: heat exchange fouling coefficient"; + parameter Real Encras_EHP2(fixed = false, start = 0.11225893) "Eco HP2: heat exchange fouling coefficient"; + parameter Real Encras_EHP3(fixed = false, start = 0.0589451) "Eco HP3: heat exchange fouling coefficient"; + parameter Real Encras_EHP4(fixed = false, start = 0.02870644) "Eco HP4: heat exchange fouling coefficient"; + parameter Real Encras_SMP1(fixed = false, start = 0.03562396) "Sur MP1: heat exchange fouling coefficient"; + parameter Real Encras_SMP2(fixed = false, start = 0.06445078) "Sur MP2: heat exchange fouling coefficient"; + parameter Real Encras_SMP3(fixed = false, start = 0.05669266) "Sur MP3: heat exchange fouling coefficient"; + parameter Real Encras_EMP(fixed = false, start = 0.08260051) "Eco MP: heat exchange fouling coefficient"; + parameter Real Encras_EvHP(fixed = false, start = 0.02220076) "Evapo HP: heat exchange fouling coefficient"; + parameter Real Encras_EvMP(fixed = false, start = 0.05100356) "Evapo MP: heat exchange fouling coefficient"; + parameter Real Encras_EvBP(fixed = false, start = 0.05506011) "Evapo BP: heat exchange fouling coefficient"; + parameter Real Encras_SBP(fixed = false, start = 0.04970671) "Sur BP: heat exchange fouling coefficient"; + parameter Real Encras_EBP(fixed = false, start = 0.05872156) "Eco BP: heat exchange fouling coefficient"; + parameter Real KgainChargeHP(fixed = false, start = 1397.64331055) "HP: Friction pressure loss coefficient"; + parameter Real KgainChargeMP(fixed = false, start = 2109.40600586) "MP: Friction pressure loss coefficient"; + parameter Real Kin_SMP2(fixed = false, start = 200.53651428) "SMPin: Friction pressure loss coefficient"; + parameter Real K_PerteChargeZero2(fixed = false, start = 128.79850769) "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( + ThermoSysPro.Fluid.Volumes.DynamicDrum BallonHP(redeclare package Medium = Medium, L = 16.27, Vertical = false, hl(start = 1460157.0, fixed = false), hv(start = 2664771.25, fixed = false), Vv(start = 28.176434, fixed = false), R = 1.05, xmv(fixed = false), P(start = 12726798.0, fixed = false), zl(start = 1.05, fixed = true), Mp = 5000, Kpa = 5, Kvl = 1000, Pfond(start = 12733709.0), Tp(start = 589.4727172851562), state_out_l(d(start = 671.1120605)), Cd(h_vol_1(start = 1460157)), Ce2(h_vol_1(start = 1460157)), Ce3(h_vol_1(start = 1460157)), Cs(h_vol_2(start = 1460157))) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationHP(redeclare package Medium = Medium, Cvmax = CvmaxValveAHP, C1(P(start = 13377830.0), h_vol_2(start = 1398733.0)), h(start = 1398733.0), Cv(start = 177.89662170410156), Pm(start = 13052314.0)) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurHP(redeclare package Medium = Medium, Cvmax = 47829.4, C2(h_vol_1(start = 2664771.25)), h(start = 2664771.25), Cv(start = 23914.69921875), Pm(start = 12725285.0)) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeHP(redeclare package Medium = Medium, z2 = 0, Q(start = 150, fixed = true), z1 = 10.83, K = KgainChargeHP, C2(P(start = 12758131.0)), h(start = 1460157.0), Pm(start = 12745920.0)) 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( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapHP(redeclare package Medium = Medium, V = 5, h(start = 1460157.0), P(start = 12758131.0), Ce2(h_vol_1(start = 1460157)), Ce3(h_vol_1(start = 1460157))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurHP(steady_state = false, option_temperature = false, h0 = {1842996.125, 2021168.75, 2103751.5}, T0 = fill(605.824, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 32.8e-3, Ntubes = 1476, L = 20.7, ExchangerWall(e = 0.0026, lambda = 47, dW1(start = {-57425876.0, -26725888.0, -12387397.0}), Tp(start = {607.973388671875, 605.4445190429688, 604.0555419921875}), Tp1(start = {606.516845703125, 604.7666015625, 603.7413330078125})), 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.32666015625, 606.0742797851562, 604.3474731445312}), h(start = {3060028.5, 2965298.75, 2921211.75, 2900777.25, 2895017})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z2 = 10.83, option_temperature(start = false) = false, continuous_flow_reversal = true, inertia = true, dW1(start = {57425876.0, 26725888.0, 12387397.0}), h(start = {1460157.0, 1842996.125, 2021168.75, 2103751.5, 1460157.0}), hb(start = {1460157.0, 1842996.125, 2021168.75, 2103751.5}), P(start = {12758131.0, 12740277.0, 12734658.0, 12730511.0, 12726798.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {13419.6875, 10783.772461, 8669.30957}), Q(start = {150.0, 150.0, 150.0, 150.0})), Cfg1(Xi(start = {0.7542451793792345, 0.1115701174007655, 0.07254632562, 0.06163837761, 0}), h_vol_1(start = 3060028.5), h_vol_2(start = 2965298.75)), Cfg2(h_vol_1(start = 2900777.25), h_vol_2(start = 2895017))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP4(steady_state = false, option_temperature = false, h0 = {1338057.875, 1372606.625, 1398733.0}, T0 = fill(581.72, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.726, Dint = 0.0266, Ntubes = 246, ExchangerWall(e = 0.0026, lambda = 47, dW1(start = {-3491887.0, -2629980.25, -1988833.5}), Tp(start = {577.0819702148438, 582.1712646484375, 585.9067993164062}), Tp1(start = {576.43310546875, 581.6826171875, 585.5372314453125})), Cws1(P(start = 13304374.0), h_vol_2(start = 1292186.75)), Cws2(h_vol_1(start = 1398733.0)), 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.6754150390625, 582.6182861328125, 586.2448120117188}), h(start = {2900777.25, 2895017, 2890678.75, 2887398, 2885295.5})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.83, z2 = 0, option_temperature(start = false) = false, inertia = true, dW1(start = {3491887.0, 2629980.25, 1988833.5}), h(start = {1292186.75, 1338057.875, 1372606.625, 1398733.0, 1398733.0}), hb(start = {1292186.75, 1338057.875, 1372606.625, 1398733.0}), P(start = {13304374.0, 13323348.0, 13341852.0, 13359985.0, 13377830.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {6917.688965, 6996.496094, 7062.208496}), Q(start = {76.123756, 76.123756, 76.123756, 76.123756})), Cfg2(h_vol_1(start = 2887398), h_vol_2(start = 2885295.5))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP1(steady_state = false, option_temperature = false, h0 = {2793338.75, 2894601.25, 2972997.5}, T0 = fill(658.513, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Dint = 0.0324, Ntubes = 246, ExchangerWall(e = 0.0028, lambda = 37.61, dW1(start = {-9787038.0, -7708485.5, -5967831.5}), Tp(start = {641.7616577148438, 659.242431640625, 674.5349731445312}), Tp1(start = {639.70947265625, 657.6260986328125, 673.2836303710938})), Cws1(h_vol_2(start = 2664771.25)), Cws2(P(start = 12720380.0), h_vol_1(start = 2972997.5)), 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.6566772460938, 660.7349853515625, 675.6904907226562}), h(start = {3098733.75, 3082589, 3069873, 3060028.5, 2965298.75})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.83, option_temperature(start = false) = false, inertia = true, dW1(start = {9787038.0, 7708485.5, 5967831.5}), h(start = {2664771.25, 2793338.75, 2894601.25, 2972997.5, 2972997.5}), hb(start = {2664771.25, 2793338.75, 2894601.25, 2972997.5}), P(start = {12723773.0, 12723715.0, 12723035.0, 12721883.0, 12720380.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {2799.019043, 2370.857422, 2135.596191}), Q(start = {76.123756, 76.123756, 76.123756, 76.123756})), Cfg1(h_vol_1(start = 3098733.75), h_vol_2(start = 3082589))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP3(steady_state = false, option_temperature = false, h0 = {1192151.75, 1265586.75, 1292186.75}, T0 = fill(562.167, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 26.6e-3, Ntubes = 1476, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-15527223.0, -5590150.0, -2024889.125}), Tp(start = {556.9667358398438, 563.5999145507812, 565.9346923828125}), Tp1(start = {556.4859008789062, 563.4267578125, 565.8719482421875})), 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.4065551757812, 563.7582397460938, 565.9920043945312}), h(start = {2883137, 2857523.25, 2848301.75, 2844961.5, 2843184.25})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.767, inertia = true, dW1(start = {15527223.0, 5590150.0, 2024889.125}), h(start = {988178.3125, 1192151.75, 1265586.75, 1292186.75, 1292186.75}), hb(start = {988178.3125, 1192151.75, 1265586.75, 1292186.75}), P(start = {13222570.0, 13244666.0, 13265102.0, 13284865.0, 13304374.0}), T0(start = {300.0, 300.0, 300.0}), Q(start = {76.123756, 76.123756, 76.123756, 76.123756})), Cfg1(h_vol_1(start = 2883137), h_vol_2(start = 2857523.25)), Cfg2(h_vol_1(start = 2844961.5), h_vol_2(start = 2843184.25))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP2(steady_state = false, option_temperature = false, h0 = {922134.562, 962653.5, 988178.312}, T0 = fill(498.43, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 26.6e-3, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-5e6, -3e6, -2.e6}), Tp(start = {492.0558166503906, 499.33734130859375, 503.8979187011719}), Tp1(start = {491.85382080078125, 499.2102355957031, 503.81787109375})), 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 = {492.2405700683594, 499.45361328125, 503.9711608886719}), h(start = {2802681.25, 2794595.5, 2789507.25, 2786302, 2782058.75})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.767, inertia = true, dW1(start = {5e6, 3e6, 2.e6}), h(start = {857742.5, 922134.5625, 962653.5, 988178.3125, 988178.3125}), hb(start = {857742.5, 922134.5625, 962653.5, 988178.3125}), P(start = {13132658.0, 13155663.0, 13178223.0, 13200491.0, 13222570.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {1831.615479, 1859.022339, 1875.480103}), Q(start = {76.123756, 76.123756, 76.123756, 76.123756})), Cfg1(h_vol_1(start = 2802681.25), h_vol_2(start = 2794595.5)), Cfg2(h_vol_1(start = 2786302), h_vol_2(start = 2782058.75))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP1(steady_state = false, option_temperature = false, h0 = {760481.0, 826108.812, 857742.5}, T0 = fill(469.09, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 26.6e-3, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-10336913.0, -4995835.0, -2408076.5}), Tp(start = {461.0337829589844, 470.7584533691406, 475.4774169921875}), Tp1(start = {460.6069641113281, 470.5521545410156, 475.37799072265625})), L = 20.726, Ntubes = 1107, Cws1(h_vol_2(start = 624690.125)), 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 = {461.4241943359375, 470.9471130371094, 475.568359375}), h(start = {2778575.75, 2761524, 2753282.75, 2749310.5, 2729320.5})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, z1 = 10.767, inertia = true, dW1(start = {10336913.0, 4995835.0, 2408076.5}), h(start = {624690.125, 760481.0, 826108.8125, 857742.5, 857742.5}), hb(start = {624690.125, 760481.0, 826108.8125, 857742.5}), advection = true, dynamic_mass_balance = true, P(start = {13038369.0, 13062802.0, 13086438.0, 13109653.0, 13132658.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {1703.350342, 1759.462891, 1784.450073}), Q(start = {76.123756, 76.123756, 76.123756, 76.123756})), Cfg1(h_vol_1(start = 2778575.75), h_vol_2(start = 2761524)), Cfg2(h_vol_1(start = 2749310.5), h_vol_2(start = 2729320.5))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP2(steady_state = false, option_temperature = false, h0 = {3088810.75, 3175837.75, 3240716.25}, T0 = fill(737.382, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Dint = 32e-3, Ntubes = 246, ExchangerWall(e = 3e-3, lambda = 27, dW1(start = {-8816137.0, -6624821.0, -4938789.5}), Tp(start = {718.056396484375, 738.9192504882812, 755.1716918945312}), Tp1(start = {715.2724609375, 736.8273315429688, 753.6121215820312})), Cws2(P(start = 12711013.0), h_vol_1(start = 3240716.25)), 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.6112060546875, 740.839111328125, 756.6029052734375}), h(start = {3173470.25, 3158927, 3147998.75, 3139851.75, 3120912.5})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.83, inertia = true, dW1(start = {8816137.0, 6624821.0, 4938789.5}), h(start = {2972997.5, 3088810.75, 3175837.75, 3240716.25, 3240716.25}), hb(start = {2972997.5, 3088810.75, 3175837.75, 3240716.25}), P(start = {12720380.0, 12718686.0, 12716472.0, 12713880.0, 12711013.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {1977.683594, 1886.197876, 1841.59021}), Q(start = {76.123756, 76.123756, 76.123756, 76.123756})), Cfg1(h_vol_1(start = 3173470.25), h_vol_2(start = 3158927)), Cfg2(h_vol_1(start = 3139851.75), h_vol_2(start = 3120912.5))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP3(steady_state = false, option_temperature = false, h0 = {3323878.25, 3386384.25, 3433201.75}, T0 = fill(805.437, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Ntubes = 246, ExchangerWall(lambda = 27, e = 5e-3, dW1(start = {-6330595.0, -4758206.5, -3563920.25}), Tp(start = {789.3624877929688, 806.8161010742188, 820.1324462890625}), Tp1(start = {785.697265625, 804.0612182617188, 818.0690307617188})), Dint = 28e-3, Cws2(h_vol_1(start = 3433201.75), h_vol_2(start = 3433201.75)), 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.5096435546875, 809.1815185546875, 821.9041748046875}), h(start = {3226298.5, 3215855.5, 3208006.25, 3202127.25, 3188843.25})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.726, inertia = true, dW1(start = {6330595.0, 4758206.5, 3563920.25}), h(start = {3240716.25, 3323878.25, 3386384.25, 3433201.75, 3433201.75}), hb(start = {3240716.25, 3323878.25, 3386384.25, 3433201.75}), P(start = {12711013.0, 12704275.0, 12696931.0, 12689134.0, 12681000.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {2295.884033, 2276.14624, 2267.704834}), Q(start = {76.123756, 76.123756, 76.123756, 76.123756})), Cfg1(h_vol_2(start = 3215855.5)), Cfg2(h_vol_1(start = 3202127.25), h_vol_2(start = 3188843.25))) 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( + ThermoSysPro.Fluid.Volumes.DynamicDrum BallonMP(redeclare package Medium = Medium, L = 16.27, Vertical = false, P0 = 27.29e5, hl(start = 980845.5, fixed = false), hv(start = 2798679.25, fixed = false), Vv(start = 28.176434, fixed = false), R = 1.05, P(start = 2733888.0, fixed = false), zl(start = 1.05, fixed = true), Kpa = 5, Mp = 5000, Kvl = 1000, Pfond(start = 2742433.0), Tp(start = 497.4056091308594), state_out_l(d(start = 829.8590088)), Cd(h_vol_1(start = 980845.5)), Ce2(h_vol_1(start = 980845.5)), Ce3(h_vol_1(start = 980845.5)), Cs(h_vol_2(start = 980845.5))) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationMP(redeclare package Medium = Medium, Cvmax = CvmaxValveAMP, C1(P(start = 3235124.75), h_vol_2(start = 946338.375)), h(start = 946338.375), Cv(start = 27.634977340698242), Pm(start = 2984506.25)) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurMP(redeclare package Medium = Medium, Cvmax = 47829.4, C2(h_vol_1(start = 2798679.25)), h(fixed = false, start = 2798000), Cv(start = 23914.69921875), Pm(fixed = false, start = 2732628.5)) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurMP(steady_state = false, option_temperature = false, h0 = {1046149.875, 1096680.0, 1135771.875}, T0 = fill(504.323, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 32.8e-3, L = 20.767, Ntubes = 738, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-9795648.0, -7579518.5, -5863791.0}), Tp(start = {504.9960632324219, 504.2750244140625, 503.69677734375}), Tp1(start = {504.5007629394531, 503.89178466796875, 503.4002685546875})), Ns = 3, TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.83, continuous_flow_reversal = true, inertia = true, dW1(start = {9795648.0, 7579518.5, 5863791.0}), P(start = {2773379.25, 2751240.0, 2743512.5, 2738258.0, 2733888.0}), h(start = {980845.5, 1046149.875, 1096680.0, 1135771.875, 980845.5}), hb(start = {980845.5, 1046149.875, 1096680.0, 1135771.875}), T0(start = {300.0, 300.0, 300.0}), Q(start = {150.0, 150.0, 150.0, 150.0})), Cws1(P(start = 2773379.25)), 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.45623779296875, 504.631103515625, 503.9722595214844}), h(start = {2841016.25, 2824857.5, 2812354.25, 2802681.25, 2794595.5})), Cfg1(h_vol_1(start = 2841016.25), h_vol_2(start = 2824857.5))) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeMP(redeclare package Medium = Medium, z2 = 0, z1 = 10.83, Q(start = 150, fixed = true), K = KgainChargeMP, Pm(start = 2757906.0), h(start = 980845.5)) 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( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapMP(redeclare package Medium = Medium, V = 5, h(start = 980845.5), P(start = 2773379.25), Ce2(h_vol_1(start = 980845.5)), Ce3(h_vol_1(start = 980845.5))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurMP(steady_state = false, option_temperature = false, h0 = {777225.0, 887380.812, 946338.375}, T0 = fill(485.041, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-2572232.0, -1375385.125, -736132.5625}), Tp(start = {469.9423828125, 487.818603515625, 497.3634033203125}), Tp1(start = {469.4644470214844, 487.5630187988281, 497.22662353515625})), L = 20.726, Ns = 3, Dint = 26.6e-3, Ntubes = 246, Cws1(h_vol_2(start = 571212.5625), P(start = 3142462.75)), Cws2(h_vol_1(start = 946338.375)), 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 = {470.3795471191406, 488.0523376464844, 497.488525390625}), h(start = {2786302, 2782058.75, 2779790, 2778575.75, 2761524})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.767, z2 = 0, inertia = true, dW1(start = {2572232.0, 1375385.125, 736132.5625}), h(start = {571212.5625, 777225.0, 887380.8125, 946338.375, 946338.375}), hb(start = {571212.5625, 777225.0, 887380.8125, 946338.375}), P(start = {3142462.75, 3167032.0, 3190375.75, 3212966.75, 3235124.75}), T0(start = {300.0, 300.0, 300.0}), Q(start = {12.485812, 12.485812, 12.485812, 12.485812}))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP1(steady_state = false, option_temperature = false, h0 = {2900753.0, 2965210.75, 3005554.0}, T0 = fill(572.207, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1274475.75, -804807.1875, -503716.96875}), Tp(start = {558.1707153320312, 574.1082763671875, 584.3428344726562}), Tp1(start = {557.7833251953125, 573.8636474609375, 584.189697265625})), L = 20.726, Ns = 3, Dint = 32.8e-3, Ntubes = 123, Cws1(h_vol_2(start = 2798679.25)), 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.5307006835938, 574.3355712890625, 584.485107421875}), h(start = {2887398, 2885295.5, 2883968, 2883137, 2857523.25})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z2 = 0, z1 = 10.77, inertia = true, dW1(start = {1274475.75, 804807.1875, 503716.96875}), h(start = {2798679.25, 2900753.0, 2965210.75, 3005554.0, 3040476.25}), hb(start = {2798679.25, 2900753.0, 2965210.75, 3005554.0}), P(start = {2731369.25, 2730428.5, 2729299.75, 2728041.0, 2726700.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {612.407593, 588.981079, 580.601746}), Q(start = {12.485812, 12.485812, 12.485812, 12.485812}))) 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( + ThermoSysPro.Fluid.Volumes.VolumeB MelangeurHPMP(redeclare package Medium = Medium, Ce1(h(start = 3046204.25), h_vol_1(start = 3040476.25)), h(start = 3040476.25), P(start = 2726700.0), Cs1(h_vol_2(start = 3040476.25))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP2(steady_state = false, option_temperature = false, h0 = {3170044.75, 3259807.75, 3321777.5}, T0 = fill(711.74, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Dint = 39.3e-3, Ntubes = 369, ExchangerWall(e = 2.6e-3, lambda = 36.86, dW1(start = {-11481016.0, -7953862.5, -5491113.5}), Tp(start = {689.0643310546875, 714.2538452148438, 731.902587890625}), Tp1(start = {687.7987060546875, 713.3770141601562, 731.2972412109375})), Cws1(P(start = 2575616.0), h_vol_2(start = 3040476.25)), Cws2(P(start = 2558251.25), h_vol_1(start = 3321777.5)), 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.2537231445312, 715.0778198242188, 732.471435546875}), h(start = {3139851.75, 3120912.5, 3107791.75, 3098733.75, 3082589})), TwoPhaseFlowPipe(advection = false, z2 = 0, z1 = 10.83, rugosrel = 1e-5, inertia = true, dW1(start = {11481016.0, 7953862.5, 5491113.5}), h(start = {3040476.25, 3170044.75, 3259807.75, 3321777.5, 3321777.5}), hb(start = {3040476.25, 3170044.75, 3259807.75, 3321777.5}), P(start = {2575616.0, 2571929.75, 2567706.0, 2563108.75, 2558251.25}), T0(start = {300.0, 300.0, 300.0}), hi(start = {821.471375, 831.789978, 841.549561}), Q(start = {88.609566, 88.609566, 88.609566, 88.609566}))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP3(steady_state = false, option_temperature = false, h0 = {3412658.5, 3475062.5, 3517830.25}, T0 = fill(801.1, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Ntubes = 369, Dint = 45.6e-3, ExchangerWall(e = 2.6e-3, lambda = 27, dW1(start = {-8052911.0, -5529594.5, -3789643.25}), Tp(start = {786.1732788085938, 802.8152465820312, 814.31103515625}), Tp1(start = {785.124267578125, 802.094970703125, 813.8173828125})), Cws2(h_vol_1(start = 3517830.25), h_vol_2(start = 3517830.25)), 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.1671752929688, 803.4977416992188, 814.77880859375}), h(start = {3202127.25, 3188843.25, 3179721.5, 3173470.25, 3158927})), TwoPhaseFlowPipe(advection = false, z2 = 0, z1 = 10.83, rugosrel = 1e-5, inertia = true, dW1(start = {8052911.0, 5529594.5, 3789643.25}), h(start = {3321777.5, 3412658.5, 3475062.5, 3517830.25, 3517830.25}), hb(start = {3321777.5, 3412658.5, 3475062.5, 3517830.25}), P(start = {2558251.25, 2556062.0, 2553688.0, 2551187.75, 2548600.0}), T0(start = {300.0, 300.0, 300.0}), hi(start = {656.760193, 666.429688, 673.31543}), Q(start = {88.609566, 88.609566, 88.609566, 88.609566}))) 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( + ThermoSysPro.Fluid.Volumes.DynamicDrum BallonBP(redeclare package Medium = Medium, Vertical = false, P0 = 5e5, Vv(start = 58.244598, fixed = false), L = 8, hl(start = 556201.6875, fixed = false), hv(start = 2683834.25, fixed = false), R = 2, P(start = 512417.21875, fixed = false), zl(start = 1.75, fixed = true), Kpa = 5, Mp = 5000, Kvl = 1000, Pfond(start = 528429.3125), Tp(start = 407.79571533203125), state_out_l(d(start = 933.0153198)), Cd(h_vol_1(start = 556201.6875)), Ce2(h_vol_1(start = 556201.6875)), Ce3(h_vol_1(start = 556201.6875))) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurBP(redeclare package Medium = Medium, p_rho = 3, Cvmax = CvmaxValveVBP, C2(P(start = 510105.625), h_vol_1(start = 2683834.25)), h(start = 2683834.25), Cv(start = 93443.7890625), Pm(start = 511261.4375)) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationBP(redeclare package Medium = Medium, Cvmax = 285, C1(h_vol_2(start = 513770.84375)), h(fixed = false, start = 509000), Cv(start = 142.5), Pm(start = 982596.875, fixed = false)) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeBP(redeclare package Medium = Medium, z2 = 0, z1 = 10.767, Q(start = 50, fixed = false), K = 32766, rho(start = 933.0189819335938), Pm(start = 533961.8125), h(start = 556201.6875)) 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( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapBP(redeclare package Medium = Medium, h(start = 556201.6875), V = 5, P(start = 539494.25), Ce2(h_vol_1(start = 556201.6875)), Ce3(h_vol_1(start = 556201.6875))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurBP(steady_state = false, option_temperature = false, h0 = {799038.938, 964745.875, 1078052.375}, T0 = fill(428.658, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 32.8e-3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-12117996.0, -8269060.0, -5654191.5}), Tp(start = {429.7086181640625, 428.56280517578125, 427.70245361328125}), Tp1(start = {429.2481689453125, 428.24859619140625, 427.48760986328125})), 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 = {430.1364440917969, 428.854736328125, 427.9020690917969}), h(start = {2749310.5, 2729320.5, 2715680, 2706352.75, 2665392.25})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.767, continuous_flow_reversal = true, inertia = true, dW1(start = {12117996.0, 8269060.0, 5654191.5}), h(start = {556201.6875, 799038.9375, 964745.875, 1078052.375, 556201.6875}), hb(start = {556201.6875, 799038.9375, 964745.875, 1078052.375}), Q(start = {49.90171432495117, 49.90171432495117, 49.90171432495117, 49.90171432495117}), P(start = {539494.25, 514856.03125, 513786.09375, 513081.78125, 512417.21875}), T0(start = {300.0, 300.0, 300.0}), hi(start = {5481.984863, 5281.962402, 5290.007812})), Cfg2(h_vol_1(start = 2706352.75), h_vol_2(start = 2665392.25))) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP(redeclare package Medium = Medium, Cvmax = 308.931, C1(h_vol_2(start = 556201.6875)), h(start = 556201.6875), Cv(start = 308.9309997558594), Pm(start = 430516.15625)) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurBP(steady_state = false, option_temperature = false, h0 = {2789058.5, 2864136.25, 2917424.75}, T0 = fill(499.111, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.726, Dint = 39.3e-3, Ntubes = 123, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1077319.25, -768670.0625, -545585.3125}), Tp(start = {476.5025939941406, 501.4080810546875, 519.423583984375}), Tp1(start = {476.2275695800781, 501.21185302734375, 519.2843017578125})), Cws1(h_vol_2(start = 2683834.25)), Cws2(h_vol_1(start = 2917424.75), h_vol_2(start = 2917424.75)), 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 = {476.76104736328125, 501.5924987792969, 519.554443359375}), h(start = {2844961.5, 2843184.25, 2841916.25, 2841016.25, 2824857.5})), TwoPhaseFlowPipe(advection = false, z2 = 0, rugosrel = 1e-5, z1 = 10.767, inertia = true, dW1(start = {1077319.25, 768670.0625, 545585.3125}), h(start = {2683834.25, 2789058.5, 2864136.25, 2917424.75, 2917424.75}), hb(start = {2683834.25, 2789058.5, 2864136.25, 2917424.75}), P(start = {510105.625, 508332.65625, 506373.03125, 504193.3125, 501850.0}), T0(start = {300.0, 300.0, 300.0}), Q(start = {10.238324, 10.238324, 10.238324, 10.238324}))) 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( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsFumees(redeclare package Medium = Medium_FlueGases, P0 = 1.013e5, C(h_vol_1(start = 2654311.25)), X(start = {0.7536821216, 0.1121331751, 0.07254632562, 0.06163837761, 0})) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurBP(steady_state = false, option_temperature = false, h0 = {445813.0, 501821.062, 513770.844}, T0 = fill(398.305, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, Dint = 32.8e-3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-24830472.0, -5536280.5, -1181209.875}), Tp(start = {401.4523620605469, 397.1709289550781, 396.2907409667969}), Tp1(start = {401.18280029296875, 397.1108093261719, 396.2779235839844})), Ntubes = 3444, L = 20.726, Cws1(h_vol_2(start = 194614.1875)), Cws2(h_vol_1(start = 513770.84375)), 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 = {401.70281982421875, 397.2267761230469, 396.30267333984375}), h(start = {2706352.75, 2665392.25, 2656259.75, 2654311.25, 2654311.25})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.767, inertia = true, dW1(start = {24830472.0, 5536280.5, 1181209.875}), h(start = {194614.1875, 445813.0, 501821.0625, 513770.84375, 513770.84375}), hb(start = {194614.1875, 445813.0, 501821.0625, 513770.84375}), P(start = {1553925.0, 1527777.625, 1502576.125, 1477646.0, 1452776.625}), T0(start = {300.0, 300.0, 300.0}), hi(start = {461.386383, 487.565826, 492.916229}), Q(start = {98.847893, 98.847893, 98.847893, 98.847893}))) 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( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineHP(redeclare package Medium = Medium, W_fric = 1, eta_stato = 1, eta_is(start = 0.8805699944496155), Qmax = 140, eta_is_nom = 0.88057, eta_is_min = 0.75, Cst(start = 8182844.56002535) = CstHP, rhos(start = 10.664762496948242), Hrs(start = 3046204.25), 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( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMP(redeclare package Medium = Medium, W_fric = 1, eta_stato = 1, eta_is(start = 0.9624999761581421), Qmax = 150, eta_is_nom = 0.9625, eta_is_min = 0.75, Cst(start = 256335.364995961) = CstMP, rhos(start = 1.8829431533813477), Hrs(start = 3029680.75), 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( + ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPostTMP1(redeclare package Medium = Medium, h(start = 3018053.5), P(start = 476800.0), Ce1(h(start = 3029680.75)), Ce2(Q(start = 20.476648)), Ce3(h_vol_1(start = 3018053.5))) 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( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineBP(redeclare package Medium = Medium, W_fric = 1, eta_stato = 1, eta_is(start = 0.9538000226020813), Qmax = 150, eta_is_nom = 0.9538, eta_is_min = 0.75, Cst(start = 11944.9445735985) = CstBP, Cs(h(start = 2401340.5)), Hrs(start = 2401340.5), Pe(fixed = true, start = 476799.99999954), Ps(start = 10052.8291015625)) annotation( Placement(transformation(extent = {{576, -250}, {616, -210}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitHP(alpha = 2) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitHP(redeclare package Medium = Medium, alpha = 2) annotation( Placement(transformation(origin = {-292, -100}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitMP(alpha = 2) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitMP(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitHP(redeclare package Medium = Medium, alpha = 0.5, Ce(h(start = 3046204.25)), P(start = 2726700.0)) 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( + ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(redeclare package Medium = Medium, redeclare package Medium_Cooling = Medium, 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 = 128035.9921875), h_vol_1(start = 70825.89844)), P(start = 10000.0, fixed = false), Pfond(start = 10000.0), Cl(h(start = 191812.296875), Q(start = 197.69578552246094), h_vol_2(start = 191812.296875)), rhom(start = 996.0200805664062), hv(start = 2583886.75), Vv(start = 850.0), state_d(d(start = 989.8436279)), Cee(P(start = 146447.2031), h(start = 113380), h_vol_2(start = 113380))) annotation( Placement(transformation(extent = {{637, -384}, {717, -304}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceCaloporteur(h0 = 113.38e3, Q0 = 29804.5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceCaloporteur(redeclare package Medium = Medium, h0 = 113.38e3, Q0 = 29804.5) annotation( Placement(transformation(extent = {{572, -377}, {620, -329}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsCaloporteur annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsCaloporteur(redeclare package Medium = Medium, C(h_vol_1(start = 70825.89844))) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK1(redeclare package Medium = Medium, K = 1e-4, h(start = 2401340.5), C1(h_vol_2(start = 2401340.5), h(start = 2401340.5)), Pm(start = 10026.4140625)) 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( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeCond1(redeclare package Medium = Medium, Ce3(h(start = 194614.1875)), h(start = 194614.1875), P(start = 1553925.0), Ce1(h_vol_1(start = 194614.1875)), Ce2(h_vol_1(start = 194614.1875))) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeKCond1(redeclare package Medium = Medium, K = 1e-4, rho(start = 990.3626098632812), Pm(start = 1553925.0)) 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( + ThermoSysPro.Fluid.Volumes.VolumeA VolumeAlimMPHP(redeclare package Medium = Medium, h(start = 556201.6875), P(start = 348615.09375), Ce2(h_vol_1(start = 556201.6875)), Cs1(h(start = 556201.6875)), Cs2(h(start = 556201.6875))) 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( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimMP(redeclare package Medium = Medium, a3 = 350, b1(fixed = true) = -3.7751, a1 = -244551, Q(fixed = false), C1(h_vol_2(start = 556201.6875), P(start = 348615.0938)), C2(h_vol_1(start = 571212.5625), P(start = 3147558.25)), Qv(start = 0.013392460532486439), rho(start = 932.3015747070312), Pm(start = 1748086.625), h(start = 563707.125)) 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( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimHP(redeclare package Medium = Medium, a3 = 1600, a1 = -28056.2, b1 = -12.7952660447433, Q(fixed = false), C1(h_vol_2(start = 556201.6875), P(start = 348615.0938)), C2(h_vol_1(start = 624690.125), P(start = 13229581)), Qv(start = 0.08183819055557251), rho(start = 930.1739501953125), Pm(start = 6789098.0), h(start = 590445.875)) 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( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitBP(redeclare package Medium = Medium, alpha = 0.5, h(start = 194614.1875), P(start = 1553925.0), Cs(h(start = 194614.1875))) annotation( Placement(transformation(extent = {{872, -328}, {886, -308}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitBP(alpha = 2) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitBP(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteChargeZero2(redeclare package Medium = Medium, z2 = 0, z1 = 0, K = K_PerteChargeZero2, h(start = 2917424.75), C1(h_vol_2(start = 2917424.75), h(start = 2917424.75), P(fixed = true, start = 501850)), Pm(start = 489325.0), rho(start = 2.155861378)) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK3(redeclare package Medium = Medium, K = 1e-4, Pm(start = 348615.09375)) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK8(redeclare package Medium = Medium, K = 1e-4, Pm(start = 348615.09375)) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK(redeclare package Medium = Medium, K = 1e-4, C1(h_vol_2(start = 191812.296875)), C2(h_vol_1(start = 191812.296875), P(start = 9999.996094)), rho(start = 989.83837890625), Pm(start = 9999.998046875)) 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( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimBP(redeclare package Medium = Medium, Qv(start = 0.1996714472770691), a3 = 400, a1(fixed = true) = -6000, Q(start = 194.502, fixed = false), C2(h_vol_1(start = 194614.1875), P(start = 1571189)), Pm(start = 790594.5), h(start = 193213.2344)) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK2(redeclare package Medium = Medium, K = 1e-4, rho(start = 990.3626098632812), C1(h_vol_2(start = 194614.1875), h(start = 194614.1875), P(start = 1553925)), Pm(start = 1553925.0)) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_extraction(redeclare package Medium = Medium, Cvmax = 2000, h(start = 194614.1875), Cv(start = 2000.0), Pm(start = 1562557.0)) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapHP(redeclare package Medium = Medium, C1(h_vol_2(start = 2664771.25), h(start = 2664771.25))) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauHP(redeclare package Medium = Medium, C2(h_vol_1(start = 1398733.0), h(start = 1398733.0))) " " 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauMP(redeclare package Medium = Medium, C2(h_vol_1(start = 946338.375), h(start = 946338.375))) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapMP(redeclare package Medium = Medium, C1(h_vol_2(start = 2798679.25), h(start = 2798679.25))) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapBP(redeclare package Medium = Medium, C2(h_vol_1(start = 2683834.25), h(start = 2683834.25))) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBP(redeclare package Medium = Medium, C2(h_vol_1(start = 513770.84375), h(start = 513770.84375))) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBPsortie(redeclare package Medium = Medium, C2(h_vol_1(start = 556201.6875), h(start = 556201.6875))) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauCondenseur(redeclare package Medium = Medium, C2(h_vol_1(start = 191812.296875), h(start = 191812.296875))) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapCondenseur(redeclare package Medium = Medium, C2(h_vol_1(start = 2583886.75), h(start = 2401340.5))) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss lumpedStraightPipeK2(redeclare package Medium = Medium, K = Kin_SMP2, Pm(start = 2651158.0), C1(P(fixed = true, start = 2726700), h_vol_2(start = 3040476.25), h(start = 3040476.25))) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineHP(redeclare package Medium = Medium, C1(P(fixed = true, start = 12680999.9999969)), Cvmax = Cvmax_THP, h(fixed = false, start = 3433000), Cv(start = 10876.2412109375), Pm(fixed = false, start = 12550000), deltaP(start = 250000)) 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( + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_HP(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), 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( + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_MP(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), 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( + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(add(k1 = -1, k2 = +1), pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), 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( + ThermoSysPro.Examples.Control.Condenser_LevelControl regulation_Niveau_Condenseur(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), 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))); @@ -203,23 +205,23 @@ model CombinedCycle_Load_100_50 "CCPP model to simulate a load variation from 10 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( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP1_2(redeclare package Medium = Medium, V = 1, h0 = 988332, h(start = 857742.5), dynamic_mass_balance = true, P0 = 7010000, P(start = 13132658.0), Ce2(h_vol_1(start = 857742.5)), Ce3(h_vol_1(start = 857742.5))) 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( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP2_3(redeclare package Medium = Medium, V = 1, h0 = 983786, h(start = 988178.3125), dynamic_mass_balance = true, P0 = 7000000, P(start = 13222570.0), Ce2(h_vol_1(start = 988178.3125)), Ce3(h_vol_1(start = 988178.3125))) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP1(redeclare package Medium = Medium, Cvmax = 308.931, h(start = 624690.125), Cv(start = 247.14480590820312), Pm(start = 13133975.0)) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP2(redeclare package Medium = Medium, Cvmax = 308.931, h(start = 571212.5625), Cv(start = 247.14480590820312), Pm(start = 3145010.5)) 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( + ThermoSysPro.Fluid.Volumes.VolumeD VolumePreTHP(redeclare package Medium = Medium, h0 = 3e6, h(start = 3433201.75), dynamic_mass_balance = true, P0 = 12700000, P(start = 12431000.0), Cs1(h_vol_2(start = 3433201.75)), Cs2(h_vol_2(start = 3433201.75))) 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( + ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPreTMP(redeclare package Medium = Medium, h0 = 3523910, h(start = 3517830.25), dynamic_mass_balance = true, P0 = 2400000, P(start = 2548500.0), Ce2(h_vol_1(start = 3517830.25)), Ce3(h_vol_1(start = 3517830.25))) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineMP(redeclare package Medium = Medium, C1(P(fixed = true, start = 25.486e5)), Cvmax = Cvmax_TMP, h(fixed = false, start = 3518000), Cv(start = 3313994.0), Pm(fixed = false, start = 2547000), deltaP(start = 100)) 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))); @@ -233,13 +235,13 @@ model CombinedCycle_Load_100_50 "CCPP model to simulate a load variation from 10 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( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceEau(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceFumees(redeclare package Medium = Medium_FlueGases, X0 = {0.79006, 0.20994, 0, 0, 0}, option_temperature = true, Q0 = 600, T0 = 29.4 + 273.16, P0 = 1.013e5) 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( + ThermoSysPro.Fluid.Machines.GasTurbine GasTurbine(redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, 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 = 1333895.5), Tsf(start = 1493.547119140625), Hrfg(start = 181479.640625), Tea(start = 678.0772094726562)), Wpth = 1e6, Compresseur(is_eff(fixed = false, start = 0.88), Xtau(fixed = false, start = 1.00), Ps(start = 1419887.5), Ts(start = 678.0772094726562), Tis(start = 630.7854614257812), Te(start = 302.55999755859375)), TurbineAgaz(Ps(fixed = false), is_eff(fixed = false, start = 0.87), Pe(fixed = false, start = 1333900), Te(start = 1493.547119140625), Ts(fixed = false, start = 893.16), Tis(start = 814.7440795898438)), xAIR(rho_air(start = 1.0994528532028198), ppvap0(start = 3817.616455), rho_vap(start = 0.02738765999674797), C2(Xi(start = {0.7708577346, 0.2048374414, 0.02430482395, 0, 0})), pro(h(start = 2554653.25)))) 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))); diff --git a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo index 5fb08a99..578b084d 100644 --- a/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo +++ b/ThermoSysPro/Fluid/Examples/CombinedCyclePowerPlant/CombinedCycle_TripTAC.mo @@ -1,199 +1,202 @@ 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"; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam "Water/steam medium"; + package Medium_Liquid = ThermoSysPro.Properties.Media.WaterSteam(Region=1) "Water/steam forced in IF97 region 1 (liquid), as mode = 1 in the WaterSteam example"; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases "Flue gases medium"; + parameter Real CstHP(fixed = false, start = 7919515.5) "Stodola's ellipse coefficient HP"; + parameter Real CstMP(fixed = false, start = 251048.328125) "Stodola's ellipse coefficient MP"; + parameter Real CstBP(fixed = false, start = 10720.13671875) "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 Real Encras_SHP1(fixed = false, start = 0.01957859) "Sur HP1: heat exchange fouling coefficient"; + parameter Real Encras_SHP2(fixed = false, start = 0.04982952) "Sur HP2: heat exchange fouling coefficient"; + parameter Real Encras_SHP3(fixed = false, start = 0.06859577) "Sur HP3: heat exchange fouling coefficient"; + parameter Real Encras_EHP1(fixed = false, start = 0.07054558) "Eco HP1: heat exchange fouling coefficient"; + parameter Real Encras_EHP2(fixed = false, start = 0.11222337) "Eco HP2: heat exchange fouling coefficient"; + parameter Real Encras_EHP3(fixed = false, start = 0.05893945) "Eco HP3: heat exchange fouling coefficient"; + parameter Real Encras_EHP4(fixed = false, start = 0.02870633) "Eco HP4: heat exchange fouling coefficient"; + parameter Real Encras_SMP1(fixed = false, start = 0.03562902) "Sur MP1: heat exchange fouling coefficient"; + parameter Real Encras_SMP2(fixed = false, start = 0.06448392) "Sur MP2: heat exchange fouling coefficient"; + parameter Real Encras_SMP3(fixed = false, start = 0.05672803) "Sur MP3: heat exchange fouling coefficient"; + parameter Real Encras_EMP(fixed = false, start = 0.08256767) "Eco MP: heat exchange fouling coefficient"; + parameter Real Encras_EvHP(fixed = false, start = 0.02220394) "Evapo HP: heat exchange fouling coefficient"; + parameter Real Encras_EvMP(fixed = false, start = 0.05100306) "Evapo MP: heat exchange fouling coefficient"; + parameter Real Encras_EvBP(fixed = false, start = 0.05495019) "Evapo BP: heat exchange fouling coefficient"; + parameter Real Encras_SBP(fixed = false, start = 0.04966641) "Sur BP: heat exchange fouling coefficient"; + parameter Real Encras_EBP(fixed = false, start = 0.0586358) "Eco BP: heat exchange fouling coefficient"; + parameter Real KgainChargeHP(fixed = false, start = 1395.875) "HP: Friction pressure loss coefficient"; + parameter Real KgainChargeMP(fixed = false, start = 2111.61694336) "MP: Friction pressure loss coefficient"; + parameter Real Kin_SMP2(fixed = false, start = 201.48884583) "SMPin: Friction pressure loss coefficient"; + parameter Real K_PerteChargeZero2(fixed = false, start = 144.01260376) "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( + ThermoSysPro.Fluid.Volumes.DynamicDrum BallonHP(redeclare package Medium = Medium, L = 16.27, Vertical = false, hl(start = 1460690.625, fixed = false), hv(start = 2664802.75, fixed = false), Vv(start = 28.176434, fixed = false), R = 1.05, xmv(fixed = false), zl(start = 1.05, fixed = true), Mp = 5000, Kpa = 5, Kvl = 1000, P(start = 12726434.0, fixed = false), Pfond(start = 12733342.0), Tp(start = 589.5374755859375), Cd(h_vol_1(start = 1460690.625)), Ce2(h_vol_1(start = 1460690.625)), Ce3(h_vol_1(start = 1460690.625)), Cs(h_vol_2(start = 1460690.625)), state_out_l(d(start = 670.8724976))) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationHP(redeclare package Medium = Medium, Cvmax = CvmaxValveAHP, C1(P(start = 13398096.0), h_vol_2(start = 1399475.5)), h(start = 1399475.5), Cv(start = 174.68450927734375), Pm(start = 13062265.0)) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurHP(redeclare package Medium = Medium, Cvmax = 47829.4, C2(h_vol_1(start = 2664802.75)), h(start = 2664802.75), Cv(start = 23914.69921875), Pm(start = 12724930.0)) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeHP(redeclare package Medium = Medium_Liquid, z2 = 0, Q(start = 150, fixed = true), z1 = 10.83, K = KgainChargeHP, C2(P(start = 12757782.0)), h(start = 1460690.625), Pm(start = 12745562.0)) 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( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapHP(redeclare package Medium = Medium_Liquid, V = 5, h(start = 1460690.625), P(start = 12757782.0), Ce2(h_vol_1(start = 1460690.625)), Ce3(h_vol_1(start = 1460690.625))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurHP(steady_state = false, option_temperature = false, h0 = {1842497.375, 2019893.75, 2101978.0}, T0 = fill(605.812, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 32.8e-3, Ntubes = 1476, L = 20.7, ExchangerWall(e = 0.0026, lambda = 47, dW1(start = {-57271024.0, -26609444.0, -12312660.0}), Tp(start = {607.958740234375, 605.4310302734375, 604.044921875}), Tp1(start = {606.506103515625, 604.756103515625, 603.7326049804688})), 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}), h(start = {3057821.75, 2963461.75, 2919619.75, 2899333.25, 2893620}), T2(start = {755.2099609375, 674.1281000784297, 635.8939469832528, 618.0787353515625}), T1(start = {714.669037024263, 655.0110235308413, 626.9863546635906}), Tp(start = {609.308349609375, 606.0580444335938, 604.3350830078125})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z2 = 10.83, option_temperature = false, continuous_flow_reversal = true, inertia = true, dW1(start = {57271024.0, 26609444.0, 12312660.0}), h(start = {1460690.625, 1842497.375, 2019893.75, 2101978.0, 1460690.625}), hb(start = {1460690.625, 1842497.375, 2019893.75, 2101978.0}), P(start = {12757782.0, 12739934.0, 12734309.0, 12730154.0, 12726434.0}), hi(start = {13411.995117, 10775.180664, 8658.856445}), Q(start = {150.0, 150.0, 150.0, 150.0}), state1(h(start = {1842497.375, 2019893.75, 2101978}))), Cfg1(h_vol_1(start = 3057821.75), h_vol_2(start = 2963461.75)), Cfg2(h_vol_1(start = 2899333.25), h_vol_2(start = 2893620))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP4(steady_state = false, option_temperature = false, h0 = {1339086.5, 1373480.25, 1399475.5}, T0 = fill(581.861, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.726, Dint = 0.0266, Ntubes = 246, ExchangerWall(e = 0.0026, lambda = 47, dW1(start = {-3467507.0, -2610240.0, -1972859.0}), Tp(start = {577.249755859375, 582.3107299804688, 586.023681640625}), Tp1(start = {576.6054077148438, 581.82568359375, 585.6571044921875})), Cws1(P(start = 13324661.0), h_vol_2(start = 1293397.125)), Cws2(h_vol_1(start = 1399475.5)), 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}), h(start = {2899333.25, 2893620, 2889319.5, 2886069, 2883965.75}), T2(start = {618.0787353515625, 613.037602447671, 609.2389186305828, 606.3656616210938}), T1(start = {615.5581823957998, 611.1382605391269, 607.8022941316214}), Tp(start = {577.8390502929688, 582.7543334960938, 586.3590087890625})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.83, z2 = 0, option_temperature = false, inertia = true, dW1(start = {3467507.0, 2610240.0, 1972859.0}), h(start = {1293397.125, 1339086.5, 1373480.25, 1399475.5, 1399475.5}), hb(start = {1293397.125, 1339086.5, 1373480.25, 1399475.5}), P(start = {13324661.0, 13343628.0, 13362125.0, 13380254.0, 13398096.0}), hi(start = {6902.874512, 6981.29834, 7046.654297}), Q(start = {75.893021, 75.893021, 75.893021, 75.893021}), state1(h(start = {1339086.5, 1373480.25, 1399475.5}))), Cfg2(h_vol_1(start = 2886069), h_vol_2(start = 2883965.75))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP1(steady_state = false, option_temperature = false, h0 = {2793422.5, 2894672.25, 2973015.75}, T0 = fill(658.506, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Dint = 0.0324, Ntubes = 246, ExchangerWall(e = 0.0028, lambda = 37.61, dW1(start = {-9761341.0, -7684141.0, -5945731.5}), Tp(start = {641.7667236328125, 659.2384033203125, 674.5120849609375}), Tp1(start = {639.7199096679688, 657.627197265625, 673.265380859375})), Cws1(h_vol_2(start = 2664802.75)), Cws2(P(start = 12720091.0), h_vol_1(start = 2973015.75)), 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}), h(start = {3096361.5, 3080278.5, 3067618, 3057821.75, 2963461.75}), T2(start = {787.8693237304688, 774.2709985521502, 763.5355376271307, 755.2099609375}), T1(start = {781.0701669240514, 768.9032680896405, 759.3727557986135}), Tp(start = {643.65673828125, 660.7262573242188, 675.663330078125})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.83, option_temperature = false, inertia = true, dW1(start = {9761341.0, 7684141.0, 5945731.5}), h(start = {2664802.75, 2793422.5, 2894672.25, 2973015.75, 2973015.75}), hb(start = {2664802.75, 2793422.5, 2894672.25, 2973015.75}), P(start = {12723426.0, 12723380.0, 12722714.0, 12721577.0, 12720091.0}), Q(start = {75.893021, 75.893021, 75.893021, 75.893021}), state1(h(start = {2793422.5, 2894672.25, 2973015.75}))), Cfg1(h_vol_1(start = 3096361.5), h_vol_2(start = 3080278.5))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP3(steady_state = false, option_temperature = false, h0 = {1194111.25, 1267023.125, 1293397.125}, T0 = fill(562.423, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 26.6e-3, Ntubes = 1476, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-15390955.0, -5533500.5, -2001599.0}), Tp(start = {557.2764282226562, 563.8421630859375, 566.1499633789062}), Tp1(start = {556.7998046875, 563.6707763671875, 566.0880126953125})), 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}), h(start = {2881802.25, 2856444, 2847326.75, 2844029, 2842288.5}), T2(start = {602.606689453125, 580.0827929934445, 571.956039969206, 569.0130004882813}), T1(start = {591.3447334381658, 576.0194164813253, 570.4845269121585}), Tp(start = {557.71240234375, 563.9989013671875, 566.2066650390625})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.767, inertia = true, dW1(start = {15390955.0, 5533500.5, 2001599.0}), h(start = {991313.25, 1194111.25, 1267023.125, 1293397.125, 1293397.125}), hb(start = {991313.25, 1194111.25, 1267023.125, 1293397.125}), P(start = {13242920.0, 13264994.0, 13285413.0, 13305163.0, 13324661.0}), Q(start = {75.893021, 75.893021, 75.893021, 75.893021}), state1(h(start = {1194111.25, 1267023.125, 1293397.125})), state2(h(start = {991313.25, 1194111.25, 1267023.125, 1293397.125}))), Cfg1(h_vol_1(start = 2881802.25), h_vol_2(start = 2856444)), Cfg2(h_vol_1(start = 2844029), h_vol_2(start = 2842288.5))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP2(steady_state = false, option_temperature = false, h0 = {926522.188, 966285.25, 991313.25}, T0 = fill(499.187, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 26.6e-3, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-5e6, -3e6, -2.e6}), Tp(start = {492.93975830078125, 500.0770263671875, 504.5434875488281}), Tp1(start = {492.7419738769531, 499.9526672363281, 504.4652099609375})), 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}), h(start = {2801776.5, 2793868.25, 2788896.25, 2785766.75, 2781592.5}), T2(start = {531.2528686523438, 524.0786479337396, 519.5624877991071, 516.7178344726563}), T1(start = {527.6657680129605, 521.8205678664233, 518.1401706426662}), Tp(start = {493.12066650390625, 500.1907653808594, 504.6151123046875})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.767, inertia = true, dW1(start = {5e6, 3e6, 2.e6}), h(start = {863278.8125, 926522.1875, 966285.25, 991313.25, 991313.25}), hb(start = {863278.8125, 926522.1875, 966285.25, 991313.25}), P(start = {13153124.0, 13176093.0, 13198622.0, 13220864.0, 13242920.0}), Q(start = {75.893021, 75.893021, 75.893021, 75.893021}), state1(h(start = {926522.1875, 966285.25, 991313.25}))), Cfg1(h_vol_1(start = 2801776.5), h_vol_2(start = 2793868.25)), Cfg2(h_vol_1(start = 2785766.75), h_vol_2(start = 2781592.5))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurHP1(steady_state = false, option_temperature = false, h0 = {768078.438, 832342.438, 863278.812}, T0 = fill(470.423, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 26.6e-3, Ns = 3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-10106326.0, -4877192.0, -2347854.75}), Tp(start = {462.5415954589844, 472.0587463378906, 476.6681213378906}), Tp1(start = {462.1242980957031, 471.85736083984375, 476.5711975097656})), L = 20.726, Ntubes = 1107, Cws1(h_vol_2(start = 634913.0)), 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}), h(start = {2778157.75, 2761506.5, 2753470.75, 2749602.5, 2730474.25}), T2(start = {509.81195068359375, 494.60709242744036, 487.25141439639447, 483.7066345214844}), T1(start = {502.2095163065458, 490.92925341191744, 485.4790272730564}), Tp(start = {462.9233093261719, 472.2429504394531, 476.7568054199219})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, z1 = 10.767, inertia = true, dW1(start = {10106326.0, 4877192.0, 2347854.75}), h(start = {634913.0, 768078.4375, 832342.4375, 863278.8125, 863278.8125}), hb(start = {634913.0, 768078.4375, 832342.4375, 863278.8125}), advection = true, dynamic_mass_balance = true, P(start = {13059016.0, 13083393.0, 13106981.0, 13130156.0, 13153124.0}), hi(start = {1705.988037, 1760.190674, 1784.338379}), Q(start = {75.893021, 75.893021, 75.893021, 75.893021}), state1(h(start = {768078.4375, 832342.4375, 863278.8125}))), Cfg1(h_vol_1(start = 2778157.75), h_vol_2(start = 2761506.5)), Cfg2(h_vol_1(start = 2749602.5), h_vol_2(start = 2730474.25))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP2(steady_state = false, option_temperature = false, h0 = {3088828.0, 3175801.75, 3240601.0}, T0 = fill(737.334, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Dint = 32e-3, Ntubes = 246, ExchangerWall(e = 3e-3, lambda = 27, dW1(start = {-8789339.0, -6600706.0, -4917819.0}), Tp(start = {718.035400390625, 738.872802734375, 755.0946655273438}), Tp1(start = {715.2599487304688, 736.7884521484375, 753.541748046875})), Cws2(P(start = 12710808.0), h_vol_1(start = 3240601.0)), 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}), h(start = {3170799.5, 3156318.25, 3145442.75, 3137340.25, 3118458.25}), T2(start = {850.2295532226563, 838.165359685431, 829.0838172755421, 822.3056030273438}), T1(start = {844.1974477839519, 833.6245884804865, 825.6946997760892}), Tp(start = {720.58251953125, 740.78564453125, 756.5198364257812})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.83, inertia = true, dW1(start = {8789339.0, 6600706.0, 4917819.0}), h(start = {2973015.75, 3088828.0, 3175801.75, 3240601.0, 3240601.0}), hb(start = {2973015.75, 3088828.0, 3175801.75, 3240601.0}), P(start = {12720091.0, 12718416.0, 12716221.0, 12713652.0, 12710808.0}), hi(start = {1972.852539, 1881.643066, 1837.180298}), Q(start = {75.893021, 75.893021, 75.893021, 75.893021}), state1(h(start = {3088828, 3175801.75, 3240601})), state2(h(start = {2973015.75, 3088828, 3175801.75, 3240601}))), Cfg1(h_vol_1(start = 3170799.5), h_vol_2(start = 3156318.25)), Cfg2(h_vol_1(start = 3137340.25), h_vol_2(start = 3118458.25))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurHP3(steady_state = false, option_temperature = false, h0 = {3323713.5, 3386144.0, 3432876.0}, T0 = fill(805.309, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Ntubes = 246, ExchangerWall(lambda = 27, e = 5e-3, dW1(start = {-6307650.5, -4738049.5, -3546629.0}), Tp(start = {789.2659301757812, 806.6884765625, 819.9727783203125}), Tp1(start = {785.6139526367188, 803.9453125, 817.91943359375})), Dint = 28e-3, Cws2(h_vol_1(start = 3432876.0)), 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}), h(start = {3223385, 3212992.25, 3205186, 3199342.5, 3186106.25}), T2(start = {893.75, 885.1796729176981, 878.7316754228791, 873.8992309570313}), T1(start = {889.464836458849, 881.9556741702886, 876.315464574507}), Tp(start = {792.4016723632812, 809.0439453125, 821.7359619140625})), TwoPhaseFlowPipe(rugosrel = 5e-6, z2 = 0, advection = false, z1 = 10.726, inertia = true, dW1(start = {6307650.5, 4738049.5, 3546629.0}), h(start = {3240601.0, 3323713.5, 3386144.0, 3432876.0, 3432876.0}), hb(start = {3240601.0, 3323713.5, 3386144.0, 3432876.0}), P(start = {12710808.0, 12704117.0, 12696822.0, 12689079.0, 12681000.0}), Q(start = {75.893021, 75.893021, 75.893021, 75.893021}), state1(h(start = {3323713.5, 3386144, 3432876})), state2(h(start = {3240601, 3323713.5, 3386144, 3432876}))), Cfg1(h_vol_2(start = 3212992.25)), Cfg2(h_vol_1(start = 3199342.5), h_vol_2(start = 3186106.25))) 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( + ThermoSysPro.Fluid.Volumes.DynamicDrum BallonMP(redeclare package Medium = Medium, L = 16.27, Vertical = false, P0 = 27.29e5, hl(start = 981073.3125, fixed = false), hv(start = 2798846.0, fixed = false), Vv(start = 28.176434, fixed = false), R = 1.05, P(start = 2733970.0, fixed = false), zl(start = 1.05, fixed = true), Kpa = 5, Mp = 5000, Kvl = 1000, Pfond(start = 2742514.5), Tp(start = 497.4441833496094), Cd(h_vol_1(start = 981073.3125)), Ce2(h_vol_1(start = 981073.3125)), Ce3(h_vol_1(start = 981073.3125)), Cs(h_vol_2(start = 981073.3125)), state_out_l(d(start = 829.7919922))) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationMP(redeclare package Medium = Medium, Cvmax = CvmaxValveAMP, C1(P(start = 3269445.75), h_vol_2(start = 949320.25)), h(start = 949320.25), Cv(start = 26.902315139770508), Pm(start = 3001708.0)) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurMP(redeclare package Medium = Medium, Cvmax = 47829.4, C2(h_vol_1(start = 2798846.0)), h(fixed = false, start = 2798000), Cv(start = 23914.69921875), 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurMP(steady_state = false, option_temperature = false, h0 = {1046648.0, 1097357.125, 1136563.875}, T0 = fill(504.329, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 32.8e-3, L = 20.767, Ntubes = 738, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-9836201.0, -7606364.5, -5881023.0}), Tp(start = {505.00445556640625, 504.2812805175781, 503.7012634277344}), Tp1(start = {504.5071105957031, 503.89666748046875, 503.4039001464844})), Ns = 3, TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.83, continuous_flow_reversal = true, inertia = true, dW1(start = {9836201.0, 7606364.5, 5881023.0}), P(start = {2773389.0, 2751251.75, 2743562.25, 2738327.25, 2733970.0}), h(start = {981073.3125, 1046648.0, 1097357.125, 1136563.875, 981073.3125}), hb(start = {981073.3125, 1046648.0, 1097357.125, 1136563.875}), Q(start = {150.0, 150.0, 150.0, 150.0}), state1(h(start = {1046648, 1097357.125, 1136563.875}))), Cws1(P(start = 2773389.0)), 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}), h(start = {2840204.5, 2823998.25, 2811466, 2801776.5, 2793868.25}), T2(start = {565.5570068359375, 551.1237970278224, 539.9287004763471, 531.2528686523438}), T1(start = {558.3404164937012, 545.5262487520847, 535.5907942842642}), Tp(start = {505.466552734375, 504.63861083984375, 503.9775390625})), Cfg1(h_vol_2(start = 2823998.25))) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeMP(redeclare package Medium = Medium_Liquid, z2 = 0, z1 = 10.83, Q(start = 150, fixed = true), K = KgainChargeMP, Pm(start = 2757951.75), h(start = 981073.3125)) 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( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapMP(redeclare package Medium = Medium_Liquid, V = 5, h(start = 981073.3125), P(start = 2773389.0), Ce2(h_vol_1(start = 981073.3125)), Ce3(h_vol_1(start = 981073.3125))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurMP(steady_state = false, option_temperature = false, h0 = {783226.25, 891345.188, 949320.25}, T0 = fill(485.834, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-2533582.5, -1356953.375, -727620.0625}), Tp(start = {470.99713134765625, 488.55792236328125, 497.9468994140625}), Tp1(start = {470.5263671875, 488.3057556152344, 497.81170654296875})), L = 20.726, Ns = 3, Dint = 26.6e-3, Ntubes = 246, Cws1(h_vol_2(start = 581356.1875)), Cws2(h_vol_1(start = 949320.25)), 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}), h(start = {2785766.75, 2781592.5, 2779356.75, 2778157.75, 2761506.5}), T2(start = {516.7178344726563, 512.927875284067, 510.89894284399503, 509.81195068359375}), T1(start = {514.8228643851462, 511.91340906403104, 510.35544151482316}), Tp(start = {471.427734375, 488.7885437011719, 498.0705871582031})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 10.767, z2 = 0, inertia = true, dW1(start = {2533582.5, 1356953.375, 727620.0625}), h(start = {581356.1875, 783226.25, 891345.1875, 949320.25, 949320.25}), hb(start = {581356.1875, 783226.25, 891345.1875, 949320.25}), P(start = {3176926.5, 3201441.25, 3224746.25, 3247309.5, 3269445.75}), Q(start = {12.550562, 12.550562, 12.550562, 12.550562}), state1(h(start = {783226.25, 891345.1875, 949320.25})))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP1(steady_state = false, option_temperature = false, h0 = {2900559.5, 2964876.0, 3005185.25}, T0 = fill(572.064, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1276559.875, -807207.9375, -505905.21875}), Tp(start = {558.0389404296875, 573.9583740234375, 584.1954956054688}), Tp1(start = {557.65087890625, 573.7130126953125, 584.041748046875})), L = 20.726, Ns = 3, Dint = 32.8e-3, Ntubes = 123, Cws1(h_vol_2(start = 2798846.0)), 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}), h(start = {2886069, 2883965.75, 2882635.75, 2881802.25, 2856444}), T2(start = {606.3656616210938, 604.5120304885253, 603.3404748736327, 602.606689453125}), T1(start = {605.4388500605926, 603.926252681079, 602.9735743782599}), Tp(start = {558.3994750976562, 574.1863403320312, 584.33837890625})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z2 = 0, z1 = 10.77, inertia = true, dW1(start = {1276559.875, 807207.9375, 505905.21875}), h(start = {2798846.0, 2900559.5, 2964876.0, 3005185.25, 3040176.25}), hb(start = {2798846.0, 2900559.5, 2964876.0, 3005185.25}), P(start = {2731424.75, 2730471.75, 2729329.5, 2728056.0, 2726700.0}), hi(start = {615.04425, 591.511108, 583.069275}), Q(start = {12.550562, 12.550562, 12.550562, 12.550562}), state1(h(start = {2900559.5, 2964876, 3005185.25})))) 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( + ThermoSysPro.Fluid.Volumes.VolumeB MelangeurHPMP(redeclare package Medium = Medium, Ce1(h(start = 3045962.75), h_vol_1(start = 3040176.25)), h(start = 3040176.25), P(start = 2726700.0), Cs1(h_vol_2(start = 3040176.25))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP2(steady_state = false, option_temperature = false, h0 = {3169752.75, 3259477.5, 3321390.75}, T0 = fill(711.567, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Dint = 39.3e-3, Ntubes = 369, ExchangerWall(e = 2.6e-3, lambda = 36.86, dW1(start = {-11460208.0, -7935598.5, -5475816.5}), Tp(start = {688.9197387695312, 714.0809326171875, 731.7014770507812}), Tp1(start = {687.6563720703125, 713.2061157226562, 731.0978393554688})), Cws1(P(start = 2575504.75), h_vol_2(start = 3040176.25)), Cws2(P(start = 2558210.5), h_vol_1(start = 3321390.75)), 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}), h(start = {3137340.25, 3118458.25, 3105383.5, 3096361.5, 3080278.5}), T2(start = {822.3056030273438, 806.4713844816748, 795.4738313791455, 787.8693237304688}), T1(start = {814.3884833791556, 800.9726079304102, 791.671583337549}), Tp(start = {690.10693359375, 714.9030151367188, 732.2687377929688})), TwoPhaseFlowPipe(advection = false, z2 = 0, z1 = 10.83, rugosrel = 1e-5, inertia = true, dW1(start = {11460208.0, 7935598.5, 5475816.5}), h(start = {3040176.25, 3169752.75, 3259477.5, 3321390.75, 3321390.75}), hb(start = {3040176.25, 3169752.75, 3259477.5, 3321390.75}), P(start = {2575504.75, 2571833.75, 2567627.25, 2563048.25, 2558210.5}), hi(start = {820.215881, 830.493896, 840.220764}), Q(start = {88.443581, 88.443581, 88.443581, 88.443581}), state1(h(start = {3169752.75, 3259477.5, 3321390.75})))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurMP3(steady_state = false, option_temperature = false, h0 = {3412222.25, 3474561.75, 3517264.5}, T0 = fill(800.845, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.4, Ntubes = 369, Dint = 45.6e-3, ExchangerWall(e = 2.6e-3, lambda = 27, dW1(start = {-8033471.0, -5513534.5, -3776766.75}), Tp(start = {785.9468383789062, 802.5588989257812, 814.0285034179688}), Tp1(start = {784.900390625, 801.8406982421875, 813.5364990234375})), Cws2(h_vol_1(start = 3517264.5)), 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}), h(start = {3199342.5, 3186106.25, 3177022.25, 3170799.5, 3156318.25}), T2(start = {873.8992309570313, 862.9376291442026, 855.3997728669909, 850.2295532226563}), T1(start = {868.4184414351687, 859.1687010055967, 852.814654374732}), Tp(start = {786.9383544921875, 803.2393798828125, 814.49462890625})), TwoPhaseFlowPipe(advection = false, z2 = 0, z1 = 10.83, rugosrel = 1e-5, inertia = true, dW1(start = {8033471.0, 5513534.5, 3776766.75}), h(start = {3321390.75, 3412222.25, 3474561.75, 3517264.5, 3517264.5}), hb(start = {3321390.75, 3412222.25, 3474561.75, 3517264.5}), P(start = {2558210.5, 2556030.5, 2553666.5, 2551176.75, 2548600.0}), hi(start = {655.709778, 665.350952, 672.213684}), Q(start = {88.443581, 88.443581, 88.443581, 88.443581}), state1(h(start = {3412222.25, 3474561.75, 3517264.5})), state2(h(start = {3321390.75, 3412222.25, 3474561.75, 3517264.5})))) 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( + ThermoSysPro.Fluid.Volumes.DynamicDrum BallonBP(redeclare package Medium = Medium, Vertical = false, P0 = 5e5, Vv(start = 58.244598, fixed = false), L = 8, hl(start = 566377.1875, fixed = false), hv(start = 2682039.0, fixed = false), R = 2, P(start = 559147.5625, fixed = false), zl(start = 1.75, fixed = true), Kpa = 5, Mp = 5000, Kvl = 1000, Pfond(start = 575124.6875), Tp(start = 410.3314514160156), Cd(h_vol_1(start = 566377.1875)), Ce2(h_vol_1(start = 566377.1875)), Ce3(h_vol_1(start = 566377.1875)), state_out_l(d(start = 930.9786377))) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_vapeurBP(redeclare package Medium = Medium, p_rho = 3, Cvmax = CvmaxValveVBP, C2(P(start = 509256.375), h_vol_1(start = 2682039.0)), h(start = 2682039.0), Cv(start = 18973.1328125), Pm(start = 534202.0)) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_alimentationBP(redeclare package Medium = Medium, Cvmax = 285, C1(h_vol_2(start = 521173.59375)), h(fixed = false, start = 509000), Cv(start = 142.5), Pm(start = 1023636.3125, fixed = false)) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss GainChargeBP(redeclare package Medium = Medium_Liquid, z2 = 0, z1 = 10.767, Q(start = 50, fixed = false), K = 32766, rho(start = 930.9823608398438), Pm(start = 580761.8125), h(start = 566377.1875)) 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( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeEvapBP(redeclare package Medium = Medium_Liquid, h(start = 566377.1875), V = 5, P(start = 586398.9375), Ce2(h_vol_1(start = 566377.1875)), Ce3(h_vol_1(start = 566377.1875))) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EvaporateurBP(steady_state = false, option_temperature = false, h0 = {799848.25, 959006.75, 1067765.75}, T0 = fill(431.922, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Dint = 32.8e-3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-11609618.0, -7914340.5, -5408166.0}), Tp(start = {432.92791748046875, 431.8335876464844, 431.004638671875}), Tp1(start = {432.4867858886719, 431.5328369140625, 430.79913330078125})), 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}), h(start = {2749602.5, 2730474.25, 2717434.5, 2708524, 2666933.25}), T2(start = {483.7066345214844, 465.9440370193418, 453.7982409323057, 445.483154296875}), T1(start = {474.8253385845301, 459.8711389758238, 449.6406958379268}), Tp(start = {433.3377990722656, 432.11297607421875, 431.195556640625})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.767, continuous_flow_reversal = true, inertia = true, dW1(start = {11609618.0, 7914340.5, 5408166.0}), h(start = {566377.1875, 799848.25, 959006.75, 1067765.75, 566377.1875}), hb(start = {566377.1875, 799848.25, 959006.75, 1067765.75}), Q(start = {49.726158142089844, 49.726158142089844, 49.726158142089844, 49.726158142089844}), P(start = {586398.9375, 561814.5, 560589.375, 559835.75, 559147.5625}), hi(start = {5420.776855, 5164.606934, 5127.338379}), state1(h(start = {799848.25, 959006.75, 1067765.75}))), Cfg2(h_vol_1(start = 2708524), h_vol_2(start = 2666933.25))) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP(redeclare package Medium = Medium_Liquid, Cvmax = 308.931, C1(h_vol_2(start = 566377.1875)), h(start = 566377.1875), Cv(start = 308.9309997558594), Pm(start = 477195.5625)) 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger SurchauffeurBP(steady_state = false, option_temperature = false, h0 = {2791421.0, 2868442.25, 2922385.0}, T0 = fill(501.331, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, L = 20.726, Dint = 39.3e-3, Ntubes = 123, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-1056375.625, -743847.4375, -520961.90625}), Tp(start = {478.4757385253906, 503.7419738769531, 521.7748413085938}), Tp1(start = {478.2060546875, 503.5520935058594, 521.641845703125})), Cws1(h_vol_2(start = 2682039.0)), Cws2(h_vol_1(start = 2922385.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 = Encras_SBP, St = 5, deltaT(start = {92, 66, 47}), h(start = {2844029, 2842288.5, 2841063, 2840204.5, 2823998.25}), T2(start = {569.0130004882813, 567.4482541171128, 566.3390581546068, 565.5570068359375}), T1(start = {568.2306339861118, 566.8936561358598, 565.9480470570934}), Tp(start = {478.7291564941406, 503.9204406738281, 521.8997802734375})), TwoPhaseFlowPipe(advection = false, z2 = 0, rugosrel = 1e-5, z1 = 10.767, inertia = true, dW1(start = {1056375.625, 743847.4375, 520961.90625}), h(start = {2682039.0, 2791421.0, 2868442.25, 2922385.0, 2922385.0}), hb(start = {2682039.0, 2791421.0, 2868442.25, 2922385.0}), P(start = {509256.375, 507673.78125, 505917.34375, 503957.90625, 501850.0}), Q(start = {9.657684, 9.657684, 9.657684, 9.657684}), state1(h(start = {2791421, 2868442.25, 2922385})))) annotation( Placement(transformation(origin = {233, -50}, extent = {{20, -20}, {-20, 20}}, rotation = 90))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsFumees(P0 = 1.013e5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsFumees(redeclare package Medium = Medium_FlueGases, 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( + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger EconomiseurBP(steady_state = false, option_temperature = false, h0 = {452010.875, 509069.875, 521173.594}, T0 = fill(400.077, 3), redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, Ns = 3, Dint = 32.8e-3, ExchangerWall(e = 2.6e-3, lambda = 47, dW1(start = {-25243184.0, -5597562.0, -1187388.0}), Tp(start = {403.2759704589844, 398.9235534667969, 398.032958984375}), Tp1(start = {403.0019226074219, 398.86279296875, 398.02008056640625})), Ntubes = 3444, L = 20.726, Cws1(h_vol_2(start = 194693.25)), Cws2(h_vol_1(start = 521173.59375)), 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}), h(start = {2708524, 2666933.25, 2657710.5, 2655754.25, 2655754.25}), T2(start = {445.483154296875, 407.64728846356843, 399.20963445670407, 397.4152526855469}), T1(start = {426.56521960355815, 403.42846146013625, 398.31244500376624}), Tp(start = {403.53057861328125, 398.9800109863281, 398.0449523925781})), TwoPhaseFlowPipe(advection = false, rugosrel = 5e-6, z1 = 0, z2 = 10.767, inertia = true, dW1(start = {25243184.0, 5597562.0, 1187388.0}), h(start = {194693.25, 452010.875, 509069.875, 521173.59375, 521173.59375}), hb(start = {194693.25, 452010.875, 509069.875, 521173.59375}), P(start = {1589172.0, 1563024.375, 1537851.5, 1512957.25, 1488125.0}), hi(start = {461.55191, 487.833466, 493.167328}), Q(start = {98.101273, 98.101273, 98.101273, 98.101273}), state1(h(start = {452010.875, 509069.875, 521173.5938})))) 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( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineHP(redeclare package Medium = Medium, W_fric = 1, eta_stato = 1, eta_is(start = 0.8805699944496155), Qmax = 140, eta_is_nom = 0.88057, eta_is_min = 0.75, Cst(start = 8182844.56002535) = CstHP, rhos(start = 10.667095184326172), Hrs(start = 3045962.75), 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( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineMP(redeclare package Medium = Medium, W_fric = 1, eta_stato = 1, eta_is(start = 0.9624999761581421), Qmax = 150, eta_is_nom = 0.9625, eta_is_min = 0.75, Cst(start = 256335.364995961) = CstMP, rhos(start = 1.883624792098999), Hrs(start = 3029286.25), 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( + ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPostTMP1(redeclare package Medium = Medium, h(start = 3018762.25), P(start = 476800.0), Ce1(h(start = 3029286.25)), Ce3(h_vol_1(start = 3018762.25))) 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( + ThermoSysPro.Fluid.Machines.StodolaTurbine TurbineBP(redeclare package Medium = Medium, W_fric = 1, eta_stato = 1, eta_is(start = 0.9538000226020813), Qmax = 150, eta_is_nom = 0.9538, eta_is_min = 0.75, Cst(start = 11944.9445735985) = CstBP, Cs(h(start = 2401715.75)), Hrs(start = 2401715.75), Pe(fixed = true, start = 476799.99999954), Ps(start = 10052.044921875)) annotation( Placement(transformation(extent = {{543, -250}, {583, -210}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitHP(alpha = 2) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitHP(redeclare package Medium = Medium, alpha = 2) annotation( Placement(transformation(origin = {-325, -100}, extent = {{-10, -10}, {10, 10}}, rotation = 270))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitMP(alpha = 2) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitMP(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitHP(redeclare package Medium = Medium, alpha = 0.5, Ce(h(start = 3045962.75)), P(start = 2726700.0)) 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( + ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur(redeclare package Medium = Medium, redeclare package Medium_Cooling = Medium, 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 = 127927.7578125), h_vol_1(start = 70825.89844)), P(start = 10000.0, fixed = false), Pfond(start = 10000.0), Cl(h(start = 191812.296875)), rhom(start = 996.0238647460938), hv(start = 2583886.75), Vv(start = 850.0), Cee(P(start = 146447.0156), h(start = 113380), h_vol_2(start = 113380)), state_d(d(start = 989.8436279))) annotation( Placement(transformation(extent = {{604, -384}, {684, -304}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceCaloporteur(h0 = 113.38e3, Q0 = 29804.5) annotation( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceCaloporteur(redeclare package Medium = Medium, h0 = 113.38e3, Q0 = 29804.5) annotation( Placement(transformation(extent = {{539, -377}, {587, -329}}, rotation = 0))); - ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsCaloporteur annotation( + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsCaloporteur(redeclare package Medium = Medium, C(h_vol_1(start = 70825.89844))) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK1(redeclare package Medium = Medium, K = 1e-4, h(start = 2401715.75), C1(h_vol_2(start = 2401715.75), h(start = 2401715.75)), Pm(start = 10026.0224609375)) 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( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeCond1(redeclare package Medium = Medium_Liquid, Ce3(h(start = 194693.25)), h(start = 194693.25), P(start = 1589172.0), Ce1(h_vol_1(start = 194693.25)), Ce2(h_vol_1(start = 194693.25))) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeKCond1(redeclare package Medium = Medium_Liquid, K = 1e-4, rho(start = 990.373046875), Pm(start = 1589172.0)) 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( + ThermoSysPro.Fluid.Volumes.VolumeA VolumeAlimMPHP(redeclare package Medium = Medium_Liquid, h(start = 566377.1875), P(start = 395243.53125), Ce2(h_vol_1(start = 566377.1875)), Cs1(h(start = 566377.1875)), Cs2(h(start = 566377.1875))) 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( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimMP(redeclare package Medium = Medium_Liquid, a3 = 350, b1(fixed = true) = -3.7751, a1 = -244551, Q(fixed = false), C1(h_vol_2(start = 566377.1875), P(start = 395243.5312)), C2(h_vol_1(start = 581356.1875), P(start = 3182097.75)), Qv(start = 0.013491539284586906), rho(start = 930.2542724609375), Pm(start = 1788670.625), h(start = 573866.6875)) 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( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimHP(redeclare package Medium = Medium_Liquid, a3 = 1600, a1 = -28056.2, b1 = -12.7952660447433, Q(fixed = false), C1(h_vol_2(start = 566377.1875), P(start = 395243.5312)), C2(h_vol_1(start = 634913.0), P(start = 13249950)), Qv(start = 0.08177389204502106), rho(start = 928.083740234375), Pm(start = 6822597.0), h(start = 600645.0625)) 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( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier MoitieDebitBP(redeclare package Medium = Medium, alpha = 0.5, h(start = 194693.25), P(start = 1589172.0), Cs(h(start = 194693.25))) annotation( Placement(transformation(extent = {{839, -328}, {853, -308}}, rotation = 0))); - ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitBP(alpha = 2) annotation( + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier DoubleDebitBP(redeclare package Medium = Medium, 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteChargeZero2(redeclare package Medium = Medium, z2 = 0, z1 = 0, K = K_PerteChargeZero2, h(start = 2922385.0), C1(h_vol_2(start = 2922385.0), h(start = 2922385.0), P(fixed = true, start = 501850)), Pm(start = 489325.0), rho(start = 2.144859076)) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK3(redeclare package Medium = Medium_Liquid, K = 1e-4, Pm(start = 395243.53125)) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK8(redeclare package Medium = Medium_Liquid, K = 1e-4, Pm(start = 395243.53125)) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK(redeclare package Medium = Medium_Liquid, K = 1e-4, C1(h_vol_2(start = 191812.296875)), C2(h_vol_1(start = 191812.296875), P(start = 9999.996094)), rho(start = 989.83837890625), Pm(start = 9999.998046875)) 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( + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump PompeAlimBP(redeclare package Medium = Medium_Liquid, Qv(start = 0.198162242770195), a3 = 400, a1(fixed = true) = -6000, Q(start = 194.502, fixed = false), C2(h_vol_1(start = 194693.25), P(start = 1606175.875)), Pm(start = 808087.9375), h(start = 193252.7656)) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss perteChargeK2(redeclare package Medium = Medium_Liquid, K = 1e-4, rho(start = 990.373046875), C1(h_vol_2(start = 194693.25), h(start = 194693.25), P(start = 1589172)), Pm(start = 1589172.0)) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_extraction(redeclare package Medium = Medium_Liquid, Cvmax = 2000, h(start = 194693.25), Cv(start = 2000.0), Pm(start = 1597674.0)) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapHP(redeclare package Medium = Medium, C1(h_vol_2(start = 2664802.75), h(start = 2664802.75))) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauHP(redeclare package Medium = Medium, C2(h_vol_1(start = 1399475.5), h(start = 1399475.5))) " " 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauMP(redeclare package Medium = Medium, C2(h_vol_1(start = 949320.25), h(start = 949320.25))) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapMP(redeclare package Medium = Medium, C1(h_vol_2(start = 2798846.0), h(start = 2798846.0))) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapBP(redeclare package Medium = Medium, C2(h_vol_1(start = 2682039.0), h(start = 2682039.0))) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBP(redeclare package Medium = Medium, C2(h_vol_1(start = 521173.59375), h(start = 521173.59375))) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauBPsortie(redeclare package Medium = Medium, C2(h_vol_1(start = 566377.1875), h(start = 566377.1875))) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitEauCondenseur(redeclare package Medium = Medium, C2(h_vol_1(start = 191812.296875), h(start = 191812.296875))) 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( + ThermoSysPro.Fluid.Sensors.SensorQ CapteurDebitVapCondenseur(redeclare package Medium = Medium, C2(h_vol_1(start = 2583886.75), h(start = 2401715.75))) 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( + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss lumpedStraightPipeK2(redeclare package Medium = Medium, K = Kin_SMP2, Pm(start = 2651102.5), C1(P(fixed = true, start = 2726700), h_vol_2(start = 3040176.25), h(start = 3040176.25))) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineHP(redeclare package Medium = Medium, C1(P(fixed = true, start = 12680999.9999969)), Cvmax = Cvmax_THP, h(fixed = false, start = 3433000), Cv(start = 10840.94140625), Pm(fixed = false, start = 12550000), deltaP(start = 250000)) 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( + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_HP(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), 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( + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_MP(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), 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( + ThermoSysPro.Examples.Control.Drum_LevelControl regulation_Niveau_BP(add(k1 = -1, k2 = +1), pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), 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( + ThermoSysPro.Examples.Control.Condenser_LevelControl regulation_Niveau_Condenseur(pIsat(Ti = 500, Limiteur1(u(signal(start = 0.800000011920929)))), 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))); @@ -203,23 +206,23 @@ model CombinedCycle_TripTAC "CCPP model to simulate a load variation from 100% t 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( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP1_2(redeclare package Medium = Medium_Liquid, V = 1, h0 = 988332, h(start = 863278.8125), dynamic_mass_balance = true, P0 = 7010000, P(start = 13153124.0), Ce2(h_vol_1(start = 863278.8125)), Ce3(h_vol_1(start = 863278.8125))) 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( + ThermoSysPro.Fluid.Volumes.VolumeC VolumeECO_HP2_3(redeclare package Medium = Medium_Liquid, V = 1, h0 = 983786, h(start = 991313.25), dynamic_mass_balance = true, P0 = 7000000, P(start = 13242920.0), Ce2(h_vol_1(start = 991313.25)), Ce3(h_vol_1(start = 991313.25))) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP1(redeclare package Medium = Medium_Liquid, Cvmax = 308.931, h(start = 634913.0), Cv(start = 247.14480590820312), Pm(start = 13154483.0)) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve Vanne_alimentationMPHP2(redeclare package Medium = Medium_Liquid, Cvmax = 308.931, h(start = 581356.1875), Cv(start = 247.14480590820312), Pm(start = 3179512.25)) 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( + ThermoSysPro.Fluid.Volumes.VolumeD VolumePreTHP(redeclare package Medium = Medium, h0 = 3e6, h(start = 3432876.0), dynamic_mass_balance = true, P0 = 12700000, P(start = 12431000.0), Cs1(h_vol_2(start = 3432876)), Cs2(h_vol_2(start = 3432876))) 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( + ThermoSysPro.Fluid.Volumes.VolumeC MelangeurPreTMP(redeclare package Medium = Medium, h0 = 3523910, h(start = 3517264.5), dynamic_mass_balance = true, P0 = 2400000, P(start = 2548500.0), Ce2(h_vol_1(start = 3517264.5)), Ce3(h_vol_1(start = 3517264.5))) 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( + ThermoSysPro.Fluid.PressureLosses.ControlValve vanne_entree_TurbineMP(redeclare package Medium = Medium, C1(P(fixed = true, start = 25.486e5)), Cvmax = Cvmax_TMP, h(fixed = false, start = 3518000), Cv(start = 3306662.0), Pm(fixed = false, start = 2547000), deltaP(start = 100)) 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))); @@ -229,7 +232,7 @@ model CombinedCycle_TripTAC "CCPP model to simulate a load variation from 100% t 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( + ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceFumees(redeclare package Medium = Medium_FlueGases, X0 = {0.7301, 0.1380, 0.0706, 0.0613, 0}, option_temperature = true, T0 = 893.75, 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))); @@ -504,7 +507,11 @@ equation 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 = " -## Copyright © EDF 2002 - 2026 -## ThermoSysPro Version 4.2 +## Copyright © EDF 2002 - 2026 +## ThermoSysPro Version 4.2 + +Adaptation to `Fluid` of the WaterSteam model `ThermoSysPro.Examples.CombinedCyclePowerPlant.CombinedCycle_TripTAC`. + +In the WaterSteam model, 22 components of the feedwater circuit force the liquid IF97 region (`mode = 1`): the water stays liquid even when the pressure drops below saturation during the gas turbine trip. `Fluid` components have no such parameter, the IF97 region is carried by the medium. These 22 components therefore use `Medium_Liquid = ThermoSysPro.Properties.Media.WaterSteam(Region=1)`, the water/steam medium forced in region 1 (liquid). ")); end CombinedCycle_TripTAC; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestBoilerSystem.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestBoilerSystem.mo new file mode 100644 index 00000000..bede404b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestBoilerSystem.mo @@ -0,0 +1,60 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Boilers; +model TestBoilerSystem + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Boilers.BoilerSystem boilerSystem( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Wloss=0, + Ke=1.e6, + Tsf=386.16) + annotation (Placement(transformation(extent={{-28,-40},{28,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + Q0=27, + T0=298.16, + option_temperature=true, + X0={0.757,0.233,0.01,0,0}) + annotation (Placement(transformation(extent={{-84,-58},{-48,-22}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + P0=100000, + T0=386.16, + option_temperature=true) + annotation (Placement(transformation(extent={{-34,74},{2,110}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + P0=140e5, + Q0=24, + h0=600e3) + annotation (Placement(transformation(extent={{54,-80},{90,-44}}, rotation=180, + origin={132,-126}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkWaterSteam(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{54,44},{90,80}}, rotation=180, + origin={90,148}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss inletPressureLoss( + redeclare package Medium = Medium, + K=1e-3, + rho(start=932.96)) + annotation (Placement(transformation(extent={{34,-66},{42,-58}}, rotation=90, + origin={-38,-94}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss outletPressureLoss( + redeclare package Medium = Medium, + K=1e-3, + rho(start=29.77)) + annotation (Placement(transformation(extent={{34,58},{42,66}}, rotation=90, + origin={112,14}))); +equation + connect(sourceFlueGases.C, boilerSystem.InletFlueGases) annotation (Line(points={{-48,-40},{-24,-40}}, color={0,0,0})); + connect(boilerSystem.OutletFlueGases, sinkFlueGases.C) annotation (Line(points={{-24,40},{-40,40},{-40,92},{-34,92}}, color={0,0,0})); + connect(sourceWaterSteam.C, inletPressureLoss.C1) annotation (Line(points={{42,-64},{24,-64},{24,-60}}, + color={0,0,255})); + connect(inletPressureLoss.C2, boilerSystem.InletWaterSteam) annotation (Line(points={{24,-52},{24,-40}}, color={0,0,255})); + connect(boilerSystem.OutletWaterSteam, outletPressureLoss.C1) annotation (Line(points={{24,40},{48,40},{48,44},{50,44},{50,48}}, + color={0,0,255})); + connect(outletPressureLoss.C2, sinkWaterSteam.C) annotation (Line(points={{50,56},{50,86},{36,86}}, + color={0,0,255})); + annotation (experiment(StopTime=1)); +end TestBoilerSystem; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestFossilFuelBoiler.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestFossilFuelBoiler.mo new file mode 100644 index 00000000..c9928e94 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/TestFossilFuelBoiler.mo @@ -0,0 +1,77 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Boilers; +model TestFossilFuelBoiler + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Boilers.FossilFuelBoiler fossilFuelBoiler( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Wloss=0, + Ke=1.e6, + Tsf=386.16, + Tea(start=298.16), + Tf(start=2138.32), + deltaPe(start=4028755.6), + rhof(start=0.2733)) + annotation (Placement(transformation(extent={{-45,-51},{45,51}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSourcePQ( + 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={{-36,-78},{0,-41}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + Q0=27, + T0=298.16, + option_temperature=true, + X0={0.757,0.233,0.01,0,0}) + annotation (Placement(transformation(extent={{-110,-50},{-71,-13}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + P0=100000, + T0=386.16, + option_temperature=true) + annotation (Placement(transformation(extent={{68,-51},{110,-12}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + P0=140e5, + Q0=24, + h0=600e3) + annotation (Placement(transformation(extent={{-107,14},{-71,48}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkWaterSteam(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{74,13},{110,49}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss inletPressureLoss( + redeclare package Medium = Medium, + K=1e-3, + rho(start=932.96)) + annotation (Placement(transformation(extent={{-64,25},{-56,37}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss outletPressureLoss( + redeclare package Medium = Medium, + K=1e-3, + rho(start=29.77)) + annotation (Placement(transformation(extent={{57,25},{65,37}}, rotation=0))); +equation + connect(sourceFlueGases.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, sinkFlueGases.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(sourceWaterSteam.C, inletPressureLoss.C1) annotation (Line(points={{-71,31},{-64,31}}, color={0,0,255})); + connect(inletPressureLoss.C2, fossilFuelBoiler.Cws1) annotation (Line(points={{-56,31},{-50,31},{-50,30.6},{-45,30.6}}, color={0,0,255})); + connect(fossilFuelBoiler.Cws2, outletPressureLoss.C1) annotation (Line(points={{45,30.6},{51,30.6},{51,31},{57,31}}, color={0,0,255})); + connect(outletPressureLoss.C2, sinkWaterSteam.C) annotation (Line(points={{65,31},{74,31}}, color={0,0,255})); + annotation (experiment(StopTime=1)); +end TestFossilFuelBoiler; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.mo new file mode 100644 index 00000000..6b2ccdaa --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Boilers + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end Boilers; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.order new file mode 100644 index 00000000..5d6f590f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Boilers/package.order @@ -0,0 +1,2 @@ +TestFossilFuelBoiler +TestBoilerSystem diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity.mo new file mode 100644 index 00000000..3bd41c98 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity.mo @@ -0,0 +1,56 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestAirHumidity + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.BoundaryConditions.AirHumidity airHumidity( + redeclare package Medium = Medium, + hum0=0.9, + T0=293, + ppvap0(start=2085), + 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( + redeclare package Medium = Medium, + K=1.e-5, + rho(start=1.17)) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases(redeclare package Medium = Medium, + T0=293, + h0=53484, + option_temperature=true) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceFlueGasesPQ( + redeclare package Medium = Medium, + option_temperature=true, + X0={1 - 0.0132625 - 0.217282,0.217282,0.0132625,0,0}, + 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=" +
Copyright © EDF 2002 - 2021
+ThermoSysPro Version 4.0
+")); +end TestAirHumidity; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity_Traces.mo new file mode 100644 index 00000000..6f7a9783 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestAirHumidity_Traces.mo @@ -0,0 +1,59 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestAirHumidity_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.AirHumidity airHumidity( + redeclare package Medium = Medium, + hum0=0.9, + T0=293, + ppvap0(start=2085), + 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( + redeclare package Medium = Medium, + K=1.e-5, + rho(start=1.17)) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases(redeclare package Medium = Medium, + T0=293, + h0=53484, + option_temperature=true) annotation (Placement(transformation(extent={{80,0},{100,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceFlueGasesPQ( + redeclare package Medium = Medium, + option_temperature=true, + X0={1 - 0.0132625 - 0.217282,0.217282,0.0132625,0,0}, + 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=" +Copyright © EDF 2002 - 2021
+ThermoSysPro Version 4.0
+")); +end TestAirHumidity_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH.mo new file mode 100644 index 00000000..860e2926 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH.mo @@ -0,0 +1,63 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefH + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP( + redeclare package Medium = Medium, + P0=2000000) + annotation (Placement(transformation(extent={{-90,-10},{-70,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ( + redeclare package Medium = Medium, + Q0=110) + annotation (Placement(transformation(extent={{92,-10},{112,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{126,-10},{146,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefH refH( + redeclare package Medium = Medium, + h0=2600e3) + annotation (Placement(transformation(extent={{-40,-10},{-20,10}}))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA( + redeclare package Medium = Medium, + h0=2600e3, + dynamic_energy_balance=false) + annotation (Placement(transformation(extent={{20,-50},{0,-30}}))); + InstrumentationAndControl.Blocks.Sources.Constante enthalpy(k=2600e3) + annotation (Placement(transformation(extent={{-58,38},{-38,58}}))); + InstrumentationAndControl.Blocks.Sources.Constante pressure(k=2000000) + annotation (Placement(transformation(extent={{-110,38},{-90,58}}))); + InstrumentationAndControl.Blocks.Sources.Constante massFlow(k=110) + annotation (Placement(transformation(extent={{2,38},{22,58}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{18,-10},{38,10}}, + rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerP loopBreakerP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{46,-10},{66,10}}, + rotation=0))); +equation + connect(refP.C2, refH.C1) + annotation (Line(points={{-70,0},{-40,0}}, color={0,0,0})); + connect(refQ.C2, pipePressureLoss.C1) + annotation (Line(points={{112,0},{126,0}}, + color={0,0,0})); + connect(pipePressureLoss.C2, volumeA.Ce1) + annotation (Line(points={{146,0},{150,0},{150,-40},{20,-40}}, + color={0,0,0})); + connect(volumeA.Cs1, refP.C1) + annotation (Line(points={{0,-40},{-102,-40},{-102,0},{-90,0}}, color={0,0,0})); + connect(enthalpy.y, refH.ISpecificEnthalpy) + annotation (Line(points={{-37,48},{-30,48},{-30,11}}, color={0,0,255})); + connect(pressure.y, refP.IPressure) + annotation (Line(points={{-89,48},{-80,48},{-80,11}}, color={0,0,255})); + connect(massFlow.y, refQ.IMassFlow) + annotation (Line(points={{23,48},{102,48},{102,11}}, + color={0,0,255})); + connect(refH.C2, loopBreakerH.C1) annotation (Line(points={{-20,0},{-10,0}}, color={0,0,0})); + connect(loopBreakerH.C2, loopBreakerQ.C1) annotation (Line(points={{10,0},{18,0}}, color={0,0,0})); + connect(loopBreakerQ.C2, loopBreakerP.C1) annotation (Line(points={{38,0},{46,0}}, color={0,0,0})); + connect(loopBreakerP.C2, refQ.C1) annotation (Line(points={{66,0},{92,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefH; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces.mo new file mode 100644 index 00000000..cc1aebed --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces.mo @@ -0,0 +1,17 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefH_Traces + extends TestRefH( + redeclare package Medium = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}), + volumeA( + dynamic_energy_balance=true, + dynamic_mass_balance=true, + steady_state=false, + P0=2000000, + h0=2600e3)); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefH_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces_FlueGases.mo new file mode 100644 index 00000000..72e57825 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefH_Traces_FlueGases.mo @@ -0,0 +1,19 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefH_Traces_FlueGases + extends TestRefH( + redeclare package Medium = ThermoSysPro.Properties.Media.FlueGases( + extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}), + volumeA( + dynamic_energy_balance=true, + dynamic_mass_balance=true, + dynamic_composition_balance=true, + steady_state=true, + P0=2000000, + h0=2600e3, + X0={0.1,0.2,0.3,0.2,0.2})); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefH_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP.mo new file mode 100644 index 00000000..60f4b2b6 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP.mo @@ -0,0 +1,36 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefP + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = Properties.Media.WaterSteam; + + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium, h0=633e3) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package + Medium = Medium, + T0=423.15, + option_temperature=true) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=20e5) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refP.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceQ.C,refP. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + + + connect(constante.y, refP.IPressure) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefP; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces.mo new file mode 100644 index 00000000..1f0736bb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefP_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium, h0=633e3) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package + Medium = Medium, + T0=423.15, + option_temperature=true, SubC0={10,20,30}) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=20e5) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refP.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceQ.C,refP. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + + connect(constante.y, refP.IPressure) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefP_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo new file mode 100644 index 00000000..9aea64c1 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefP_Traces_FlueGases.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefP_Traces_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP( + redeclare package Medium = + Medium, + T0=453.15, + h0=633193.1, + option_temperature=true) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package + Medium = Medium, + Q0=50, + T0=473.15, + h0=633193.1, + option_temperature=true, SubC0={10,20,30}, X0={0.1,0.2,0.3,0.2,0.2}, + T(start=423.15)) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=20e5) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-38,-10},{-18,10}}))); +equation + connect(sinkP.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refP.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + + connect(constante.y, refP.IPressure) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + connect(sourceQ.C, singularPressureLoss.C1) + annotation (Line(points={{-46,0},{-38,0}}, color={0,0,0})); + connect(singularPressureLoss.C2, refP.C1) + annotation (Line(points={{-18,0},{-10,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefP_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ.mo new file mode 100644 index 00000000..63865b8f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefQ + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package + Medium = Medium, h0=2600e3, + option_temperature=false) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=110) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refQ.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceP.C,refQ. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + connect(constante.y, refQ.IMassFlow) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefQ; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces.mo new file mode 100644 index 00000000..4cda43cc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces.mo @@ -0,0 +1,33 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefQ_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package + Medium = Medium, h0=2600e3,SubC0={10,20,30}, + option_temperature=false) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=110) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refQ.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceP.C,refQ. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + connect(constante.y, refQ.IMassFlow) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefQ_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces_FlueGases.mo new file mode 100644 index 00000000..3babe41f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefQ_Traces_FlueGases.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefQ_Traces_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases(extraPropertiesNames={"Trace1", "Trace2", "Trace3"}, C_nominal={0.1, 0.2, 0.3}, C_default={0.2, 0.3, 0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = + Medium, h0=2600e3) + annotation (Placement(transformation(extent={{66,-10},{86,10}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipePressureLoss( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{32,-10},{52,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package + Medium = Medium, + P0=2000000, h0=2600e3,SubC0={10,20,30}, X0={0.1,0.2,0.3,0.2,0.2}, + option_temperature=false) + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=110) + annotation (Placement(transformation(extent={{-30,38},{-10,58}}))); +equation + connect(sink.C, pipePressureLoss.C2) + annotation (Line(points={{66,0},{52,0}}, color={0,0,0})); + connect(refQ.C2, pipePressureLoss.C1) + annotation (Line(points={{10,0},{32,0}}, color={0,0,0})); + connect(sourceP.C,refQ. C1) + annotation (Line(points={{-46,0},{-10,0}}, color={0,0,0})); + connect(constante.y, refQ.IMassFlow) + annotation (Line(points={{-9,48},{0,48},{0,11}}, color={0,0,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestRefQ_Traces_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefSubC_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefSubC_Traces.mo new file mode 100644 index 00000000..a4200c97 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefSubC_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefSubC_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) 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(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefSubC refSubC(redeclare package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{90,-30},{70,-10}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerSubC loopBreakerSubC(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,-30},{40,-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(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(volumeA.Ce1, loopBreakerSubC.C2) annotation (Line(points={{10,-20},{40,-20}}, color={0,0,0})); + connect(loopBreakerSubC.C1, refSubC.C2) annotation (Line(points={{60,-20},{70,-20}}, color={0,0,0})); + connect(loopBreakerH.C2, refSubC.C1) annotation (Line(points={{50,10},{100,10},{100,-20},{90,-20}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestRefSubC_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo new file mode 100644 index 00000000..b1530cbe --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefT.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefT + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) 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(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, 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(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(volumeA.Ce1, loopBreakerH.C2) annotation (Line(points={{10,-20},{100,-20},{100,10},{50,10}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestRefT; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefX_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefX_FlueGases.mo new file mode 100644 index 00000000..33881c78 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/TestRefX_FlueGases.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.BoundaryConditions; +model TestRefX_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) 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(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefXgas refXgas(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{62,0},{82,20}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerXgas loopBreakerXgas(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{64,-30},{44,-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(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(refXgas.C1, loopBreakerH.C2) annotation (Line(points={{62,10},{50,10}}, color={0,0,0})); + connect(volumeA.Ce1, loopBreakerXgas.C2) annotation (Line(points={{10,-20},{44,-20}}, color={0,0,0})); + connect(loopBreakerXgas.C1, refXgas.C2) annotation (Line(points={{64,-20},{100,-20},{100,10},{82,10}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestRefX_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.mo new file mode 100644 index 00000000..bbbaeddd --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package BoundaryConditions + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end BoundaryConditions; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order new file mode 100644 index 00000000..1cb5ba44 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/BoundaryConditions/package.order @@ -0,0 +1,14 @@ +TestRefQ +TestRefQ_Traces +TestRefQ_Traces_FlueGases +TestRefH +TestRefH_Traces +TestRefH_Traces_FlueGases +TestRefP +TestRefP_Traces +TestRefP_Traces_FlueGases +TestRefT +TestRefSubC_Traces +TestRefX_FlueGases +TestAirHumidity +TestAirHumidity_Traces diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGTCombustionChamber.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGTCombustionChamber.mo new file mode 100644 index 00000000..0a2ca23b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGTCombustionChamber.mo @@ -0,0 +1,49 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGTCombustionChamber + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.CombustionChambers.GTCombustionChamber combustionChamber( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases) + annotation (Placement(transformation(extent={{-40,-40},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + Q0=0, + P0=15e5, + h0=300e3) + annotation (Placement(transformation(extent={{-100,50},{-60,90}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel( + 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={{-100,-90},{-60,-50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + P0=15e5, + Q0=415, + T0=680, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-120,-20},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(extent={{80,-20},{120,20}}, rotation=0))); +equation + connect(sourceWaterSteam.C, combustionChamber.Cws) annotation (Line(points={{-60,70},{-24,70},{-24,36}}, color={0,0,255})); + connect(sourceFuel.C, combustionChamber.Cfuel) annotation (Line(points={{-60,-70},{0,-70},{0,-36}}, color={0,0,0})); + connect(sourceAir.C, combustionChamber.Ca) annotation (Line(points={{-80,0},{-36,0}}, color={0,0,0})); + connect(combustionChamber.Cfg, sinkFlueGases.C) annotation (Line(points={{36,0},{80,0}}, color={0,0,0})); + annotation (experiment(StopTime=1)); +end TestGTCombustionChamber; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion.mo new file mode 100644 index 00000000..353493ee --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion.mo @@ -0,0 +1,49 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGenericCombustion + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion combustionChamber( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases) + annotation (Placement(transformation(extent={{-40,-40},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + Q0=0, + P0=15e5, + h0=300e3) + annotation (Placement(transformation(extent={{-120,10},{-80,50}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel( + 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={{30,-100},{70,-60}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + P0=15e5, + Q0=415, + T0=680, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-40,-100},{0,-60}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(extent={{-20,80},{20,120}}, rotation=0))); +equation + connect(sourceWaterSteam.C, combustionChamber.Cws) annotation (Line(points={{-80,30},{-70,30},{-70,4},{-36,4}}, color={0,0,255})); + connect(sourceFuel.C, combustionChamber.Cfuel) annotation (Line(points={{70,-80},{28,-80},{28,-36}}, color={0,0,0})); + connect(sourceAir.C, combustionChamber.Ca) annotation (Line(points={{0,-80},{-12,-80},{-12,-36}}, color={0,0,0})); + connect(combustionChamber.Cfg, sinkFlueGases.C) annotation (Line(points={{-12,36},{-12,100},{-20,100}}, color={0,0,0})); + annotation (experiment(StopTime=1)); +end TestGenericCombustion; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1D.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1D.mo new file mode 100644 index 00000000..dab35fd7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1D.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGenericCombustion1D + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D combustionChamber(redeclare package Medium = Medium, redeclare package Medium_FlueGases = Medium_FlueGases, 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(origin = {-4, 10}, extent = {{-40, -40}, {40, 40}}))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel(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 = {{-100, -30}, {-60, 10}}, rotation = 0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir(redeclare package Medium = Medium_FlueGases, Q0 = 609.29, P0 = 191000, T0 = 524.89, option_temperature = true, X0 = {0.76, 0.23, 0.01, 0, 0}) annotation( + Placement(transformation(origin = {-80, -74}, extent = {{-20, -100}, {20, -60}}, rotation = 90))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam(redeclare package Medium = Medium, Q0 = 0, P0 = 100000) annotation( + Placement(transformation(extent = {{-100, 30}, {-60, 70}}, rotation = 0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases(redeclare package Medium = Medium_FlueGases, T0 = 1200, option_temperature = true) annotation( + Placement(transformation(origin = {24, -18}, extent = {{-20, 80}, {20, 120}}))); +equation + connect(sourceFuel.C, combustionChamber.Cfuel) annotation( + Line(points = {{-60, -10}, {-40, -10}})); + connect(sourceAir.C, combustionChamber.Ca) annotation( + Line(points = {{0, -54}, {0, -45}, {-4, -45}, {-4, -26}})); + connect(sourceWaterSteam.C, combustionChamber.Cws) annotation( + Line(points = {{-60, 50}, {-60, 32}, {-40, 32}, {-40, 30}}, color = {0, 0, 255})); + connect(combustionChamber.Cfg, sinkFlueGases.C) annotation( + Line(points = {{-4, 46}, {-4, 63}, {4, 63}, {4, 82}})); + annotation( + experiment(StopTime = 1)); +end TestGenericCombustion1D; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo new file mode 100644 index 00000000..80cede49 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGenericCombustion1DWithPipe.mo @@ -0,0 +1,109 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGenericCombustion1DWithPipe + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.CombustionChambers.GenericCombustion1D genericCombustionCCS( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + 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 sourceFuel( + 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( + redeclare package Medium = Medium_FlueGases, + Q0=609.29, + P0=191000, + T0=524.89, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-44,-98},{0,-58}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWaterSteam( + redeclare package Medium = Medium, + Q0=0, + P0=100000) + annotation (Placement(transformation(extent={{-107,23},{-71,57}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(extent={{0,70},{44,112}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe pipeWaterSteam( + redeclare package Medium = Medium, + Ns=7, + inertia=false, + dynamic_energy_balance=false, + z2=56, + rugosrel=5e-5, + ntubes=403, + L=58, + D=0.0327, + P(start=fill(2.0e7, 9)), + Q(start=fill(486.69, 8)), + h(start=fill(1.8e6, 9)), + C2(Q(fixed=false, start=486.69), P(fixed=false, start=1.96318e7, displayUnit="Pa")), + dpfCorr=3.5) + annotation (Placement(transformation(origin={91,8}, extent={{49,16},{-49,-16}}, rotation=270))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall wall( + Ns=7, + dynamic_energy_balance=false, + Tp1(start=fill(500, 7)), + Tp2(start=fill(400, 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.SourceP sourcePipe( + redeclare package Medium = Medium, + h0=1.292e6, + option_temperature=false, + P0=20112000) + annotation (Placement(transformation(origin={91,-81}, extent={{15,-15},{-15,15}}, rotation=270))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPipe( + redeclare package Medium = Medium, + option_temperature=false, + Q(start=486.69, fixed=true), + h0=2.5e6, + P0(fixed=false) = 19621600) + annotation (Placement(transformation(origin={90,90.5}, extent={{14.5,-15},{-14.5,15}}, rotation=270))); +equation + connect(sourceFuel.C, genericCombustionCCS.Cfuel) annotation (Line(points={{-72,-24},{-55.8,-24}}, color={0,0,0})); + connect(genericCombustionCCS.Cfg, sinkFlueGases.C) annotation (Line(points={{0,65.6},{0,91}}, color={0,0,0})); + connect(sourceAir.C, genericCombustionCCS.Ca) annotation (Line(points={{0,-78},{0,-49.6}}, color={0,0,0})); + connect(sourceWaterSteam.C, genericCombustionCCS.Cws) annotation (Line(points={{-71,40},{-55.8,40}}, color={0,0,255})); + connect(genericCombustionCCS.Cth, wall.WT2) annotation (Line(points={{55.8,8},{68,8},{68,7.5},{76,7.5}}, color={191,95,0})); + connect(wall.WT1, pipeWaterSteam.CTh) + annotation (Line(points={{70,7.5},{71,7.5},{71,8},{86.2,8}}, color={191,95,0})); + connect(sourcePipe.C, pipeWaterSteam.C1) + annotation (Line(points={{91,-66},{91,-41}}, color={0,0,255})); + connect(pipeWaterSteam.C2, sinkPipe.C) + annotation (Line(points={{91,57},{91,76},{90,76}}, color={0,0,255})); + annotation (experiment(StopTime=1)); +end TestGenericCombustion1DWithPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGridFurnace.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGridFurnace.mo new file mode 100644 index 00000000..f7dcf2e6 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestGridFurnace.mo @@ -0,0 +1,73 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestGridFurnace + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ fuelSource( + 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 sourcePrimaryAir( + redeclare package Medium = Medium_FlueGases, + T0=300, + Q0=10, + P0=1.9e5, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-74,-80},{-30,-40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(extent={{28,50},{72,92}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceCoolingWater( + redeclare package Medium = Medium, + P0=1.e5, + Q0=1) + annotation (Placement(transformation(extent={{89,13},{53,47}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.CombustionChambers.GridFurnace gridFurnace( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Q5eH2O(start=27.562088697651173), + Q5eN2(start=18.629997579210396), + Q5sCO(start=16.083169558220888), + Q5sCO2(start=-23.220946069965017), + Q5sO2(start=-1.7763568394002505E-15), + T2(start=4353.611752483582), + Teap(start=2396.269823464287, displayUnit="degC"), + Teas(start=2396.269823464287, displayUnit="degC"), + Teasm(start=2419.8632089574135, displayUnit="degC"), + Tsf(start=1964.2922985959055), Hsf(start = 4575373),Qeasm(start=14.733687)) + annotation (Placement(transformation(extent={{-40,-40},{40,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSecondaryAir( + redeclare package Medium = Medium_FlueGases, + option_temperature=true, + T0=300, + Q0=10, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-90,4},{-46,44}}, rotation=0))); +equation + connect(fuelSource.C, gridFurnace.Com) + annotation (Line(points={{-72,-4},{-36,-4}}, color={0,0,0})); + connect(gridFurnace.Cfg, sinkFlueGases.C) + annotation (Line(points={{0,36},{0,71},{28,71}}, color={0,0,0})); + connect(sourceCoolingWater.C, gridFurnace.port_eau_refroid) + annotation (Line(points={{53,30},{32,30},{32,12}}, color={0,0,255})); + connect(sourceSecondaryAir.C, gridFurnace.Ca2) + annotation (Line(points={{-46,24},{-20,24}}, color={0,0,0})); + connect(sourcePrimaryAir.C, gridFurnace.Ca1) + annotation (Line(points={{-30,-60},{0,-60},{0,-36}}, color={0,0,0})); + annotation (experiment(StopTime=1)); +end TestGridFurnace; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestPostCombustionGas.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestPostCombustionGas.mo new file mode 100644 index 00000000..7b9a15fe --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/TestPostCombustionGas.mo @@ -0,0 +1,67 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Combustion; +model TestPostCombustionGas + extends ThermoSysPro.UsersGuide.Icons.Example; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + T0=1200, + option_temperature=true) + annotation (Placement(transformation(origin={151,-6}, extent={{23,-24},{-23,24}}, rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + P0=15e5, + Q0=415, + T0=680, + option_temperature=true, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-174,-30},{-128,18}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceAir( + redeclare package Medium = Medium_FlueGases, + T0=680, + option_temperature=true, + Q0=10, + X0={0.76,0.23,0.01,0,0}) + annotation (Placement(transformation(extent={{-172,68},{-132,108}}, rotation=0))); + ThermoSysPro.Fluid.Combustion.BoundaryConditions.FuelSourcePQ sourceFuel( + 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( + redeclare package Medium_FlueGases = Medium_FlueGases, Psf(start = 1.5e6), Tmel(start = 2427.85 + 273.15), h(start = 4026550)) + annotation (Placement(transformation(extent={{-52,-74},{74,50}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss airPressureLoss( + redeclare package Medium = Medium_FlueGases) + annotation (Placement(transformation(extent={{-100,78},{-80,98}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss inletPressureLoss( + redeclare package Medium = Medium_FlueGases) + annotation (Placement(transformation(extent={{-102,-16},{-82,4}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss outletPressureLoss( + redeclare package Medium = Medium_FlueGases) + annotation (Placement(transformation(extent={{90,-16},{110,4}}))); +equation + connect(sourceFuel.C, postCombustionGas.Cfuel) + annotation (Line(points={{-71,-91},{-7.9,-91},{-7.9,-67.8}}, color={0,0,0})); + connect(sourceAir.C, airPressureLoss.C1) + annotation (Line(points={{-132,88},{-100,88}}, color={0,0,0})); + connect(airPressureLoss.C2, postCombustionGas.Ca) + annotation (Line(points={{-80,88},{-20.5,88},{-20.5,43.8}}, color={0,0,0})); + connect(sourceFlueGases.C, inletPressureLoss.C1) + annotation (Line(points={{-128,-6},{-102,-6}}, color={0,0,0})); + connect(inletPressureLoss.C2, postCombustionGas.Cfg1) + annotation (Line(points={{-82,-6},{-64,-6},{-64,-5.8},{-45.7,-5.8}}, color={0,0,0})); + connect(postCombustionGas.Cfg2, outletPressureLoss.C1) + annotation (Line(points={{67.7,-5.8},{79.85,-5.8},{79.85,-6},{90,-6}}, color={0,0,0})); + connect(outletPressureLoss.C2, sinkFlueGases.C) + annotation (Line(points={{110,-6},{128,-6}}, color={0,0,0})); + annotation (experiment(StopTime=1)); +end TestPostCombustionGas; \ No newline at end of file diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.mo new file mode 100644 index 00000000..7f2e6adc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Combustion + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end Combustion; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.order new file mode 100644 index 00000000..a7bc0903 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Combustion/package.order @@ -0,0 +1,6 @@ +TestGTCombustionChamber +TestGenericCombustion +TestGenericCombustion1D +TestGenericCombustion1DWithPipe +TestPostCombustionGas +TestGridFurnace diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo new file mode 100644 index 00000000..3568f0c4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser.mo @@ -0,0 +1,52 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicCondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_Cooling = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicCondenser condenser( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium_Cooling, + Ns=3, + ntubest=1000, + ntubesV=50, + C1vap(P(start=66004), h_vol_2(start=353999)), + C2vap(P(start=66004), h_vol_2(start=353999)), + C1(P(start=66004)), + C2ex(P(start=47631), h(start=370191)), + DynamicCondenser( + P(start=66004), + Pfond(start=47631), + hv(start=353999), + hl(start=370191), + Tp(start=357.683), + Tp1(start={351.781,354.987,356.535}), + CvBP(P(start=66004), h_vol_2(start=353999)), + CvGCT(P(start=66004), h_vol_2(start=353999)), + Cl(P(start=47631))), + Wall_3(Tp2(start={351.781,354.987,356.535})), + pipe_3( + P(start={107635,105730,103825,101915,100000}), + mu2(start=fill(9.14034e-4, 4)), + rho2(start=fill(997.34, 4))), + sortieReelle(signal(start=-97.6173)), + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ vaporSource(redeclare package Medium = Medium, Q0=10, h0=2.7e6, option_temperature=false, C(P(start=66004), h_vol_2(start=353999))) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraVaporSource(redeclare package Medium = Medium, Q0=1e-4, h0=2.7e6, option_temperature=false, C(P(start=66004), h_vol_2(start=353999))) annotation (Placement(transformation(extent={{-70,50},{-50,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraWaterSource(redeclare package Medium = Medium, Q0=1e-4, h0=1e5, option_temperature=false, C(P(start=66004))) annotation (Placement(transformation(extent={{-70,20},{-50,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ condensateSink(redeclare package Medium = Medium, Q0=10.0002, h0=1e5, option_temperature=false, C(P(start=47631), h(start=370191))) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ coolingSource(redeclare package Medium = Medium_Cooling, Q0=100, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,-20},{-50,0}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP coolingSink(redeclare package Medium = Medium_Cooling, P0=100000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{50,-20},{70,0}}))); +equation + connect(vaporSource.C, condenser.C1vap) annotation (Line(points={{10,60},{0,60},{0,10}}, color={0,0,255})); + connect(extraVaporSource.C, condenser.C2vap) annotation (Line(points={{-50,60},{-3.9,60},{-3.9,9.2}}, color={0,0,255})); + connect(extraWaterSource.C, condenser.C1) annotation (Line(points={{-50,30},{-8.1,30},{-8.1,7.5}}, color={0,0,255})); + connect(condenser.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-36},{0,-60},{-10,-60}}, + color={0,0,255})); + connect(coolingSource.C, condenser.Ce1) annotation (Line(points={{-50,-10},{-10,-10},{-10,-0.1}}, color={0,0,255})); + connect(condenser.Ce2, coolingSink.C) annotation (Line(points={{9.9,-0.1},{30,-0.1},{30,-10},{50,-10}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser_Traces.mo new file mode 100644 index 00000000..0a600512 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicCondenser_Traces.mo @@ -0,0 +1,7 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicCondenser_Traces + extends TestDynamicCondenser( + redeclare package Medium = Properties.Media.WaterSteam, + redeclare package Medium_Cooling = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + coolingSource(SubC0={10})); +end TestDynamicCondenser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo new file mode 100644 index 00000000..4345686d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicFlueGasesMultiFluidHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.HeatExchangers.DynamicFlueGasesMultiFluidHeatExchanger exchanger( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + h0=fill(1.2e6, 1), + option_temperature=false, + ExchangerFlueGasesMetal(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2))), + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFg(redeclare package Medium = Medium_FlueGases, Q0=10, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFg(redeclare package Medium = Medium_FlueGases, P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6))) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceWs(redeclare package Medium = Medium, P0=300000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWs(redeclare package Medium = Medium, P0=100000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-10},{70,10}}))); +equation + connect(sourceFg.C, exchanger.Cfg1) annotation (Line(points={{10,60},{20,60},{20,5},{0,5}}, color={0,0,255})); + connect(exchanger.Cfg2, sinkFg.C) annotation (Line(points={{0,-5},{0,-50}}, color={0,0,255})); + connect(sourceWs.C, exchanger.Cws1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.Cws2, sinkWs.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicFlueGasesMultiFluidHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger_Traces.mo new file mode 100644 index 00000000..39a421d8 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicFlueGasesMultiFluidHeatExchanger_Traces.mo @@ -0,0 +1,8 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicFlueGasesMultiFluidHeatExchanger_Traces + extends TestDynamicFlueGasesMultiFluidHeatExchanger( + redeclare package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + redeclare package Medium_FlueGases = Properties.Media.FlueGases(extraPropertiesNames={"Trace1"}, C_nominal={0.1}, C_default={0.2}), + sourceFg(SubC0={30}), + sourceWs(SubC0={10})); +end TestDynamicFlueGasesMultiFluidHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger.mo new file mode 100644 index 00000000..d0b36344 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_1 = Properties.Media.WaterSteam; + replaceable package Medium_2 = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicMultiFluidHeatExchanger exchanger( + redeclare package Medium_1 = Medium_1, + redeclare package Medium_2 = Medium_2, + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source1(redeclare package Medium = Medium_1, P0=300000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{-70,-30},{-50,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink1(redeclare package Medium = Medium_1, P0=100000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{50,-30},{70,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source2(redeclare package Medium = Medium_2, P0=300000, h0=320000, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink2(redeclare package Medium = Medium_2, P0=100000, h0=310000, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); +equation + connect(source1.C, exchanger.Cws1) annotation (Line(points={{-50,-20},{-30,-20},{-30,0},{-10,0}}, color={0,0,255})); + connect(exchanger.Cws2, sink1.C) annotation (Line(points={{10,0},{30,0},{30,-20},{50,-20}}, color={0,0,255})); + connect(source2.C, exchanger.Cfg1) annotation (Line(points={{10,60},{20,60},{20,5},{0,5}}, color={0,0,255})); + connect(exchanger.Cfg2, sink2.C) annotation (Line(points={{0,-5},{0,-50}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicMultiFluidHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo new file mode 100644 index 00000000..7699ef1f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchangerShell + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_shell = Properties.Media.WaterSteam; + replaceable package Medium_pipe = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicMultiFluidHeatExchangerShell exchanger( + redeclare package Medium_shell = Medium_shell, + redeclare package Medium_pipe = Medium_pipe, + Dint=0.016, + Dext=0.019, + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePipe(redeclare package Medium = Medium_pipe, P0=300000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPipe(redeclare package Medium = Medium_pipe, P0=100000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{50,-10},{70,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceShell(redeclare package Medium = Medium_shell, P0=300000, h0=320000, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkShell(redeclare package Medium = Medium_shell, P0=100000, h0=310000, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); +equation + connect(sourcePipe.C, exchanger.Cws1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.Cws2, sinkPipe.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + connect(sourceShell.C, exchanger.Cfg1) annotation (Line(points={{10,60},{20,60},{20,5},{0,5}}, color={0,0,255})); + connect(exchanger.Cfg2, sinkShell.C) annotation (Line(points={{0,-5},{0,-32},{0,-60},{-10,-60}}, + color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicMultiFluidHeatExchangerShell; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo new file mode 100644 index 00000000..7df2c666 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_FlueGases.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchangerShell_FlueGases + extends TestDynamicMultiFluidHeatExchangerShell( + redeclare package Medium_shell = Properties.Media.FlueGases, + redeclare package Medium_pipe = Properties.Media.FlueGases, + exchanger( + P0=450000, + h0=fill(3e6, 1), + option_temperature=false, + dynamicOnePhaseFlowShell(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2))), + DynamicOnePhaseFlowPipe(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2)))), + sourceShell(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))), + sinkShell(P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6))), + sourcePipe(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))), + sinkPipe(P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6)))); +end TestDynamicMultiFluidHeatExchangerShell_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_Traces.mo new file mode 100644 index 00000000..0f698216 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchangerShell_Traces.mo @@ -0,0 +1,8 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchangerShell_Traces + extends TestDynamicMultiFluidHeatExchangerShell( + redeclare package Medium_shell = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + redeclare package Medium_pipe = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + sourcePipe(SubC0={10}), + sourceShell(SubC0={20})); +end TestDynamicMultiFluidHeatExchangerShell_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo new file mode 100644 index 00000000..a794ed00 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_FlueGases.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchanger_FlueGases + extends TestDynamicMultiFluidHeatExchanger( + redeclare package Medium_1 = Properties.Media.FlueGases, + redeclare package Medium_2 = Properties.Media.FlueGases, + exchanger( + P0=450000, + h0=fill(3e6, 1), + option_temperature=false, + DynamicOnePhaseFlowPipe_1(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2))), + DynamicOnePhaseFlowPipe_2(h(start=fill(3e6, 3)), hb(start=fill(3e6, 2)))), + source1(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))), + sink1(P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6))), + source2(P0=450000, h0=3e6, option_temperature=false, X0={0.1,0.2,0.3,0.2,0.2}, C(h(start=3e6), h_vol_1(start=3e6))), + sink2(P0=100000, h0=3e6, option_temperature=false, C(h(start=3e6), h_vol_2(start=3e6)))); +end TestDynamicMultiFluidHeatExchanger_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_Traces.mo new file mode 100644 index 00000000..268cc90a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicMultiFluidHeatExchanger_Traces.mo @@ -0,0 +1,8 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicMultiFluidHeatExchanger_Traces + extends TestDynamicMultiFluidHeatExchanger( + redeclare package Medium_1 = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + redeclare package Medium_2 = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + source1(SubC0={10}), + source2(SubC0={20})); +end TestDynamicMultiFluidHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe.mo new file mode 100644 index 00000000..d682e934 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowPipe + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe dynamicOnePhaseFlowPipe( + redeclare package Medium = Medium, + 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={{-10,-10},{10,10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}},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={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10) annotation (Placement(transformation(extent={{-10,10},{10,30}},rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo new file mode 100644 index 00000000..29f0ce1b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_FlueGases.mo @@ -0,0 +1,42 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowPipe_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe dynamicOnePhaseFlowPipe( + redeclare package Medium = Medium, + Ns=1, + Q(start=fill(36, dynamicOnePhaseFlowPipe.Ns + 1)), + h(start={3077096.0822837264,3135044.986588299,3077096.0822837264}), + P(start=linspace( + 45, + 44.5, + dynamicOnePhaseFlowPipe.Ns + 2))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + P0=4500000, + T0=573.15, + X0={0,0,1,0,0}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0=fill(726.855, dynamicOnePhaseFlowPipe.Ns), + option_temperature=2, + W0=fill(2e6/dynamicOnePhaseFlowPipe.Ns, dynamicOnePhaseFlowPipe.Ns)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=dynamicOnePhaseFlowPipe.Ns) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowPipe_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo new file mode 100644 index 00000000..84ca3da5 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowPipe_Traces.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowPipe_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe dynamicOnePhaseFlowPipe( + redeclare package Medium = Medium, + 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={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, 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={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowPipe.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowPipe.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowPipe_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell.mo new file mode 100644 index 00000000..0c70d9a9 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowShell + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowShell( + redeclare package Medium = Medium, + 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={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, 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={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowShell.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowShell.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowShell.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowShell; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_FlueGases.mo new file mode 100644 index 00000000..7bcd5cfc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_FlueGases.mo @@ -0,0 +1,42 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowShell_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowShell( + redeclare package Medium = Medium, + Ns=1, + Q(start=fill(36, dynamicOnePhaseFlowShell.Ns + 1)), + h(start={3077096.0822837264,3135044.986588299,3077096.0822837264}), + P(start=linspace( + 45, + 44.5, + dynamicOnePhaseFlowShell.Ns + 2))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + P0=4500000, + T0=573.15, + X0={0,0,1,0,0}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + T0=fill(726.855, dynamicOnePhaseFlowShell.Ns), + option_temperature=2, + W0=fill(2e6/dynamicOnePhaseFlowShell.Ns, dynamicOnePhaseFlowShell.Ns)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=dynamicOnePhaseFlowShell.Ns) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowShell.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowShell.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowShell.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowShell_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_Traces.mo new file mode 100644 index 00000000..52a41273 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicOnePhaseFlowShell_Traces.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicOnePhaseFlowShell_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell dynamicOnePhaseFlowShell( + redeclare package Medium = Medium, + 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={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, 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={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(Ns=10) annotation (Placement(transformation(extent={{-10,10},{10,30}}, rotation=0))); +equation + connect(sourceP.C, dynamicOnePhaseFlowShell.C1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(dynamicOnePhaseFlowShell.C2, sinkP.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,30.2},{0,22}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicOnePhaseFlowShell.CTh) annotation (Line(points={{0,18},{0,3}}, color={191,95,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicOnePhaseFlowShell_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo new file mode 100644 index 00000000..db2f7dd6 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger.mo @@ -0,0 +1,61 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicPlateHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger dynamicPlateHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Ns=5, + Sp=2, + dynamic_energy_balance=false, + heat_exchange_correlation=0, + pressure_loss_correlation=0, + p_Kc=1e-4, + p_Kf=1e-4, + state_f2(p(each start=3e5)), + Ec( + P(start=300000), + Q(start=1036), + h(start=280050)), + Sc(P(start=100000), h(start=275103), Q(start=1000)), + Ef(P(start=300000), h(start=280104), Q(start=1000)), + Sf(P(start=100000), h(start=280076)), + Pc(start=fill(3e5, 5+2)), + Pf(start=fill(3e5, 5+2)), + Qf(start=fill(1000, 5+1)), + hc(start={280050,280050,280052,280040,280303,275103,275103}), + hf(start={280076,280104,280154,279724,289301,280000,280000}), + hbc(start={280050,280050,280052,280040,280303,275103}), + hbf(start={280076,280104,280154,279724,289301,280000})) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + P0=300000, + option_temperature=false, + h0=280050) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium, + P0=300000, + option_temperature=false, + h0=280104) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkPc( + redeclare package Medium = Medium, + Q0=1036, + option_temperature=false, + h0=275103) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + redeclare package Medium = Medium, + P0=100000, + option_temperature=false, + h0=280076) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, dynamicPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, dynamicPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicPlateHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo new file mode 100644 index 00000000..d7ec2ada --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchangerW.mo @@ -0,0 +1,48 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicPlateHeatExchangerW + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger echangeurAPlaques1D1( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Ns=5, + Sc(Q(start=1036))) annotation (Placement(transformation(extent={{-14,6},{6,26}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2(redeclare package Medium = Medium, T0=340) annotation (Placement(transformation(extent={{-74,6},{-54,26}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,-14},{-34,6}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ puitsP2(redeclare package Medium = Medium, Q0=1036) annotation (Placement(transformation(extent={{46,6},{66,26}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP3(redeclare package Medium = Medium) 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=" +Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1
+This model is documented in Sect. 9.6.1.5 of the ThermoSysPro book. +
The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestDynamicPlateHeatExchangerW; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo new file mode 100644 index 00000000..4ffb344c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_FlueGases.mo @@ -0,0 +1,63 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicPlateHeatExchanger_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_c = Properties.Media.FlueGases; + replaceable package Medium_f = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger dynamicPlateHeatExchanger( + redeclare package Medium_c = Medium_c, + redeclare package Medium_f = Medium_f, + Ns=5, + Sp=2, + dynamic_energy_balance=false, + heat_exchange_correlation=0, + pressure_loss_correlation=0, + p_hc=100, + p_hf=100, + p_Kc=1e-4, + p_Kf=1e-4, + Ec(P(start=4500000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sc(P(start=4450000), h(start=2879115.64844), Q(start=117275.047014), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Ef(P(start=300000), h(start=2879115.64844), Q(start=49585.430645), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sf(P(start=100000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + hc(start=fill(2879115.64844, 7)), + hf(start=fill(2879115.64844, 7)), + hbc(start=fill(2879115.64844, 6)), + hbf(start=fill(2879115.64844, 6)), + Tc1(start=fill(573.15, 5)), + Tf1(start=fill(573.15, 5)), + Tc2(start=fill(573.15, 6)), + Tf2(start=fill(573.15, 6)), + Pc(start=linspace(4500000, 4450000, 7)), + Pf(start=linspace(100000, 300000, 7)), + Qc(start=fill(117275.047014, 6)), + Qf(start=fill(49585.430645, 6))) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium_c, + P0=4500000, + T0=573.15, + X0={0.1,0.2,0.3,0.2,0.2}) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium_f, + P0=300000, + T0=573.15, + X0={0.1,0.2,0.3,0.2,0.2}) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + redeclare package Medium = Medium_c, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + redeclare package Medium = Medium_f, + P0=100000, + T0=573.15) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, dynamicPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, dynamicPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicPlateHeatExchanger_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo new file mode 100644 index 00000000..5d28ed67 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicPlateHeatExchanger_Traces.mo @@ -0,0 +1,63 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicPlateHeatExchanger_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.DynamicPlateHeatExchanger dynamicPlateHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Ns=5, + Sp=2, + dynamic_energy_balance=false, + heat_exchange_correlation=0, + pressure_loss_correlation=0, + p_Kc=1e-4, + p_Kf=1e-4, + Ec(P(start=300000), h(start=280050)), + Pc(start=linspace(300000, 100000, 7)), + Pf(start=linspace(100000, 300000, 7)), + Qc(start=fill(1.4e6, 6)), + Qf(start=fill(1.4e6, 6)), + Sc(P(start=100000), h(start=275103), Q(start=1000)), + Ef(P(start=300000), h(start=280104), Q(start=1000)), + Sf(P(start=100000), h(start=280076)), + hc(start={280050,280050,280052,280040,280303,275103,275103}), + hf(start={280076,280104,280154,279724,289301,280000,280000}), + hbc(start={280050,280050,280052,280040,280303,275103}), + hbf(start={280076,280104,280154,279724,289301,280000})) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + P0=300000, + option_temperature=false, + h0=280050, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium, + P0=300000, + option_temperature=false, + h0=280104, + SubC0={0.4,0.5,0.6}) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + redeclare package Medium = Medium, + P0=100000, + option_temperature=false, + h0=275103) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + redeclare package Medium = Medium, + P0=100000, + option_temperature=false, + h0=280076) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, dynamicPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, dynamicPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(dynamicPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicPlateHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo new file mode 100644 index 00000000..986a0e6b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe.mo @@ -0,0 +1,43 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicTwoPhaseFlowPipe + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe( + redeclare package Medium = Medium, + L=10, + D=0.03, + dpfCorr(fixed=false, start=0.2396333653343408)=1, + 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,-48},{40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(Q(start=1, fixed=true)), + option_temperature=false, + h0=800e3, + P0=2000000) annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + option_temperature=false, + h0=2000e3, + P0=19.9e5) annotation (Placement(transformation(extent={{68,-28},{88,-8}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + 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 heatExchangerWall( + 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))); +equation + connect(sourceP.C, dynamicTwoPhaseFlowPipe.C1) annotation (Line(points={{-70,-18},{-42,-18},{-42,-19},{-40,-19}}, color={0,0,255})); + connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{40,-19},{68,-18}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,31.2},{0,20}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{0,4},{0,-10.3}}, color={191,95,0})); + annotation (experiment(StopTime=1500), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicTwoPhaseFlowPipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo new file mode 100644 index 00000000..178c5f8c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowPipe_Traces.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicTwoPhaseFlowPipe_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowPipe dynamicTwoPhaseFlowPipe( + redeclare package Medium = Medium, + L=10, + D=0.03, + C1(SubC(start={0.1})), + C2(SubC(start={0.1})), + dpfCorr(fixed=false, start=0.2396333653343408)=1, + 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,-48},{40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(Q(start=1, fixed=true), SubC(start={0.1})), + option_temperature=false, + h0=800e3, + P0=2000000, + SubC0={0.1}) annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + option_temperature=false, + h0=2000e3, + P0=19.9e5) annotation (Placement(transformation(extent={{70,-28},{90,-8}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource( + 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 heatExchangerWall( + 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))); +equation + connect(sourceP.C, dynamicTwoPhaseFlowPipe.C1) annotation (Line(points={{-70,-18},{-42,-18},{-42,-19},{-40,-19}}, color={0,0,255})); + connect(dynamicTwoPhaseFlowPipe.C2, sinkP.C) annotation (Line(points={{40,-19},{70,-18}}, color={0,0,255})); + connect(heatSource.C, heatExchangerWall.WT2) annotation (Line(points={{0,31.2},{0,20}}, color={191,95,0})); + connect(heatExchangerWall.WT1, dynamicTwoPhaseFlowPipe.CTh) annotation (Line(points={{0,4},{0,-10.3}}, color={191,95,0})); + annotation (experiment(StopTime=1500), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicTwoPhaseFlowPipe_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser.mo new file mode 100644 index 00000000..b3e20adc --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser.mo @@ -0,0 +1,41 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicTwoPhaseFlowRiser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser dynamicTwoPhaseFlowRiser( + redeclare package Medium = Medium, + L=10, + D=0.03, + inertia=false, + Ns=1, + steady_state=false, + option_temperature=false, + h0={800e3}) annotation (Placement(transformation(extent={{-40,-48},{40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(Q(start=1)), + option_temperature=false, + h0=800e3, + P0=2000000) annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + 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}, + W0={2e4}) annotation (Placement(transformation(extent={{-10,31},{10,51}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2( + option_temperature=2, + T0={1000}, + W0={2e4}) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=0))); +equation + connect(sourceP.C, dynamicTwoPhaseFlowRiser.C1) annotation (Line(points={{-70,-18},{-42,-18},{-42,-19},{-40,-19}}, color={0,0,255})); + connect(dynamicTwoPhaseFlowRiser.C2, sinkP.C) annotation (Line(points={{40,-19},{70,-18}}, color={0,0,255})); + connect(heatSource1.C, dynamicTwoPhaseFlowRiser.CTh1) annotation (Line(points={{0,31.2},{0,-7.7}}, color={191,95,0})); + connect(heatSource2.C, dynamicTwoPhaseFlowRiser.CTh2) annotation (Line(points={{0,-50},{0,-33.5}}, color={191,95,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicTwoPhaseFlowRiser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser_Traces.mo new file mode 100644 index 00000000..777fc36f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicTwoPhaseFlowRiser_Traces.mo @@ -0,0 +1,44 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicTwoPhaseFlowRiser_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + + ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser dynamicTwoPhaseFlowRiser( + redeclare package Medium = Medium, + L=10, + D=0.03, + inertia=false, + Ns=1, + steady_state=false, + option_temperature=false, + h0={800e3}, + C1(SubC(start={0.1})), + C2(SubC(start={0.1}))) annotation (Placement(transformation(extent={{-40,-48},{40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(Q(start=1), SubC(start={0.1})), + option_temperature=false, + h0=800e3, + P0=2000000, + SubC0={0.1}) annotation (Placement(transformation(extent={{-90,-28},{-70,-8}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium, + 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}, + W0={2e4}) annotation (Placement(transformation(extent={{-10,31},{10,51}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2( + option_temperature=2, + T0={1000}, + W0={2e4}) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=0))); +equation + connect(sourceP.C, dynamicTwoPhaseFlowRiser.C1) annotation (Line(points={{-70,-18},{-42,-18},{-42,-19},{-40,-19}}, color={0,0,255})); + connect(dynamicTwoPhaseFlowRiser.C2, sinkP.C) annotation (Line(points={{40,-19},{70,-18}}, color={0,0,255})); + connect(heatSource1.C, dynamicTwoPhaseFlowRiser.CTh1) annotation (Line(points={{0,31.2},{0,-7.7}}, color={191,95,0})); + connect(heatSource2.C, dynamicTwoPhaseFlowRiser.CTh2) annotation (Line(points={{0,-50},{0,-33.5}}, color={191,95,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicTwoPhaseFlowRiser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo new file mode 100644 index 00000000..5aab623f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater.mo @@ -0,0 +1,38 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterHeater + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_Cooling = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeater waterHeater( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium_Cooling, + dynamic_energy_balance=true, + dynamic_mass_balance=true, + P0c=2200000, + Vf0=0.43, + pipe_1(h0=fill(9e5, 10), P0=6900000), + pipe_2(h0=fill(1.0e6, 10), P0=6900000), + pipe_3(h0=fill(9e5, 20), P0=6900000), + inertia=false, + volumeC(P0=6900000, P(start=6900000)), + volumeD1(P0=6900000, P(start=6900000)), + volumeD(P0=6900000, P(start=6900000))) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ steamSource(redeclare package Medium = Medium, Q0=10, h0=2.7e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraSource(redeclare package Medium = Medium, Q0=1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,50},{-50,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ condensateSink(redeclare package Medium = Medium, + Q0=10 + 1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ coolingSource(redeclare package Medium = Medium_Cooling, Q0=100, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,-50},{-50,-30}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP coolingSink(redeclare package Medium = Medium_Cooling, + P0=6900000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,10},{-50,30}}))); +equation + connect(steamSource.C, waterHeater.C1vap) annotation (Line(points={{10,60},{0,60},{0,10}}, color={0,0,255})); + connect(extraSource.C, waterHeater.C1) annotation (Line(points={{-50,60},{-6.4,60},{-6.4,9.2}}, color={0,0,255})); + connect(waterHeater.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-36},{0,-60},{-10,-60}}, + color={0,0,255})); + connect(coolingSource.C, waterHeater.Ce1) annotation (Line(points={{-50,-40},{-30,-40},{-30,-4.5},{-10,-4.5}}, color={0,0,255})); + connect(waterHeater.Ce2, coolingSink.C) annotation (Line(points={{-10,4.4},{-30,4.4},{-30,20},{-70,20}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicWaterHeater; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo new file mode 100644 index 00000000..1593241d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterHeaterOnePipe + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_Cooling = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterHeaterOnePipe waterHeater( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium_Cooling, + dynamic_energy_balance=true, + dynamic_mass_balance=true, + P0c=2200000, + Vf0=0.43, + pipe_3(h0=fill(9e5, 20), P0=6900000), + inertia=false, + volumeC(P0=6900000, P(start=6900000)), + volumeD(P0=6900000, P(start=6900000))) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ steamSource(redeclare package Medium = Medium, Q0=10, h0=2.7e6, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ extraSource(redeclare package Medium = Medium, Q0=1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,50},{-50,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ condensateSink(redeclare package Medium = Medium, + Q0=10 + 1e-4, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ coolingSource(redeclare package Medium = Medium_Cooling, Q0=100, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,-50},{-50,-30}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP coolingSink(redeclare package Medium = Medium_Cooling, + P0=6900000, h0=1e5, option_temperature=false) annotation (Placement(transformation(extent={{-70,10},{-50,30}}))); +equation + connect(steamSource.C, waterHeater.C1vap) annotation (Line(points={{10,60},{0,60},{0,10}}, color={0,0,255})); + connect(extraSource.C, waterHeater.C1) annotation (Line(points={{-50,60},{-6.4,60},{-6.4,9.2}}, color={0,0,255})); + connect(waterHeater.C2ex, condensateSink.C) annotation (Line(points={{0,-10},{0,-36},{0,-60},{-10,-60}}, + color={0,0,255})); + connect(coolingSource.C, waterHeater.Ce1) annotation (Line(points={{-50,-40},{-30,-40},{-30,-4.5},{-10,-4.5}}, color={0,0,255})); + connect(waterHeater.Ce2, coolingSink.C) annotation (Line(points={{-10,4.4},{-30,4.4},{-30,20},{-70,20}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicWaterHeaterOnePipe; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe_Traces.mo new file mode 100644 index 00000000..62c252c9 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeaterOnePipe_Traces.mo @@ -0,0 +1,7 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterHeaterOnePipe_Traces + extends TestDynamicWaterHeaterOnePipe( + redeclare package Medium = Properties.Media.WaterSteam, + redeclare package Medium_Cooling = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + coolingSource(SubC0={10})); +end TestDynamicWaterHeaterOnePipe_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater_Traces.mo new file mode 100644 index 00000000..ec38847c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterHeater_Traces.mo @@ -0,0 +1,7 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterHeater_Traces + extends TestDynamicWaterHeater( + redeclare package Medium = Properties.Media.WaterSteam, + redeclare package Medium_Cooling = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + coolingSource(SubC0={10})); +end TestDynamicWaterHeater_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo new file mode 100644 index 00000000..163d83df --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger.mo @@ -0,0 +1,25 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterSteamMultiFluidsHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_1 = Properties.Media.WaterSteam; + replaceable package Medium_2 = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.DynamicWaterSteamMultiFluidsHeatExchanger exchanger( + redeclare package Medium_1 = Medium_1, + redeclare package Medium_2 = Medium_2, + dynamic_energy_balance=false, + dynamic_mass_balance=false, + inertia=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source1(redeclare package Medium = Medium_1, P0=300000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{-10,50},{10,70}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink1(redeclare package Medium = Medium_1, P0=100000, h0=280000, option_temperature=false) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source2(redeclare package Medium = Medium_2, P0=300000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink2(redeclare package Medium = Medium_2, P0=100000, h0=1.2e6, option_temperature=false) annotation (Placement(transformation(extent={{50,-10},{70,10}}))); +equation + connect(source1.C, exchanger.Cfg1) annotation (Line(points={{10,60},{20,60},{20,5},{0,5}}, color={0,0,255})); + connect(exchanger.Cfg2, sink1.C) annotation (Line(points={{0,-5},{0,-32},{0,-60},{-10,-60}}, + color={0,0,255})); + connect(source2.C, exchanger.Cws1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.Cws2, sink2.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + annotation (experiment(StopTime=1), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDynamicWaterSteamMultiFluidsHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces.mo new file mode 100644 index 00000000..ab12229d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces.mo @@ -0,0 +1,8 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces + extends TestDynamicWaterSteamMultiFluidsHeatExchanger( + redeclare package Medium_1 = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + redeclare package Medium_2 = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + source1(SubC0={10}), + source2(SubC0={20})); +end TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo new file mode 100644 index 00000000..79aa47c2 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestFixedPowerHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.FixedPowerHeatExchanger fixedPowerHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + DW=1e6) + annotation (Placement(transformation(extent={{-20,44},{0,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + T0=340) annotation (Placement(transformation(extent={{-70,22},{-50,42}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-58,44},{-38,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkPc( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{40,44},{60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkPf( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,24},{40,44}}, rotation=0))); +equation + connect(sourcePQ.C, fixedPowerHeatExchanger.Ec) annotation (Line(points={{-50,32},{-16,32},{-16,48},{-15.8,48}}, + color={0,0,255})); + connect(sourcePQ1.C, fixedPowerHeatExchanger.Ef) annotation (Line(points={{-38,54},{-20,54}}, color={0,0,255})); + connect(fixedPowerHeatExchanger.Sc, sinkPf.C) annotation (Line(points={{-4.2,48},{-4.2,34},{20,34}}, color={0,0,0})); + connect(fixedPowerHeatExchanger.Sf, sinkPc.C) annotation (Line(points={{-0.2,54.1},{19.9,54.1},{19.9,54},{40,54}}, color={0,0,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestFixedPowerHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo new file mode 100644 index 00000000..84d2f19c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestFixedPowerHeatExchanger_Traces.mo @@ -0,0 +1,17 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestFixedPowerHeatExchanger_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + extends TestFixedPowerHeatExchanger( + redeclare replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1"}, + C_nominal={0.1}, + C_default={0.2}), + sourcePQ1(SubC0={1}), + sourcePQ(SubC0={2})); + + + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestFixedPowerHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater.mo new file mode 100644 index 00000000..f0eea4e3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater.mo @@ -0,0 +1,73 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestNTUWaterHeater + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_e = Properties.Media.WaterSteam; + replaceable package Medium_c = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1( + redeclare package Medium = Medium_e, + Q0=1788.90, + h0=760.83e3, + P0=8270000) annotation (Placement(transformation(extent={{-174,-16},{-154,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium_e) annotation (Placement(transformation(extent={{137,-16},{157,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1( + redeclare package Medium = Medium_c, + option_temperature=false, + P0=17.49e5, + h0=2432.50e3) annotation (Placement(transformation(extent={{-174,84},{-154,104}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{-111,-16},{-91,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss7( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,84},{-90,104}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3( + redeclare package Medium = Medium_c) annotation (Placement(transformation(extent={{136,-75},{156,-55}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss8( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{75,-16},{95,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss9( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{75,-75},{95,-55}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1( + redeclare package Medium_e = Medium_e, + redeclare package Medium_c = Medium_c, + 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=5024, + KPurge=1767, + Sp(h_vol_1(start=780.13e3), h(fixed=true, start=780.13e3)), + lambdaE=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( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,35},{-90,55}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Drain_inlet1( + redeclare package Medium = Medium_c, + 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}}, color={0,0,255})); + 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 (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,-200},{200,200}}))); +end TestNTUWaterHeater; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_FlueGases.mo new file mode 100644 index 00000000..c4b542b3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_FlueGases.mo @@ -0,0 +1,83 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestNTUWaterHeater_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_e = Properties.Media.FlueGases; + replaceable package Medium_c = Properties.Media.WaterSteam; + + parameter Medium_e.MassFraction X0[Medium_e.nX]={0.1,0.2,0.3,0.2,0.2}; + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1( + redeclare package Medium = Medium_e, + Q0=1788.90, + P0=8270000, + option_temperature=true, + T0=573.15, + X0=X0) annotation (Placement(transformation(extent={{-174,-16},{-154,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium_e, + option_temperature=true, + T0=573.15) annotation (Placement(transformation(extent={{137,-16},{157,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1( + redeclare package Medium = Medium_c, + option_temperature=false, + P0=17.49e5, + h0=2432.50e3) annotation (Placement(transformation(extent={{-174,84},{-154,104}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{-111,-16},{-91,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss7( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,84},{-90,104}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3( + redeclare package Medium = Medium_c) annotation (Placement(transformation(extent={{136,-75},{156,-55}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss8( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{75,-16},{95,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss9( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{75,-75},{95,-55}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1( + redeclare package Medium_e = Medium_e, + redeclare package Medium_c = Medium_c, + HeiF(start=2879115.64844), + HDesF(start=2879115.64844), + Hep(start=500000), + SCondDes=5752, + Ee( + P(start=82e5), + h_vol_2(start=2879115.64844), + Q(start=1790), + h(start=2879115.64844), + Xi(start={0.1,0.2,0.3,0.2,0.2})), + Ep(Q(start=118)), + Ev(P(start=27.22e5), h_vol_2(start=2430000)), + KCond=5024, + KPurge=1767, + Sp(h_vol_1(start=780.13e3), h(fixed=true, start=780.13e3)), + lambdaE=67.1, + SPurge=1458, + Se( + h(fixed=true, start=2879115.64844), + P(start=80.19e5, fixed=true), + Xi(start={0.1,0.2,0.3,0.2,0.2}))) annotation (Placement(transformation(extent={{-66,-77},{50,65}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss10( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,35},{-90,55}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Drain_inlet1( + redeclare package Medium = Medium_c, + 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}}, color={0,0,255})); + 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 (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,-200},{200,200}}))); +end TestNTUWaterHeater_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_Traces.mo new file mode 100644 index 00000000..a79a6470 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestNTUWaterHeater_Traces.mo @@ -0,0 +1,85 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestNTUWaterHeater_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_e = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + replaceable package Medium_c = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace4","Trace5","Trace6"}, + C_nominal={0.3,0.4,0.5}, + C_default={0.4,0.5,0.6}); + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ Water_inlet1( + redeclare package Medium = Medium_e, + Q0=1788.90, + h0=760.83e3, + P0=8270000, + SubC0={0.4,0.5,0.6}) + annotation (Placement(transformation(extent={{-174,-16},{-154,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur2( + redeclare package Medium = Medium_e) annotation (Placement(transformation(extent={{137,-16},{157,4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP Steam_inlet1( + redeclare package Medium = Medium_c, + option_temperature=false, + P0=1749000, + h0=2432.50e3, + SubC0={0.4,0.5,0.6}) + annotation (Placement(transformation(extent={{-174,84},{-154,104}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss6( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{-111,-16},{-91,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss7( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,84},{-90,104}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink Puit_condenseur3( + redeclare package Medium = Medium_c) annotation (Placement(transformation(extent={{136,-75},{156,-55}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss8( + redeclare package Medium = Medium_e, + K=1e-4) annotation (Placement(transformation(extent={{75,-16},{95,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss9( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{75,-75},{95,-55}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.NTUWaterHeater nTUWaterHeating1( + redeclare package Medium_e = Medium_e, + redeclare package Medium_c = Medium_c, + 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=5024, + KPurge=1767, + Sp(h_vol_1(start=780.13e3), h(fixed=true, start=780.13e3)), + lambdaE=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( + redeclare package Medium = Medium_c, + K=1e-4) annotation (Placement(transformation(extent={{-110,35},{-90,55}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ Drain_inlet1( + redeclare package Medium = Medium_c, + Q0=118.02, + h0=889.89e3, + SubC0={0.5,0.6,0.7}) + 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}}, color={0,0,255})); + 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 (experiment(StopTime=1000), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-200,-200},{200,200}}))); +end TestNTUWaterHeater_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo new file mode 100644 index 00000000..38586f75 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser.mo @@ -0,0 +1,128 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleDynamicCondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe( + redeclare package Medium = Medium, + K=1e-6, + Q(start=234.2), + rho(start=994.7163, displayUnit="g/cm3"), + C1(P(start=33724.215, displayUnit="bar"))) annotation (Placement(transformation( + origin={-8,-80}, + extent={{-10,-10},{10,10}}, + rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ PuitsRechauffeurEau( + redeclare package Medium = Medium, + Q0=234.2, + h0=137.9e3) annotation (Placement(transformation(extent={{-58,-90},{-78,-70}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe1( + redeclare package Medium = Medium, + K=1e-6, + rho(start=995.2436, displayUnit="g/cm3")) annotation (Placement(transformation( + origin={94,-30}, + extent={{10,-10},{-10,10}}, + rotation=180))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss PerteChargeCondPompe2( + redeclare package Medium = Medium, + K=1e-6, + rho(start=998.6793, displayUnit="g/cm3")) annotation (Placement(transformation( + origin={-22,-30}, + extent={{10,-10},{-10,10}}, + rotation=180))); + ThermoSysPro.Fluid.HeatExchangers.SimpleDynamicCondenser Condenseur( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + D=0.018, + V=26.592685799971978, + A=1.0140805624113665, + lambda=0.01, + ntubes=30000, + gravity_pressure=true, + steady_state=true, + P0=5010, + yNiveau(signal(fixed=false, start=1.5)), + Vf0=0.10, + P(start=4999.0117, + displayUnit="bar"), + rhom(displayUnit="g/cm3", start=997.1903), + xv(start=4.3733834E-09), + /* Steam and condensate flows are both imposed: the steady-state start + leaves the condenser mass undetermined, it is fixed by Vv. */ + Vv(start=23.606508, fixed=true), + xl(start=-3.5873317E-08)) + annotation (Placement(transformation(extent={{14,-46},{70,-6}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source_retourCondensats( + redeclare package Medium = Medium, + P0=25560, + h0=160.7e3, + option_temperature=false, + T(start=311.52)) annotation (Placement(transformation(extent={{-60,70},{-40,90}}))); + ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare package Medium = Medium, h(start=1861385.9)) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={42,40}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP source_autre( + redeclare package Medium = Medium, + P0=82050, + h0=394.5e3, + option_temperature=false, + T(start=367.32)) annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PdC_chaudCond_out(redeclare package Medium = Medium, K=1e-5) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=-90, + origin={42,14}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ source_vapLP( + redeclare package Medium = Medium, + Q0=194.355 - 9.231 - 9.766 - 9.418, + h0=2624.5e3, + option_temperature=false) annotation (Placement(transformation(extent={{-60,110},{-40,130}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ( + redeclare package Medium = Medium, + Q0=7006, + T0=290.68, + h0=113e3, + option_temperature=true) annotation (Placement(transformation(extent={{-72,-40},{-52,-20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsPCaloporteur( + redeclare package Medium = Medium, + T0=302.74, + option_temperature=true) annotation (Placement(transformation(extent={{128,-40},{148,-20}}, rotation=0))); + ThermoSysPro.Fluid.Machines.StodolaTurbine LP4( + redeclare package Medium = Medium, + Cst( + fixed=false, + start=92.838486) = 8000, + eta_is_nom(fixed=false) = 0.8, + Ce(P(fixed=true, start=30000)), + Cs(P(fixed=false, start=5010), h(fixed=true, start=2560.8e3))) annotation (Placement(transformation(extent={{20,110},{40,130}}))); + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve_autre( + redeclare package Medium = Medium, + Cvmax(fixed=false) = 8000, + Q(fixed=true, start=0.1199), + C2(P(start=5010, fixed=false))) annotation (Placement(transformation(extent={{-20,36},{0,56}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante2 annotation (Placement(transformation(extent={{-28,56},{-20,64}}))); + ThermoSysPro.Fluid.PressureLosses.ControlValve controlValve_retourCondensats( + redeclare package Medium = Medium, + Cvmax(fixed=false) = 8000, + C2(P(start=5010, fixed=false))) annotation (Placement(transformation(extent={{-20,76},{0,96}}))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante1 annotation (Placement(transformation(extent={{-28,96},{-20,104}}))); +equation + connect(PerteChargeCondPompe2.C2, Condenseur.Cee) annotation (Line(points={{-12,-30},{4,-30},{4,-30.4},{14,-30.4}}, color={0,0,0})); + connect(PerteChargeCondPompe.C1, Condenseur.Cl) annotation (Line(points={{2,-80},{42.56,-80},{42.56,-46}})); + connect(PerteChargeCondPompe1.C1, Condenseur.Cse) annotation (Line(points={{84,-30},{70,-30}})); + connect(PdC_chaudCond_out.C1, volumeC.Cs) annotation (Line(points={{42,24},{42,30}}, color={0,0,0})); + connect(PdC_chaudCond_out.C2, Condenseur.Cv) annotation (Line(points={{42,4},{42,-6}}, color={0,0,0})); + connect(sourceQ.C, PerteChargeCondPompe2.C1) annotation (Line(points={{-52,-30},{-32,-30}}, color={0,0,0})); + connect(PerteChargeCondPompe1.C2, puitsPCaloporteur.C) annotation (Line(points={{104,-30},{128,-30}}, color={0,0,0})); + connect(LP4.Ce, source_vapLP.C) annotation (Line(points={{19.9,120},{-40,120}}, color={0,0,0})); + connect(LP4.Cs, volumeC.Ce2) annotation (Line(points={{40.1,120},{58,120},{58,40},{52,40}}, color={0,0,0})); + connect(source_autre.C, controlValve_autre.C1) annotation (Line(points={{-40,40},{-20,40}}, color={0,0,0})); + connect(controlValve_autre.C2, volumeC.Ce3) annotation (Line(points={{0,40},{32,40}}, color={0,0,0})); + connect(controlValve_autre.Ouv, constante2.y) annotation (Line(points={{-10,57},{-10,60},{-19.6,60}}, color={0,0,255})); + connect(source_retourCondensats.C, controlValve_retourCondensats.C1) annotation (Line(points={{-40,80},{-20,80}}, color={0,0,0})); + connect(controlValve_retourCondensats.C2, volumeC.Ce1) annotation (Line(points={{0,80},{42,80},{42,50}}, color={0,0,0})); + connect(constante1.y, controlValve_retourCondensats.Ouv) annotation (Line(points={{-19.6,100},{-10,100},{-10,97}}, color={0,0,255})); + connect(PuitsRechauffeurEau.C, PerteChargeCondPompe.C2) annotation (Line(points={{-58,-80},{-18,-80}}, color={0,0,0})); + + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleDynamicCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo new file mode 100644 index 00000000..7460966b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleDynamicCondenser_Traces.mo @@ -0,0 +1,5 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleDynamicCondenser_Traces + extends ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers.TestSimpleDynamicCondenser( + redeclare package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace) annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleDynamicCondenser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases.mo new file mode 100644 index 00000000..9ba63f1a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases.mo @@ -0,0 +1,47 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleEvaporatorWaterSteamFlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater( + redeclare package Medium = Medium, + Q0=10, + C(P(start=2000000)), + h0=300000, + option_temperature=false) annotation (Placement(transformation(extent={{-80,-10},{-60,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkSteam( + redeclare package Medium = Medium, + P0=1900000) annotation (Placement(transformation(extent={{60,-10},{80,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + Q0=50, + C(P(start=300000)), + T0=900, + option_temperature=true, + X0={0.75,0.1,0.1,0.03,0.02}) annotation (Placement(transformation(extent={{-10,70},{10,50}}, rotation=-90, + origin={-60,30}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases( + redeclare package Medium = Medium_FlueGases, + P0=250000) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=-90, + origin={60,-30}))); + ThermoSysPro.Fluid.HeatExchangers.SimpleEvaporatorWaterSteamFlueGases evaporator( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Kdpf=0.02, + Kdpe=0.02, + Cws1(P(start=2000000), h(start=300000)), + Cws2(P(start=1900000), h(start=2800000)), + Cfg1(P(start=300000), h(start=1000000), Xi(start={0.75,0.1,0.1,0.03,0.02})), + Cfg2(P(start=250000), h(start=500000), Xi(start={0.75,0.1,0.1,0.03,0.02}))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourceWater.C, evaporator.Cws1) annotation (Line(points={{-60,0},{-10,0}}, color={0,0,255})); + connect(evaporator.Cws2, sinkSteam.C) annotation (Line(points={{10,0},{60,0}}, color={0,0,255})); + connect(sourceFlueGases.C, evaporator.Cfg1) annotation (Line(points={{0,20},{0,9}}, color={0,0,255})); + connect(evaporator.Cfg2, sinkFlueGases.C) annotation (Line(points={{0,-9},{0,-20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleEvaporatorWaterSteamFlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases_Traces.mo new file mode 100644 index 00000000..ce5c9c42 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleEvaporatorWaterSteamFlueGases_Traces.mo @@ -0,0 +1,48 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleEvaporatorWaterSteamFlueGases_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater( + redeclare package Medium = Medium, + Q0=10, + C(P(start=2000000), SubC(start={0.1})), + h0=300000, + option_temperature=false, + SubC0={0.1}) annotation (Placement(transformation(extent={{-80,-10},{-60,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkSteam(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,-10},{80,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases( + redeclare package Medium = Medium_FlueGases, + Q0=50, + C(P(start=300000), SubC(start={0.3})), + T0=900, + option_temperature=true, + X0={0.75,0.1,0.1,0.03,0.02}, + SubC0={0.3}) annotation (Placement(transformation(extent={{-10,70},{10,50}}, rotation=-90, + origin={-60,30}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases(redeclare package Medium = Medium_FlueGases) annotation (Placement(transformation(extent={{-10,-70},{10,-50}}, rotation=-90, + origin={60,-30}))); + ThermoSysPro.Fluid.HeatExchangers.SimpleEvaporatorWaterSteamFlueGases evaporator( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + Kdpf=0.02, + Kdpe=0.02, + Cws1(P(start=2000000), h(start=300000), SubC(start={0.1})), + Cws2(P(start=1900000), h(start=2800000), SubC(start={0.1})), + Cfg1(P(start=300000), h(start=1000000), Xi(start={0.75,0.1,0.1,0.03,0.02}), SubC(start={0.3})), + Cfg2(P(start=250000), h(start=500000), Xi(start={0.75,0.1,0.1,0.03,0.02}), SubC(start={0.3}))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourceWater.C, evaporator.Cws1) annotation (Line(points={{-60,0},{-10,0}}, color={0,0,255})); + connect(evaporator.Cws2, sinkSteam.C) annotation (Line(points={{10,0},{60,0}}, color={0,0,255})); + connect(sourceFlueGases.C, evaporator.Cfg1) annotation (Line(points={{0,20},{0,9}}, color={0,0,255})); + connect(evaporator.Cfg2, sinkFlueGases.C) annotation (Line(points={{0,-9},{0,-20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleEvaporatorWaterSteamFlueGases_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser.mo new file mode 100644 index 00000000..be8ea3fb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser.mo @@ -0,0 +1,33 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleStaticCondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.SimpleStaticCondenser simpleStaticCondenser( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + 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( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + T0=400) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare package Medium = Medium) 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), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleStaticCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser_Traces.mo new file mode 100644 index 00000000..b18f22c4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSimpleStaticCondenser_Traces.mo @@ -0,0 +1,38 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSimpleStaticCondenser_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1", "Trace2"}, + C_nominal={0.1, 2}, + C_default={0.2, 5}); + + ThermoSysPro.Fluid.HeatExchangers.SimpleStaticCondenser simpleStaticCondenser( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + Ec(h(start=532983.7176868258), SubC(start={10,20})), + Ef(h(start=71016.12237181116), SubC(start={10,20})), + Qc(start=1049.6385508765125), + Qf(start=4469.84281279143), + Sf(h(start=64330.208038325145), SubC(start={10,20}))) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + SubC0={10,20}) annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + T0=400, + SubC0={10,20}) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare package Medium = Medium) 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), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestSimpleStaticCondenser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo new file mode 100644 index 00000000..f3c3ca7b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticAerocondenser.mo @@ -0,0 +1,56 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticAerocondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_Air = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.HeatExchangers.StaticAerocondenser staticAerocondenser( + redeclare package Medium = Medium, + redeclare package Medium_Air = Medium_Air, + Se=10000, + z=0.5, + Ka=1) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ airSource( + redeclare package Medium = Medium_Air, + Q0=1400, + h0=Medium_Air.specificEnthalpy_pTX( + p=100000, + T=293.15, + X=Medium_Air.X_default)) annotation (Placement(transformation(extent={{40,-30},{20,-10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ drainSource( + redeclare package Medium = Medium, + Q0=1, + T0=340, + h0=370000) annotation (Placement(transformation(extent={{-40,-20},{-20,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ steamSource1( + redeclare package Medium = Medium, + Q0=100, + T0=340, + h0=2600000) annotation (Placement(transformation(extent={{-40,10},{-20,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink condensateSink( + redeclare package Medium = Medium, + h0=370000) annotation (Placement(transformation( + extent={{-10,-70},{10,-50}}, + rotation=-90, + origin={60,-50}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP airSink( + redeclare package Medium = Medium_Air, + P0=100000, + T0=293.15) annotation (Placement(transformation( + extent={{40,50},{60,70}}, + rotation=90, + origin={80,-20}))); +equation + connect(airSource.C, staticAerocondenser.Cair1) annotation (Line(points={{20,-20},{9.16667,-20},{9.16667,-9.08333}}, + color={0,0,0})); + connect(drainSource.C, staticAerocondenser.Cw) annotation (Line(points={{-20,-10},{-14,-10},{-14,-7.5},{-9.16667,-7.5}}, color={0,0,0})); + connect(staticAerocondenser.Cws1, steamSource1.C) annotation (Line(points={{0,9.16667},{0,20},{-20,20}}, color={0,0,0})); + connect(staticAerocondenser.Cws2, condensateSink.C) annotation (Line(points={{0,-9.16667},{0,-40}}, color={0,0,0})); + connect(staticAerocondenser.Cair2, airSink.C) annotation (Line(points={{9.16667,9.16667},{20,9.16667},{20,20}}, + color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticAerocondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser.mo new file mode 100644 index 00000000..3dfd512a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser.mo @@ -0,0 +1,89 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticCondenser + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000) + "Flow pressure at inlet 1"; + parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000) + "Flow pressure at inlet 2"; + parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000) + "Flow pressure at inlet 3"; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceCooling( + redeclare package Medium = Medium, + h0=60e3, + Q0(fixed=true)=4000) annotation (Placement(transformation(extent={{-180,0},{-160,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkCooling( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{160,0},{180,20}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticCondenser condenseur( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + 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( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_1, + h0=2.5817e6, + C(Q(fixed=true, start=100))) annotation (Placement(transformation(extent={{-100,140},{-80,160}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_2, + h0=2.5481e6, + C(Q(fixed=true, start=1e-5))) annotation (Placement(transformation(extent={{-182,80},{-162,100}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_3, + h0=2.5055e6, + C(Q(fixed=true, start=1e-5))) annotation (Placement(transformation(extent={{-180,40},{-160,60}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-40,140},{-20,160}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkEx( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{100,-100},{120,-80}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{100,0},{120,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5( + redeclare package Medium = Medium, + 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(sourceCooling.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, sinkCooling.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, sinkEx.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}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCondenser; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI.mo new file mode 100644 index 00000000..2fc01b2a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI.mo @@ -0,0 +1,88 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticCondenserHEI + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + + parameter Units.SI.AbsolutePressure Pin_1(fixed=false, start=20000) + "Flow pressure at inlet 1"; + parameter Units.SI.AbsolutePressure Pin_2(fixed=false, start=20000) + "Flow pressure at inlet 2"; + parameter Units.SI.AbsolutePressure Pin_3(fixed=false, start=20000) + "Flow pressure at inlet 3"; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceCooling( + redeclare package Medium = Medium, + h0=60e3, + Q0(fixed=true)=4000) annotation (Placement(transformation(extent={{-180,0},{-160,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkCooling( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{160,0},{180,20}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticCondenserHEI condenseur( + redeclare package Medium = Medium, + redeclare package Medium_Cooling = Medium, + Kf=0, + z1c=0, + z2c=5, + Qc(start=100), + Qf(start=4000), + Pcond(fixed=false, start=2154.77)) annotation (Placement(transformation(extent={{-20,-16},{72,82}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_1, + h0=2.5817e6, + C(Q(fixed=true, start=100))) annotation (Placement(transformation(extent={{-100,140},{-80,160}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_2, + h0=2.5481e6, + C(Q(fixed=true, start=1e-5))) annotation (Placement(transformation(extent={{-182,80},{-162,100}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP2( + redeclare package Medium = Medium, + option_temperature=false, + P0=Pin_3, + h0=2.5055e6, + C(Q(fixed=true, start=1e-5))) annotation (Placement(transformation(extent={{-180,40},{-160,60}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-100,80},{-80,100}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-100,40},{-80,60}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3( + redeclare package Medium = Medium, + K=10) annotation (Placement(transformation(extent={{-40,140},{-20,160}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkEx( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{100,-100},{120,-80}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4( + redeclare package Medium = Medium, + K=1e-4) annotation (Placement(transformation(extent={{100,0},{120,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5( + redeclare package Medium = Medium, + 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(sourceCooling.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, sinkCooling.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, sinkEx.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}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCondenserHEI; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI_Traces.mo new file mode 100644 index 00000000..adacd0a4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenserHEI_Traces.mo @@ -0,0 +1,14 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticCondenserHEI_Traces + extends TestStaticCondenserHEI( + redeclare package Medium = ThermoSysPro.Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1", "Trace2"}, + C_nominal={0.1, 2}, + C_default={0.2, 5}), + sourceP(SubC0={10,20}), + sourceP1(SubC0={10,20}), + sourceP2(SubC0={10,20}), + sourceCooling(SubC0={10,20}), + condenseur(Cvt(SubC(start={10,20})), Cev(SubC(start={10,20})), Cep(SubC(start={10,20})), Cee(SubC(start={10,20})))); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCondenserHEI_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser_Traces.mo new file mode 100644 index 00000000..b235af11 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticCondenser_Traces.mo @@ -0,0 +1,14 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticCondenser_Traces + extends TestStaticCondenser( + redeclare package Medium = ThermoSysPro.Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1", "Trace2"}, + C_nominal={0.1, 2}, + C_default={0.2, 5}), + sourceP(SubC0={10,20}), + sourceP1(SubC0={10,20}), + sourceP2(SubC0={10,20}), + sourceCooling(SubC0={10,20}), + condenseur(Cvt(SubC(start={10,20})), Cev(SubC(start={10,20})), Cep(SubC(start={10,20})), Cee(SubC(start={10,20})))); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCondenser_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff.mo new file mode 100644 index 00000000..e054d592 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff.mo @@ -0,0 +1,37 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerDTorWorEff + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FF( + redeclare package Medium = Medium, + C(P(start=219e5)), + Q0=481.07, + h0=1067.9e3) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FF( + redeclare package Medium = Medium, + P0=217.68e5) annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FC( + redeclare package Medium = Medium, + 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( + redeclare package Medium = Medium, + P0=24.13e5) annotation (Placement(transformation(extent={{-2,20},{20,40}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff exchangerWaterSteamDTorWorEFF( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + 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), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerDTorWorEff; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_FlueGases.mo new file mode 100644 index 00000000..b41a7281 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_FlueGases.mo @@ -0,0 +1,51 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerDTorWorEff_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + parameter Medium.MassFraction X0[Medium.nX]={0.1,0.2,0.3,0.2,0.2}; + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases_FF( + redeclare package Medium = Medium, + C(P(start=4500000), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Q0=481.07, + option_temperature=true, + T0=573.15, + X0=X0) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases_FF( + redeclare package Medium = Medium, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceFlueGases_FC( + redeclare package Medium = Medium, + C(P(start=300000), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Q0=23.377, + option_temperature=true, + T0=673.15, + X0=X0) annotation (Placement(transformation(origin={-30,30}, extent={{10,-10},{-10,10}}, rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkFlueGases_FC( + redeclare package Medium = Medium, + P0=100000, + T0=573.15) annotation (Placement(transformation(extent={{-2,20},{20,40}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff exchangerFlueGasesDTorWorEFF( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + EffEch=0.8, + Kc=1e-4, + Kf=1e-4, + Ec(P(start=300000), h(start=3379115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sc(P(start=100000), h(start=3200000), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Ef(P(start=4500000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sf(P(start=4450000), h(start=3000000), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Tec(start=673.15), + Tsc(start=640), + Tef(start=573.15), + Tsf(start=600), + exchanger_type=3) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); +equation + connect(sourceFlueGases_FF.C, exchangerFlueGasesDTorWorEFF.Ef) annotation (Line(points={{-40,-10},{-20,-10}}, color={0,0,255})); + connect(exchangerFlueGasesDTorWorEFF.Sf, sinkFlueGases_FF.C) annotation (Line(points={{0,-9.9},{10.2,-9.9},{10.2,-10},{20,-10}}, color={0,0,255})); + connect(sourceFlueGases_FC.C, exchangerFlueGasesDTorWorEFF.Ec) annotation (Line(points={{-20,30},{-14,30},{-14,-5.9}}, color={0,0,255})); + connect(exchangerFlueGasesDTorWorEFF.Sc, sinkFlueGases_FC.C) annotation (Line(points={{-6,-5.9},{-6,30},{-2,30}}, color={0,0,255})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerDTorWorEff_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_Traces.mo new file mode 100644 index 00000000..b39a7964 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerDTorWorEff_Traces.mo @@ -0,0 +1,42 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerDTorWorEff_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FF( + redeclare package Medium = Medium, + C(P(start=219e5)), + Q0=481.07, + h0=1067.9e3, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FF( + redeclare package Medium = Medium, + P0=217.68e5) annotation (Placement(transformation(extent={{20,-20},{40,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWaterSteam_FC( + redeclare package Medium = Medium, + C(P(start=24e5)), + Q0=23.377, + h0=3420.3e3, + SubC0={0.4,0.5,0.6}) annotation (Placement(transformation(origin={-30,30}, extent={{10,-10},{-10,10}}, rotation=180))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkWaterSteam_FC( + redeclare package Medium = Medium, + P0=24.13e5) annotation (Placement(transformation(extent={{-2,20},{20,40}}, rotation=0))); + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff exchangerWaterSteamDTorWorEFF( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + 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), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerDTorWorEff_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS.mo new file mode 100644 index 00000000..19074313 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerKS + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerKS staticExchangerKS( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + K=100, + S=10, + exchanger_conf=1) annotation (Placement(transformation(extent={{-20,44},{0,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + T0=340) annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{40,44},{60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,24},{40,44}}, rotation=0))); +equation + connect(sourcePc.C, staticExchangerKS.Ec) annotation (Line(points={{-60,54},{-20,54},{-20,51}}, color={0,0,255})); + connect(sourcePf.C, staticExchangerKS.Ef) annotation (Line(points={{-40,34},{-20,34},{-20,57}}, color={0,0,255})); + connect(staticExchangerKS.Sc, sinkPc.C) annotation (Line(points={{0,51},{20,51},{20,54},{40,54}}, color={0,0,255})); + connect(staticExchangerKS.Sf, sinkPf.C) annotation (Line(points={{0,57},{6,57},{6,34},{20,34}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerKS; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS_Traces.mo new file mode 100644 index 00000000..be41268e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticExchangerKS_Traces.mo @@ -0,0 +1,34 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticExchangerKS_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.StaticExchangerKS staticExchangerKS( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + K=100, + S=10, + exchanger_conf=1) annotation (Placement(transformation(extent={{-20,44},{0,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + T0=340, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-80,44},{-60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium, + SubC0={0.4,0.5,0.6}) annotation (Placement(transformation(extent={{-60,24},{-40,44}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{40,44},{60,64}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,24},{40,44}}, rotation=0))); +equation + connect(sourcePc.C, staticExchangerKS.Ec) annotation (Line(points={{-60,54},{-20,54},{-20,51}}, color={0,0,255})); + connect(sourcePf.C, staticExchangerKS.Ef) annotation (Line(points={{-40,34},{-20,34},{-20,57}}, color={0,0,255})); + connect(staticExchangerKS.Sc, sinkPc.C) annotation (Line(points={{0,51},{20,51},{20,54},{40,54}}, color={0,0,255})); + connect(staticExchangerKS.Sf, sinkPf.C) annotation (Line(points={{0,57},{6,57},{6,34},{20,34}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticExchangerKS_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger.mo new file mode 100644 index 00000000..ac3044f3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger.mo @@ -0,0 +1,38 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticPlateHeatExchanger + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger staticPlateHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Sp=2, + Ec(P(start=300000), h(start=280e3)), + Sc(P(start=100000), h(start=250e3), Q(start=1000)), + Ef(P(start=300000), h(start=70e3), Q(start=1000)), + Sf(P(start=100000), h(start=200e3)), + Tec(start=340), + Tsc(start=330), + Tef(start=290), + Tsf(start=320), + Tmc(start=335), + Tmf(start=305), + Hmc(start=270e3), + Hmf(start=140e3)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + T0=340) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, staticPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, staticPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticPlateHeatExchanger; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_FlueGases.mo new file mode 100644 index 00000000..b94ad1bd --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_FlueGases.mo @@ -0,0 +1,57 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticPlateHeatExchanger_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium_c = Properties.Media.FlueGases; + replaceable package Medium_f = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger staticPlateHeatExchanger( + redeclare package Medium_c = Medium_c, + redeclare package Medium_f = Medium_f, + Sp=2, + heat_exchange_correlation=0, + pressure_loss_correlation=0, + p_hc=100, + p_hf=100, + p_Kc=1e-4, + p_Kf=1e-4, + Ec(P(start=4500000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sc(P(start=4450000), h(start=2879115.64844), Q(start=117275.047014), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Ef(P(start=300000), h(start=2879115.64844), Q(start=49585.430645), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Sf(P(start=100000), h(start=2879115.64844), Xi(start={0.1,0.2,0.3,0.2,0.2})), + Tec(start=573.15), + Tsc(start=573.15), + Tef(start=573.15), + Tsf(start=573.15), + Tmc(start=573.15), + Tmf(start=573.15), + Hmc(start=2879115.64844), + Hmf(start=2879115.64844)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium_c, + P0=4500000, + T0=573.15, + X0={0.1,0.2,0.3,0.2,0.2}) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium_f, + P0=300000, + T0=573.15, + X0={0.1,0.2,0.3,0.2,0.2}) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc( + redeclare package Medium = Medium_c, + P0=4450000, + T0=573.15) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf( + redeclare package Medium = Medium_f, + P0=100000, + T0=573.15) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, staticPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, staticPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticPlateHeatExchanger_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_Traces.mo new file mode 100644 index 00000000..32cd71d4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticPlateHeatExchanger_Traces.mo @@ -0,0 +1,44 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticPlateHeatExchanger_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + + ThermoSysPro.Fluid.HeatExchangers.StaticPlateHeatExchanger staticPlateHeatExchanger( + redeclare package Medium_c = Medium, + redeclare package Medium_f = Medium, + Sp=2, + Ec(P(start=300000), h(start=280e3)), + Sc(P(start=100000), h(start=250e3), Q(start=1000)), + Ef(P(start=300000), h(start=70e3), Q(start=1000)), + Sf(P(start=100000), h(start=200e3)), + Tec(start=340), + Tsc(start=330), + Tef(start=290), + Tsf(start=320), + Tmc(start=335), + Tmf(start=305), + Hmc(start=270e3), + Hmf(start=140e3)) annotation (Placement(transformation(extent={{-10,30},{10,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePc( + redeclare package Medium = Medium, + T0=340, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-70,30},{-50,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourcePf( + redeclare package Medium = Medium, + SubC0={0.4,0.5,0.6}) annotation (Placement(transformation(extent={{-50,10},{-30,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPc(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{50,30},{70,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkPf(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,10},{50,30}}, rotation=0))); +equation + connect(sourcePc.C, staticPlateHeatExchanger.Ec) annotation (Line(points={{-50,40},{-10,40}}, color={0,0,255})); + connect(sourcePf.C, staticPlateHeatExchanger.Ef) annotation (Line(points={{-30,20},{-5,20},{-5,34}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sc, sinkPc.C) annotation (Line(points={{10,40},{30,40},{50,40}}, color={0,0,255})); + connect(staticPlateHeatExchanger.Sf, sinkPf.C) annotation (Line(points={{5,34},{4,34},{4,20},{30,20}}, color={0,0,255})); + annotation ( + experiment(StopTime=1000), + Icon(coordinateSystem(preserveAspectRatio=false)), + Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticPlateHeatExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_CustomMixture.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_CustomMixture.mo new file mode 100644 index 00000000..85a1472e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_CustomMixture.mo @@ -0,0 +1,54 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticWallFlueGasesExchanger_CustomMixture + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium + extends ThermoSysPro.Properties.Media.PartialSubCMedium(nSubC=nC, isCompressible=true); + extends Modelica.Media.IdealGases.Common.MixtureGasNasa( + mediumName="CustomCombustionGas", + data={Modelica.Media.IdealGases.Common.SingleGasesData.CO2, + Modelica.Media.IdealGases.Common.SingleGasesData.H2O, + Modelica.Media.IdealGases.Common.SingleGasesData.O2, + Modelica.Media.IdealGases.Common.SingleGasesData.N2}, + fluidConstants={Modelica.Media.IdealGases.Common.FluidData.CO2, + Modelica.Media.IdealGases.Common.FluidData.H2O, + Modelica.Media.IdealGases.Common.FluidData.O2, + Modelica.Media.IdealGases.Common.FluidData.N2}, + substanceNames={"CO2","H2O","O2","N2"}, + reference_X={0.12,0.08,0.05,0.75}); + end Medium; + + parameter Integer Ns=3; + parameter Medium.MassFraction X0[Medium.nX]={0.12,0.08,0.05,0.75}; + + ThermoSysPro.Fluid.HeatExchangers.StaticWallFlueGasesExchanger exchanger( + redeclare package Medium = Medium, + Ns=Ns, + DPc=1e-4, + Tp0=500, + C1(P(start=4500000), h(start=700000), Q(start=10), Xi(start={0.12,0.08,0.05,0.75})), + C2(P(start=4450000), h(start=650000), Q(start=10), Xi(start={0.12,0.08,0.05,0.75})), + h(start=fill(700000, Ns + 2)), + hb(start=fill(700000, Ns + 1)), + T1(start=fill(650, Ns)), + T2(start=fill(650, Ns + 1))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ source( + redeclare package Medium = Medium, + P0=4500000, + Q0=10, + option_temperature=true, + T0=650, + X0=X0) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium, + option_temperature=false, + h0=650000) annotation (Placement(transformation(extent={{50,-10},{70,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource wall( + T0=fill(500, Ns), + option_temperature=1) annotation (Placement(transformation(extent={{-10,50},{10,70}}, rotation=0))); +equation + connect(source.C, exchanger.C1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.C2, sink.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + connect(wall.C, exchanger.CTh) annotation (Line(points={{0,50.2},{0,3}}, color={255,127,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticWallFlueGasesExchanger_CustomMixture; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_FlueGases.mo new file mode 100644 index 00000000..0982b5b9 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_FlueGases.mo @@ -0,0 +1,39 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticWallFlueGasesExchanger_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + parameter Integer Ns=3; + parameter Medium.MassFraction X0[Medium.nX]={0.1,0.2,0.3,0.2,0.2}; + + ThermoSysPro.Fluid.HeatExchangers.StaticWallFlueGasesExchanger exchanger( + redeclare package Medium = Medium, + Ns=Ns, + DPc=1e-4, + Tp0=500, + C1(P(start=4500000), h(start=2879115.64844), Q(start=10), Xi(start={0.1,0.2,0.3,0.2,0.2})), + C2(P(start=4450000), h(start=2820000), Q(start=10), Xi(start={0.1,0.2,0.3,0.2,0.2})), + h(start=fill(2879115.64844, Ns + 2)), + hb(start=fill(2879115.64844, Ns + 1)), + T1(start=fill(573.15, Ns)), + T2(start=fill(573.15, Ns + 1))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ source( + redeclare package Medium = Medium, + P0=4500000, + Q0=10, + option_temperature=true, + T0=573.15, + X0=X0) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium, + option_temperature=false, + h0=2820000) annotation (Placement(transformation(extent={{50,-10},{70,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource wall( + T0=fill(500, Ns), + option_temperature=1) annotation (Placement(transformation(extent={{-10,50},{10,70}}, rotation=0))); +equation + connect(source.C, exchanger.C1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.C2, sink.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + connect(wall.C, exchanger.CTh) annotation (Line(points={{0,50.2},{0,3}}, color={255,127,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticWallFlueGasesExchanger_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_Traces.mo new file mode 100644 index 00000000..264cba4b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestStaticWallFlueGasesExchanger_Traces.mo @@ -0,0 +1,53 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestStaticWallFlueGasesExchanger_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases( + extraPropertiesNames={"Trace1","Trace2","Trace3"}, + C_nominal={0.1,0.2,0.3}, + C_default={0.2,0.3,0.4}); + parameter Integer Ns=3; + parameter Medium.MassFraction X0[Medium.nX]={0.1,0.2,0.3,0.2,0.2}; + + ThermoSysPro.Fluid.HeatExchangers.StaticWallFlueGasesExchanger exchanger( + redeclare package Medium = Medium, + Ns=Ns, + DPc=1e-4, + Tp0=500, + C1( + P(start=4500000), + h(start=2879115.64844), + Q(start=10), + Xi(start={0.1,0.2,0.3,0.2,0.2}), + SubC(start={0.1,0.2,0.3})), + C2( + P(start=4450000), + h(start=2820000), + Q(start=10), + Xi(start={0.1,0.2,0.3,0.2,0.2}), + SubC(start={0.1,0.2,0.3})), + h(start=fill(2879115.64844, Ns + 2)), + hb(start=fill(2879115.64844, Ns + 1)), + T1(start=fill(573.15, Ns)), + T2(start=fill(573.15, Ns + 1))) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ source( + redeclare package Medium = Medium, + P0=4500000, + Q0=10, + option_temperature=true, + T0=573.15, + X0=X0, + SubC0={0.1,0.2,0.3}) annotation (Placement(transformation(extent={{-70,-10},{-50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium, + option_temperature=false, + h0=2820000) annotation (Placement(transformation(extent={{50,-10},{70,10}}, rotation=0))); + ThermoSysPro.Thermal.BoundaryConditions.HeatSource wall( + T0=fill(500, Ns), + option_temperature=1) annotation (Placement(transformation(extent={{-10,50},{10,70}}, rotation=0))); +equation + connect(source.C, exchanger.C1) annotation (Line(points={{-50,0},{-10,0}}, color={0,0,255})); + connect(exchanger.C2, sink.C) annotation (Line(points={{10,0},{50,0}}, color={0,0,255})); + connect(wall.C, exchanger.CTh) annotation (Line(points={{0,50.2},{0,3}}, color={255,127,0})); + annotation (experiment(StopTime=1000), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticWallFlueGasesExchanger_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo new file mode 100644 index 00000000..e19b8e06 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG.mo @@ -0,0 +1,114 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSteamGenerator_1SG + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + replaceable package Medium_Primary = Properties.Media.WaterSteam; + + parameter Units.SI.Pressure P_Prim=155e5 annotation (Dialog(group="Primary")); + parameter Units.SI.Temperature Thot_Prim=320 + 273.15 annotation (Dialog(group="Primary")); + parameter Units.SI.Temperature Tcold_Prim=288.8 + 273.15 annotation (Dialog(group="Primary")); + parameter Units.SI.MassFlowRate Q_Prim=5000 "Primary side flow rate per SG" annotation (Dialog(group="Primary")); + + parameter Units.SI.Temperature T_Feedwater=227 + 273.15 annotation (Dialog(group="Secondary")); + parameter Units.SI.SpecificEnthalpy h_Feedwater=977100 annotation (Dialog(group="Secondary")); + parameter Units.SI.MassFlowRate Q_Secondary=520 "Secondary side flow rate per SG" annotation (Dialog(group="Secondary")); + parameter Units.SI.Pressure P_Secondary=67.3e5 annotation (Dialog(group="Secondary")); + + parameter Real K_steam(fixed=false, start=43.9) + "Pressure loss coefficient of the steam line, computed so that the drum level is 1 m (inverse problem)" annotation (Dialog(group="Secondary")); + + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare package Medium = Medium_Primary, Q0=Q_Prim, h0=1.278e6) annotation (Placement(transformation(extent={{60,-44},{80,-24}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium_Primary, + P0=P_Prim, + T0=Thot_Prim, + h0=1.478e6, + option_temperature=false) annotation (Placement(transformation(extent={{-80,-46},{-60,-26}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ1( + redeclare package Medium = Medium, + h0=h_Feedwater, + Q0=Q_Secondary, + option_temperature=false) annotation (Placement(transformation(extent={{100,20},{80,40}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare package Medium = Medium, + h0=2764e3, + option_temperature=false, + P0=P_Secondary) annotation (Placement(transformation(extent={{80,50},{100,70}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1( + redeclare package Medium = Medium, + K=K_steam, + Pm(start=6895125.5), h(start=2771781.2), Q(start=520), rho(start=35.961479)) annotation (Placement(transformation( + origin={50,60}, + extent={{10,-10},{-10,10}}, + rotation=180))); + ThermoSysPro.Fluid.HeatExchangers.SteamGenerator_1SG steamGenerator( + redeclare package Medium = Medium, + redeclare package Medium_Primary = Medium_Primary, + n_tubes=5500, + S=7000, + e_tubes=1.09e-3, + Dext_tubes=19.05e-3, + hcCorr=1.0, + V_sep=12, + L_sep=2.9, + V_Riser=75, + V_Dome=100, + L_Dome=6.3, + V_MixARE=22.5, + K_riser=0.6, + volumeA(dynamic_mass_balance=false), + UtubeHotLeg(Q(start={5000,5000,5000,5000,5000,5000}), state2(p(start={15500000,15470475,15441022,15411612,15382228,15352859})), P(start={15500000,15470475,15441022,15411612,15382228,15352859,15323499}), h(start={1478000,1437996.6,1405566.4,1379131.4,1357572.5,1340007.1,1340007.1}), Tp(start={583.25378,579.10779,575.58075,572.63025,570.18518})), + UtubeColdLeg(Q(start={5000,5000,5000,5000,5000,5000}), state2(p(start={15323499,15322608,15321934,15321431,15321063,15320805})), P(start={15323499,15322608,15321934,15321431,15321063,15320805,15320634}), h(start={1340007.1,1325737.9,1314275.8,1304999.8,1297471.1,1291353.1,1291353.1}), Tp(start={568.18042,566.58685,565.26953,564.18793,563.30261})), + RiserGV(state2(p(start={7102785,7087560,7079207.5,7074296,7070380.5,7066886.5})), P(start={7102785,7087560,7079207.5,7074296,7070380.5,7066886.5,7063601.5}), h(start={1188296.2,1334547.2,1452826.2,1549058.2,1627441.8,1691262.8,1691262.8}), Q(start={1855.46,1855.46,1855.46,1855.46,1855.46,1855.46}), Tp1(start={563.6377,562.93787,562.31647,561.79114,561.35492}), Tp2(start={570.51843,568.78345,567.16504,565.76685,564.59314})), + heatExchangerWall(Tp(start={576.69275,573.78888,571.24512,569.09436,567.30426})), + heatExchangerWall1(Tp(start={565.84009,564.70697,563.74817,562.95319,562.29919})), + DomeGV(Pfond(start=7067494.5), P(start=7060251), hl(start=1270562.4), hv(start=2771781.2), Tp(start=559.56055), zl(fixed=true, start=1.0)), + volumeA(P(start=7105473), h(start=1188296.2)), + volumeA1(P(start=7063601.5), h(start=1691262.8)), + MixAlimDomeGV(P(start=7067079), h(start=1188296.2)), + DPnulle_Tcirc(Pm(start=7104129), h(start=1188296.2), Q(start=1855.46), rho(start=768.50885)), + DPnulle_AlimDwnc(Pm(start=7067079), h(start=977100), Q(start=520), rho(start=835.24182)), + DPnulle_DomeDwnc(Pm(start=7067287), h(start=1270531.6), Q(start=1335.46), rho(start=738.66504)), + DPSeparateurCyclone(Pm(start=7061926), h(start=1691262.8), Q(start=1855.46), rho(start=116.6667)), + DownComerGV(Pm(start=7086276), h(start=1188296.2), rho(start=768.48517), Q(start=1855.46))) annotation (Placement(transformation(extent={{-34,-36},{32,40}}))); + ThermoSysPro.Fluid.Sensors.SensorT SensorT_ThotPrim(redeclare package Medium = Medium_Primary) annotation (Placement(transformation( + origin={-40,-28}, + extent={{-10,-10},{10,10}}, + rotation=0))); + ThermoSysPro.Fluid.Sensors.SensorT SensorT_TcoldPrim(redeclare package Medium = Medium_Primary) annotation (Placement(transformation( + origin={40,-26}, + extent={{-10,-10},{10,10}}, + rotation=0))); + ThermoSysPro.Fluid.Sensors.SensorT SensorT_TARE(redeclare package Medium = Medium, T(start=T_Feedwater)) annotation (Placement(transformation( + origin={50,38}, + extent={{10,-10},{-10,10}}, + rotation=0))); +equation + connect(sinkP1.C, singularPressureLoss1.C2) annotation (Line(points={{80,60},{60,60}})); + connect(singularPressureLoss1.C1, steamGenerator.fluidOutletI) annotation (Line(points={{40,60},{0,60},{0,39.7467},{-1,39.7467}}, color={0,0,255})); + connect(sourceP.C, SensorT_ThotPrim.C1) annotation (Line(points={{-60,-36},{-50,-36}}, color={0,0,255})); + connect(SensorT_ThotPrim.C2, steamGenerator.fluidInlet1) annotation (Line(points={{-29.8,-36},{-12,-36}}, color={0,0,255})); + connect(sinkQ.C, SensorT_TcoldPrim.C2) annotation (Line(points={{60,-34},{50.2,-34}}, color={0,0,255})); + connect(SensorT_TcoldPrim.C1, steamGenerator.fluidOutletI1) annotation (Line(points={{30,-34},{10,-34},{10,-36}}, color={0,0,255})); + connect(sourceQ1.C, SensorT_TARE.C1) annotation (Line(points={{80,30},{60,30}}, color={0,0,255})); + connect(SensorT_TARE.C2, steamGenerator.fluidInlet) annotation (Line(points={{39.8,30},{26,30},{26,29.8667},{10.44,29.8667}}, color={0,0,255})); + annotation (experiment(StopTime=1, Tolerance=1e-6), Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +Fluid counterpart of `ThermoSysPro.Examples.SimpleExamples.TestSteamGenerator_1SG`, with the same parameters and boundary conditions: +primary pressure and enthalpy imposed at the inlet, primary flow rate imposed at the outlet, feedwater flow rate and enthalpy imposed, +steam outlet connected to a pressure sink through a singular pressure loss. + +As in the WaterSteam example, the drum level is imposed (`steamGenerator.DomeGV.zl(fixed=true, start=1.0)`) and the pressure loss +coefficient of the steam line is computed (inverse problem). The computed coefficient is the parameter `K_steam(fixed=false)`, declared +without binding and passed to `singularPressureLoss1`: a `fixed=false` modifier on `singularPressureLoss1.K` itself would keep the +default binding of `K`, which OpenModelica uses as an equation. + +The mass balance of the riser inlet volume `steamGenerator.volumeA` is static (`dynamic_mass_balance=false`), whereas the component +(as the WaterSteam one) uses a dynamic mass balance. At steady state both settings give the same equations (`der(P) = 0` reduces +the dynamic mass balance to `0 = BQ`) and the same solution. They however change the set of states, hence the tearing of the large +nonlinear initialisation system chosen by OpenModelica: without purge flow and with the dynamic mass balance, the torn system is +ill-conditioned (near-null directions along wall temperatures of the tubes) and OpenModelica does not converge, whereas with the static +mass balance it converges to the same steady state as Dymola. `TestSteamGenerator_1SG_Purge` restores the dynamic mass balance. +")); +end TestSteamGenerator_1SG; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Purge.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Purge.mo new file mode 100644 index 00000000..5b0d5b81 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Purge.mo @@ -0,0 +1,19 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSteamGenerator_1SG_Purge + extends TestSteamGenerator_1SG(steamGenerator(volumeA(dynamic_mass_balance=true))); + + parameter Units.SI.MassFlowRate Q_Purges=5.55 "Purge massflowrate per SG" annotation (Dialog(group="Secondary")); + + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ1(redeclare package Medium = Medium, Q0=Q_Purges, h0=1.278e6) annotation (Placement(transformation(extent={{80,-10},{100,10}}))); + ThermoSysPro.Fluid.Sensors.SensorT SensorT_Tpurge(redeclare package Medium = Medium) annotation (Placement(transformation( + origin={58,8}, + extent={{-10,-10},{10,10}}, + rotation=0))); +equation + connect(SensorT_Tpurge.C2, sinkQ1.C) annotation (Line(points={{68.2,0},{80,0}}, color={0,0,255})); + connect(steamGenerator.fluidOutletI_purge, SensorT_Tpurge.C1) annotation (Line(points={{7.8,-20.8},{7.8,-20},{26,-20},{26,0},{48,0}}, color={255,0,0})); + annotation (Documentation(info=" +Fluid counterpart of `ThermoSysPro.Examples.SimpleExamples.TestSteamGenerator_1SG_Purge`: same as `TestSteamGenerator_1SG`, with a purge +flow rate imposed on the purge outlet of the steam generator. +")); +end TestSteamGenerator_1SG_Purge; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo new file mode 100644 index 00000000..60584657 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/TestSteamGenerator_1SG_Traces.mo @@ -0,0 +1,7 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.HeatExchangers; +model TestSteamGenerator_1SG_Traces + extends TestSteamGenerator_1SG( + redeclare package Medium = Properties.Media.WaterSteam, + redeclare package Medium_Primary = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace, + sourceP(SubC0={10})); +end TestSteamGenerator_1SG_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.mo new file mode 100644 index 00000000..0da727b3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package HeatExchangers + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end HeatExchangers; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order new file mode 100644 index 00000000..0465a1fd --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/HeatExchangers/package.order @@ -0,0 +1,60 @@ +TestDynamicOnePhaseFlowPipe +TestDynamicOnePhaseFlowPipe_Traces +TestDynamicOnePhaseFlowPipe_FlueGases +TestDynamicTwoPhaseFlowPipe +TestDynamicTwoPhaseFlowPipe_Traces +TestDynamicTwoPhaseFlowRiser +TestDynamicTwoPhaseFlowRiser_Traces +TestDynamicOnePhaseFlowShell +TestDynamicOnePhaseFlowShell_Traces +TestDynamicOnePhaseFlowShell_FlueGases +TestFixedPowerHeatExchanger +TestFixedPowerHeatExchanger_Traces +TestStaticExchangerKS +TestStaticExchangerKS_Traces +TestStaticExchangerDTorWorEff +TestStaticExchangerDTorWorEff_Traces +TestStaticExchangerDTorWorEff_FlueGases +TestStaticWallFlueGasesExchanger_FlueGases +TestStaticWallFlueGasesExchanger_Traces +TestStaticWallFlueGasesExchanger_CustomMixture +TestStaticPlateHeatExchanger +TestStaticPlateHeatExchanger_Traces +TestStaticPlateHeatExchanger_FlueGases +TestDynamicPlateHeatExchanger +TestDynamicPlateHeatExchanger_Traces +TestDynamicPlateHeatExchanger_FlueGases +TestDynamicPlateHeatExchangerW +TestNTUWaterHeater +TestNTUWaterHeater_Traces +TestNTUWaterHeater_FlueGases +TestSimpleDynamicCondenser +TestSimpleDynamicCondenser_Traces +TestSimpleEvaporatorWaterSteamFlueGases +TestSimpleEvaporatorWaterSteamFlueGases_Traces +TestSimpleStaticCondenser +TestSimpleStaticCondenser_Traces +TestStaticCondenser +TestStaticCondenser_Traces +TestStaticCondenserHEI +TestStaticCondenserHEI_Traces +TestStaticAerocondenser +TestDynamicCondenser +TestDynamicCondenser_Traces +TestDynamicFlueGasesMultiFluidHeatExchanger +TestDynamicFlueGasesMultiFluidHeatExchanger_Traces +TestDynamicMultiFluidHeatExchanger +TestDynamicMultiFluidHeatExchanger_FlueGases +TestDynamicMultiFluidHeatExchanger_Traces +TestDynamicMultiFluidHeatExchangerShell +TestDynamicMultiFluidHeatExchangerShell_FlueGases +TestDynamicMultiFluidHeatExchangerShell_Traces +TestDynamicWaterHeater +TestDynamicWaterHeater_Traces +TestDynamicWaterHeaterOnePipe +TestDynamicWaterHeaterOnePipe_Traces +TestDynamicWaterSteamMultiFluidsHeatExchanger +TestDynamicWaterSteamMultiFluidsHeatExchanger_Traces +TestSteamGenerator_1SG +TestSteamGenerator_1SG_Purge +TestSteamGenerator_1SG_Traces diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2.mo new file mode 100644 index 00000000..8e92ed16 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDeheaterMixer2 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.DeheaterMixer2 deheaterMixer2_1(redeclare package Medium = Medium, Tmax=308) annotation (Placement(transformation(extent={{-10,-16},{10,4}},rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}},rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}},rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-50},{-30,-30}}, + rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-10},{90,10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, T0=310) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source source(redeclare package Medium = Medium, h0=30000) annotation (Placement(transformation(extent={{-90,-50},{-70,-30}},rotation=0))); +equation + connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation (Line(points={{-30,-40},{0.1,-40},{0.1,-16}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(source.C, singularPressureLoss2.C1) annotation (Line(points={{-70,-40},{-50,-40}}, 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=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestDeheaterMixer2; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_FlueGases.mo new file mode 100644 index 00000000..47bc0115 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_FlueGases.mo @@ -0,0 +1,53 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDeheaterMixer2_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.Junctions.DeheaterMixer2 deheaterMixer2_1(redeclare package Medium = Medium, + Tmax=308, + h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-16},{10,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-50},{-30,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, + P0=4500000, + T0=573.15) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source source(redeclare package Medium = Medium, + h0=2.5e6, + option_temperature=false) annotation (Placement(transformation(extent={{-90,-50},{-70,-30}}, rotation=0))); +equation + connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation (Line(points={{-30,-40},{0.1,-40},{0.1,-16}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(source.C, singularPressureLoss2.C1) annotation (Line(points={{-70,-40},{-50,-40}}, 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=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestDeheaterMixer2_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_Traces.mo new file mode 100644 index 00000000..bb783883 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDeheaterMixer2_Traces.mo @@ -0,0 +1,48 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDeheaterMixer2_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.DeheaterMixer2 deheaterMixer2_1(redeclare package Medium = Medium, Tmax=308) annotation (Placement(transformation(extent={{-10,-16},{10,4}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-50},{-30,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP(redeclare package Medium = Medium, T0=310) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source source(redeclare package Medium = Medium, h0=30000) annotation (Placement(transformation(extent={{-90,-50},{-70,-30}}, rotation=0))); +equation + connect(singularPressureLoss.C2, deheaterMixer2_1.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(deheaterMixer2_1.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, color={0,0,255})); + connect(singularPressureLoss2.C2, deheaterMixer2_1.Ce_mix) annotation (Line(points={{-30,-40},{0.1,-40},{0.1,-16}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(source.C, singularPressureLoss2.C1) annotation (Line(points={{-70,-40},{-50,-40}}, 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=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestDeheaterMixer2_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo new file mode 100644 index 00000000..6bb1a642 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDryer + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, h0=2e6) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-14},{10,6}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink_cond(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-40},{50,-20}}))); +equation + connect(sourcePQ.C, steamDryer.Cev) annotation (Line(points={{-30,0},{-9.9,0}}, color={0,0,0})); + connect(sink.C, steamDryer.Csv) annotation (Line(points={{30,0},{9.9,0}}, color={0,0,0})); + connect(steamDryer.Csl, sink_cond.C) annotation (Line(points={{0.1,-14},{0.1,-30},{30,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDryer; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo new file mode 100644 index 00000000..2a58e9b1 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDryer_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, h0=2e6, + SubC0={1}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.Junctions.SteamDryer steamDryer(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-14},{10,6}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink_cond(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-40},{50,-20}}))); +equation + connect(sourcePQ.C, steamDryer.Cev) annotation (Line(points={{-30,0},{-9.9,0}}, color={0,0,0})); + connect(sink.C, steamDryer.Csv) annotation (Line(points={{30,0},{9.9,0}}, color={0,0,0})); + connect(steamDryer.Csl, sink_cond.C) annotation (Line(points={{0.1,-14},{0.1,-30},{30,-30}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestDryer_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces_ApproachToEquilibrium.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces_ApproachToEquilibrium.mo new file mode 100644 index 00000000..087782d2 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestDryer_Traces_ApproachToEquilibrium.mo @@ -0,0 +1,12 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestDryer_Traces_ApproachToEquilibrium + "Steam dryer with a non-volatile trace that does not reach the phase equilibrium" + extends TestDryer_Traces( + steamDryer(redeclare function tracePartition = Medium.approachToEquilibriumPartition(eta=0.5))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +Same configuration as `TestDryer_Traces` (non-volatile trace), but the steam dryer uses the example partition law `Media.WaterSteam_NonVolatileTrace.approachToEquilibriumPartition` with `eta = 0.5` instead of the default `equilibriumPartition`: the inlet traces only reach half of their phase equilibrium. + +At equilibrium (`TestDryer_Traces`) the vapour phase of the inlet carries no trace. Here it carries half of the mixture concentration, so the vapour outlet `sink` receives more trace and the liquid outlet `sink_cond` less. The trace mass balance of the dryer remains exact. +")); +end TestDryer_Traces_ApproachToEquilibrium; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier.mo new file mode 100644 index 00000000..ac220531 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier.mo @@ -0,0 +1,40 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMassFlowMultiplier + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourcePQ.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sink.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, 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=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestMassFlowMultiplier; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_FlueGases.mo new file mode 100644 index 00000000..789689ec --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_FlueGases.mo @@ -0,0 +1,51 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMassFlowMultiplier_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true, + C(h_vol_2(start=2830566))) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium, rho(start=27, displayUnit="kg/m3")) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium, rho(displayUnit="kg/m3", start=27)) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourcePQ.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sink.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, 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=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestMassFlowMultiplier_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_Traces.mo new file mode 100644 index 00000000..623e1b0e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMassFlowMultiplier_Traces.mo @@ -0,0 +1,43 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMassFlowMultiplier_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,-10},{-70,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-10},{90,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.MassFlowMultiplier massFlowMultiplier(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); +equation + connect(sourcePQ.C, singularPressureLoss.C1) annotation (Line(points={{-70,0},{-50,0}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sink.C) annotation (Line(points={{50,0},{70,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, massFlowMultiplier.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,255})); + connect(massFlowMultiplier.Cs, singularPressureLoss1.C1) annotation (Line(points={{10,0},{30,0}}, 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=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestMassFlowMultiplier_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo new file mode 100644 index 00000000..88646025 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2.mo @@ -0,0 +1,26 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer2 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer2_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer2_1.Ialpha1) annotation (Line(points={{-25,0},{-14,0},{-14,6},{-3,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestMixer2; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo new file mode 100644 index 00000000..a89f075e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_FlueGases.mo @@ -0,0 +1,38 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer2_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP( + redeclare package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + P0=4500000, + T0=573.15) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP( + redeclare package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer2_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer2_1.Ialpha1) annotation (Line(points={{-25,0},{-14,0},{-14,6},{-3,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestMixer2_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo new file mode 100644 index 00000000..108d702f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer2_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer2_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium, SubC0={10}) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium, SubC0={20}) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.3) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer2_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer2_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer2_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer2_1.Ialpha1) annotation (Line(points={{-25,0},{-14,0},{-14,6},{-3,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestMixer2_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3.mo new file mode 100644 index 00000000..7161949d --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer3 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.Mixer3 mixer3_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-54,52},{-34,72}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-10},{-26,10}},rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-86,-10},{-66,10}},rotation=0))); +equation + connect(singularPressureLoss1.C2,mixer3_1. Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2,mixer3_1. Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer3_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y,mixer3_1. Ialpha1) annotation (Line(points={{-33,62},{-16,62},{-16,6},{-3,6}})); + connect(sourceQ.C, singularPressureLoss3.C1) annotation (Line(points={{-66,0},{-46,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, mixer3_1.Ce3) annotation (Line(points={{-26,0},{-6,0}}, color={0,0,0})); + annotation (experiment(StopTime=10), Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestMixer3; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_FlueGases.mo new file mode 100644 index 00000000..ed8b978e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_FlueGases.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer3_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.Junctions.Mixer3 mixer3_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium, + P0=4500000, + T0=573.15) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-54,52},{-34,72}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{-86,-10},{-66,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer3_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer3_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer3_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer3_1.Ialpha1) annotation (Line(points={{-33,62},{-16,62},{-16,6},{-3,6}})); + connect(sourceQ.C, singularPressureLoss3.C1) annotation (Line(points={{-66,0},{-46,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, mixer3_1.Ce3) annotation (Line(points={{-26,0},{-6,0}}, color={0,0,0})); + annotation (experiment(StopTime=10), Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestMixer3_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_Traces.mo new file mode 100644 index 00000000..e0839bec --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer3_Traces.mo @@ -0,0 +1,33 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer3_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Mixer3 mixer3_1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{34,-10},{54,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,10},{-26,30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-30},{-26,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Source sourceP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,10},{-66,30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-30},{-66,-10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{74,-10},{94,10}}, rotation=0))); + InstrumentationAndControl.Blocks.Sources.Constante constante(k=0) annotation (Placement(transformation(extent={{-54,52},{-34,72}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-46,-10},{-26,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-86,-10},{-66,10}}, rotation=0))); +equation + connect(singularPressureLoss1.C2, mixer3_1.Ce1) annotation (Line(points={{-26,20},{0,20},{0,10}}, color={0,0,255})); + connect(singularPressureLoss2.C2, mixer3_1.Ce2) annotation (Line(points={{-26,-20},{0,-20},{0,-10}}, color={0,0,255})); + connect(mixer3_1.Cs, singularPressureLoss.C1) annotation (Line(points={{14,0},{34,0}}, color={0,0,255})); + connect(sourceP.C, singularPressureLoss1.C1) annotation (Line(points={{-66,20},{-46,20}}, color={0,0,255})); + connect(sourceP1.C, singularPressureLoss2.C1) annotation (Line(points={{-66,-20},{-46,-20}}, color={0,0,255})); + connect(singularPressureLoss.C2, sinkP.C) annotation (Line(points={{54,0},{74,0}}, color={0,0,255})); + connect(constante.y, mixer3_1.Ialpha1) annotation (Line(points={{-33,62},{-16,62},{-16,6},{-3,6}})); + connect(sourceQ.C, singularPressureLoss3.C1) annotation (Line(points={{-66,0},{-46,0}}, color={0,0,255})); + connect(singularPressureLoss3.C2, mixer3_1.Ce3) annotation (Line(points={{-26,0},{-6,0}}, color={0,0,0})); + annotation (experiment(StopTime=10), Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestMixer3_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo new file mode 100644 index 00000000..b653f8bb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8.mo @@ -0,0 +1,84 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer8 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(h_vol_2(start=71016.12237181116)), + Q(start=1659.0367844064706)) annotation (Placement(transformation(extent={{-104,0},{-84,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + P0=2e5, + Q(start=240.90950915749266)) annotation (Placement(transformation(extent={{-104,-60},{-84,-40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve1( + redeclare package Medium = Medium, + C1(h_vol_2(start=71004.06316721764)), + C2(h_vol_1(start=70977.89042837733)), + Pm(start=120690.8728732298)) annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve2( + redeclare package Medium = Medium, + C1(h_vol_1(start=70921.01678153824)), + Pm(start=118970.64778985853)) annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve3( + redeclare package Medium = Medium, + Q(start=1899.9462935639633), + Pm(start=148922.95104974302, displayUnit="bar")) annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(redeclare package Medium = Medium) 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.PipePressureLoss pipe1(redeclare package Medium = Medium, Pm(start=286222.6050714449, displayUnit="bar")) annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipe2(redeclare package Medium = Medium, Pm(start=199709.4772494724, displayUnit="bar")) annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume2(redeclare package Medium = Medium) 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=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestMixer8; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8_Traces.mo new file mode 100644 index 00000000..c4016de3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestMixer8_Traces.mo @@ -0,0 +1,87 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestMixer8_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + C(h_vol_2(start=71016.12237181116)), + Q(start=1659.0367844064706)) annotation (Placement(transformation(extent={{-104,0},{-84,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP1( + redeclare package Medium = Medium, + P0=2e5, + Q(start=240.90950915749266)) annotation (Placement(transformation(extent={{-104,-60},{-84,-40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve1( + redeclare package Medium = Medium, + C1(h_vol_2(start=71004.06316721764)), + C2(h_vol_1(start=70977.89042837733)), + Pm(start=120690.8728732298)) annotation (Placement(transformation(extent={{-10,6},{10,26}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve2( + redeclare package Medium = Medium, + C1(h_vol_1(start=70921.01678153824)), + Pm(start=118970.64778985853)) annotation (Placement(transformation(extent={{-10,-54},{10,-34}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve valve3( + redeclare package Medium = Medium, + Q(start=1899.9462935639633), + Pm(start=148922.95104974302, displayUnit="bar")) annotation (Placement(transformation(extent={{50,-24},{70,-4}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP2(redeclare package Medium = Medium) 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.PipePressureLoss pipe1(redeclare package Medium = Medium, Pm(start=286222.6050714449, displayUnit="bar")) annotation (Placement(transformation(extent={{-80,0},{-60,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss pipe2(redeclare package Medium = Medium, Pm(start=199709.4772494724, displayUnit="bar")) annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-40,0},{-20,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,-30},{40,-10}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer8 staticVolume2(redeclare package Medium = Medium) 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=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestMixer8_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2.mo new file mode 100644 index 00000000..7558ca29 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2.mo @@ -0,0 +1,26 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter2 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-10},{0,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(redeclare replaceable package Medium = Medium, Q0=200) annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,30},{100,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,-50},{100,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,30},{60,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.2) annotation (Placement(transformation(extent={{-40,10},{-20,30}}, rotation=0))); +equation + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-80,0},{-60,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, splitter2.Ce) annotation (Line(points={{-40,0},{-20,0}}, color={0,0,255})); + connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(points={{-6,10},{-6,40},{40,40}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{60,40},{80,40}}, color={0,0,255})); + connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(points={{-6,-10},{-6,-40},{40,-40}}, color={0,0,255})); + connect(singularPressureLoss2.C2, sinkP1.C) annotation (Line(points={{60,-40},{80,-40}}, color={0,0,255})); + connect(constante.y, splitter2.Ialpha1) annotation (Line(points={{-19,20},{-14,20},{-14,6},{-9,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestSplitter2; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_FlueGases.mo new file mode 100644 index 00000000..9443b946 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_FlueGases.mo @@ -0,0 +1,41 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter2_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-20,-10},{0,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP( + redeclare replaceable package Medium = Medium, + Q0=200, + T0=573.15, + option_temperature=true, + SubC0={3}) annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{80,30},{100,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{80,-50},{100,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,30},{60,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.2) annotation (Placement(transformation(extent={{-40,10},{-20,30}}, rotation=0))); +equation + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-80,0},{-60,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, splitter2.Ce) annotation (Line(points={{-40,0},{-20,0}}, color={0,0,255})); + connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(points={{-6,10},{-6,40},{40,40}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{60,40},{80,40}}, color={0,0,255})); + connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(points={{-6,-10},{-6,-40},{40,-40}}, color={0,0,255})); + connect(singularPressureLoss2.C2, sinkP1.C) annotation (Line(points={{60,-40},{80,-40}}, color={0,0,255})); + connect(constante.y, splitter2.Ialpha1) annotation (Line(points={{-19,20},{-14,20},{-14,6},{-9,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestSplitter2_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_Traces.mo new file mode 100644 index 00000000..84f56024 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter2_Traces.mo @@ -0,0 +1,30 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter2_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-10},{0,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP(redeclare replaceable package Medium = Medium, Q0=200, + SubC0={3}) annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,30},{100,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{80,-50},{100,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,30},{60,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,-50},{60,-30}}, rotation=0))); + ThermoSysPro.InstrumentationAndControl.Blocks.Sources.Constante constante(k=0.2) annotation (Placement(transformation(extent={{-40,10},{-20,30}}, rotation=0))); +equation + connect(sourceP.C, singularPressureLoss.C1) annotation (Line(points={{-80,0},{-60,0}}, color={0,0,255})); + connect(singularPressureLoss.C2, splitter2.Ce) annotation (Line(points={{-40,0},{-20,0}}, color={0,0,255})); + connect(splitter2.Cs1, singularPressureLoss1.C1) annotation (Line(points={{-6,10},{-6,40},{40,40}}, color={0,0,255})); + connect(singularPressureLoss1.C2, sinkP.C) annotation (Line(points={{60,40},{80,40}}, color={0,0,255})); + connect(splitter2.Cs2, singularPressureLoss2.C1) annotation (Line(points={{-6,-10},{-6,-40},{40,-40}}, color={0,0,255})); + connect(singularPressureLoss2.C2, sinkP1.C) annotation (Line(points={{60,-40},{80,-40}}, color={0,0,255})); + connect(constante.y, splitter2.Ialpha1) annotation (Line(points={{-19,20},{-14,20},{-14,6},{-9,6}})); + annotation (experiment(StopTime=10), Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestSplitter2_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3.mo new file mode 100644 index 00000000..4fec417a --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter3 + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.Splitter3 splitter3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-16,-10},{4,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(redeclare package Medium = Medium, Q0=100) annotation (Placement(transformation(extent={{-96,-10},{-76,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-56,-10},{-36,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,30},{104,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,-50},{104,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,30},{64,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(redeclare package Medium = Medium) 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(redeclare package Medium = Medium) 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), + Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1
+This model is documented in Sect. 14.8.5 of the ThermoSysPro book. +
The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestSplitter3; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_FlueGases.mo new file mode 100644 index 00000000..0f66835f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_FlueGases.mo @@ -0,0 +1,41 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter3_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + ThermoSysPro.Fluid.Junctions.Splitter3 splitter3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-16,-10},{4,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(redeclare package Medium = Medium, Q0=100, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-96,-10},{-76,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-56,-10},{-36,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{84,30},{104,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3(redeclare package Medium = Medium, h0=2830566) + annotation (Placement(transformation(extent={{84,-50},{104,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,30},{64,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(redeclare package Medium = Medium) 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(redeclare package Medium = Medium, + P0=4500000, + T0=573.15) 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), + Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1
+This model is documented in Sect. 14.8.5 of the ThermoSysPro book. +
The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestSplitter3_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_Traces.mo new file mode 100644 index 00000000..3da13371 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSplitter3_Traces.mo @@ -0,0 +1,38 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSplitter3_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Junctions.Splitter3 splitter3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-16,-10},{4,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceP1(redeclare package Medium = Medium, Q0=100) annotation (Placement(transformation(extent={{-96,-10},{-76,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-56,-10},{-36,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,30},{104,50}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{84,-50},{104,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss4(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{44,30},{64,50}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss5(redeclare package Medium = Medium) 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(redeclare package Medium = Medium) 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), + Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1
+This model is documented in Sect. 14.8.5 of the ThermoSysPro book. +
The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestSplitter3_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum.mo new file mode 100644 index 00000000..2714cbae --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestStaticDrum + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare package Medium = Medium, 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(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, 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(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(sourcePQ.C, singularPressureLossVALI2.C1) annotation (Line(points={{-70,-80},{-66,-80},{-66,-54},{-84,-54},{-84,-40},{-80,-40}}, color={0,0,0})); + connect(singularPressureLossVALI3.C2, sinkP2.C) annotation (Line(points={{0,60},{60,60}}, color={0,0,0})); + annotation ( + experiment(StopTime=1000), + Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestStaticDrum; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug.mo new file mode 100644 index 00000000..ad146428 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug.mo @@ -0,0 +1,53 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestStaticDrum_Plug + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, 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(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium, P0=3e5) annotation (Placement(transformation(extent={{-26,-90},{-6,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = Medium, Q0=100) annotation (Placement(transformation(extent={{-56,-90},{-36,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.PlugA sourcePlug(redeclare package Medium = Medium, 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(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(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, singularPressureLossVALI2.C1) annotation (Line(points={{-6,-80},{-2,-80},{-2,-56},{-84,-56},{-84,-40},{-80,-40}}, color={0,0,0})); + connect(singularPressureLossVALI3.C2, sinkP2.C) annotation (Line(points={{0,60},{60,60}}, 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=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestStaticDrum_Plug; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo new file mode 100644 index 00000000..9b0035ae --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Plug_Traces.mo @@ -0,0 +1,56 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestStaticDrum_Plug_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, 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(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium, P0=3e5) annotation (Placement(transformation(extent={{-26,-90},{-6,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefQ refQ(redeclare package Medium = Medium, Q0=100) annotation (Placement(transformation(extent={{-56,-90},{-36,-70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.PlugA sourcePlug( + redeclare package Medium = Medium, + SubC0={10}) 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(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(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, singularPressureLossVALI2.C1) annotation (Line(points={{-6,-80},{-2,-80},{-2,-56},{-84,-56},{-84,-40},{-80,-40}}, color={0,0,0})); + connect(singularPressureLossVALI3.C2, sinkP2.C) annotation (Line(points={{0,60},{60,60}}, 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=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestStaticDrum_Plug_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo new file mode 100644 index 00000000..5ff72def --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestStaticDrum_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestStaticDrum_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; + ThermoSysPro.Fluid.Junctions.StaticDrum StaticDrumTh1( + redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-54,0},{-34,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI1(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{0,-10},{20,10}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLossVALI2(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-80,-50},{-60,-30}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkP1(redeclare package Medium = Medium, Q0=10) annotation (Placement(transformation(extent={{40,-10},{60,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare package Medium = Medium, + P0=10000000, + SubC0={10}) 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(redeclare package Medium = Medium, K=1e-4) annotation (Placement(transformation(extent={{-20,50},{0,70}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sinkP2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,50},{80,70}}, 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(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(sourcePQ.C, singularPressureLossVALI2.C1) annotation (Line(points={{-70,-80},{-66,-80},{-66,-54},{-84,-54},{-84,-40},{-80,-40}}, color={0,0,0})); + connect(singularPressureLossVALI3.C2, sinkP2.C) annotation (Line(points={{0,60},{60,60}}, color={0,0,0})); + annotation (experiment(StopTime=1000), Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestStaticDrum_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter.mo new file mode 100644 index 00000000..bb39c918 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSteamExtractionSplitter + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Junctions.SteamExtractionSplitter steamExtractionSplitter(redeclare package Medium = Medium, alpha=0.9) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium, h0=2600000) annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium, P0=100e5) annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium, K=2.e-3) annotation (Placement(transformation(extent={{0,-20},{20,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sink(redeclare package Medium = Medium, 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), + Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestSteamExtractionSplitter; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo new file mode 100644 index 00000000..9a92e0db --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/TestSteamExtractionSplitter_Traces.mo @@ -0,0 +1,27 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Junctions; +model TestSteamExtractionSplitter_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_NonVolatileTrace; + ThermoSysPro.Fluid.Junctions.SteamExtractionSplitter steamExtractionSplitter(redeclare package Medium = Medium, alpha=0.9) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare package Medium = Medium, h0=2600000) annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,20},{-40,40}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sinkP(redeclare package Medium = Medium, P0=100e5) annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss3(redeclare package Medium = Medium, K=2.e-3) annotation (Placement(transformation(extent={{0,-20},{20,0}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkQ sink(redeclare package Medium = Medium, 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), + Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestSteamExtractionSplitter_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo new file mode 100644 index 00000000..659c5137 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Junctions + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end Junctions; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order new file mode 100644 index 00000000..0a0a2573 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Junctions/package.order @@ -0,0 +1,29 @@ +TestDryer +TestDryer_Traces +TestDryer_Traces_ApproachToEquilibrium +TestSplitter2 +TestSplitter2_Traces +TestSplitter2_FlueGases +TestMixer2 +TestMixer2_Traces +TestMixer2_FlueGases +TestDeheaterMixer2 +TestDeheaterMixer2_Traces +TestDeheaterMixer2_FlueGases +TestMassFlowMultiplier +TestMassFlowMultiplier_Traces +TestMassFlowMultiplier_FlueGases +TestMixer3 +TestMixer3_Traces +TestMixer3_FlueGases +TestMixer8 +TestMixer8_Traces +TestSplitter3 +TestSplitter3_Traces +TestSplitter3_FlueGases +TestStaticDrum +TestStaticDrum_Traces +TestStaticDrum_Plug +TestStaticDrum_Plug_Traces +TestSteamExtractionSplitter +TestSteamExtractionSplitter_Traces diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP.mo new file mode 100644 index 00000000..76c078a7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP.mo @@ -0,0 +1,43 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerP + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) 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(redeclare replaceable package Medium = Medium) 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 (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerP; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo new file mode 100644 index 00000000..33e8eb00 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_FlueGases.mo @@ -0,0 +1,54 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerP_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true, + SubC0={3}) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare replaceable package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) 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(redeclare replaceable package Medium = Medium) 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 (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerP_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo new file mode 100644 index 00000000..3a67cdb0 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerP_Traces.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerP_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={3}) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,20},{0,40}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss singularPressureLoss2(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{0,0}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Splitter2 splitter2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-56,0},{-36,20}}, rotation=0))); + ThermoSysPro.Fluid.Junctions.Mixer2 mixer2_1(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{40,0},{60,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) 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(redeclare replaceable package Medium = Medium) 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 (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerP_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo new file mode 100644 index 00000000..c6bf70b7 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerQH.mo @@ -0,0 +1,24 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerQH + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) 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(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, 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(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(volumeA.Ce1, loopBreakerH.C2) annotation (Line(points={{10,-20},{100,-20},{100,10},{50,10}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerQH; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerSubC_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerSubC_Traces.mo new file mode 100644 index 00000000..9661a3bf --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerSubC_Traces.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerSubC_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) 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(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefSubC refSubC(redeclare package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{90,-30},{70,-10}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerSubC loopBreakerSubC(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,-30},{40,-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(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(volumeA.Ce1, loopBreakerSubC.C2) annotation (Line(points={{10,-20},{40,-20}}, color={0,0,0})); + connect(loopBreakerSubC.C1, refSubC.C2) annotation (Line(points={{60,-20},{70,-20}}, color={0,0,0})); + connect(loopBreakerH.C2, refSubC.C1) annotation (Line(points={{50,10},{100,10},{100,-20},{90,-20}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerSubC_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerX_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerX_FlueGases.mo new file mode 100644 index 00000000..c30188a1 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/TestLoopBreakerX_FlueGases.mo @@ -0,0 +1,28 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.LoopBreakers; +model TestLoopBreakerX_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.RefP refP(redeclare package Medium = Medium) 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(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-30,0},{-10,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerQ loopBreakerQ(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{0,0},{20,20}}, rotation=0))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerH loopBreakerH(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,0},{50,20}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.RefT refT(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-60,0},{-40,20}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium, dynamic_energy_balance=false) annotation (Placement(transformation(extent={{10,-30},{-10,-10}}))); + ThermoSysPro.Fluid.BoundaryConditions.RefXgas refXgas(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{62,0},{82,20}}))); + ThermoSysPro.Fluid.LoopBreakers.LoopBreakerXgas loopBreakerXgas(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{64,-30},{44,-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(volumeA.Cs1, refP.C1) annotation (Line(points={{-10,-20},{-100,-20},{-100,10},{-90,10}}, color={0,0,0})); + + connect(refXgas.C1, loopBreakerH.C2) annotation (Line(points={{62,10},{50,10}}, color={0,0,0})); + connect(volumeA.Ce1, loopBreakerXgas.C2) annotation (Line(points={{10,-20},{44,-20}}, color={0,0,0})); + connect(loopBreakerXgas.C1, refXgas.C2) annotation (Line(points={{64,-20},{100,-20},{100,10},{82,10}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestLoopBreakerX_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.mo new file mode 100644 index 00000000..d8e41490 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package LoopBreakers + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end LoopBreakers; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order new file mode 100644 index 00000000..0b1ec3d4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/LoopBreakers/package.order @@ -0,0 +1,6 @@ +TestLoopBreakerP +TestLoopBreakerP_Traces +TestLoopBreakerP_FlueGases +TestLoopBreakerQH +TestLoopBreakerSubC_Traces +TestLoopBreakerX_FlueGases diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCHPEngineBarkantineSystem.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCHPEngineBarkantineSystem.mo new file mode 100644 index 00000000..4b0c3637 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCHPEngineBarkantineSystem.mo @@ -0,0 +1,57 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCHPEngineBarkantineSystem + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1( + redeclare package Medium = Medium, + P0=300000, + h0=293e3, + option_temperature=false) + annotation (Placement(transformation(extent={{-100,20},{-80,40}}, rotation= + 0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1( + redeclare package Medium = Medium, + P0=100000, + T0=360) + annotation (Placement(transformation(extent={{60,20},{80,40}}, rotation=0))); + ThermoSysPro.Fluid.Machines.CHPEngineBarkantineSystem CHPBarkantine( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases) + 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), + 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=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1
+")); +end TestCHPEngineBarkantineSystem; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo new file mode 100644 index 00000000..b306260b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump.mo @@ -0,0 +1,13 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCentrifugalPump + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(centrifugalPump.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(centrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestCentrifugalPump; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo new file mode 100644 index 00000000..9fdeb876 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_FlueGases.mo @@ -0,0 +1,20 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCentrifugalPump_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(centrifugalPump.C2, sink.C) annotation (Line(points={{14,0},{30,0}}, color={0,0,0})); + connect(centrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-6,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestCentrifugalPump_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo new file mode 100644 index 00000000..8387f4d8 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCentrifugalPump_Traces.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCentrifugalPump_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Machines.CentrifugalPump centrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); +equation + connect(centrifugalPump.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(centrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-32,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestCentrifugalPump_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine.mo new file mode 100644 index 00000000..6812d7bb --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCombustionTurbine + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + 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"; + + Fluid.Machines.CombustionTurbine CombustionTurbine( + redeclare package Medium = Medium, + tau_n=0.065, + is_eff_n=is_eff_n1, + Qred=Qred1, + Pe(fixed=true, start=1500000), + Ts(fixed=true, start=830), + Hs(start=769796.2+Medium.h_offset)) annotation (Placement(transformation(extent={{-42,-42},{36,42}}, rotation=0))); + Fluid.BoundaryConditions.SourceQ SourceQ1( + redeclare package Medium = Medium, + option_temperature=true, + X0={1-0.14-0.06-0.06,0.14,0.06,0.06,0}, + Q0=430, + T0=1500) annotation (Placement(transformation(extent={{-106,-10},{-86,10}}, rotation=0))); + Fluid.BoundaryConditions.SinkP SinkP1(redeclare package Medium = Medium, + P0=100000, + T0=830) 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,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), Documentation(info=" +Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1
+This model is documented in Sect. 11.4.5 of the ThermoSysPro book. +
The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestCombustionTurbine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine_Traces.mo new file mode 100644 index 00000000..6dac368b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCombustionTurbine_Traces.mo @@ -0,0 +1,50 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCombustionTurbine_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + 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"; + + Fluid.Machines.CombustionTurbine CombustionTurbine( + redeclare package Medium = Medium, + tau_n=0.065, + is_eff_n=is_eff_n1, + Qred=Qred1, + Pe(fixed=true, start=1500000), + Ts(fixed=true, start=830), + Hs(start=769796.2 + Medium.h_offset)) annotation (Placement(transformation(extent={{-42,-42},{36,42}}, rotation=0))); + Fluid.BoundaryConditions.SourceQ SourceQ1( + redeclare package Medium = Medium, + option_temperature=true, + X0={1 - 0.14 - 0.06 - 0.06,0.14,0.06,0.06,0}, + Q0=430, + T0=1500) annotation (Placement(transformation(extent={{-106,-10},{-86,10}}, rotation=0))); + Fluid.BoundaryConditions.SinkP SinkP1( + redeclare package Medium = Medium, + P0=100000, + T0=830) 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,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), Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1
+This model is documented in Sect. 11.4.5 of the ThermoSysPro book. +
The results reported in the ThermoSysPro book were computed using Dymola. +")); +end TestCombustionTurbine_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor.mo new file mode 100644 index 00000000..345c316c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor.mo @@ -0,0 +1,40 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCompressor + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + parameter Real is_eff_n1(fixed=false, start=0.85) "Nominal isentropic efficiency"; + + ThermoSysPro.Fluid.Machines.Compressor Compressor( + redeclare package Medium = Medium, + 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( + redeclare package Medium = Medium, + X0={1 - 0.003 - 0.23,0.23,0.003,0,0}, + Q0=420, + P0=100000, + T0=288, + option_temperature=true) annotation (Placement(transformation(extent={{-104,-10},{-84,10}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(redeclare package Medium = Medium, 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), Documentation(info=" +
Copyright © EDF 2002 - 2021
+ThermoSysPro Version 4.0
+")); +end TestCompressor; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor_Traces.mo new file mode 100644 index 00000000..e2792641 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestCompressor_Traces.mo @@ -0,0 +1,43 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestCompressor_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + parameter Real is_eff_n1(fixed=false, start=0.85) "Nominal isentropic efficiency"; + + ThermoSysPro.Fluid.Machines.Compressor Compressor( + redeclare package Medium = Medium, + 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( + redeclare package Medium = Medium, + X0={1 - 0.003 - 0.23,0.23,0.003,0,0}, + Q0=420, + P0=100000, + T0=288, + option_temperature=true) annotation (Placement(transformation(extent={{-104,-10},{-84,10}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1(redeclare package Medium = Medium, 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), Documentation(info=" +Copyright © EDF 2002 - 2021
+ThermoSysPro Version 4.0
+")); +end TestCompressor_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestGasTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestGasTurbine.mo new file mode 100644 index 00000000..1d20227f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestGasTurbine.mo @@ -0,0 +1,120 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestGasTurbine + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare package Medium = Medium_FlueGases, + P0=1.013e5, + Q0=600, + T0=29.4 + 273.16, + option_temperature=true, + X0={1 - 0.20994,0.20994,0,0,0}) + annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP sink( + redeclare package Medium = Medium_FlueGases) + 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}}))); + ThermoSysPro.Fluid.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}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ water( + redeclare package Medium = Medium, + Q0=0) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + ThermoSysPro.Fluid.Machines.GasTurbine gasTurbine( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + 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), + He(start=2.5525e6), + Hs(start=3.008e6), + His(start=2.95e6), + Te(start=302.56000000000006), + Tis(start=630.0), + Ts(start=729.0)), + TurbineAgaz( + He(start=4.0e6), + Hs(start=3.24e6), + His(start=3.1e6), + Tis(start=847.0)), + chambreCombustionTAC( + Psf(start=1310000.0), + Tea(start=729.0), + Hsf(start=4.0e6), + Tsf(start=1532.57)), + xAIR( + T(start=302.56000000000006), + 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=" +Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1
+"), + experiment(StopTime=1200)); +end TestGasTurbine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestHeatPumpCompressor.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestHeatPumpCompressor.mo new file mode 100644 index 00000000..d4210dc3 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestHeatPumpCompressor.mo @@ -0,0 +1,55 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestHeatPumpCompressor + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.C3H3F5; + + ThermoSysPro.Fluid.Machines.HeatPumpCompressor Compressor( + redeclare package Medium = Medium, + Pe(fixed=false, start=100000), + Ts(fixed=false, start=680)) + annotation (Placement(transformation(extent={{-52,-52},{48,52}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceQ SourceQ1( + redeclare package Medium = Medium, + Q0=420, + h0=3.e5, + T0=288, + option_temperature=false) + annotation (Placement(transformation(extent={{-104,-10},{-84,10}}, + rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP SinkP1( + redeclare package Medium = Medium, + 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=" +Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1
+")); +end TestHeatPumpCompressor; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestInternalCombustionEngine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestInternalCombustionEngine.mo new file mode 100644 index 00000000..3a722f76 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestInternalCombustionEngine.mo @@ -0,0 +1,93 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestInternalCombustionEngine + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases; + + 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=1) + annotation (Placement(transformation(extent={{-106,-81},{-72,-43}}, + rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceAir( + redeclare package Medium = Medium_FlueGases, + Q0=1.9627, + T0=30 + 273.16, + option_temperature=true, + X0={0.765,0.23,0.005,0,0}, + P0=191000) + annotation (Placement(transformation(extent={{111,-79},{73,-45}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare package Medium = Medium_FlueGases, + option_temperature=true) + annotation (Placement(transformation(extent={{0,44},{44,86}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourceWater( + redeclare package Medium = Medium, + Q0=15.3, + h0=334.41e3, + P0=410000) + annotation (Placement(transformation(extent={{-107,-19},{-71,15}}, rotation=0))); + ThermoSysPro.Fluid.Machines.InternalCombustionEngine internalCombustionEngine( + redeclare package Medium = Medium, + redeclare package Medium_FlueGases = Medium_FlueGases, + 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 sinkWater(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{75,-19},{111,15}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss waterPressureLossIn( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-63,-8},{-51,4}}))); + ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss waterPressureLossOut( + redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{51,-9},{65,5}}))); +equation + connect(internalCombustionEngine.Cair, sourceAir.C) annotation (Line( + points={{0,-41.6},{0,-62},{73,-62}}, + color={0,0,0}, + thickness=1)); + connect(internalCombustionEngine.Cfuel, fuelSourcePQ.C) annotation (Line( + points={{-30.8,-41.6},{-30.8,-62},{-72,-62}}, color={0,0,0})); + connect(sourceWater.C, waterPressureLossIn.C1) + annotation (Line(points={{-71,-2},{-63,-2}}, color={0,0,255})); + connect(internalCombustionEngine.Cws1, waterPressureLossIn.C2) annotation ( + Line(points={{-39.6,-2},{-51,-2}}, color={0,0,255})); + connect(internalCombustionEngine.Cws2, waterPressureLossOut.C1) + annotation (Line(points={{39.6,-2},{48,-2},{51,-2}}, color={0,0,255})); + connect(sinkWater.C, waterPressureLossOut.C2) + annotation (Line(points={{75,-2},{65,-2}}, color={0,0,255})); + connect(internalCombustionEngine.Cfg, sink.C) annotation (Line( + points={{0,37.6},{0,65}}, + color={0,0,0}, + thickness=1)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestInternalCombustionEngine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo new file mode 100644 index 00000000..123ab095 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump.mo @@ -0,0 +1,13 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStaticCentrifugalPump + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(staticCentrifugalPump.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCentrifugalPump; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo new file mode 100644 index 00000000..3e2e9e02 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_FlueGases.mo @@ -0,0 +1,20 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStaticCentrifugalPump_FlueGases + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-6,-10},{14,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink( + redeclare replaceable package Medium = Medium, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=4500000, + T0=573.15, + option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); +equation + connect(staticCentrifugalPump.C2, sink.C) annotation (Line(points={{14,0},{30,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-6,0},{-30,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCentrifugalPump_FlueGases; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo new file mode 100644 index 00000000..9cc25305 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticCentrifugalPump_Traces.mo @@ -0,0 +1,16 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStaticCentrifugalPump_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Machines.StaticCentrifugalPump staticCentrifugalPump(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.3}) annotation (Placement(transformation(extent={{-52,-10},{-32,10}}))); +equation + connect(staticCentrifugalPump.C2, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0})); + connect(staticCentrifugalPump.C1, sourcePQ.C) annotation (Line(points={{-10,0},{-32,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false))); +end TestStaticCentrifugalPump_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo new file mode 100644 index 00000000..d1bc4845 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan.mo @@ -0,0 +1,41 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStaticFan + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases; + + ThermoSysPro.Fluid.Machines.StaticFan Compressor( + redeclare package Medium = Medium, + 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={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1( + redeclare package Medium = Medium, + X0={1-0.006-0.23,0.23,0.006,0,0}, + Q0=4, + P0=130000, + T0=300, + option_temperature=true) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.Sink SinkP1(redeclare package Medium = Medium, + T0=300, + option_temperature=true) annotation (Placement(transformation( + origin={50,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); +equation + connect(Compressor.C2, SinkP1.C) annotation (Line(points={{10,0},{40,0}}, color={0,0,0})); + connect(Compressor.C1, SourceQ1.C) annotation (Line(points={{-10,0},{-40,0}}, color={0,0,0})); + annotation ( Documentation(info=" +Copyright © EDF 2002 - 2021
+ThermoSysPro Version 4.0
+")); +end TestStaticFan; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan_Traces.mo new file mode 100644 index 00000000..acf05608 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStaticFan_Traces.mo @@ -0,0 +1,46 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStaticFan_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + + ThermoSysPro.Fluid.Machines.StaticFan Compressor( + redeclare package Medium = Medium, + 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={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ SourceQ1( + redeclare package Medium = Medium, + SubC0={0.5}, + X0={1 - 0.006 - 0.23,0.23,0.006,0,0}, + Q0=4, + P0=130000, + T0=300, + option_temperature=true) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}, rotation=0))); + + ThermoSysPro.Fluid.BoundaryConditions.Sink SinkP1( + redeclare package Medium = Medium, + T0=300, + option_temperature=true) annotation (Placement(transformation( + origin={50,0}, + extent={{10,-10},{-10,10}}, + rotation=180))); +equation + connect(Compressor.C2, SinkP1.C) annotation (Line(points={{10,0},{40,0}}, color={0,0,0})); + connect(Compressor.C1, SourceQ1.C) annotation (Line(points={{-10,0},{-40,0}}, color={0,0,0})); + annotation (Documentation(info=" +Copyright © EDF 2002 - 2021
+ThermoSysPro Version 4.0
+")); +end TestStaticFan_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo new file mode 100644 index 00000000..6fd8484e --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestSteamEngine + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.Machines.SteamEngine steamEngine1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(redeclare package Medium = Medium, P0=100000) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + h0=3.e6, + option_temperature=false, + P0=1600000) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); +equation + connect(sourceP.C, steamEngine1.C1) annotation (Line(points={{-30,0},{-7,0}}, color={0,0,255})); + connect(steamEngine1.C2, puitsP.C) annotation (Line(points={{7,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), + Documentation(info=" +Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestSteamEngine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo new file mode 100644 index 00000000..20f0d47c --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestSteamEngine_Traces.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestSteamEngine_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.Machines.SteamEngine steamEngine1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP puitsP(redeclare package Medium = Medium, P0=100000) annotation (Placement(transformation(extent={{30,-10},{50,10}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP sourceP( + redeclare package Medium = Medium, + h0=3.e6, + option_temperature=false, + P0=1600000, + SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}, rotation=0))); +equation + connect(sourceP.C, steamEngine1.C1) annotation (Line(points={{-30,0},{-7,0}}, color={0,0,255})); + connect(steamEngine1.C2, puitsP.C) annotation (Line(points={{7,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), + Documentation(info=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestSteamEngine_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo new file mode 100644 index 00000000..ac7159d2 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine.mo @@ -0,0 +1,29 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStodolaTurbine + extends ThermoSysPro.UsersGuide.Icons.Example; + +replaceable package Medium = Properties.Media.WaterSteam; + + ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine( + redeclare replaceable package Medium = Medium, + Cst=4100, + Ps(start=5000), + rhos(start=1.22)) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=300000, + Q0=200, + h0=3e6, + option_temperature=false) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) + annotation (Placement(transformation(extent={{26,-10},{46,10}}))); +equation + connect(sourcePQ.C, stodolaTurbine.Ce) + annotation (Line(points={{-30,0},{-10.1,0}}, color={0,0,0})); + connect(stodolaTurbine.Cs, sink.C) + annotation (Line(points={{10.1,0},{26,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestStodolaTurbine; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine_Traces.mo new file mode 100644 index 00000000..adcb506f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/TestStodolaTurbine_Traces.mo @@ -0,0 +1,31 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Machines; +model TestStodolaTurbine_Traces + extends ThermoSysPro.UsersGuide.Icons.Example; + +replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace1", "Trace2", "Trace3", "Trace4"}, C_nominal={0.1, 0.2, 0.3, 0.4}, C_default={0.2, 0.3, 0.4, 0.5}); + + ThermoSysPro.Fluid.Machines.StodolaTurbine stodolaTurbine( + redeclare replaceable package Medium = Medium, + Cst=4100, + Ps(start=5000), + rhos(start=1.22)) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ( + redeclare replaceable package Medium = Medium, + P0=300000, + Q0=200, + h0=3e6, + SubC0={40,50,60,70}, + option_temperature=false) + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package + Medium = Medium) + annotation (Placement(transformation(extent={{26,-10},{46,10}}))); +equation + connect(sourcePQ.C, stodolaTurbine.Ce) + annotation (Line(points={{-30,0},{-10.1,0}}, color={0,0,0})); + connect(stodolaTurbine.Cs, sink.C) + annotation (Line(points={{10.1,0},{26,0}}, color={0,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end TestStodolaTurbine_Traces; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.mo new file mode 100644 index 00000000..de97f225 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.mo @@ -0,0 +1,4 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples; +package Machines + extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon; +end Machines; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order new file mode 100644 index 00000000..a20912f4 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Machines/package.order @@ -0,0 +1,20 @@ +TestStodolaTurbine +TestStodolaTurbine_Traces +TestStaticCentrifugalPump +TestStaticCentrifugalPump_FlueGases +TestStaticCentrifugalPump_Traces +TestCentrifugalPump +TestCentrifugalPump_FlueGases +TestCentrifugalPump_Traces +TestCombustionTurbine +TestCombustionTurbine_Traces +TestGasTurbine +TestHeatPumpCompressor +TestInternalCombustionEngine +TestCHPEngineBarkantineSystem +TestCompressor +TestCompressor_Traces +TestStaticFan +TestStaticFan_Traces +TestSteamEngine +TestSteamEngine_Traces diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestC3H3F5.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestC3H3F5.mo new file mode 100644 index 00000000..bb2e9ecf --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestC3H3F5.mo @@ -0,0 +1,41 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +model TestC3H3F5 + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium = ThermoSysPro.Properties.Media.C3H3F5; + + parameter Units.SI.AbsolutePressure p = 1e5; + parameter Units.SI.SpecificEnthalpy h = 3e5; + parameter Units.SI.SpecificEntropy s = 1.5e3; + parameter Medium.ThermodynamicState state_ph = Medium.setState_phX(p, h, {1}); + parameter Medium.ThermodynamicState state_ps = Medium.setState_psX(p, s, {1}); + parameter ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph legacy_ph = + ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h); + parameter ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps legacy_ps = + ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p, s); + parameter Real eps = 1e-6; +equation + assert(abs(Medium.temperature(state_ph) - legacy_ph.T) < eps, + "C3H3F5 medium temperature_ph differs from legacy C3H3F5_Ph"); + assert(abs(Medium.density(state_ph) - legacy_ph.d) < eps, + "C3H3F5 medium density_ph differs from legacy C3H3F5_Ph"); + assert(abs(Medium.specificEntropy(state_ph) - legacy_ph.s) < eps, + "C3H3F5 medium specificEntropy differs from legacy C3H3F5_Ph"); + assert(abs(Medium.vapourQuality(state_ph) - legacy_ph.x) < 1e-4, + "C3H3F5 medium vapourQuality differs from legacy C3H3F5_Ph"); + + assert(abs(Medium.temperature(state_ps) - legacy_ps.T) < eps, + "C3H3F5 medium temperature_ps differs from legacy C3H3F5_Ps"); + assert(abs(Medium.density(state_ps) - legacy_ps.d) < eps, + "C3H3F5 medium density_ps differs from legacy C3H3F5_Ps"); + assert(abs(Medium.specificEnthalpy(state_ps) - legacy_ps.h) < eps, + "C3H3F5 medium specificEnthalpy_ps differs from legacy C3H3F5_Ps"); + + assert(abs(Medium.specificInternalEnergy(state_ph) - (h - p/legacy_ph.d)) < eps, + "C3H3F5 medium internal energy does not match legacy Fluid assumption u=h-p/d"); + assert(abs(Medium.density_derh_p(state_ph) + 1e6) < eps, + "C3H3F5 medium density_derh_p does not match legacy Fluid assumption"); + assert(abs(Medium.density_derp_h(state_ph) - 1e-8) < eps, + "C3H3F5 medium density_derp_h does not match legacy Fluid assumption"); + annotation (experiment(StopTime=1)); +end TestC3H3F5; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestDryAirIdealGas.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestDryAirIdealGas.mo new file mode 100644 index 00000000..6335caae --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestDryAirIdealGas.mo @@ -0,0 +1,32 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +model TestDryAirIdealGas + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium = ThermoSysPro.Properties.Media.DryAirIdealGas; + + parameter Units.SI.AbsolutePressure p = 1e5; + parameter Units.SI.Temperature T = 300; + parameter Units.SI.SpecificEnthalpy h = + ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(p, T, 6, 0, 0, 0, 0, 0); + parameter Medium.ThermodynamicState state = Medium.setState_phX(p, h, {1}); + parameter ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas data; + parameter Real eps = 1e-6; +equation + assert(abs(Medium.temperature(state) - + ThermoSysPro.Properties.Fluid.Temperature_Ph(p, h, 6, 0, 0, 0, 0, 0)) < eps, + "DryAirIdealGas medium temperature differs from legacy Fluid wrapper"); + assert(abs(Medium.density(state) - + ThermoSysPro.Properties.Fluid.Density_Ph(p, h, 6, 0, 0, 0, 0, 0)) < eps, + "DryAirIdealGas medium density differs from legacy Fluid wrapper"); + assert(abs(Medium.specificEnthalpy_pTX(p, T, {1}) - h) < eps, + "DryAirIdealGas medium specificEnthalpy_pTX differs from legacy Fluid wrapper"); + assert(abs(Medium.specificInternalEnergy(state) - (h - data.specificGasConstant*Medium.temperature(state))) < eps, + "DryAirIdealGas medium internal energy differs from legacy Fluid assumption"); + assert(abs(Medium.density_derh_p(state) - + ThermoSysPro.Properties.Fluid.Density_derh_Ph(p, h, 6, 0, 0, 0, 0, 0)) < eps, + "DryAirIdealGas medium density_derh_p differs from legacy Fluid wrapper"); + assert(abs(Medium.density_derp_h(state) - + ThermoSysPro.Properties.Fluid.Density_derp_Ph(p, h, 6, 0, 0, 0, 0, 0)) < eps, + "DryAirIdealGas medium density_derp_h differs from legacy Fluid wrapper"); + annotation (experiment(StopTime=1)); +end TestDryAirIdealGas; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestMoltenSalt.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestMoltenSalt.mo new file mode 100644 index 00000000..c6a355da --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestMoltenSalt.mo @@ -0,0 +1,32 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +model TestMoltenSalt + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium = ThermoSysPro.Properties.Media.MoltenSalt; + + parameter Units.SI.AbsolutePressure p = 1e5; + parameter Units.SI.Temperature T = 600; + parameter Units.SI.SpecificEnthalpy h = + ThermoSysPro.Properties.Fluid.SpecificEnthalpy_PT(p, T, 4, 0, 0, 0, 0, 0); + parameter Medium.ThermodynamicState state = Medium.setState_phX(p, h, {1}); + parameter Real eps = 1e-6; +equation + assert(abs(Medium.temperature(state) - + ThermoSysPro.Properties.Fluid.Temperature_Ph(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium temperature differs from legacy Fluid wrapper"); + assert(abs(Medium.density(state) - + ThermoSysPro.Properties.Fluid.Density_Ph(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium density differs from legacy Fluid wrapper"); + assert(abs(Medium.specificEnthalpy_pTX(p, T, {1}) - h) < eps, + "MoltenSalt medium specificEnthalpy_pTX differs from legacy Fluid wrapper"); + assert(abs(Medium.specificInternalEnergy(state) - + ThermoSysPro.Properties.Fluid.SpecificInternalEnergy_Ph_DO_NOT_USE(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium internal energy differs from legacy Fluid assumption"); + assert(abs(Medium.density_derh_p(state) - + ThermoSysPro.Properties.Fluid.Density_derh_Ph(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium density_derh_p differs from legacy Fluid wrapper"); + assert(abs(Medium.density_derp_h(state) - + ThermoSysPro.Properties.Fluid.Density_derp_Ph(p, h, 4, 0, 0, 0, 0, 0)) < eps, + "MoltenSalt medium density_derp_h differs from legacy Fluid wrapper"); + annotation (experiment(StopTime=1)); +end TestMoltenSalt; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestWaterSteamSimple.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestWaterSteamSimple.mo new file mode 100644 index 00000000..d20ae3ca --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/TestWaterSteamSimple.mo @@ -0,0 +1,35 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +model TestWaterSteamSimple + extends ThermoSysPro.UsersGuide.Icons.Example; + + package Medium = ThermoSysPro.Properties.Media.WaterSteamSimple; + + parameter Units.SI.AbsolutePressure p = 1e5; + parameter Units.SI.SpecificEnthalpy h = 3e5; + parameter Units.SI.SpecificEntropy s = 1000; + parameter Medium.ThermodynamicState state_ph = Medium.setState_phX(p, h, {1}); + parameter Medium.ThermodynamicState state_ps = Medium.setState_psX(p, s, {1}); + parameter ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph legacy_ph = + ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ph(p, h, 0); + parameter ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps legacy_ps = + ThermoSysPro.Properties.WaterSteamSimple.SimpleWater.Water_Ps(p, s, 0); + parameter Real eps = 1e-6; +equation + assert(abs(Medium.temperature(state_ph) - legacy_ph.T) < eps, + "WaterSteamSimple medium temperature_ph differs from legacy SimpleWater"); + assert(abs(Medium.density(state_ph) - legacy_ph.d) < eps, + "WaterSteamSimple medium density_ph differs from legacy SimpleWater"); + assert(abs(Medium.specificEntropy(state_ph) - legacy_ph.s) < eps, + "WaterSteamSimple medium entropy differs from legacy SimpleWater"); + assert(abs(Medium.temperature(state_ps) - legacy_ps.T) < eps, + "WaterSteamSimple medium temperature_ps differs from legacy SimpleWater"); + assert(abs(Medium.density(state_ps) - legacy_ps.d) < eps, + "WaterSteamSimple medium density_ps differs from legacy SimpleWater"); + assert(abs(Medium.specificEnthalpy(state_ps) - legacy_ps.h) < eps, + "WaterSteamSimple medium enthalpy_ps differs from legacy SimpleWater"); + assert(abs(Medium.density_derh_p(state_ph) - legacy_ph.ddhp) < eps, + "WaterSteamSimple medium density_derh_p differs from legacy SimpleWater"); + assert(abs(Medium.density_derp_h(state_ph) - legacy_ph.ddph) < eps, + "WaterSteamSimple medium density_derp_h differs from legacy SimpleWater"); + annotation (experiment(StopTime=1)); +end TestWaterSteamSimple; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo new file mode 100644 index 00000000..2c371330 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Media/WaterSteam_FullyVolatileTrace/package.mo @@ -0,0 +1,17 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Media; +package WaterSteam_FullyVolatileTrace "Water/steam carrying one fully volatile trace" + extends Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2}); + + redeclare function relativeVolatility "Fully volatile trace: it goes to the vapour phase" + extends partialRelativeVolatility; + algorithm + RV := fill(1e6, nSubC); + end relativeVolatility; + + annotation (Documentation(info=" +
Water/steam with one trace that goes entirely to the vapour phase. The exact
+limit, Cl = 0 and Cg = SubC/x, corresponds to an infinite
+relative volatility; relativeVolatility = 1e6 reproduces it to better
+than 0.1 % as soon as the vapour mass fraction exceeds 1e-3.
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestTankHorizontal_Traces_withPipePressureLosses; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_withPipePressureLosses.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_withPipePressureLosses.mo new file mode 100644 index 00000000..b8ff2542 --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTankHorizontal_withPipePressureLosses.mo @@ -0,0 +1,61 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTankHorizontal_withPipePressureLosses + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1( + redeclare package Medium = Medium, + K=1.5, + Q(start=5282.482640023983), + rho(start=997.40780979054, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1( + redeclare package Medium = Medium, + Pm(start=21741.77302868171, displayUnit="bar"), + Q(start=-1.3278998585228342E-31)) annotation (Placement(transformation(extent={{-50,2},{-30,22}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,-4},{-70,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-50},{90,-30}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.TankHorizontal Tank1( + redeclare package Medium = Medium, + z(fixed=false, start=1), + Cs1(Q(start=1.2116903504194741E-27)), + Cs2(P(start=3.2e5)), + rho(start=997.4119292829444, displayUnit="g/cm3")) 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.PipePressureLoss PerteDP2( + redeclare package Medium = Medium, + K=1.5, + rho(start=997.33695032119, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-4},{50,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2(redeclare package Medium = Medium) 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,-5},{20,-5},{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},{-20,5},{-10,5}}, color={0,0,255})); + connect(Tank1.Cs1, PerteDP2.C1) annotation (Line(points={{10.2,4.9},{20,4.9},{20,6},{30,6}}, color={0,0,255})); + connect(PerteDP2.C2, PuitsP2.C) annotation (Line(points={{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=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestTankHorizontal_withPipePressureLosses; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_Traces_withPipePressureLosses.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_Traces_withPipePressureLosses.mo new file mode 100644 index 00000000..0107dd5f --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_Traces_withPipePressureLosses.mo @@ -0,0 +1,66 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTank_Traces_withPipePressureLosses + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam ( + extraPropertiesNames={"Trace"}, + C_nominal={0.1}, + C_default={0.2}); + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1( + redeclare package Medium = Medium, + K=1.5, + Q(start=5282.482640023983), + rho(start=997.40780979054, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1( + redeclare package Medium = Medium, + Pm(start=21741.77302868171, displayUnit="bar"), + Q(start=-1.3278998585228342E-31)) annotation (Placement(transformation(extent={{-50,2},{-30,22}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1(redeclare package Medium = Medium, SubC0={0.3}) + annotation (Placement(transformation(extent={{-90,-4},{-70,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-50},{90,-30}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.Tank Tank1( + redeclare package Medium = Medium, + SubC(start={0.9}), + z(fixed=false, start=5), + Cs1(Q(start=1.2116903504194741E-27)), + Cs2(P(start=3.2e5)), + rho(start=997.4119292829444, displayUnit="g/cm3")) 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.PipePressureLoss PerteDP2( + redeclare package Medium = Medium, + K=1.5, + rho(start=997.33695032119, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-4},{50,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2(redeclare package Medium = Medium) 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=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1 +")); +end TestTank_Traces_withPipePressureLosses; diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_withPipePressureLosses.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_withPipePressureLosses.mo new file mode 100644 index 00000000..24010d0b --- /dev/null +++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTank_withPipePressureLosses.mo @@ -0,0 +1,61 @@ +within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes; +model TestTank_withPipePressureLosses + extends ThermoSysPro.UsersGuide.Icons.Example; + + replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam; + ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1( + redeclare package Medium = Medium, + K=1.5, + Q(start=5282.482640023983), + rho(start=997.40780979054, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-50},{50,-30}}, rotation=0))); + ThermoSysPro.Fluid.PressureLosses.ControlValve VanneReglante1( + redeclare package Medium = Medium, + Pm(start=21741.77302868171, displayUnit="bar"), + Q(start=-1.3278998585228342E-31)) annotation (Placement(transformation(extent={{-50,2},{-30,22}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SourceP SourceP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-90,-4},{-70,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{70,-50},{90,-30}}, rotation=0))); + ThermoSysPro.Fluid.Volumes.Tank Tank1( + redeclare package Medium = Medium, + z(fixed=false, start=5), + Cs1(Q(start=1.2116903504194741E-27)), + Cs2(P(start=3.2e5)), + rho(start=997.4119292829444, displayUnit="g/cm3")) 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.PipePressureLoss PerteDP2( + redeclare package Medium = Medium, + K=1.5, + rho(start=997.33695032119, displayUnit="g/cm3")) annotation (Placement(transformation(extent={{30,-4},{50,16}}, rotation=0))); + ThermoSysPro.Fluid.BoundaryConditions.SinkP PuitsP2(redeclare package Medium = Medium) 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=" +
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1
+"));
+end TestTank_withPipePressureLosses;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity.mo
new file mode 100644
index 00000000..59e389cc
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity.mo
@@ -0,0 +1,60 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestTwoPhaseCavity
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam;
+
+ ThermoSysPro.Fluid.Volumes.TwoPhaseCavity cavity(
+ redeclare package Medium = Medium,
+ steady_state=false,
+ P0=13000000,
+ P(start=13000000, fixed=true),
+ hl(start=1454400),
+ hv(start=2.658e6),
+ xv(start=0.01),
+ rhol(start=670),
+ rhov(start=78),
+ Ns=1,
+ Vf0=0.5,
+ Cal_hconv=false) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0)));
+
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater(
+ redeclare package Medium = Medium,
+ Q0=1,
+ h0=1454400) annotation (Placement(transformation(extent={{-90,20},{-70,40}}, rotation=0)));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteam(
+ redeclare package Medium = Medium,
+ Q0=1,
+ h0=2.8e6) annotation (Placement(transformation(extent={{-60,50},{-40,70}}, rotation=0)));
+ ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkWater(
+ redeclare package Medium = Medium,
+ Q0=2) annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}, rotation=0)));
+
+ ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
+ option_temperature=2,
+ W0={1e5}) annotation (Placement(transformation(extent={{60,-70},{80,-50}}, rotation=0)));
+ ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(
+ option_temperature=2,
+ W0={1e5}) annotation (Placement(transformation(extent={{70,0},{90,20}}, rotation=0)));
+ ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource3a(
+ T0={293.15,293.15},
+ option_temperature=2,
+ W0={1e5,1e5})
+ annotation (Placement(transformation(extent={{70,50},{90,70}}, rotation=0)));
+equation
+ cavity.Cth3[3:2*cavity.Ns].W = fill(0, 2*cavity.Ns - 2);
+ connect(sourceWater.C, cavity.Ce) annotation (Line(points={{-70,30},{-40,30},{-40,32},{-1.66667,32}},
+ color={0,0,0}));
+ connect(sourceSteam.C, cavity.Cv) annotation (Line(points={{-40,60},{10.3333,60},{10.3333,32}},
+ color={0,0,0}));
+ connect(cavity.Cl, sinkWater.C) annotation (Line(points={{10.3333,-12},{10.3333,-50},{-90,-50}},
+ color={0,0,0}));
+ connect(heatSource1.C, cavity.Cth1) annotation (Line(points={{70,-69.8},{20,-69.8},{20,-5.3},{10.1667,-5.3}},color={255,0,0}));
+ connect(heatSource2.C, cavity.Cth2) annotation (Line(points={{80,0.2},{42,0.2},{42,25.1},{10.1667,25.1}},
+ color={255,0,0}));
+ connect(cavity.Cth3, heatSource3a.C) annotation (Line(points={{10.1667,10.6},{58,10.6},{58,50.2},{80,50.2}}, color={255,0,0}));
+ annotation (
+ experiment(StopTime=1000),
+ Icon(coordinateSystem(preserveAspectRatio=false)),
+ Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}})));
+end TestTwoPhaseCavity;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe.mo
new file mode 100644
index 00000000..b435abf8
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe.mo
@@ -0,0 +1,57 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestTwoPhaseCavityOnePipe
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam;
+
+ ThermoSysPro.Fluid.Volumes.TwoPhaseCavityOnePipe cavity(
+ redeclare package Medium = Medium,
+ steady_state=false,
+ P0=13000000,
+ P(start=13000000, fixed=true),
+ hl(start=1454400),
+ hv(start=2.658e6),
+ hvIn(start=2.8e6),
+ xv(start=0.01),
+ rhol(start=670),
+ rhov(start=78),
+ Ns=2,
+ Vf0=0.5,
+ Cal_hcond=false) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0)));
+
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater(
+ redeclare package Medium = Medium,
+ Q0=1,
+ h0=1454400) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteamBP(
+ redeclare package Medium = Medium,
+ Q0=1,
+ h0=2.8e6) annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0)));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteamGCT(
+ redeclare package Medium = Medium,
+ Q0=1,
+ h0=2.8e6) annotation (Placement(transformation(extent={{-110,50},{-90,70}}, rotation=0)));
+ ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkWater(
+ redeclare package Medium = Medium,
+ Q0=3) annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}, rotation=0)));
+
+ ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+ T0={293.15, 293.15},
+ option_temperature=2,
+ W0={1e5, 1e5}) annotation (Placement(transformation(extent={{70,30},{90,50}}, rotation=0)));
+equation
+ connect(sourceWater.C, cavity.Ce) annotation (Line(points={{-80,10},{-26,10},{-26,25.8},{-12.971,25.8}},
+ color={0,0,0}));
+ connect(sourceSteamBP.C, cavity.CvBP) annotation (Line(points={{-60,60},{9.82857,60},{9.82857,32}},
+ color={0,0,0}));
+ connect(sourceSteamGCT.C, cavity.CvGCT) annotation (Line(points={{-90,60},{-84,60},{-84,46},{-2.857,46},{-2.857,32}},
+ color={0,0,0}));
+ connect(cavity.Cl, sinkWater.C) annotation (Line(points={{10,-12},{10,-34},{-94,-34},{-94,-50},{-90,-50}},
+ color={0,0,0}));
+ connect(cavity.Cth3, heatSource.C) annotation (Line(points={{9.82857,21.2},{50,21.2},{50,30.2},{80,30.2}},
+ color={255,0,0}));
+ annotation (
+ experiment(StopTime=1000),
+ Icon(coordinateSystem(preserveAspectRatio=false)),
+ Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}})));
+end TestTwoPhaseCavityOnePipe;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo
new file mode 100644
index 00000000..b45fa58d
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavityOnePipe_Traces.mo
@@ -0,0 +1,62 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestTwoPhaseCavityOnePipe_Traces
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace;
+
+ ThermoSysPro.Fluid.Volumes.TwoPhaseCavityOnePipe cavity(
+ redeclare package Medium = Medium,
+ steady_state=false,
+ P0=13000000,
+ P(start=13000000, fixed=true),
+ hl(start=1454400),
+ hv(start=2.658e6),
+ hvIn(start=2.8e6),
+ xv(start=0.01),
+ rhol(start=670),
+ rhov(start=78),
+ Ns=2,
+ Vf0=0.5,
+ Cal_hcond=false,
+ SubCl0={1},
+ SubCv0={10}) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0)));
+
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater(
+ redeclare package Medium = Medium,
+ Q0=1,
+ h0=1454400,
+ SubC0={1}) annotation (Placement(transformation(extent={{-100,0},{-80,20}}, rotation=0)));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteamBP(
+ redeclare package Medium = Medium,
+ Q0=1,
+ h0=2.8e6,
+ SubC0={10}) annotation (Placement(transformation(extent={{-80,50},{-60,70}}, rotation=0)));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteamGCT(
+ redeclare package Medium = Medium,
+ Q0=1,
+ h0=2.8e6,
+ SubC0={10}) annotation (Placement(transformation(extent={{-110,50},{-90,70}}, rotation=0)));
+ ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkWater(
+ redeclare package Medium = Medium, Q0=3)
+ annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}, rotation=0)));
+
+ ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource(
+ T0={293.15, 293.15},
+ option_temperature=2,
+ W0={1e5, 1e5}) annotation (Placement(transformation(extent={{70,30},{90,50}}, rotation=0)));
+equation
+ connect(sourceWater.C, cavity.Ce) annotation (Line(points={{-80,10},{-26,10},{-26,25.8},{-12.971,25.8}},
+ color={0,0,0}));
+ connect(sourceSteamBP.C, cavity.CvBP) annotation (Line(points={{-60,60},{9.82857,60},{9.82857,32}},
+ color={0,0,0}));
+ connect(sourceSteamGCT.C, cavity.CvGCT) annotation (Line(points={{-90,60},{-84,60},{-84,46},{-2.857,46},{-2.857,32}},
+ color={0,0,0}));
+ connect(cavity.Cl, sinkWater.C) annotation (Line(points={{10,-12},{10,-34},{-94,-34},{-94,-50},{-90,-50}},
+ color={0,0,0}));
+ connect(cavity.Cth3, heatSource.C) annotation (Line(points={{9.82857,21.2},{50,21.2},{50,30.2},{80,30.2}},
+ color={255,0,0}));
+ annotation (
+ experiment(StopTime=1000),
+ Icon(coordinateSystem(preserveAspectRatio=false)),
+ Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}})));
+end TestTwoPhaseCavityOnePipe_Traces;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo
new file mode 100644
index 00000000..23e07a38
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseCavity_Traces.mo
@@ -0,0 +1,64 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestTwoPhaseCavity_Traces
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace;
+
+ ThermoSysPro.Fluid.Volumes.TwoPhaseCavity cavity(
+ redeclare package Medium = Medium,
+ steady_state=false,
+ P0=13000000,
+ P(start=13000000, fixed=true),
+ hl(start=1454400),
+ hv(start=2.658e6),
+ xv(start=0.01),
+ rhol(start=670),
+ rhov(start=78),
+ Ns=1,
+ Vf0=0.5,
+ Cal_hconv=false,
+ SubCl0={0},
+ SubCv0={0}) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0)));
+
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceWater(
+ redeclare package Medium = Medium,
+ Q0=1,
+ h0=1454400,
+ SubC0={0}) annotation (Placement(transformation(extent={{-90,20},{-70,40}}, rotation=0)));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceSteam(
+ redeclare package Medium = Medium,
+ Q0=1,
+ h0=2.8e6,
+ SubC0={10}) annotation (Placement(transformation(extent={{-60,50},{-40,70}}, rotation=0)));
+ ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkWater(
+ redeclare package Medium = Medium,
+ Q0=2) annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}, rotation=0)));
+
+ ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource1(
+ option_temperature=2,
+ W0={1e5}) annotation (Placement(transformation(extent={{60,-70},{80,-50}}, rotation=0)));
+ ThermoSysPro.Thermal.BoundaryConditions.HeatSource heatSource2(
+ option_temperature=2,
+ W0={1e5}) annotation (Placement(transformation(extent={{70,0},{90,20}}, rotation=0)));
+ Thermal.BoundaryConditions.HeatSource heatSource3a(
+ T0={293.15,293.15},
+ option_temperature=2,
+ W0={1e5,1e5})
+ annotation (Placement(transformation(extent={{68,56},{88,76}}, rotation=0)));
+equation
+ cavity.Cth3[3:2*cavity.Ns].W = fill(0, 2*cavity.Ns - 2);
+ connect(sourceWater.C, cavity.Ce) annotation (Line(points={{-70,30},{-40,30},{-40,32},{-1.66667,32}},
+ color={0,0,0}));
+ connect(sourceSteam.C, cavity.Cv) annotation (Line(points={{-40,60},{10.3333,60},{10.3333,32}},
+ color={0,0,0}));
+ connect(cavity.Cl, sinkWater.C) annotation (Line(points={{10.3333,-12},{10.3333,-50},{-90,-50}},
+ color={0,0,0}));
+ connect(heatSource1.C, cavity.Cth1) annotation (Line(points={{70,-69.8},{20,-69.8},{20,-5.3},{10.1667,-5.3}},color={255,0,0}));
+ connect(heatSource2.C, cavity.Cth2) annotation (Line(points={{80,0.2},{42,0.2},{42,25.1},{10.1667,25.1}},
+ color={255,0,0}));
+ connect(cavity.Cth3, heatSource3a.C) annotation (Line(points={{10.1667,10.6},{64,10.6},{64,52},{78,52},{78,56.2}}, color={255,0,0}));
+ annotation (
+ experiment(StopTime=1000),
+ Icon(coordinateSystem(preserveAspectRatio=false)),
+ Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}})));
+end TestTwoPhaseCavity_Traces;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume.mo
new file mode 100644
index 00000000..1279de8f
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume.mo
@@ -0,0 +1,31 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestTwoPhaseVolume
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam;
+ ThermoSysPro.Fluid.Volumes.TwoPhaseVolume volume(
+ steady_state=false,
+ P0=13000000,
+ P(start=13000000, fixed=true),
+ hl(start=1454400),
+ hv(start=2.658e6),
+ xv(start=0.01),
+ rhol(start=670),
+ rhov(start=78),
+ V=80,
+ A=20,
+ Vf0=0.5,
+ redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0)));
+
+ ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium, Q0=1)
+ annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=0,
+ origin={30,-40})));
+equation
+ connect(sinkQ.C, volume.Cl) annotation (Line(points={{20,-40},{10,-40},{10,-20}}, color={0,0,0}));
+ annotation (
+ experiment(StopTime=1000),
+ Icon(coordinateSystem(preserveAspectRatio=false)),
+ Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}})));
+end TestTwoPhaseVolume;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo
new file mode 100644
index 00000000..58df232e
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestTwoPhaseVolume_Traces.mo
@@ -0,0 +1,34 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestTwoPhaseVolume_Traces
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Fluid.Examples.SimpleExamples.Media.WaterSteam_FullyVolatileTrace;
+
+ ThermoSysPro.Fluid.Volumes.TwoPhaseVolume volume(
+ redeclare package Medium = Medium,
+ steady_state=false,
+ P0=13000000,
+ P(start=13000000, fixed=true),
+ hl(start=1454400),
+ hv(start=2.658e6),
+ xv(start=0.01),
+ rhol(start=670),
+ rhov(start=78),
+ V=80,
+ A=20,
+ Vf0=0.5,
+ SubCl0={0},
+ SubCv0={10}) annotation (Placement(transformation(extent={{-20,-20},{40,40}}, rotation=0)));
+
+ ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium, Q0=1)
+ annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=0,
+ origin={30,-40})));
+equation
+ connect(sinkQ.C, volume.Cl) annotation (Line(points={{20,-40},{10,-40},{10,-20}}, color={0,0,0}));
+ annotation (
+ experiment(StopTime=1000),
+ Icon(coordinateSystem(preserveAspectRatio=false)),
+ Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,80}})));
+end TestTwoPhaseVolume_Traces;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA.mo
new file mode 100644
index 00000000..13e231d2
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA.mo
@@ -0,0 +1,19 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeA
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.WaterSteam;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package
+ Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare
+ replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable
+ package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}})));
+equation
+ connect(sourcePQ.C,volumeA. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(volumeA.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0}));
+ connect(volumeA.Cs1, sink.C)
+ annotation (Line(points={{10,0},{30,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeA;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo
new file mode 100644
index 00000000..6b2789bd
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh.mo
@@ -0,0 +1,17 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeATh
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.WaterSteam;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}})));
+ Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22},{10,-42}})));
+equation
+ connect(sourcePQ.C, volumeATh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(volumeATh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0}));
+ connect(volumeATh.Cs1, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0}));
+ connect(heatSource.C[1], volumeATh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeATh;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo
new file mode 100644
index 00000000..2f1a9e64
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_FlueGases.mo
@@ -0,0 +1,32 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeATh_FlueGases
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.FlueGases;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ P0=4500000,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}})));
+ Thermal.BoundaryConditions.HeatSource heatSource(T0 = {573.15}) annotation(
+ Placement(transformation(extent = {{-10, -20}, {10, -40}})));
+equation
+ connect(sourcePQ.C, volumeATh.Ce1) annotation(
+ Line(points = {{-30, 0}, {-10, 0}}, color = {0, 0, 0}));
+ connect(volumeATh.Ce2, sourceQ.C) annotation(
+ Line(points = {{0, 10}, {0, 30}, {-30, 30}}, color = {0, 0, 0}));
+ connect(volumeATh.Cs1, sink.C) annotation(
+ Line(points = {{10, 0}, {30, 0}}, color = {0, 0, 0}));
+ connect(volumeATh.Cth, heatSource.C[1]) annotation(
+ Line(points = {{0, 0}, {0, -20.2}}, color = {0, 0, 0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeATh_FlueGases;
\ No newline at end of file
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo
new file mode 100644
index 00000000..ecbf2734
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeATh_Traces.mo
@@ -0,0 +1,26 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeATh_Traces
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.WaterSteam (
+ extraPropertiesNames={"Trace"},
+ C_nominal={0.1},
+ C_default={0.2});
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ Q0=100,
+ SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeATh volumeATh(
+ redeclare package Medium = Medium,
+ V=1,
+ dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) annotation (Placement(transformation(extent={{-50,20},{-30,40}})));
+ Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-20},{10,-40}})));
+equation
+ connect(sourcePQ.C, volumeATh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(volumeATh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0}));
+ connect(volumeATh.Cs1, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0}));
+ connect(volumeATh.Cth, heatSource.C[1]) annotation (Line(points={{0,0},{0,-20.2}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeATh_Traces;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo
new file mode 100644
index 00000000..a154a30d
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_FlueGases.mo
@@ -0,0 +1,26 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeA_FlueGases
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.FlueGases;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package
+ Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare
+ replaceable package Medium = Medium,
+ P0=4500000,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium,h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable
+ package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}})));
+equation
+ connect(sourcePQ.C,volumeA. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(volumeA.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0}));
+ connect(volumeA.Cs1, sink.C)
+ annotation (Line(points={{10,0},{30,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeA_FlueGases;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_Traces.mo
new file mode 100644
index 00000000..35f5de29
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeA_Traces.mo
@@ -0,0 +1,26 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeA_Traces
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.WaterSteam (extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2});
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package
+ Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare
+ replaceable package Medium = Medium,
+ Q0=100,
+ SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeA volumeA(redeclare package Medium = Medium,
+ V=1,
+ dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10},
+ {10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable
+ package Medium = Medium,
+ SubC0={0.2}) annotation (Placement(transformation(extent={{-50,20},{-30,40}})));
+equation
+ connect(sourcePQ.C,volumeA. Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(volumeA.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,
+ 30}}, color={0,0,0}));
+ connect(volumeA.Cs1, sink.C)
+ annotation (Line(points={{10,0},{30,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeA_Traces;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo
new file mode 100644
index 00000000..70a46a81
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB.mo
@@ -0,0 +1,18 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeB
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,28},{40,48}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeB volumeB(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=180,
+ origin={42,0})));
+equation
+ connect(sourcePQ.C, volumeB.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{21,0},{21,7.21645e-16},{32,7.21645e-16}}, color={0,0,0}));
+ connect(volumeB.Cs1, sink.C) annotation (Line(points={{0,10},{0,38},{20,38}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeB;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo
new file mode 100644
index 00000000..927f3cd4
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh.mo
@@ -0,0 +1,23 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeBTh
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.WaterSteam;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=90,
+ origin={0,38})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeBTh volumeBTh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=180,
+ origin={42,0})));
+ Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22},{10,-42}})));
+equation
+ connect(sourcePQ.C, volumeBTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{21,0},{21,7.21645e-16},{32,7.21645e-16}}, color={0,0,0}));
+ connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,19},{-5.55112e-16,19},{-5.55112e-16,28}}, color={0,0,0}));
+ connect(heatSource.C[1], volumeBTh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeBTh;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo
new file mode 100644
index 00000000..ae9b8890
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_FlueGases.mo
@@ -0,0 +1,33 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeBTh_FlueGases
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.FlueGases;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=90,
+ origin={0,40})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ P0=4500000,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeBTh volumeBTh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=180,
+ origin={40,0})));
+ Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation (Placement(transformation(extent={{-10,-22},{10,-42}})));
+equation
+ connect(sourcePQ.C, volumeBTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{25,0},{25,6.66134e-16},{30,6.66134e-16}}, color={0,0,0}));
+ connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,20},{-5.55112e-16,20},{-5.55112e-16,30}}, color={0,0,0}));
+ connect(heatSource.C[1], volumeBTh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeBTh_FlueGases;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo
new file mode 100644
index 00000000..23543d62
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeBTh_Traces.mo
@@ -0,0 +1,32 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeBTh_Traces
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.WaterSteam (
+ extraPropertiesNames={"Trace"},
+ C_nominal={0.1},
+ C_default={0.2});
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=90,
+ origin={0,36})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ Q0=100,
+ SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeBTh volumeBTh(
+ redeclare package Medium = Medium,
+ V=1,
+ dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=180,
+ origin={38,0})));
+ Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22},{10,-42}})));
+equation
+ connect(sourcePQ.C, volumeBTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(volumeBTh.Ce2, sourceQ.C) annotation (Line(points={{10,0},{19,0},{19,7.21645e-16},{28,7.21645e-16}}, color={0,0,0}));
+ connect(volumeBTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,26},{-6.66134e-16,26}}, color={0,0,0}));
+ connect(heatSource.C[1], volumeBTh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeBTh_Traces;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo
new file mode 100644
index 00000000..034bfd84
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_FlueGases.mo
@@ -0,0 +1,28 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeB_FlueGases
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{26,16},{46,36}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ P0=4500000,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeB volumeB(redeclare package Medium = Medium,h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=180,
+ origin={40,0})));
+equation
+ connect(sourcePQ.C, volumeB.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{23,0},{23,7.21645e-16},{30,7.21645e-16}}, color={0,0,0}));
+ connect(volumeB.Cs1, sink.C) annotation (Line(points={{0,10},{0,26},{26,26}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeB_FlueGases;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo
new file mode 100644
index 00000000..1622f1d4
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeB_Traces.mo
@@ -0,0 +1,27 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeB_Traces
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam (
+ extraPropertiesNames={"Trace"},
+ C_nominal={0.1},
+ C_default={0.2});
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ Q0=100,
+ SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeB volumeB(
+ redeclare package Medium = Medium,
+ V=1,
+ dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=180,
+ origin={40,0})));
+equation
+ connect(sourcePQ.C, volumeB.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(volumeB.Ce2, sourceQ.C) annotation (Line(points={{10,0},{24,0},{24,7.21645e-16},{30,7.21645e-16}}, color={0,0,0}));
+ connect(volumeB.Cs1, sink.C) annotation (Line(points={{0,10},{0,30},{20,30}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeB_Traces;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo
new file mode 100644
index 00000000..60ba1d38
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC.mo
@@ -0,0 +1,15 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeC
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.WaterSteam;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}})));
+equation
+ connect(sourcePQ.C, volumeC.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(sink.C, volumeC.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0}));
+ connect(volumeC.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeC;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo
new file mode 100644
index 00000000..ff030840
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh.mo
@@ -0,0 +1,17 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeCTh
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.WaterSteam;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeCTh volumeCTh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,20},{-30,40}})));
+ Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-26},{10,-46}})));
+equation
+ connect(sourcePQ.C, volumeCTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(sink.C, volumeCTh.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0}));
+ connect(volumeCTh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0}));
+ connect(heatSource.C[1], volumeCTh.Cth) annotation (Line(points={{0,-26.2},{0,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeCTh;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo
new file mode 100644
index 00000000..224fc061
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_FlueGases.mo
@@ -0,0 +1,27 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeCTh_FlueGases
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.FlueGases;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ P0=4500000,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeCTh volumeCTh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}})));
+ Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation (Placement(transformation(extent={{-10,-24},{10,-44}})));
+equation
+ connect(sourcePQ.C, volumeCTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(sink.C, volumeCTh.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0}));
+ connect(volumeCTh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0}));
+ connect(heatSource.C[1], volumeCTh.Cth) annotation (Line(points={{0,-24.2},{0,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeCTh_FlueGases;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo
new file mode 100644
index 00000000..7b584788
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeCTh_Traces.mo
@@ -0,0 +1,20 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeCTh_Traces
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.WaterSteam (
+ extraPropertiesNames={"Trace"},
+ C_nominal={0.1},
+ C_default={0.2});
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.2}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeCTh volumeCTh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.1}) annotation (Placement(transformation(extent={{-50,20},{-30,40}})));
+ Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-22},{10,-42}})));
+equation
+ connect(sourcePQ.C, volumeCTh.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(sink.C, volumeCTh.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0}));
+ connect(volumeCTh.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0}));
+ connect(heatSource.C[1], volumeCTh.Cth) annotation (Line(points={{0,-22.2},{0,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeCTh_Traces;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo
new file mode 100644
index 00000000..e17f46c6
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_FlueGases.mo
@@ -0,0 +1,25 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeC_FlueGases
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.FlueGases;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ P0=4500000,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{-50,20},{-30,40}})));
+equation
+ connect(sourcePQ.C, volumeC.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(sink.C, volumeC.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0}));
+ connect(volumeC.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeC_FlueGases;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo
new file mode 100644
index 00000000..77037832
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeC_Traces.mo
@@ -0,0 +1,17 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeC_Traces
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = Properties.Media.WaterSteam(extraPropertiesNames={"Trace"}, C_nominal={0.1}, C_default={0.2});
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium, SubC0={0.2})
+ annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeC volumeC(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium, SubC0={0.1})
+ annotation (Placement(transformation(extent={{-50,20},{-30,40}})));
+equation
+ connect(sourcePQ.C, volumeC.Ce1) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(sink.C, volumeC.Cs) annotation (Line(points={{30,0},{10,0}}, color={0,0,0}));
+ connect(volumeC.Ce2, sourceQ.C) annotation (Line(points={{0,10},{0,30},{-30,30}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeC_Traces;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo
new file mode 100644
index 00000000..141159c5
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD.mo
@@ -0,0 +1,15 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeD
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeD volumeD(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10},{-32,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{12,22},{32,42}})));
+equation
+ connect(sourcePQ.C, volumeD.Ce) annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0}));
+ connect(volumeD.Cs3, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0}));
+ connect(volumeD.Cs1, sinkQ.C) annotation (Line(points={{0,10},{0,32},{12,32}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeD;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo
new file mode 100644
index 00000000..7f9fc507
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh.mo
@@ -0,0 +1,18 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeDTh
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam;
+
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeDTh volumeDTh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10},{-32,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{12,22},{32,42}})));
+ Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-28},{10,-48}})));
+equation
+ connect(sourcePQ.C, volumeDTh.Ce) annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0}));
+ connect(volumeDTh.Cs3, sink.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0}));
+ connect(volumeDTh.Cs1, sinkQ.C) annotation (Line(points={{0,10},{0,32},{12,32}}, color={0,0,0}));
+ connect(heatSource.C[1], volumeDTh.Cth) annotation (Line(points={{0,-28.2},{0,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeDTh;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo
new file mode 100644
index 00000000..25920676
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_FlueGases.mo
@@ -0,0 +1,31 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeDTh_FlueGases
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases;
+
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{26,16},{46,36}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ P0=4500000,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeDTh volumeDTh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=0,
+ origin={40,0})));
+ Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation (Placement(transformation(extent={{-10,-28},{10,-48}})));
+equation
+ connect(volumeDTh.Cs1, sink.C) annotation (Line(points={{0,10},{0,26},{26,26}}, color={0,0,0}));
+ connect(sourcePQ.C, volumeDTh.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(volumeDTh.Cs3, sinkQ.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0}));
+ connect(heatSource.C[1], volumeDTh.Cth) annotation (Line(points={{0,-28.2},{0,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeDTh_FlueGases;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo
new file mode 100644
index 00000000..bd6a3ae9
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeDTh_Traces.mo
@@ -0,0 +1,30 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeDTh_Traces
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam (
+ extraPropertiesNames={"Trace"},
+ C_nominal={0.1},
+ C_default={0.2});
+
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ Q0=100,
+ SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeDTh volumeDTh(
+ redeclare package Medium = Medium,
+ V=1,
+ dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10},{8,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=0,
+ origin={40,0})));
+ Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-12,-28},{8,-48}})));
+equation
+ connect(volumeDTh.Cs1, sink.C) annotation (Line(points={{-2,10},{-2,30},{20,30}}, color={0,0,0}));
+ connect(sourcePQ.C, volumeDTh.Ce) annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0}));
+ connect(volumeDTh.Cs3, sinkQ.C) annotation (Line(points={{8,0},{30,0}}, color={0,0,0}));
+ connect(heatSource.C[1], volumeDTh.Cth) annotation (Line(points={{-2,-28.2},{-2,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeDTh_Traces;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo
new file mode 100644
index 00000000..aad09e10
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_FlueGases.mo
@@ -0,0 +1,28 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeD_FlueGases
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{26,16},{46,36}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ P0=4500000,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeD volumeD(redeclare package Medium = Medium,h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=0,
+ origin={40,0})));
+equation
+ connect(volumeD.Cs1, sink.C) annotation (Line(points={{0,10},{0,26},{26,26}}, color={0,0,0}));
+ connect(sourcePQ.C, volumeD.Ce) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(volumeD.Cs3, sinkQ.C) annotation (Line(points={{10,0},{30,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeD_FlueGases;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo
new file mode 100644
index 00000000..767e33ce
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeD_Traces.mo
@@ -0,0 +1,27 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeD_Traces
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam (
+ extraPropertiesNames={"Trace"},
+ C_nominal={0.1},
+ C_default={0.2});
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ Q0=100,
+ SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeD volumeD(
+ redeclare package Medium = Medium,
+ V=1,
+ dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10},{8,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SinkQ sinkQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=0,
+ origin={40,0})));
+equation
+ connect(volumeD.Cs1, sink.C) annotation (Line(points={{-2,10},{-2,30},{20,30}}, color={0,0,0}));
+ connect(sourcePQ.C, volumeD.Ce) annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0}));
+ connect(volumeD.Cs3, sinkQ.C) annotation (Line(points={{8,0},{30,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeD_Traces;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo
new file mode 100644
index 00000000..4ffc4874
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI.mo
@@ -0,0 +1,15 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeI
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeI volumeI(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10},{-32,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,10},{-30,30}})));
+equation
+ connect(volumeI.Cs3, sink.C) annotation (Line(points={{10,-8},{20,-8},{20,0},{30,0}}, color={0,0,0}));
+ connect(sourcePQ.C, volumeI.Ce2) annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0}));
+ connect(sourceQ.C, volumeI.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeI;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo
new file mode 100644
index 00000000..7bb2b515
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh.mo
@@ -0,0 +1,18 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeITh
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam;
+
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{30,-10},{50,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeITh volumeITh(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-52,-10},{-32,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{-50,10},{-30,30}})));
+ Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-10,-24},{10,-44}})));
+equation
+ connect(volumeITh.Cs3, sink.C) annotation (Line(points={{10,-8},{20,-8},{20,0},{30,0}}, color={0,0,0}));
+ connect(sourcePQ.C, volumeITh.Ce2) annotation (Line(points={{-32,0},{-10,0}}, color={0,0,0}));
+ connect(sourceQ.C, volumeITh.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0}));
+ connect(heatSource.C[1], volumeITh.Cth) annotation (Line(points={{0,-24.2},{0,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeITh;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo
new file mode 100644
index 00000000..dd23d458
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_FlueGases.mo
@@ -0,0 +1,31 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeITh_FlueGases
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases;
+
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{26,-18},{46,2}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ P0=4500000,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeITh volumeITh(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=0,
+ origin={-40,20})));
+ Thermal.BoundaryConditions.HeatSource heatSource(T0={573.15}) annotation (Placement(transformation(extent={{-10,-26},{10,-46}})));
+equation
+ connect(sourcePQ.C, volumeITh.Ce2) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(sourceQ.C, volumeITh.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0}));
+ connect(volumeITh.Cs3, sink.C) annotation (Line(points={{10,-8},{26,-8}}, color={0,0,0}));
+ connect(heatSource.C[1], volumeITh.Cth) annotation (Line(points={{0,-26.2},{0,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeITh_FlueGases;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo
new file mode 100644
index 00000000..9b182a61
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeITh_Traces.mo
@@ -0,0 +1,30 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeITh_Traces
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam (
+ extraPropertiesNames={"Trace"},
+ C_nominal={0.1},
+ C_default={0.2});
+
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ Q0=100,
+ SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeITh volumeITh(
+ redeclare package Medium = Medium,
+ V=1,
+ dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10},{8,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
+ redeclare replaceable package Medium = Medium,
+ Q0=100,
+ SubC0={0.5}) annotation (Placement(transformation(extent={{-56,18},{-36,38}})));
+ Thermal.BoundaryConditions.HeatSource heatSource annotation (Placement(transformation(extent={{-12,-28},{8,-48}})));
+equation
+ connect(volumeITh.Cs1, sink.C) annotation (Line(points={{8,8},{8,30},{20,30}}, color={0,0,0}));
+ connect(sourcePQ.C, volumeITh.Ce2) annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0}));
+ connect(sourceQ.C, volumeITh.Ce1) annotation (Line(points={{-36,28},{-12,28},{-12,8}}, color={0,0,0}));
+ connect(heatSource.C[1], volumeITh.Cth) annotation (Line(points={{-2,-28.2},{-2,0}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeITh_Traces;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo
new file mode 100644
index 00000000..b8b11661
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_FlueGases.mo
@@ -0,0 +1,28 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeI_FlueGases
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases;
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{26,-18},{46,2}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ P0=4500000,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeI volumeI(redeclare package Medium = Medium, h(start=2.83057e6)) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
+ redeclare replaceable package Medium = Medium,
+ T0=573.15,
+ option_temperature=true) annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}},
+ rotation=0,
+ origin={-40,20})));
+equation
+ connect(sourcePQ.C, volumeI.Ce2) annotation (Line(points={{-30,0},{-10,0}}, color={0,0,0}));
+ connect(sourceQ.C, volumeI.Ce1) annotation (Line(points={{-30,20},{-10,20},{-10,8}}, color={0,0,0}));
+ connect(volumeI.Cs3, sink.C) annotation (Line(points={{10,-8},{26,-8}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeI_FlueGases;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo
new file mode 100644
index 00000000..3ee353d0
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/TestVolumeI_Traces.mo
@@ -0,0 +1,27 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples.Volumes;
+model TestVolumeI_Traces
+ extends ThermoSysPro.UsersGuide.Icons.Example;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam (
+ extraPropertiesNames={"Trace"},
+ C_nominal={0.1},
+ C_default={0.2});
+ ThermoSysPro.Fluid.BoundaryConditions.Sink sink(redeclare replaceable package Medium = Medium) annotation (Placement(transformation(extent={{20,20},{40,40}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourcePQ sourcePQ(
+ redeclare replaceable package Medium = Medium,
+ Q0=100,
+ SubC0={0.5}) annotation (Placement(transformation(extent={{-50,-10},{-30,10}})));
+ ThermoSysPro.Fluid.Volumes.VolumeI volumeI(
+ redeclare package Medium = Medium,
+ V=1,
+ dynamic_mass_balance=false) annotation (Placement(transformation(extent={{-12,-10},{8,10}})));
+ ThermoSysPro.Fluid.BoundaryConditions.SourceQ sourceQ(
+ redeclare replaceable package Medium = Medium,
+ Q0=100,
+ SubC0={0.5}) annotation (Placement(transformation(extent={{-56,18},{-36,38}})));
+equation
+ connect(volumeI.Cs1, sink.C) annotation (Line(points={{8,8},{8,30},{20,30}}, color={0,0,0}));
+ connect(sourcePQ.C, volumeI.Ce2) annotation (Line(points={{-30,0},{-12,0}}, color={0,0,0}));
+ connect(sourceQ.C, volumeI.Ce1) annotation (Line(points={{-36,28},{-12,28},{-12,8}}, color={0,0,0}));
+ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(coordinateSystem(preserveAspectRatio=false)));
+end TestVolumeI_Traces;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.mo b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.mo
new file mode 100644
index 00000000..e67a9f76
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.mo
@@ -0,0 +1,4 @@
+within ThermoSysPro.Fluid.Examples.SimpleExamples;
+package Volumes
+ extends ThermoSysPro.UsersGuide.Documentation.ThermoSysProPackageIcon;
+end Volumes;
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order
new file mode 100644
index 00000000..f8cc92cc
--- /dev/null
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/Volumes/package.order
@@ -0,0 +1,44 @@
+TestVolumeC
+TestVolumeC_FlueGases
+TestVolumeC_Traces
+TestVolumeA
+TestVolumeA_FlueGases
+TestVolumeA_Traces
+TestVolumeD
+TestVolumeD_FlueGases
+TestVolumeD_Traces
+TestVolumeB
+TestVolumeB_FlueGases
+TestVolumeB_Traces
+TestVolumeI
+TestVolumeI_FlueGases
+TestVolumeI_Traces
+TestVolumeATh
+TestVolumeATh_Traces
+TestVolumeATh_FlueGases
+TestVolumeBTh
+TestVolumeBTh_FlueGases
+TestVolumeBTh_Traces
+TestVolumeCTh
+TestVolumeCTh_FlueGases
+TestVolumeCTh_Traces
+TestVolumeDTh
+TestVolumeDTh_FlueGases
+TestVolumeDTh_Traces
+TestVolumeITh
+TestVolumeITh_FlueGases
+TestVolumeITh_Traces
+TestTank_withPipePressureLosses
+TestTank_Traces_withPipePressureLosses
+TestTankHorizontal_withPipePressureLosses
+TestTankHorizontal_Traces_withPipePressureLosses
+TestDynamicDrum
+TestDynamicDrum_Traces
+TestTwoPhaseVolume
+TestTwoPhaseVolume_Traces
+TestTwoPhaseCavity
+TestTwoPhaseCavity_Traces
+TestTwoPhaseCavityOnePipe
+TestTwoPhaseCavityOnePipe_Traces
+TestPressurizer
+TestPressurizer_Traces
diff --git a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order
index f1d67d76..6f19330f 100644
--- a/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order
+++ b/ThermoSysPro/Fluid/Examples/SimpleExamples/package.order
@@ -1,86 +1,11 @@
-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
+Boilers
+BoundaryConditions
+Combustion
+HeatExchangers
+Junctions
+LoopBreakers
+Machines
+PressureLosses
+Sensors
+Volumes
+Media
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo
index 73d78dc0..9a3c9369 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicCondenser.mo
@@ -1,116 +1,314 @@
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}})));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling pipes" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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(
+ redeclare package Medium = Medium,
+ Vf0=Vf0,
+ P0=P0c,
+ Ns=Ns,
+ L2=L2,
+ NbTubT=ntubest,
+ Lc=Lc,
+ NbTubV=ntubesV,
+ Dext=Dc + 2*ec,
+ R=Rv,
+ L=Lv,
+ Vertical=true,
+ 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(
+ redeclare package Medium = Medium_Cooling,
+ 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(redeclare package Medium = Medium) "Vapor inlet" annotation (Placement(
+ transformation(extent={{-10,90},{10,110}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet C2ex(redeclare package Medium = Medium) "Condensed water extraction outlet"
+ annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+ 0)));
+ Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium_Cooling) "Cooling water inlet" annotation (
+ Placement(transformation(extent={{-110,-11},{-90,9}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Ce2(redeclare package Medium = Medium_Cooling) "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(redeclare package Medium = Medium) "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(redeclare package Medium = Medium) "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;
+ C1.Xi = Medium.X_default[1:Medium.nXi];
+ C1.SubC = Medium.C_default;
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;
+ C2vap.Xi = Medium.X_default[1:Medium.nXi];
+ C2vap.SubC = Medium.C_default;
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})}),
+
+ 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={53,117,255},
+ 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 = "
Author
@@ -121,4 +319,4 @@ Baligh El Hefni
## ThermoSysPro Version 4.2
This component model is documented in Sect. 9.5.4 of the ThermoSysPro book.
"));
-end DynamicCondenser;
\ No newline at end of file
+end DynamicCondenser;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo
index bf5362fb..25a758ff 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicFlueGasesMultiFluidHeatExchanger.mo
@@ -1,78 +1,170 @@
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)));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+
+ StaticWallFlueGasesExchanger
+ ExchangerFlueGasesMetal(
+ redeclare package Medium = Medium_FlueGases,
+ 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(
+ redeclare package Medium = Medium,
+ 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(redeclare package Medium = Medium_FlueGases) annotation (Placement(transformation(
+ extent={{-10,40},{10,60}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_FlueGases) annotation (Placement(transformation(
+ extent={{-10,-60},{10,-40}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{-110,-10},{-90,10}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium) 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")}),
+ 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 = "
Author
@@ -82,4 +174,4 @@ Baligh El Hefni
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
"));
-end DynamicFlueGasesMultiFluidHeatExchanger;
\ No newline at end of file
+end DynamicFlueGasesMultiFluidHeatExchanger;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo
index ced79086..95fb0991 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchanger.mo
@@ -1,84 +1,202 @@
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)));
+
+ replaceable package Medium_1 = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for fluid 1" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_2 = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for fluid 2" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+
+ DynamicOnePhaseFlowPipe DynamicOnePhaseFlowPipe_2(
+ redeclare package Medium = Medium_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,
+ 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(
+ redeclare package Medium = Medium_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,
+ 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(redeclare package Medium = Medium_2) annotation (Placement(transformation(
+ extent={{-10,40},{10,60}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_2) annotation (Placement(transformation(
+ extent={{-10,-60},{10,-40}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium_1) annotation (
+ Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium_1) 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")}),
+ 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 = "
Author
@@ -88,4 +206,4 @@ Baligh El Hefni
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
"));
-end DynamicMultiFluidHeatExchanger;
\ No newline at end of file
+end DynamicMultiFluidHeatExchanger;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo
index 08447592..7c6c23a3 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicMultiFluidHeatExchangerShell.mo
@@ -1,74 +1,200 @@
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)));
+
+ replaceable package Medium_shell = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for shell-side fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_pipe = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for pipe-side fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+
+ ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowShell
+ dynamicOnePhaseFlowShell(
+ redeclare package Medium = Medium_shell,
+ 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)
+ 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(
+ redeclare package Medium = Medium_pipe,
+ 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)
+ annotation (Placement(transformation(extent={{-10,-30},{10,-10}},
+ rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_shell) annotation (
+ Placement(transformation(extent={{-10,40},{10,60}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_shell) annotation (
+ Placement(transformation(extent={{-10,-60},{10,-40}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium_pipe) annotation (
+ Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium_pipe) 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")}),
+ 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 = "
Author
@@ -78,4 +204,4 @@ Baligh El Hefni
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
"));
-end DynamicMultiFluidHeatExchangerShell;
\ No newline at end of file
+end DynamicMultiFluidHeatExchangerShell;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo
index eac7d57c..9b6e13a9 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowPipe.mo
@@ -1,116 +1,152 @@
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"));
- 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";
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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";
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ constant Real pi=Modelica.Constants.pi "pi";
+ 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 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";
+ 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";
+ 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";
+ Medium.ThermodynamicState state1[N - 1];
+ Medium.ThermodynamicState state2[N];
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
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.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.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)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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
@@ -120,7 +156,7 @@ initial equation
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);
+ h[i] = Medium.specificEnthalpy_pTX(P0, T0[i-1], X);
end for;
else
for i in 2:N loop
@@ -128,57 +164,68 @@ initial equation
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 */
+
+ /* Wall temperature */
Tp = CTh.T;
CTh.W = dW1;
-/* Pipe boundaries */
+
+ /* 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) */
+
+ C1.SubC = C2.SubC;
+
+ C1.Xi = C2.Xi;
+
+ X = C1.Xi;
+
+ /* Mass and energy balance equations (thermal nodes) */
for i in 1:N - 1 loop
-/* Mass balance equation */
+ /* 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 */
+
+ /* 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
@@ -192,32 +239,40 @@ equation
else
0 = BH[i];
end if;
-/* Heat transfer at the wall */
+
+ /* 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) */
+
+ /* 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);
+ // 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 */
+
+ /* 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
+ 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;
@@ -228,73 +283,136 @@ equation
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 */
+
+ /* 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);
+
+ /* Fluid thermodynamic properties */
+ state1[i] = Medium.setState_phX(p=P[i + 1], h=h[i + 1], X=X);
+ ddph[i] = Medium.density_derp_h(state1[i]);
+ ddhp[i] = Medium.density_derh_p(state1[i]);
+
+ rho1[i] = Medium.density(state1[i]);
+ T1[i] = Medium.temperature(state1[i]);
+ cp1[i] = Medium.specificHeatCapacityCp(state1[i]);
+ mu1[i] = Medium.dynamicViscosity(state1[i]);
+ k1[i] = Medium.thermalConductivity(state1[i]);
end for;
-/* Momentum balance equations (hydraulic nodes) */
+
+ /* Momentum balance equations (hydraulic nodes) */
for i in 1:N loop
-/* Momentum balance equation */
+ /* 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 */
+
+ /* 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 */
+
+ /* Gravity pressure losses */
dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
-/* Friction pressure losses */
+
+ /* 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 */
+
+ /* 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);
+
+ /* Fluid thermodynamic properties */
+ state2[i] = Medium.setState_phX(p=(P[i] + P[i + 1])/2, h=hb[i], X=X);
+
+ rho2[i] = Medium.density(state2[i]);
+ T2[i] = Medium.temperature(state2[i]);
+ cp2[i] = Medium.specificHeatCapacityCp(state2[i]);
+ mu2[i] = Medium.dynamicViscosity(state2[i]);
+ k2[i] = Medium.thermalConductivity(state2[i]);
end for;
-/* Fluid densities at the boundaries of the nodes */
+
+ /* 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);
+
+ rhoc[1] = Medium.density_phX(p=P[1],h=h[1],X=X);
+ rhoc[N + 1] = Medium.density_phX(p=P[N + 1],h=h[N + 1],X=X);
+
W1t = sum(dW1);
-/* Total fluid diffusion resistance */
+
+ /* 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),
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -305,4 +423,4 @@ Daniel Bouskela
Baligh El Hefni
"));
-end DynamicOnePhaseFlowPipe;
\ No newline at end of file
+end DynamicOnePhaseFlowPipe;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo
index 6895fe61..53d1544a 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicOnePhaseFlowShell.mo
@@ -1,115 +1,147 @@
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;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
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"));
- 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";
+ 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";
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ constant Real pi=Modelica.Constants.pi "pi";
+ 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 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";
+ 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";
+ Medium.ThermodynamicState state1[N - 1];
+ Medium.ThermodynamicState state2[N];
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
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.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.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)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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
@@ -119,7 +151,7 @@ initial equation
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);
+ h[i] = Medium.specificEnthalpy_pTX(P[i], T0[i - 1], X);
end for;
else
for i in 2:N loop
@@ -127,59 +159,71 @@ initial equation
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 */
+
+ /* dt must be positive */
+ assert( dt > 0, "DynamicOnePhaseFlowShell: dt = dc - De must be positive");
+
+ /* Wall temperature */
Tp = CTh.T;
CTh.W = dW1;
-/* Pipe boundaries */
+
+ /* 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) */
+
+ C1.SubC = C2.SubC;
+
+ C1.Xi = C2.Xi;
+
+ X = C1.Xi;
+
+ /* Mass and energy balance equations (thermal nodes) */
for i in 1:N - 1 loop
-/* Mass balance equation */
+ /* 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 */
+
+ /* 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
@@ -193,27 +237,35 @@ equation
else
0 = BH[i];
end if;
-/* Heat transfer at the wall */
+
+ /* 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) */
+
+ /* 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 */
+
+ /* 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
+ 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;
@@ -224,72 +276,258 @@ equation
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 */
+
+ /* 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);
+
+ /* Fluid thermodynamic properties */
+ state1[i] = Medium.setState_phX(p=P[i + 1], h=h[i + 1], X=X);
+ ddph[i] = Medium.density_derp_h(state1[i]);
+ ddhp[i] = Medium.density_derh_p(state1[i]);
+
+ rho1[i] = Medium.density(state1[i]);
+ T1[i] = Medium.temperature(state1[i]);
+ cp1[i] = Medium.specificHeatCapacityCp(state1[i]);
+
+ mu1[i] = Medium.dynamicViscosity(state1[i]);
+ k1[i] = Medium.thermalConductivity(state1[i]);
end for;
-/* Momentum balance equations (hydraulic nodes) */
+
+ /* Momentum balance equations (hydraulic nodes) */
for i in 1:N loop
-/* Momentum balance equation */
+ /* 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 */
+
+ /* 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 */
+
+ /* 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]));
+
+ /* 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 */
+
+ /* 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);
+
+ /* Fluid thermodynamic properties */
+ state2[i] = Medium.setState_phX(p=(P[i] + P[i + 1])/2, h=hb[i], X=X);
+
+ rho2[i] = Medium.density(state2[i]);
+ T2[i] = Medium.temperature(state2[i]);
+ cp2[i] = Medium.specificHeatCapacityCp(state2[i]);
+ mu2[i] = Medium.dynamicViscosity(state2[i]);
+ k2[i] = Medium.thermalConductivity(state2[i]);
end for;
-/* Fluid densities at the boundaries of the nodes */
+
+ /* 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);
+
+ rhoc[1] = Medium.density(Medium.setState_phX(p=P[1], h=h[1], X=X));
+ rhoc[N + 1] = Medium.density(Medium.setState_phX(p=P[N + 1], h=h[N + 1], X=X));
+
W1t = sum(dW1);
-/* Total fluid diffusion resistance */
+
+ /* 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),
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -303,4 +541,4 @@ Daniel Bouskela
Jiahui LU
"));
-end DynamicOnePhaseFlowShell;
\ No newline at end of file
+end DynamicOnePhaseFlowShell;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo
index 19430338..6575e513 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicPlateHeatExchanger.mo
@@ -1,103 +1,161 @@
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"));
- 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";
+
+ replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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"));
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ constant Real pi=Modelica.Constants.pi "pi";
+ 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";
+ 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];
@@ -105,24 +163,24 @@ model DynamicPlateHeatExchanger "Dynamic plate heat exchanger"
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";
+ 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";
+ Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid";
+ Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid";
+ Medium_c.ThermodynamicState state_c1[N - 1] "Hot fluid thermodynamic state in thermal node i";
+ Medium_f.ThermodynamicState state_f1[N - 1] "Cold fluid thermodynamic state in thermal node i";
+ Medium_c.ThermodynamicState state_c2[N] "Hot fluid thermodynamic state in hydraulic node i";
+ Medium_f.ThermodynamicState state_f2[N] "Cold fluid thermodynamic state in hydraulic node i";
+ Medium_c.ThermodynamicState state_ce "Thermodynamic state of the hot fluid at the inlet";
+ Medium_c.ThermodynamicState state_cs "Thermodynamic state of the hot fluid at the outlet";
+ Medium_f.ThermodynamicState state_fe "Thermodynamic state of the cold fluid at the inlet";
+ Medium_f.ThermodynamicState state_fs "Thermodynamic state of the cold fluid at the outlet";
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";
@@ -131,41 +189,44 @@ model DynamicPlateHeatExchanger "Dynamic plate heat exchanger"
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";
+ 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";
- 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)));
-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
+ Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) annotation (Placement(transformation(
+ extent={{-110,-10},{-90,10}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) annotation (Placement(transformation(
+ extent={{-60,-70},{-40,-50}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) annotation (Placement(transformation(
+ extent={{40,-70},{60,-50}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) annotation (Placement(transformation(
+ extent={{90,-10},{110,10}}, rotation=0)));
initial equation
if dynamic_energy_balance then
if steady_state then
@@ -176,8 +237,8 @@ initial equation
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);
+ hc[i] = Medium_c.specificEnthalpy(Medium_c.setState_pTX(p=Pc0, T=Tc0[i - 1], X=Medium_c.X_default));
+ hf[i] = Medium_f.specificEnthalpy(Medium_f.setState_pTX(p=Pf0, T=Tf0[i - 1], X=Medium_f.X_default));
end for;
else
for i in 2:N loop
@@ -187,68 +248,77 @@ initial equation
end if;
end if;
end if;
+
equation
-/* Heat exchanger boundaries */
+
+ /* 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 */
+
+ Ec.Xi = Sc.Xi;
+ Ec.SubC = Sc.SubC;
+
+ Sf.Xi = Ef.Xi;
+ Sf.SubC = Ef.SubC;
+
+ Xc = Ec.Xi;
+ Xf = Ef.Xi;
+
+ /* Exchange area for the plate exchanger */
dS = (nbp - 2)*Sp/(N - 1);
-/* Mass and energy balance equations (thermal nodes) */
+
+ /* Mass and energy balance equations (thermal nodes) */
for i in 1:N - 1 loop
-/* Mass balance equations */
+ /* 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 */
+
+ /* 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];
@@ -256,13 +326,16 @@ equation
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 */
+
+ /* 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 */
+
+ /* 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;
@@ -274,105 +347,133 @@ equation
hconv_f[i] = 0;
assert(false, "DynamicWaterWaterExchanger: incorrect heat exchange correlation number");
end if;
-/* Diffusion power */
+
+ /* 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
+ 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;
+ 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
+ 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;
+ 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 */
+
+ /* 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);
+ hbf[i] = ThermoSysPro.Functions.SmoothCond(Qf[i]/gamma_f[i], hf[i + 1], hf[i], 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];
+ hbf[i] = if (Qf[i] > 0) then hf[i + 1] else hf[i];
end if;
-/* Fluid thermodynamic properties */
+
+ /* 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);
+ rhoc1[i] = Medium_c.density(state_c1[i]);
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);
+
+ state_c1[i] = Medium_c.setState_phX(p=Pc[i + 1], h=hc[i + 1], X=Xc);
+ Tc1[i] = Medium_c.temperature(state_c1[i]);
+ cpc1[i] = Medium_c.specificHeatCapacityCp(state_c1[i]);
+ muc1[i] = Medium_c.dynamicViscosity(state_c1[i]);
+ kc1[i] = Medium_c.thermalConductivity(state_c1[i]);
+ lambdac1[i] = Medium_c.thermalConductivity(state_c1[i]);
+
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);
+ rhof1[i] = Medium_f.density(state_f1[i]);
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);
+
+ state_f1[i] = Medium_f.setState_phX(p=Pf[i + 1], h=hf[i + 1], X=Xf);
+ Tf1[i] = Medium_f.temperature(state_f1[i]);
+ cpf1[i] = Medium_f.specificHeatCapacityCp(state_f1[i]);
+ muf1[i] = Medium_f.dynamicViscosity(state_f1[i]);
+ kf1[i] = Medium_f.thermalConductivity(state_f1[i]);
+ lambdaf1[i] = Medium_f.thermalConductivity(state_f1[i]);
end for;
-/* Pressure losses correlations */
+
+ /* Pressure losses correlations */
M = (nbp - 1)/2;
-/* Momentum balance equations (hydraulic nodes) */
+
+ /* Momentum balance equations (hydraulic nodes) */
for i in 1:N loop
-/* Pressure losses */
+ /* 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;
+ 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];
@@ -384,43 +485,139 @@ equation
DPf[i] = 0;
assert(false, "DynamicWaterWaterExchanger: incorrect pressure loss correlation number");
end if;
-/* Diffusion resistance */
+
+ /* 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 */
+
+ /* 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);
+ rhoc2[i] = Medium_c.density(state_c2[i]);
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);
+
+ state_c2[i] = Medium_c.setState_phX(p=(Pc[i] + Pc[i + 1])/2, h=hbc[i], X=Xc);
+ Tc2[i] = Medium_c.temperature(state_c2[i]);
+ cpc2[i] = Medium_c.specificHeatCapacityCp(state_c2[i]);
+ muc2[i] = Medium_c.dynamicViscosity(state_c2[i]);
+ kc2[i] = Medium_c.thermalConductivity(state_c2[i]);
+
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);
+ rhof2[i] = Medium_f.density(state_f2[i]);
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);
+
+ state_f2[i] = Medium_f.setState_phX(p=(Pf[i] + Pf[i + 1])/2, h=hbf[i], X=Xf);
+ Tf2[i] = Medium_f.temperature(state_f2[i]);
+ cpf2[i] = Medium_f.specificHeatCapacityCp(state_f2[i]);
+ muf2[i] = Medium_f.dynamicViscosity(state_f2[i]);
+ kf2[i] = Medium_f.thermalConductivity(state_f2[i]);
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 */
+
+ /* Calcul des températures en entrée et en sortie de l'échangeur */
+ state_ce = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc);
+ state_cs = Medium_c.setState_phX(p=Sc.P, h=Sc.h, X=Xc);
+ Tec = Medium_c.temperature(state_ce);
+ Tsc = Medium_c.temperature(state_cs);
+
+ state_fe = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf);
+ state_fs = Medium_f.setState_phX(p=Sf.P, h=Sf.h, X=Xf);
+ Tef = Medium_f.temperature(state_fe);
+ Tsf = Medium_f.temperature(state_fs);
+
+ /* 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),
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -432,4 +629,4 @@ Daniel Bouskela
Baligh El Hefni
"));
-end DynamicPlateHeatExchanger;
\ No newline at end of file
+end DynamicPlateHeatExchanger;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo
index 858abb61..fc2f5e86 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowPipe.mo
@@ -1,161 +1,218 @@
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"));
- 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";
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ constant Real pi=Modelica.Constants.pi "pi";
+ 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=Medium.fluidConstants[1].criticalPressure "Critical pressure";
+ parameter Units.SI.Temperature Tcrit=Medium.fluidConstants[1].criticalTemperature "Critical temperature";
+ parameter Units.SI.AbsolutePressure ptriple=Medium.fluidConstants[1].triplePointPressure "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";
+ 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";
+ 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.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";
+ 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 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";
+ Units.SI.DerDensityByPressure ddph[N - 1] "Density derivative wrt. pressure";
+ Units.SI.DerDensityByEnthalpy ddhp[N - 1] "Density derivative wrt. enthalpy";
+ Medium.ThermodynamicState state1[N - 1];
+ Medium.ThermodynamicState state2[N];
+ Medium.ThermodynamicState state_c[2];
+ Medium.SaturationProperties sat1[N - 1];
+ Medium.SaturationProperties sat2[N];
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
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.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)));
- 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)));
-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
+ Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) 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(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{90,-10},{110,10}}, rotation=0)));
initial equation
if dynamic_energy_balance then
if steady_state then
@@ -165,7 +222,7 @@ initial equation
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);
+ h[i] = Medium.specificEnthalpy_pTX(Pb[i], T0[i - 1], X);
end for;
else
for i in 2:N loop
@@ -173,67 +230,75 @@ initial equation
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 */
+
+ /* Wall temperature */
Tp1 = CTh.T;
CTh.W = dW1;
-/* Pipe boundaries */
+
+ /* 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) */
+
+ C1.Xi = C2.Xi;
+ X = C1.Xi;
+ C1.SubC = C2.SubC;
+
+ /* Mass and energy balance equations (thermal nodes) */
for i in 1:N - 1 loop
-/* Mass balance equation */
+ /* 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];
+ 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 */
+
+ /* 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];
+ 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];
@@ -241,12 +306,15 @@ equation
else
0 = BH[i];
end if;
-/* Heat transfer at the wall */
+
+ /* 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]);
+ 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]);
@@ -255,29 +323,37 @@ equation
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 */
+
+ /* 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
+ 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;
@@ -288,72 +364,96 @@ equation
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 */
+
+ /* 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;
+
+ /* Fluid thermodynamic properties */
+ state1[i] = Medium.setState_phX(P[i + 1], h[i + 1], X);
+
+ rho1[i] = Medium.density(state1[i]);
+ T1[i] = Medium.temperature(state1[i]);
+ xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else Medium.vapourQuality(state1[i]);
+ ddph[i] = Medium.density_derp_h(state1[i]);
+ ddhp[i] = Medium.density_derh_p(state1[i]);
+
+ sat1[i] = Medium.setSat_p(P[i + 1]);
+
+ if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then
+ xbs[i] = 0;
+ xbi[i] = 1;
+ rhol1[i] = rho1[i];
+ rhov1[i] = rho1[i];
+ cpl1[i] = Medium.specificHeatCapacityCp(state1[i]);
+ cpv1[i] = Medium.specificHeatCapacityCp(state1[i]);
+ 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;
+ xbs[i] = min(xv1[i], 0.90);
+ xbi[i] = max(xv1[i], 0.10);
+ rhol1[i] = max(rho1[i], Medium.bubbleDensity(sat1[i]));
+ rhov1[i] = min(rho1[i], Medium.dewDensity(sat1[i]));
+ cpl1[i] = if noEvent(xv1[i] <= 0.0) then Medium.specificHeatCapacityCp(state1[i]) else Medium.specificHeatCapacityCp(Medium.setBubbleState(sat1[i]));
+ cpv1[i] = if noEvent(xv1[i] >= 1.0) then Medium.specificHeatCapacityCp(state1[i]) else Medium.specificHeatCapacityCp(Medium.setDewState(sat1[i]));
+ lv[i] = Medium.dewEnthalpy(sat1[i]) - Medium.bubbleEnthalpy(sat1[i]);
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);
+
+ /* Transport properties at the actual node state in single phase (as in WaterSteam and ThermoSysPro 4.2),
+ at saturation only in two-phase flow */
+ mul1[i] = if noEvent(xv1[i] <= 0.0 or xv1[i] >= 1.0) then Medium.dynamicViscosity(state1[i]) else Medium.dynamicViscosity(Medium.setBubbleState(sat1[i]));
+ muv1[i] = if noEvent(xv1[i] <= 0.0 or xv1[i] >= 1.0) then Medium.dynamicViscosity(state1[i]) else Medium.dynamicViscosity(Medium.setDewState(sat1[i]));
+
+ kl1[i] = if noEvent(xv1[i] <= 0.0 or xv1[i] >= 1.0) then Medium.thermalConductivity(state1[i]) else Medium.thermalConductivity(Medium.setBubbleState(sat1[i]));
+ kv1[i] = if noEvent(xv1[i] <= 0.0 or xv1[i] >= 1.0) then Medium.thermalConductivity(state1[i]) else Medium.thermalConductivity(Medium.setDewState(sat1[i]));
+
Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple);
end for;
-/* Momentum balance equations (hydraulic nodes) */
+
+ /* Momentum balance equations (hydraulic nodes) */
for i in 1:N loop
-/* Momentum balance equation */
+ /* 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 */
+
+ /* 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 */
+
+ /* Gravity pressure losses */
dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
-/* Friction pressure losses */
+
+ /* 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
@@ -363,50 +463,112 @@ equation
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];
+
+ /* 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;
+
+ /* Fluid thermodynamic properties */
+ state2[i] = Medium.setState_phX((P[i] + P[i + 1])/2, hb[i], X);
+
+ rho2[i] = Medium.density(state2[i]);
+ xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else Medium.vapourQuality(state2[i]);
+ T2[i] = Medium.temperature(state2[i]);
+
+ sat2[i] = Medium.setSat_p((P[i] + P[i + 1])/2);
+
+ if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then
+ rhol2[i] = rho2[i];
+ rhov2[i] = rho2[i];
+ cpl2[i] = Medium.specificHeatCapacityCp(state2[i]);
+ cpv2[i] = Medium.specificHeatCapacityCp(state2[i]);
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;
+ rhol2[i] = max(rho2[i], Medium.bubbleDensity(sat2[i]));
+ rhov2[i] = min(rho2[i], Medium.dewDensity(sat2[i]));
+ cpl2[i] = if noEvent(xv2[i] <= 0.0) then Medium.specificHeatCapacityCp(state2[i]) else Medium.specificHeatCapacityCp(Medium.setBubbleState(sat2[i]));
+ cpv2[i] = if noEvent(xv2[i] >= 1.0) then Medium.specificHeatCapacityCp(state2[i]) else Medium.specificHeatCapacityCp(Medium.setDewState(sat2[i]));
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);
+
+ /* Transport properties at the actual node state in single phase (as in WaterSteam and ThermoSysPro 4.2),
+ at saturation only in two-phase flow */
+ mul2[i] = if noEvent(xv2[i] <= 0.0 or xv2[i] >= 1.0) then Medium.dynamicViscosity(state2[i]) else Medium.dynamicViscosity(Medium.setBubbleState(sat2[i]));
+ muv2[i] = if noEvent(xv2[i] <= 0.0 or xv2[i] >= 1.0) then Medium.dynamicViscosity(state2[i]) else Medium.dynamicViscosity(Medium.setDewState(sat2[i]));
+
+ kl2[i] = if noEvent(xv2[i] <= 0.0 or xv2[i] >= 1.0) then Medium.thermalConductivity(state2[i]) else Medium.thermalConductivity(Medium.setBubbleState(sat2[i]));
+ kv2[i] = if noEvent(xv2[i] <= 0.0 or xv2[i] >= 1.0) then Medium.thermalConductivity(state2[i]) else Medium.thermalConductivity(Medium.setDewState(sat2[i]));
end for;
-/* Fluid densities at the boundaries of the nodes */
+
+ /* 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;
+
+ state_c[1] = Medium.setState_phX(P[1], h[1], X);
+ state_c[2] = Medium.setState_phX(P[N + 1], h[N + 1], X);
+
+ rhoc[1] = Medium.density(state_c[1]);
+ rhoc[N + 1] = Medium.density(state_c[2]);
+
W1t = sum(dW1);
-/* Total fluid diffusion resistance */
+
+ /* 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),
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -419,4 +581,4 @@ Baligh El Hefni
Guillaume Larrignon
"));
-end DynamicTwoPhaseFlowPipe;
\ No newline at end of file
+end DynamicTwoPhaseFlowPipe;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo
index bd485801..b7a4132b 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicTwoPhaseFlowRiser.mo
@@ -1,169 +1,236 @@
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"));
- 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";
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ constant Real pi=Modelica.Constants.pi "pi";
+ 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";
+ 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";
+ 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.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";
+ 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 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";
+ Units.SI.DerDensityByPressure ddph[N - 1] "Density derivative wrt. pressure";
+ Units.SI.DerDensityByEnthalpy ddhp[N - 1] "Density derivative wrt. enthalpy";
+ Medium.ThermodynamicState state1[N - 1];
+ Medium.ThermodynamicState state2[N];
+ Medium.ThermodynamicState state_c[2];
+ Medium.SaturationProperties sat1[N - 1];
+ Medium.SaturationProperties sat2[N];
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
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.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)));
- 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)));
-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
+ Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) 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(redeclare package Medium = Medium) 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
@@ -172,7 +239,7 @@ initial equation
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);
+ h[i] = Medium.specificEnthalpy_pTX(Pb[i], T0[i - 1], X);
end for;
else
for i in 2:N loop
@@ -180,69 +247,78 @@ initial equation
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 */
+
+ /* Wall temperature */
Tp1 = CTh1.T;
CTh1.W = dW1;
+
Tp2 = CTh2.T;
CTh2.W = dW2;
-/* Pipe boundaries */
+
+ /* 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) */
+
+ C1.Xi = C2.Xi;
+ X = C1.Xi;
+ C1.SubC = C2.SubC;
+
+ /* Mass and energy balance equations (thermal nodes) */
for i in 1:N - 1 loop
BQ[i] = Q[i] - Q[i + 1];
-/* Mass balance equation */
+
+ /* 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];
+ 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] + dW2[i] + J[i];
+
+ /* 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];
+ 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];
@@ -250,19 +326,24 @@ equation
else
0 = BH[i];
end if;
-/* Heat transfer at the wall */
+
+ /* 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);
+
+ //*** 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]);
+ 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]);
@@ -271,29 +352,37 @@ equation
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 */
+
+ /* 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
+ 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;
@@ -304,72 +393,94 @@ equation
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 */
+
+ /* 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;
+
+ /* Fluid thermodynamic properties */
+ state1[i] = Medium.setState_phX(P[i + 1], h[i + 1], X);
+
+ rho1[i] = Medium.density(state1[i]);
+ T1[i] = Medium.temperature(state1[i]);
+ xv1[i] = if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then 1 else Medium.vapourQuality(state1[i]);
+ ddph[i] = Medium.density_derp_h(state1[i]);
+ ddhp[i] = Medium.density_derh_p(state1[i]);
+
+ sat1[i] = Medium.setSat_p(P[i + 1]);
+
+ if noEvent((P[i+1] > pcrit) or (T1[i] > Tcrit)) then
+ xbs[i] = 0;
+ xbi[i] = 1;
+ rhol1[i] = rho1[i];
+ rhov1[i] = rho1[i];
+ cpl1[i] = Medium.specificHeatCapacityCp(state1[i]);
+ cpv1[i] = Medium.specificHeatCapacityCp(state1[i]);
+ 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;
+ xbs[i] = min(xv1[i], 0.90);
+ xbi[i] = max(xv1[i], 0.10);
+ rhol1[i] = max(rho1[i], Medium.bubbleDensity(sat1[i]));
+ rhov1[i] = min(rho1[i], Medium.dewDensity(sat1[i]));
+ cpl1[i] = if noEvent(xv1[i] <= 0.0) then Medium.specificHeatCapacityCp(state1[i]) else Medium.specificHeatCapacityCp(Medium.setBubbleState(sat1[i]));
+ cpv1[i] = if noEvent(xv1[i] >= 1.0) then Medium.specificHeatCapacityCp(state1[i]) else Medium.specificHeatCapacityCp(Medium.setDewState(sat1[i]));
+ lv[i] = Medium.dewEnthalpy(sat1[i]) - Medium.bubbleEnthalpy(sat1[i]);
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);
+
+ mul1[i] = Medium.dynamicViscosity(Medium.setBubbleState(sat1[i]));
+ muv1[i] = Medium.dynamicViscosity(Medium.setDewState(sat1[i]));
+
+ kl1[i] = Medium.thermalConductivity(Medium.setBubbleState(sat1[i]));
+ kv1[i] = Medium.thermalConductivity(Medium.setDewState(sat1[i]));
+
Pb[i + 1] = max(min(P[i + 1], pcrit - 1), ptriple);
end for;
-/* Momentum balance equations (hydraulic nodes) */
+
+ /* Momentum balance equations (hydraulic nodes) */
for i in 1:N loop
-/* Momentum balance equation */
+ /* 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 */
+
+ /* 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 */
+
+ /* Gravity pressure losses */
dpg[i] = rho2[i]*g*(z2 - z1)*dx2/L;
-/* Friction pressure losses */
+
+ /* 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
@@ -379,43 +490,152 @@ equation
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];
+
+ /* 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);
+
+ /* Fluid thermodynamic properties */
+ state2[i] = Medium.setState_phX((P[i] + P[i + 1])/2, hb[i], X);
+
+ rho2[i] = Medium.density(state2[i]);
+ xv2[i] = if noEvent(((P[i] + P[i + 1])/2 > pcrit) or (T2[i] > Tcrit)) then 1 else Medium.vapourQuality(state2[i]);
+ T2[i] = Medium.temperature(state2[i]);
+
+ sat2[i] = Medium.setSat_p((P[i] + P[i + 1])/2);
+
+ rhol2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then rho2[i] else max(rho2[i], Medium.bubbleDensity(sat2[i]));
+ rhov2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then rho2[i] else min(rho2[i], Medium.dewDensity(sat2[i]));
+
+ cpl2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then Medium.specificHeatCapacityCp(state2[i]) else (if noEvent(xv2[i] <= 0.0) then Medium.specificHeatCapacityCp(state2[i]) else Medium.specificHeatCapacityCp(Medium.setBubbleState(sat2[i])));
+ cpv2[i] = if noEvent((P[i+1] > pcrit) or (T2[i] > Tcrit)) then Medium.specificHeatCapacityCp(state2[i]) else (if noEvent(xv2[i] >= 1.0) then Medium.specificHeatCapacityCp(state2[i]) else Medium.specificHeatCapacityCp(Medium.setDewState(sat2[i])));
+
+ mul2[i] = Medium.dynamicViscosity(Medium.setBubbleState(sat2[i]));
+ muv2[i] = Medium.dynamicViscosity(Medium.setDewState(sat2[i]));
+
+ kl2[i] = Medium.thermalConductivity(Medium.setBubbleState(sat2[i]));
+ kv2[i] = Medium.thermalConductivity(Medium.setDewState(sat2[i]));
end for;
-/* Fluid densities at the boundaries of the nodes */
+
+ /* 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;
+
+ state_c[1] = Medium.setState_phX(P[1], h[1], X);
+ state_c[2] = Medium.setState_phX(P[N + 1], h[N + 1], X);
+
+ rhoc[1] = Medium.density(state_c[1]);
+ rhoc[N + 1] = Medium.density(state_c[2]);
+
W1t = sum(dW1);
-/* Total fluid diffusion resistance */
+
+ /* 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),
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -426,4 +646,4 @@ Baligh El Hefni
Daniel Bouskela
"));
-end DynamicTwoPhaseFlowRiser;
\ No newline at end of file
+end DynamicTwoPhaseFlowRiser;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo
index b28188c7..c0f50a69 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeater.mo
@@ -1,138 +1,455 @@
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 ThermoSysPro.Units.SI.Volume Vc=4510 "Cavity total volume";
- //parameter ThermoSysPro.Units.SI.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 ThermoSysPro.Units.SI.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 ThermoSysPro.Units.SI.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";
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the water/steam cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling pipes" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ //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)));
+ 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=Medium_Cooling.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(
+ redeclare package Medium = Medium,
+ 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)
+ annotation ( Placement(transformation(extent={{-100,
+ -100},{100,100}}, rotation=0)));
+ ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3(
+ redeclare package Medium = Medium_Cooling,
+ 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(redeclare package Medium = Medium) "Vapor inlet" annotation (Placement(
+ transformation(extent={{-10,90},{10,110}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet C2ex(redeclare package Medium = Medium) "Condensed water extraction outlet"
+ annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+ 0)));
+ Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium_Cooling) "Cooling water inlet" annotation (
+ Placement(transformation(extent={{-110,-55},{-90,-35}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Ce2(redeclare package Medium = Medium_Cooling) "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(redeclare package Medium = Medium) "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(
+ redeclare package Medium = Medium_Cooling,
+ 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(
+ redeclare package Medium = Medium_Cooling,
+ 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(
+ redeclare package Medium = Medium_Cooling,
+ 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) annotation (Placement(transformation(extent={{
+ -56,35},{-74,53}}, rotation=0)));
+ Volumes.VolumeD volumeD(
+ redeclare package Medium = Medium_Cooling,
+ 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) annotation (Placement(transformation(extent={{-74,-54},{-56,
+ -36}}, rotation=0)));
+ Volumes.VolumeD volumeD1(
+ redeclare package Medium = Medium_Cooling,
+ h0=850e3,
+ dynamic_energy_balance=dynamic_energy_balance,
+ steady_state=steady_state,
+ diffusion=diffusion,
+ dynamic_mass_balance=dynamic_mass_balance) 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;
+ C1.Xi = Medium.X_default[1:Medium.nXi];
+ C1.SubC = Medium.C_default;
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")}),
+
+ 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 = "
Author
@@ -143,4 +460,4 @@ Baligh El Hefni
## ThermoSysPro Version 4.2
This component model is documented in Sect. 9.5.2 of the ThermoSysPro book.
"));
-end DynamicWaterHeater;
\ No newline at end of file
+end DynamicWaterHeater;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo
index 0a639da3..cf94719e 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterHeaterOnePipe.mo
@@ -1,85 +1,157 @@
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 ThermoSysPro.Units.SI.Volume Vc=4510 "Cavity total volume";
- //parameter ThermoSysPro.Units.SI.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 ThermoSysPro.Units.SI.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 ThermoSysPro.Units.SI.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)));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the water/steam cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling pipe" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ //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=Medium_Cooling.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(
+ redeclare package Medium = Medium,
+ 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)
+ annotation ( Placement(transformation(extent={{-100,
+ -100},{100,100}}, rotation=0)));
+ ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe pipe_3(
+ redeclare package Medium = Medium_Cooling,
+ 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(redeclare package Medium = Medium) "Vapor inlet" annotation (Placement(
+ transformation(extent={{-10,90},{10,110}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet C2ex(redeclare package Medium = Medium) "Condensed water extraction outlet"
+ annotation (Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=
+ 0)));
+ Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium_Cooling) "Cooling water inlet" annotation (
+ Placement(transformation(extent={{-110,-55},{-90,-35}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Ce2(redeclare package Medium = Medium_Cooling) "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(redeclare package Medium = Medium) "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(
+ redeclare package Medium = Medium_Cooling,
+ 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) annotation (Placement(transformation(extent={{-72,-54},{-54,-36}},
+ rotation=0)));
+ Volumes.VolumeC volumeC(
+ redeclare package Medium = Medium_Cooling,
+ 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) annotation (Placement(transformation(extent={{-52,35},
+ {-70,53}}, rotation=0)));
equation
if (cardinality(C1) == 1) then
C1.Q = 0;
@@ -87,35 +159,202 @@ equation
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;
+ C1.Xi = Medium.X_default[1:Medium.nXi];
+ C1.SubC = Medium.C_default;
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")}),
+
+ 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 = "
Author
@@ -125,4 +364,4 @@ Baligh El Hefni
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
"));
-end DynamicWaterHeaterOnePipe;
\ No newline at end of file
+end DynamicWaterHeaterOnePipe;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo
index 1e79742e..6b1c0c7d 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/DynamicWaterSteamMultiFluidsHeatExchanger.mo
@@ -1,74 +1,170 @@
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)));
+
+ replaceable package Medium_1 = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the one-phase side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_2 = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+
+ Fluid.HeatExchangers.DynamicOnePhaseFlowPipe ExchangerMultiFluids(
+ redeclare package Medium = Medium_1,
+ 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(
+ redeclare package Medium = Medium_2,
+ 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(redeclare package Medium = Medium_1) annotation (Placement(transformation(
+ extent={{-10,40},{10,60}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_1) annotation (Placement(transformation(
+ extent={{-10,-60},{10,-40}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium_2) annotation (Placement(transformation(
+ extent={{-110,-10},{-90,10}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium_2) 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}})}),
+ 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 = "
Author
@@ -78,6 +174,42 @@ Baligh El Hefni
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
"),
- 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;
\ No newline at end of file
+ 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 1886832c..8be65437 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/FixedPowerHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/FixedPowerHeatExchanger.mo
@@ -1,99 +1,175 @@
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"));
+
+ replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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)";
+
+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";
- 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)));
-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";
+ Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
+ Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
+ Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid";
+ Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid";
+ Medium_c.ThermodynamicState state_ce "Thermodynamic state of the hot fluid at the inlet";
+ Medium_c.ThermodynamicState state_cs "Thermodynamic state of the hot fluid at the outlet";
+ Medium_f.ThermodynamicState state_fe "Thermodynamic state of the cold fluid at the inlet";
+ Medium_f.ThermodynamicState state_fs "Thermodynamic state of the cold fluid at the outlet";
+
+public
+ Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) annotation (Placement(transformation(
+ extent={{-68,-70},{-48,-50}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) annotation (Placement(transformation(
+ extent={{-110,-10},{-90,10}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) annotation (Placement(transformation(
+ extent={{88,-9},{108,11}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) annotation (Placement(transformation(
+ extent={{48,-70},{68,-50}}, rotation=0)));
equation
-/* Mass flow rates */
+
+ /* 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;
+
+ Ec.Xi = Sc.Xi;
+ Ec.SubC = Sc.SubC;
+
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;
+
+ Ef.Xi = Sf.Xi;
+ Ef.SubC = Sf.SubC;
+
Qc = Ec.Q;
Qf = Ef.Q;
-/* Power exchanged between the hot and cold fluid */
+ Xc = Ec.Xi;
+ Xf = Ef.Xi;
+
+ /* Power exchanged between the hot and cold fluid */
DW = Qf*(Sf.h - Ef.h);
DW = Qc*(Ec.h - Sc.h);
-/* Pressure losses */
+
+ /* 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),
+
+ /* Fluid thermodynamic properties for the hot fluid */
+ state_ce = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc);
+ state_cs = Medium_c.setState_phX(p=Sc.P, h=Sc.h, X=Xc);
+
+ Tec = Medium_c.temperature(state_ce);
+ Tsc = Medium_c.temperature(state_cs);
+
+ /* Fluid thermodynamic properties for the cold fluid */
+ state_fe = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf);
+ state_fs = Medium_f.setState_phX(p=Sf.P, h=Sf.h, X=Xf);
+
+ Tef = Medium_f.temperature(state_fe);
+ Tsf = Medium_f.temperature(state_fs);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -103,4 +179,4 @@ Author
Baligh El Hefni
"));
-end FixedPowerHeatExchanger;
\ No newline at end of file
+end FixedPowerHeatExchanger;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo b/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo
index 615f7377..772fcd33 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/NTUWaterHeater.mo
@@ -1,255 +1,249 @@
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"));
- 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";
+
+ replaceable package Medium_e = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+
+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 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";
+ Medium_e.MassFraction Xe[Medium_e.nXi](start=Medium_e.X_default[1:Medium_e.nXi]) "Mass fractions on the water side";
+ Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions in the condensing volume";
+ Medium_c.ExtraProperty SubCc[Medium_c.nC](quantity=Medium_c.extraPropertiesNames, start=Medium_c.C_default) "Trace substances in the condensing volume";
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";
+ 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)));
-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";
+
+ Medium_e.ThermodynamicState state_eeF "Water inlet fluid state (4F)";
+ Medium_e.ThermodynamicState state_seF "Water outlet fluid state (1F)";
+ Medium_c.ThermodynamicState state_spC "Drain outlet fluid state (4C)";
+ Interfaces.Connectors.FluidInlet Ee(redeclare package Medium = Medium_e) "Water inlet"
+ annotation (Placement(transformation(extent={{-90,-10},{-110,10}}, rotation=
+ 0)));
+ Interfaces.Connectors.FluidOutlet Se(redeclare package Medium = Medium_e) "Water outlet" annotation (Placement(
+ transformation(extent={{110,-10},{90,10}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet Ep(redeclare package Medium = Medium_c) "Drain inlet"
+ annotation (Placement(transformation(extent={{-50,24},{-70,44}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Sp(redeclare package Medium = Medium_c) "Drain outlet" annotation (Placement(
+ transformation(extent={{-50,-43},{-70,-23}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet Ev(redeclare package Medium = Medium_c) "Vapor inlet"
+ annotation (Placement(transformation(extent={{70,24},{50,44}}, rotation=0),
+ iconTransformation(extent={{70,24},{50,44}})));
+ Medium_c.ThermodynamicState state_evC "Vapor inlet fluid state (1C)";
+ Medium_c.SaturationProperties satC "Saturation conditions at the vapor inlet pressure";
+ Medium_c.ThermodynamicState state_lsatC "Saturated liquid state";
+ Medium_c.ThermodynamicState state_vsatC "Saturated vapor state";
+ Medium_e.ThermodynamicState state_meF "Average water fluid state (between 4F and 3F)";
+ Medium_c.ThermodynamicState state_desmC "Deheating average fluid state (between 1C and 2C)";
+ Medium_e.ThermodynamicState state_mcF "Average deheating fluid state (between 3F and 2F)";
+ Medium_e.ThermodynamicState state_desF "Deheating inlet fluid state (2F)";
+ Medium_e.ThermodynamicState state_desmF "Average deheating fluid state (between 2F and 1F)";
+ Medium_c.ThermodynamicState state_sp "Drain outlet fluid state before cooling (near 3C)";
+ Medium_c.ThermodynamicState state_mpC "Average fluid state in the drain (between 3C and 4C)";
+ Medium_e.ThermodynamicState state_mpF "Average water fluid state (between 4F and 3F)";
+ Medium_e.ThermodynamicState state_ecF "Water fluid state (3F)";
+ Units.SI.SpecificHeatCapacity cp_desmC;
+ Units.SI.SpecificHeatCapacity cp_mcF;
+ Units.SI.SpecificHeatCapacity cp_desmF;
+ Units.SI.SpecificHeatCapacity cp_mpC;
+ Units.SI.SpecificHeatCapacity cp_mpF;
+ Units.SI.Temperature T_evC;
+ Units.SI.Temperature T_desF;
+ Units.SI.Temperature T_sp;
+ Units.SI.Temperature T_eeF;
+ Real x_flashepC "Steam mass fraction in the flash state";
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 */
+
+ /* 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;
+ Ep.Xi = Medium_c.X_default[1:Medium_c.nXi];
+ Ep.SubC = fill(0, Medium_c.nC);
end if;
-// Cooling pipe
-//-------------
+
+ // 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.Xi = Se.Xi;
+ Ee.SubC = Se.SubC;
+
+ Xe = Ee.Xi;
+
+ /* 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 */
+
+ /* Heating power released to the cooling pipe */
W = Se.Q*(Se.h - Ee.h);
-// Water/steam cavity
-//-------------------
-/* Fluid pressure */
+
+ // Water/steam cavity
+ //-------------------
+
+ /* Fluid pressure */
P = Ep.P;
P = Ev.P;
P = Sp.P;
-/* Fluid specific enthalpy (singular if all flows = 0) */
+
+ /* 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 */
+
+ /* 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 */
+
+ /* 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 */
+ Wdes = noEvent(min(Ev.Q*cp_desmC, Ee.Q*cp_desmF)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, cp_desmC, cp_desmF, KCond/2, SDes, 1)*(T_evC - T_desF));
+ /* 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 */
+
+ // 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
+ Wcond = Ee.Q*cp_mcF*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Ev.Q, Ee.Q, 1.e20, cp_mcF, KCond, (SCondDes - SDes), 0.5)*(TsatC - TeiF);
+
+ // Flash zone
+ //-----------
+
+ /* Heat power in case of partial vaporization in the drain */
+ if (x_flashepC > 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
+
+ /* Condition for partial vaporisation in the drain (flash) */
+ if (x_flashepC > 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 */
+
+ // 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;
+ Wpurge = noEvent(min(Sp.Q*cp_mpC, Ee.Q*cp_mpF)*ThermoSysPro.Correlations.Thermal.WBHeatExchangerEfficiency(Sp.Q, Ee.Q, cp_mpC, cp_mpF, KPurge, SPurge, 0)*(T_sp - T_eeF));
+ TeiF = Medium_e.temperature(state_ecF);
else
HeiF = Ee.h;
Wpurge = 0;
Hep = Sp.h;
- TeiF = proeeF.T;
+ TeiF = T_eeF;
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 */
+
+ /* Fluid composition balance equations */
+ zeros(Medium_c.nXi) = Ep.Xi*Ep.Q + Ev.Xi*Ev.Q - Sp.Xi*Sp.Q;
+ zeros(Medium_c.nC) = Ep.SubC*Ep.Q + Ev.SubC*Ev.Q - Sp.SubC*Sp.Q;
+
+ Xc = Sp.Xi;
+ SubCc = Sp.SubC;
+
+ /* 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 */
+
+ /* 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;
@@ -257,46 +251,344 @@ equation
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),
+
+ /* Fluid thermodynamic properties */
+ state_eeF = Medium_e.setState_phX(p=Ee.P, h=Ee.h, X=Xe);
+ state_seF = Medium_e.setState_phX(p=Se.P, h=Se.h, X=Xe);
+ state_meF = Medium_e.setState_phX(p=(Ee.P + Se.P)/2, h=(Ee.h + Se.h)/2, X=Xe);
+ state_evC = Medium_c.setState_phX(p=Ev.P, h=Ev.h, X=Ev.Xi);
+ state_spC = Medium_c.setState_phX(p=Sp.P, h=Sp.h, X=Xc);
+ state_sp = Medium_c.setState_phX(p=Ev.P, h=Hep, X=Xc);
+ state_desF = Medium_e.setState_phX(p=Se.P, h=HDesF, X=Xe);
+ state_mpC = Medium_c.setState_phX(p=Ev.P, h=(Hep + Sp.h)/2, X=Xc);
+ state_desmC = Medium_c.setState_phX(p=Ev.P, h=(HsatvC + Ev.h)/2, X=Ev.Xi);
+ state_mpF = Medium_e.setState_phX(p=Ee.P, h=(Ee.h + HeiF)/2, X=Xe);
+ state_mcF = Medium_e.setState_phX(p=(Ee.P + Se.P)/2, h=(HeiF + HDesF)/2, X=Xe);
+ state_desmF = Medium_e.setState_phX(p=Se.P, h=(HDesF + Se.h)/2, X=Xe);
+ state_ecF = Medium_e.setState_phX(p=Ee.P, h=HeiF, X=Xe);
+ cp_desmC = Medium_c.specificHeatCapacityCp(state_desmC);
+ cp_mcF = Medium_e.specificHeatCapacityCp(state_mcF);
+ cp_desmF = Medium_e.specificHeatCapacityCp(state_desmF);
+ cp_mpC = Medium_c.specificHeatCapacityCp(state_mpC);
+ cp_mpF = Medium_e.specificHeatCapacityCp(state_mpF);
+
+ T_evC = Medium_c.temperature(state_evC);
+ T_desF = Medium_e.temperature(state_desF);
+ T_sp = Medium_c.temperature(state_sp);
+ T_eeF = Medium_e.temperature(state_eeF);
+
+ x_flashepC = noEvent(if (Ep.h <= HsateC) then 0 else if (Ep.h >= HsatvC) then 1 else (Ep.h - HsateC)/(HsatvC - HsateC));
+
+ /* Fluid density */
+ rho = Medium_e.density(state_meF);
+
+ /* Saturation point at the vapor inlet pressure */
+ satC = Medium_c.setSat_p(Ev.P);
+ state_lsatC = Medium_c.setBubbleState(satC);
+ state_vsatC = Medium_c.setDewState(satC);
+
+ TsatC = Medium_c.saturationTemperature(Ev.P);
+ HsateC = Medium_c.specificEnthalpy(state_lsatC);
+ HsatvC = Medium_c.specificEnthalpy(state_vsatC);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -308,4 +600,4 @@ Baligh El Hefni
"),
DymolaStoredErrors);
-end NTUWaterHeater;
\ No newline at end of file
+end NTUWaterHeater;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo
index 7dd003e4..6ca73e7e 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleDynamicCondenser.mo
@@ -1,52 +1,72 @@
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"));
- Units.SI.MassFlowRate Q(start = 100) "Mass flow rate in the pipes";
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condenser cavity" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the cooling pipes" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default
+ "Initial liquid phase trace substances (active if dynamic_energy_balance=true and steady_state=false)"
+ annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not
+ steady_state));
+ parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default
+ "Initial vapor phase trace substances (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 "pi";
+ 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";
+ 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";
@@ -56,58 +76,66 @@ model SimpleDynamicCondenser "Simple dynamic condenser"
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";
+ 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";
+ Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Right hand side of the trace balance equation of the liquid phase in the cavity";
+ Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Right hand side of the trace balance equation of the vapor phase in the cavity";
+ Medium.C_BiPhase C_l "Trace partition of the liquid phase of the cavity";
+ Medium.C_BiPhase C_v "Trace partition of the gas phase of 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.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)));
- ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph prod annotation(
- Placement(transformation(extent = {{-60, 20}, {-40, 40}}, rotation = 0)));
- 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)));
-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";
+ Units.SI.MassFlowRate gamma_diff(start=1.e-4)
+ "Diffusion conductance in the pipes";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condenser cavity";
+ Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Liquid phase trace substances in the cavity";
+ Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Vapor phase trace substances in the cavity";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
+ Medium_Cooling.MassFraction Xp[Medium_Cooling.nXi](start=Medium_Cooling.X_default[1:Medium_Cooling.nXi]) "Mass fractions in the cooling pipes";
+ Medium.ThermodynamicState state_l "Liquid phase thermodynamic state in the cavity";
+ Medium.ThermodynamicState state_v "Vapor phase thermodynamic state in the cavity";
+ Medium.ThermodynamicState state_d "Outlet liquid thermodynamic state";
+ Medium_Cooling.ThermodynamicState state_e "Average cooling pipe thermodynamic state";
+ Medium.SaturationProperties sat "Saturation properties in the cavity";
+
+ Interfaces.Connectors.FluidInlet Cv(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{-10,90},{10,110}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cl(redeclare package Medium = Medium) 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
+ Interfaces.Connectors.FluidInlet Cee(redeclare package Medium = Medium_Cooling) annotation (Placement(transformation(
+ extent={{-110,-32},{-90,-12}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cse(redeclare package Medium = Medium_Cooling) annotation (Placement(transformation(
+ extent={{90,-30},{110,-10}}, rotation=0)));
initial equation
if dynamic_energy_balance then
if steady_state then
@@ -115,177 +143,431 @@ initial equation
der(hv) = 0;
der(Vl) = 0;
der(P) = 0;
+ der(SubCl) = fill(0, Medium.nC);
+ der(SubCv) = fill(0, Medium.nC);
else
- hl = lsat.h;
- hv = vsat.h;
+ hl = Medium.bubbleEnthalpy(Medium.setSat_p(P0));
+ hv = Medium.dewEnthalpy(Medium.setSat_p(P0));
Vl = Vf0*V;
P = P0;
+ SubCl = SubCl0;
+ SubCv = SubCv0;
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 */
+
+ /* 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;
+ Cv.Xi = Medium.X_default[1:Medium.nXi];
+ Cv.SubC = Medium.C_default;
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;
+ Cee.Xi = Medium_Cooling.X_default[1:Medium_Cooling.nXi];
+ Cee.SubC = Medium_Cooling.C_default;
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;
+ Cl.Xi = Medium.X_default[1:Medium.nXi];
+ Cl.SubC = Medium.C_default;
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;
+ Cse.Xi = Medium_Cooling.X_default[1:Medium_Cooling.nXi];
+ Cse.SubC = Medium_Cooling.C_default;
end if;
-/* Drum volume */
+
+ /* Drum volume */
V = Vl + Vv;
-/* Water level */
+
+ /* 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 */
+
+ /* Pressure at the bottom of the condenser */
+ Pfond = if gravity_pressure then P + Medium.density(state_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;
+ rhol*der(Vl) + Vl*(Medium.density_derp_h(state_l)*der(P) + Medium.density_derh_p(state_l)*der(hl)) = BQl;
else
0 = BQl;
end if;
-/* Vapor phase mass balance equation in the cavity */
+
+ /* 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;
+ rhov*der(Vv) + Vv*(Medium.density_derp_h(state_v)*der(P) + Medium.density_derh_p(state_v)*der(hv)) = BQv;
else
0 = BQv;
end if;
-/* Condensation and evaporation mass flow rates */
+
+ /* 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;
+
+ /* Liquid phase energy balance equation in the cavity */
+ BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(Medium.bubbleEnthalpy(sat) - (hl - P/rhol)) - Qevap*(Medium.dewEnthalpy(sat) - (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;
+ Vl*((P/rhol*Medium.density_derp_h(state_l) - 1)*der(P) + (P/rhol*Medium.density_derh_p(state_l) + 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;
+
+ /* Vapor phase energy balance equation in the cavity */
+ BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(Medium.dewEnthalpy(sat) - (hv - P/rhov)) - Qcond*(Medium.bubbleEnthalpy(sat) - (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;
+ Vv*((P/rhov*Medium.density_derp_h(state_v) - 1)*der(P) + (P/rhov*Medium.density_derh_p(state_v) + 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 */
+
+ /* Heat transfer between the liquid and the vapor */
Wvl = Kvl*Avl*(Tv - Tl);
-/* Thermal power exchanged from the steam to the pipes */
+
+ /* 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 */
+
+ /* Fluid composition in the cavity (no balance equations) */
+ Cv.Xi = Cl.Xi;
+ X = Cv.Xi;
+
+ /* Traces composition balance equations */
+ /* Equilibrium partition of the traces (Medium.relativeVolatility) applied to
+ every mass transfer between phases. Each transfer removes from one phase
+ exactly what it adds to the other: the balance is exact for any volatility. */
+ if Medium.nC > 0 then
+ C_l = tracePartition(SubCl, xl, sat.Tsat);
+ C_v = tracePartition(SubCv, xv, sat.Tsat);
+ end if;
+
+ SubCSaS = SaS();
+
+ BSubCl = Qcond*C_v.Cl - Qevap*C_l.Cg - Cl.Q*Cl.SubC;
+ BSubCv = Cv.Q*Cv.SubC + Qevap*C_l.Cg - Qcond*C_v.Cl;
+
+ if dynamic_energy_balance then
+ Vl*rhol*der(SubCl) + SubCl*BQl = BSubCl;
+ Vv*rhov*der(SubCv) + SubCv*BQv + Vv*rhov*SubCSaS = BSubCv;
+ else
+ SubCl*BQl = BSubCl;
+ SubCv*BQv + Vv*rhov*SubCSaS = BSubCv;
+ end if;
+
+ Cl.SubC = SubCl;
+
+ /* 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;
+
+ Cee.Xi = Cse.Xi;
+ Cee.SubC = Cse.SubC;
+ Xp = Cee.Xi;
+
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);
+
+ /* 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 */
+
+ /* Diffusion resistance in the pipes */
gamma_diff = A*k/cp/L;
-/* Flow reversal */
+
+ /* 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 */
+
+ /* 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;
+ 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 */
+
+ /* 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),
+
+ sat = Medium.setSat_p(P);
+ state_l = Medium.setState_phX(p=P, h=hl, X=X);
+ state_v = Medium.setState_phX(p=P, h=hv, X=X);
+ state_d = Medium.setState_phX(p=Pfond, h=Cl.h, X=X);
+ state_e = Medium_Cooling.setState_phX(p=Pm, h=hm, X=Xp);
+
+ rhom = Medium_Cooling.density(state_e);
+
+ Tl = Medium.temperature(state_l);
+ rhol = Medium.density(state_l);
+ xl = (hl - Medium.bubbleEnthalpy(sat))/(Medium.dewEnthalpy(sat) - Medium.bubbleEnthalpy(sat));
+
+ Tv = Medium.temperature(state_v);
+ rhov = Medium.density(state_v);
+ xv = (hv - Medium.bubbleEnthalpy(sat))/(Medium.dewEnthalpy(sat) - Medium.bubbleEnthalpy(sat));
+
+ k = Medium_Cooling.thermalConductivity(state_e);
+ cp = Medium_Cooling.specificHeatCapacityCp(state_e);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -296,4 +578,4 @@ Author
Baligh El Hefni
"));
-end SimpleDynamicCondenser;
\ No newline at end of file
+end SimpleDynamicCondenser;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo
index 7bf6bd1c..2c656622 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleEvaporatorWaterSteamFlueGases.mo
@@ -1,125 +1,242 @@
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"));
- 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)));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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)";
+
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";
+ 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";
+ Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions";
+ Medium_FlueGases.MassFraction Xfg[Medium_FlueGases.nXi](start=Medium_FlueGases.X_default[1:Medium_FlueGases.nXi]) "Flue gases mass fractions";
+ Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances";
+ Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances";
+ Medium.ThermodynamicState state_ws_in "Water/steam inlet thermodynamic state";
+ Medium.ThermodynamicState state_ws_out "Water/steam outlet thermodynamic state";
+ Medium.ThermodynamicState state_ws_m "Water/steam average thermodynamic state";
+ Medium.SaturationProperties sat_ws "Water/steam saturation properties at the outlet pressure";
+ Medium_FlueGases.ThermodynamicState state_fg_in "Flue gases inlet thermodynamic state";
+ Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state";
+
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cfg1(redeclare package Medium = Medium_FlueGases) annotation (
+ Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg2(redeclare package Medium = Medium_FlueGases) annotation (
+ Placement(transformation(extent={{-10,-100},{10,-80}}, 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 */
+ /* Flue gases inlet */
Pef = Cfg1.P;
Hef = Cfg1.h;
Qf = Cfg1.Q;
-/* Flue gases outlet */
+
+ /* 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 */
+
+ Cfg1.Xi = Cfg2.Xi;
+ Xfg = Cfg1.Xi;
+ Cfg1.SubC = Cfg2.SubC;
+ SubCfg = Cfg1.SubC;
+
+ /* Water inlet */
Pee = Cws1.P;
Hee = Cws1.h;
Qe = Cws1.Q;
-/* Water outlet */
+
+ /* 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 */
+
+ Cws1.Xi = Cws2.Xi;
+ Xws = Cws1.Xi;
+ Cws1.SubC = Cws2.SubC;
+ SubCws = Cws1.SubC;
+
+ /* Pressure losses */
Pef = Psf + Kdpf*ThermoSysPro.Functions.ThermoSquare(Qf, eps)/rhof;
Pee = Pse + Kdpe*ThermoSysPro.Functions.ThermoSquare(Qe, eps)/rhoe;
-/* Power exchanged */
+
+ /* 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")}),
+
+ /* Flue gases specific enthalpy at the inlet */
+ state_fg_in = Medium_FlueGases.setState_phX(p=Pef, h=Hef, X=Xfg);
+ Tef = Medium_FlueGases.temperature(state_fg_in);
+
+ /* Flue gases specific enthalpy at the outlet */
+ state_fg_out = Medium_FlueGases.setState_phX(p=Psf, h=Hsf, X=Xfg);
+ Tsf = Medium_FlueGases.temperature(state_fg_out);
+
+ /* Flue gases density */
+ rhof = Medium_FlueGases.density(state_fg_in);
+
+ /* Water/steam thermodynamic properties */
+ state_ws_in = Medium.setState_phX(p=Pee, h=Hee, X=Xws);
+ Tee = Medium.temperature(state_ws_in);
+
+ state_ws_m = Medium.setState_phX(p=(Pee + Pse)/2, h=(Hee + Hse)/2, X=Xws);
+ rhoe = Medium.density(state_ws_m);
+
+ state_ws_out = Medium.setState_phX(p=Pse, h=Hse, X=Xws);
+ Tse = Medium.temperature(state_ws_out);
+
+ sat_ws = Medium.setSat_p(Pse);
+ Hse = Medium.dewEnthalpy(sat_ws);
+
+ 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 = "
Author
@@ -129,4 +246,4 @@ Baligh El Hefni
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
"));
-end SimpleEvaporatorWaterSteamFlueGases;
\ No newline at end of file
+end SimpleEvaporatorWaterSteamFlueGases;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo
index a66bcfca..19e87ac9 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/SimpleStaticCondenser.mo
@@ -1,152 +1,243 @@
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"));
- 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";
- 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)));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the cooling side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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)";
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";
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ 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";
+ Medium.MassFraction Xc[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condensing side";
+ Medium_Cooling.MassFraction Xf[Medium_Cooling.nXi](start=Medium_Cooling.X_default[1:Medium_Cooling.nXi]) "Mass fractions in the cooling side";
+ Medium.ThermodynamicState state_ce "Thermodynamic state at the condensing-side inlet";
+ Medium.ThermodynamicState state_cs "Thermodynamic state at the condensing-side outlet";
+ Medium.ThermodynamicState state_mc "Average thermodynamic state in the condensing side";
+ Medium_Cooling.ThermodynamicState state_fe "Thermodynamic state at the cooling-side inlet";
+ Medium_Cooling.ThermodynamicState state_fs "Thermodynamic state at the cooling-side outlet";
+ Medium_Cooling.ThermodynamicState state_mf "Average thermodynamic state in the cooling side";
+ Medium.SaturationProperties sat_c "Saturation properties at the condensing-side inlet pressure";
+
+public
+ Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{-70,-110},{-50,-90}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_Cooling) annotation (Placement(transformation(
+ extent={{-110,-10},{-90,10}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_Cooling) annotation (Placement(transformation(
+ extent={{90,-11},{110,9}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{50,-110},{70,-90}}, 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 */
+
+ /* 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;
+
+ Ec.Xi = Sc.Xi;
+ Ec.SubC = Sc.SubC;
+
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;
+
+ Ef.Xi = Sf.Xi;
+ Ef.SubC = Sf.SubC;
+
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 */
+ Xc = Ec.Xi;
+ Xf = Ef.Xi;
+
+ /* The fluid specific enthalpy at the outlet of the hot side is assumed to be at the saturation point */
+ Sc.h = Medium.bubbleEnthalpy(sat_c);
+
+ /* Power exchanged between the two sides */
W = Qf*(Sf.h - Ef.h);
W = Qc*(Ec.h - Sc.h);
-/* Pressure losses in the hot side */
+
+ /* 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 */
+ 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);
+ DPf = DPff + DPgf;
+
+ /* Fluid thermodynamic properties at the hot side */
+ sat_c = Medium.setSat_p(Ec.P);
+ state_ce = Medium.setState_phX(p=Ec.P, h=Ec.h, X=Xc);
+ state_cs = Medium.setState_phX(p=Sc.P, h=Sc.h, X=Xc);
+ state_mc = Medium.setState_phX(p=(Ec.P + Sc.P)/2, h=(Ec.h + Sc.h)/2, X=Xc);
+
+ Tec = Medium.temperature(state_ce);
+ Tsc = Medium.temperature(state_cs);
+
if (p_rhoc > 0) then
rhoc = p_rhoc;
else
- rhoc = promc.d;
+ rhoc = Medium.density(state_mc);
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;
+
+ /* Fluid thermodynamic properties at the cold side */
+ state_fe = Medium_Cooling.setState_phX(p=Ef.P, h=Ef.h, X=Xf);
+ state_fs = Medium_Cooling.setState_phX(p=Sf.P, h=Sf.h, X=Xf);
+ state_mf = Medium_Cooling.setState_phX(p=(Ef.P + Sf.P)/2, h=(Ef.h + Sf.h)/2, X=Xf);
+
+ Tef = Medium_Cooling.temperature(state_fe);
+ Tsf = Medium_Cooling.temperature(state_fs);
+
if (p_rhof > 0) then
rhof = p_rhof;
else
- rhof = promf.d;
+ rhof = Medium_Cooling.density(state_mf);
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),
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -157,4 +248,4 @@ Baligh El Hefni
"),
DymolaStoredErrors);
-end SimpleStaticCondenser;
\ No newline at end of file
+end SimpleStaticCondenser;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo
index ab8ea84b..d5246afd 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/StaticAerocondenser.mo
@@ -1,46 +1,58 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-
+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"));
- 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";
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_Air = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the air side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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.s2/(kg.m3))";
+ parameter Real Ka=0.00 "Pressure loss coefficient for the air (Pa.s2/(kg.m3))";
+ 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";
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ 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.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.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.Density rho_e(start=998)
+ "Water density at the outlet of the condenser";
+ Units.SI.Density rho_a(start=1) "Air density";
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";
@@ -51,118 +63,117 @@ model StaticAerocondenser "Static aerocondenser"
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";
- 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)));
- 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)));
-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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condenser cavity";
+ Medium.ExtraProperty SubC[Medium.nC](start=Medium.C_default) "Trace substance concentrations in the condenser cavity";
+ Medium_Air.MassFraction X_Air[Medium_Air.nXi](start=Medium_Air.X_default[1:Medium_Air.nXi]) "Air mass fractions";
+ Medium.SaturationProperties sat "Saturation properties inside the condenser";
+
+public
+ Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{-10,100},{10,120}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{-10,-120},{10,-100}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet Cair1(redeclare package Medium = Medium_Air) annotation (Placement(transformation(
+ extent={{100,-119},{120,-99}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cair2(redeclare package Medium = Medium_Air) annotation (Placement(transformation(
+ extent={{100,100},{120,120}}, rotation=0)));
+public
+ Interfaces.Connectors.FluidInlet Cw(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{-120,-100},{-100,-80}}, rotation=0), iconTransformation(
+ extent={{-120,-100},{-100,-80}})));
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 */
+ /* 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;
+ Cw.Xi = Medium.X_default[1:Medium.nXi];
+ Cw.SubC = Medium.C_default;
end if;
-/* Pressure at the bottom of the condenser*/
+
+ /* Pressure at the bottom of the condenser*/
Pfond = Pcond + rho_e*g*z;
-/* Water/steam mass balance equation */
+
+ /* 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 */
+
+ /* 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 */
+
+ /* Fluid composition in the cavity (no balance equations) */
+ X = Cws1.Xi;
+ SubC = Cws1.SubC;
+ Cws2.Xi = X;
+ Cws2.SubC = SubC;
+
+ /* 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;
+
+ Cair1.Xi = Cair2.Xi;
+ Cair1.SubC = Cair2.SubC;
+ X_Air = Cair1.Xi;
+
Qa = Cair1.Q;
Pae = Cair1.P;
Pas = Cair2.P;
hae = Cair1.h;
has = Cair2.h;
+
deltaP = Cair1.P - Cair2.P;
-/* Air pressure loss */
+
+ /* Air pressure loss */
deltaP = Ka*Qa*abs(Qa)/rho_a;
-/* Heat power transferred to the cooling water */
+
+ /* Heat power transferred to the cooling water */
W = Qa*(has - hae);
-/* Heat exchange coefficient */
+
+ /* Heat exchange coefficient */
U = UCOR*Uref*(-2.e-4*(Tae - 273.16)^2 + 0.0187*(Tae - 273.16) + 0.5007);
-/* Number of transfer units */
+
+ /* 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 */
+
+ /* Efficiency in the two-phase flow regime */
Ef = 1 - exp(-Nut);
-/* Flow reversal */
+
+ /* 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 */
+
+ /* 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;
@@ -170,40 +181,293 @@ equation
rws1 = 0;
rw = 0;
rws2 = 0;
+
gamma_ws1 = gamma0;
gamma_w = gamma0;
gamma_ws2 = gamma0;
+
Jws1 = 0;
Jw = 0;
Jws2 = 0;
- end if;
+ 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 */
+
+ /* 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),
+
+ /* Condensation pressure */
+ Pcond = Medium.saturationPressure(Tcond);
+
+ /* Water/steam thermodynamic properties */
+ rho_e = Medium.density_phX(p=(Pfond + Pcond)/2, h=he, X=X);
+
+ /* Water specific enthalpy at the saturation point with pressure Pcond */
+ sat = Medium.setSat_p(Pcond);
+ he = Medium.bubbleEnthalpy(sat);
+
+ /* Air thermodynamic properties */
+ Tae = Medium_Air.temperature_phX(p=Pae, h=hae, X=X_Air);
+ has = Medium_Air.specificEnthalpy_pTX(p=Pas, T=Tas, X=X_Air);
+ rho_a = Medium_Air.density_phX(p=Pae, h=hae, X=X_Air);
+ cp_a = Medium_Air.specificHeatCapacityCp(Medium_Air.setState_pTX(p=(Pae + Pas)/2, T=(Tae + Tas)/2, X=X_Air));
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -213,4 +477,4 @@ Author
Baligh El Hefni
"));
-end StaticAerocondenser;
\ No newline at end of file
+end StaticAerocondenser;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo
index 1f050e36..c9c862de 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenser.mo
@@ -1,58 +1,76 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-
+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"));
- 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";
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ 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";
@@ -66,134 +84,132 @@ model StaticCondenser "Static condenser"
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";
- 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)));
- ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proee "Propriétés de l'eau" annotation(
- Placement(transformation(extent = {{20, 80}, {40, 100}}, rotation = 0)));
- 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)));
- ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep "Drain inlet" annotation(
- Placement(transformation(extent = {{-112, 8}, {-88, 30}}, rotation = 0)));
- ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev "Vapor inlet" annotation(
- Placement(transformation(extent = {{-112, 50}, {-88, 72}}, rotation = 0)));
-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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condenser cavity";
+ Medium.ExtraProperty SubC[Medium.nC](start=Medium.C_default) "Trace substance concentrations in the condenser cavity";
+ Medium_Cooling.MassFraction X_Cooling[Medium_Cooling.nXi](start=Medium_Cooling.X_default[1:Medium_Cooling.nXi]) "Mass fractions in the cooling pipe";
+ Medium.ThermodynamicState state_ex "Thermodynamic state at the extraction point";
+ Medium_Cooling.ThermodynamicState state_ee "Thermodynamic state at the cooling water inlet";
+ Medium_Cooling.ThermodynamicState state_se "Thermodynamic state at the cooling water outlet";
+ Medium.SaturationProperties sat "Saturation properties inside the condenser";
+
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cee(redeclare package Medium = Medium_Cooling) "Cooling water inlet"
+ annotation (Placement(transformation(extent={{-112,-72},{-88,-50}},
+ rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cse(redeclare package Medium = Medium_Cooling)
+ "Cooling water outlet" annotation (Placement(transformation(extent={{90,-72},
+ {114,-50}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex(redeclare package Medium = Medium) "Extraction water"
+ annotation (Placement(transformation(extent={{-12,-112},{14,-88}}, rotation=
+ 0), iconTransformation(extent={{-12,-112},{14,-88}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cvt(redeclare package Medium = Medium) "Turbine outlet"
+ annotation (Placement(transformation(extent={{-13,88},{13,114}}, rotation=0)));
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep(redeclare package Medium = Medium) "Drain inlet"
+ annotation (Placement(transformation(extent={{-112,8},{-88,30}}, rotation=0)));
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev(redeclare package Medium = Medium) "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 */
+ /* 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;
+ Cev.Xi = Medium.X_default[1:Medium.nXi];
+ Cev.SubC = Medium.C_default;
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;
+ Cep.Xi = Medium.X_default[1:Medium.nXi];
+ Cep.SubC = Medium.C_default;
end if;
-// Water/steam cavity
-//-------------------
-/* Mass balance equation */
+
+ // 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 */
+
+ /* Extraction water pressure */
Pex = Pcond + rho_ex*g*z;
-/* Fluid pressure */
+
+ /* 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 */
+
+ /* 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;
+ // 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 */
+
+ /* 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 */
+ // 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 */
+
+ /* Second reference value for the exchange coefficient */
KT2 = -0.05*(Tee - 273.16)^2 + 3.3*(Tee - 273.16) + 52;
-/* Heat exchange coefficient */
+
+ /* Heat exchange coefficient */
XKCO = KCO*(COP/COPR)*(KT2/KT1)*ThermoSysPro.Functions.ThermoRoot(Qee/QC0, Modelica.Constants.eps);
-/* Fluid saturation temperature */
+
+ /* 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 */
+
+ /* Fluid composition in the cavity (no balance equations) */
+ X = Cvt.Xi;
+ SubC = Cvt.SubC;
+ Cex.Xi = X;
+ Cex.SubC = SubC;
+
+ /* 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 */
+
+ /* 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;
@@ -203,67 +219,230 @@ equation
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;
+ 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 */
+
+ // 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;
+
+ Cee.Xi = Cse.Xi;
+ Cee.SubC = Cse.SubC;
+
Qee = Cee.Q;
Qse = Cse.Q;
+ X_Cooling = Cee.Xi;
+
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 */
+
+ /* 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),
+
+ /* Fluid thermodynamic properties */
+ state_ee = Medium_Cooling.setState_phX(p=Pee, h=Hee, X=X_Cooling);
+ state_ex = Medium.setState_phX(p=Pex, h=Hex, X=X);
+ state_se = Medium_Cooling.setState_phX(p=Pse, h=Hse, X=X_Cooling);
+
+ rho_ee = Medium_Cooling.density(state_ee);
+ rho_ex = Medium.density(state_ex);
+
+ Tee = Medium_Cooling.temperature(state_ee);
+ Tse = Medium_Cooling.temperature(state_se);
+
+ /* Vapor pressure inside the condenser */
+ Pcond = Medium.saturationPressure(Tsat);
+
+ /* Fluid thermodynamic properties at the saturation point */
+ sat = Medium.setSat_p(Pcond);
+
+ Hsate = Medium.bubbleEnthalpy(sat);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -274,4 +453,4 @@ Author
Baligh El Hefni
"));
-end StaticCondenser;
\ No newline at end of file
+end StaticCondenser;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo
index 4f105a77..ac85f0c7 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/StaticCondenserHEI.mo
@@ -1,124 +1,147 @@
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"));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the condensing side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_Cooling = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cooling side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ constant Real pi=Modelica.Constants.pi "pi";
+ 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";
+ 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.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";
+ 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 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.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.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";
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";
@@ -132,130 +155,126 @@ model StaticCondenserHEI "HEI static condenser"
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";
- 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)));
- ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph profe "Proprietes eau" annotation(
- Placement(transformation(extent = {{20, 80}, {40, 100}}, rotation = 0)));
- 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)));
- ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep "Drain inlet" annotation(
- Placement(transformation(extent = {{-112, 8}, {-88, 30}}, rotation = 0)));
- ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev "Vapor inlet" annotation(
- Placement(transformation(extent = {{-112, 50}, {-88, 72}}, rotation = 0)));
- 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)));
-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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions in the condenser cavity";
+ Medium.ExtraProperty SubC[Medium.nC](start=Medium.C_default) "Trace substance concentrations in the condenser cavity";
+ Medium_Cooling.MassFraction X_Cooling[Medium_Cooling.nXi](start=Medium_Cooling.X_default[1:Medium_Cooling.nXi]) "Mass fractions in the cooling pipe";
+ Medium.ThermodynamicState state_ce "Thermodynamic state at the condensing-side inlet average enthalpy";
+ Medium.ThermodynamicState state_cs "Thermodynamic state at the extraction outlet";
+ Medium_Cooling.ThermodynamicState state_fe "Thermodynamic state at the cooling water inlet";
+ Medium_Cooling.ThermodynamicState state_fs "Thermodynamic state at the cooling water outlet";
+ Medium_Cooling.ThermodynamicState state_mf "Average thermodynamic state of the cooling water";
+ Medium.SaturationProperties sat "Saturation properties inside the condenser";
+
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cee(redeclare package Medium = Medium_Cooling) "Cooling water inlet"
+ annotation (Placement(transformation(extent={{-112,-72},{-88,-50}},
+ rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cse(redeclare package Medium = Medium_Cooling)
+ "Cooling water outlet" annotation (Placement(transformation(extent={{90,-72},
+ {114,-50}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex(redeclare package Medium = Medium) "Extraction water"
+ annotation (Placement(transformation(extent={{-12,-112},{14,-88}}, rotation=
+ 0), iconTransformation(extent={{-12,-112},{14,-88}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cvt(redeclare package Medium = Medium) "Turbine outlet"
+ annotation (Placement(transformation(extent={{-13,88},{13,114}}, rotation=0),
+ iconTransformation(extent={{-13,88},{13,114}})));
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cep(redeclare package Medium = Medium) "Drain inlet"
+ annotation (Placement(transformation(extent={{-112,8},{-88,30}}, rotation=0)));
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev(redeclare package Medium = Medium) "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;
-/* 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 */
+ /* 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;
+ Cev.Xi = Medium.X_default[1:Medium.nXi];
+ Cev.SubC = Medium.C_default;
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;
+ Cep.Xi = Medium.X_default[1:Medium.nXi];
+ Cep.SubC = Medium.C_default;
end if;
-// Water/steam cavity
-//-------------------
-/* Mixer: mass balance equation */
+
+ // Water/steam cavity
+ //-------------------
+
+ /* Mixer: mass balance equation */
0 = Cvt.Q + Cev.Q + Cep.Q - Cex.Q;
+
Qc = Cex.Q;
-/* Extraction water pressure */
+
+ /* Extraction water pressure */
Cex.P = Pcond + rho_ex*g*(z2c - z1c);
-/* Fluid pressure */
+
+ /* 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;
+
+ /* 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 = Medium.bubbleEnthalpy(sat);
+ // 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 */
+
+ /* 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 */
+
+ // 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 Medium.bubbleEnthalpy(sat) + ((Cex.P - Pcond)/rho_ex) else Medium.bubbleEnthalpy(sat));
+
+ /* 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 */
+
+ /* Fluid composition in the cavity (no balance equations) */
+ X = Cvt.Xi;
+ SubC = Cvt.SubC;
+ Cex.Xi = X;
+ Cex.SubC = SubC;
+
+ /* 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 */
+
+ /* 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;
@@ -265,72 +284,92 @@ equation
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;
+ 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 */
+
+ // 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;
+
+ Cee.Xi = Cse.Xi;
+ Cee.SubC = Cse.SubC;
+
Qf = Cee.Q;
-/* Pressure losses in the cold side */
+ X_Cooling = Cee.Xi;
+
+ /* 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 */
+
+ /* 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);
+
+ /* Fluid thermodynamic properties of the hot side */
+ state_ce = Medium.setState_phX(p=Cvt.P, h=Hmv, X=X);
+ state_cs = Medium.setState_phX(p=Cex.P, h=Cex.h, X=X);
+ // state_cs could alternatively use an average pressure and enthalpy between saturation and extraction outlet.
+
+ Tec = Medium.temperature(state_ce);
+ Tsc = Medium.temperature(state_cs);
+
+ sat = Medium.setSat_p(Pcond);
+
if (p_rhoc > 0) then
rho_ex = p_rhoc;
else
- rho_ex = procs.d;
+ rho_ex = Medium.density(state_cs);
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;
+
+ /* Fluid thermodynamic properties of the cold side */
+ state_fe = Medium_Cooling.setState_phX(p=Cee.P, h=Cee.h, X=X_Cooling);
+ state_fs = Medium_Cooling.setState_phX(p=Cse.P, h=Cse.h, X=X_Cooling);
+ state_mf = Medium_Cooling.setState_phX(p=(Cee.P + Cse.P)/2, h=(Cee.h + Cse.h)/2, X=X_Cooling);
+
+ Tef = Medium_Cooling.temperature(state_fe);
+ Tsf = Medium_Cooling.temperature(state_fs);
+
if (p_rhof > 0) then
rhof = p_rhof;
else
- rhof = promf.d;
+ rhof = Medium_Cooling.density(state_mf);
end if;
-/* Calculation of the heat exchange surface */
+
+ /* 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;
@@ -338,19 +377,26 @@ equation
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 */
+
+ /* 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 */
+
+ /* 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 */
+
+ /* 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 */
+
+ /* 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 */
+
+ /* 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 */
+
+ /* 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);
@@ -358,49 +404,179 @@ equation
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 */
+
+ /* 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 */
+
+ /* Calculation of the average specific heat capacity of the cold water */
+ Cpmf = Medium_Cooling.specificHeatCapacityCp(state_mf);
+
+ /* 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 */
+
+ /* Calculation of expected HEI saturation pressure */
+ Psat_att = Medium.saturationPressure(Tsat_att);
+
+ /* 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 = Medium.saturationTemperature(Pcut_off);
+
+ /* 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*/
+
+ /* 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 */
+
+ /* Calculation of the expected HEI corrected saturation pressure */
+ Tsat = Medium.saturationTemperature(Pcond);
+
+ /* 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 */
+
+ /* 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),
+
+ 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 = "
-## Copyright © EDF 2002 - 2026
-## ThermoSysPro Version 4.2
+## Copyright © EDF 2002 - 2026
+## ThermoSysPro Version 4.2
", revisions = "
-Author
+Author
-Baligh El Hefni
+Baligh El Hefni
"));
-end StaticCondenserHEI;
\ No newline at end of file
+end StaticCondenserHEI;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo
index 9a8bde44..2b4c4417 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerDTorWorEff.mo
@@ -1,150 +1,390 @@
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"));
- 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";
+
+ replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ 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";
- 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)));
-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";
+ Units.SI.MassFlowRate Qc(start=100) "Hot fluid mass flow rate";
+ Units.SI.MassFlowRate Qf(start=100) "Cold fluid mass flow rate";
+ Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid";
+ Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid";
+ Medium_c.ThermodynamicState state_ce "Thermodynamic state of the hot fluid at the inlet";
+ Medium_c.ThermodynamicState state_cs "Thermodynamic state of the hot fluid at the outlet";
+ Medium_c.ThermodynamicState state_cm "Average thermodynamic state of the hot fluid";
+ Medium_f.ThermodynamicState state_fe "Thermodynamic state of the cold fluid at the inlet";
+ Medium_f.ThermodynamicState state_fs "Thermodynamic state of the cold fluid at the outlet";
+ Medium_f.ThermodynamicState state_fm "Average thermodynamic state of the cold fluid";
+
+public
+ Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) "Hot inlet" annotation (Placement(
+ transformation(extent={{-50,31},{-30,51}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) "Cold inlet" annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) "Cold outlet" annotation (Placement(
+ transformation(extent={{90,-9},{110,11}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) "Hot outlet" annotation (Placement(
+ transformation(extent={{30,31},{50,51}}, rotation=0)));
equation
-/* Mass flow rates */
+
+ /* 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;
+
+ Ec.Xi = Sc.Xi;
+ Ec.SubC = Sc.SubC;
+
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;
+
+ Ef.Xi = Sf.Xi;
+ Ef.SubC = Sf.SubC;
+
Qc = Ec.Q;
Qf = Ef.Q;
-/* Power exchanged between the hot and cold fluids */
+ Xc = Ec.Xi;
+ Xf = Ef.Xi;
+
+ /* 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);
+ Sf.h = Medium_f.specificEnthalpy_pTX(p=Sf.P, T=Tsf, X=Xf);
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);
+ Tsf = Medium_f.temperature(state_fs);
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);
+ Tsf = Medium_f.temperature(state_fs);
else
assert(false, "StaticWaterWaterExchangerDTorWorEff: invalid option");
end if;
-/* Pressure losses for the hot fluid */
+
+ /* 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 */
+ 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 */
+ DPf = DPff + DPgf;
+
+ /* Hot fluid Temperature at the inlet and at the outlet */
+ state_ce = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc);
+ state_cs = Medium_c.setState_phX(p=Sc.P, h=Sc.h, X=Xc);
+ state_cm = Medium_c.setState_phX(p=(Ec.P + Sc.P)/2, h=(Ec.h + Sc.h)/2, X=Xc);
+ Tec = Medium_c.temperature(state_ce);
+ Tsc = Medium_c.temperature(state_cs);
+
+ /* 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);
+ rhoc = Medium_c.density(state_cm);
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 */
+
+ /* Cold fluid Temperature at the inlet */
+ state_fe = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf);
+ state_fs = Medium_f.setState_phX(p=Sf.P, h=Sf.h, X=Xf);
+ state_fm = Medium_f.setState_phX(p=(Ef.P + Sf.P)/2, h=(Ef.h + Sf.h)/2, X=Xf);
+ Tef = Medium_f.temperature(state_fe);
+
+ /* 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);
+ rhof = Medium_f.density(state_fm);
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),
+
+ /* Average specific heat capacities */
+ Cpf = Medium_f.specificHeatCapacityCp(state_fe);
+ Cpc = Medium_c.specificHeatCapacityCp(state_ce);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -155,4 +395,4 @@ Baligh El Hefni
"),
DymolaStoredErrors);
-end StaticExchangerDTorWorEff;
\ No newline at end of file
+end StaticExchangerDTorWorEff;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo
index e73dd292..8ee3569d 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/StaticExchangerKS.mo
@@ -1,140 +1,244 @@
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"));
+
+ replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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"));
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ 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";
+ 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";
+ 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";
+ Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid";
+ Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid";
+ Medium_c.ThermodynamicState state_c "Thermodynamic state of the hot fluid";
+ Medium_f.ThermodynamicState state_f "Thermodynamic state 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)));
-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";
+
+ Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) annotation (Placement(transformation(
+ extent={{90,-40},{110,-20}}, rotation=0), iconTransformation(extent={
+ {90,-40},{110,-20}})));
+ Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) annotation (Placement(transformation(
+ extent={{-110,-40},{-90,-20}}, rotation=0), iconTransformation(extent=
+ {{-110,-40},{-90,-20}})));
+ Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) annotation (Placement(transformation(
+ extent={{-110,20},{-90,40}}, rotation=0), iconTransformation(extent={
+ {-110,20},{-90,40}})));
+ Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) 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 */
+
+ /* 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;
+
+ Ec.Xi = Sc.Xi;
+ Ec.SubC = Sc.SubC;
+
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;
+
+ Ef.Xi = Sf.Xi;
+ Ef.SubC = Sf.SubC;
+
Qc = Ec.Q;
Qf = Ef.Q;
-/* Presure losses */
+ Xc = Ec.Xi;
+ Xf = Ef.Xi;
+
+ /* 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;
+ /* Counter-current exchanger */
+ DT1 = Tec - Tsf;
+ DT2 = Tsc - Tef;
elseif (exchanger_conf == 2) then
-/* Co-current exchanger */
- DT1 = Tec - Tef;
- DT2 = Tsc - Tsf;
+ /* Co-current exchanger */
+ DT1 = Tec - Tef;
+ DT2 = Tsc - Tsf;
else
- DT1 = 0;
- DT2 = 0;
- assert(false, "StaticExchangerFlueGasesWaterSteam: incorrect exchanger configuration");
+ 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);
+
+ 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 */
+
+ /* Cold fluid temperatures */
+ Tef = Medium_f.temperature_phX(p=Ef.P, h=Ef.h, X=Xf);
+ Tsf = Medium_f.temperature_phX(p=Sf.P, h=Sf.h, X=Xf);
+
+ /* Hot fluid temperatures */
+ Tec = Medium_c.temperature_phX(p=Ec.P, h=Ec.h, X=Xc);
+ Tsc = Medium_c.temperature_phX(p=Sc.P, h=Sc.h, X=Xc);
+
+ /* Specific heat capacities */
+ state_f = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf);
+ state_c = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc);
+ Cpf = Medium_f.specificHeatCapacityCp(state_f);
+ Cpc = Medium_c.specificHeatCapacityCp(state_c);
+
+ /* 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);
+ rhoc = Medium_c.density_phX(p=(Ec.P + Sc.P)/2, h=(Ec.h + Sc.h)/2, X=Xc);
end if;
-/* Cold fluid density */
+
+ /* 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);
+ rhof = Medium_f.density_phX(p=(Ef.P + Sf.P)/2, h=(Ef.h + Sf.h)/2, X=Xf);
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),
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -144,4 +248,4 @@ Author
Baligh El Hefni
"));
-end StaticExchangerKS;
\ No newline at end of file
+end StaticExchangerKS;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo
index 75382a2c..bf61196b 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/StaticPlateHeatExchanger.mo
@@ -1,154 +1,168 @@
-within ThermoSysPro.Fluid.HeatExchangers;
-
+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"));
+
+ replaceable package Medium_c = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the hot fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_f = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the cold fluid" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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"));
+
+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";
+ 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";
+ 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";
+ 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";
- 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)));
-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";
+ 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";
+ Medium_c.MassFraction Xc[Medium_c.nXi](start=Medium_c.X_default[1:Medium_c.nXi]) "Mass fractions of the hot fluid";
+ Medium_f.MassFraction Xf[Medium_f.nXi](start=Medium_f.X_default[1:Medium_f.nXi]) "Mass fractions of the cold fluid";
+ Medium_c.ThermodynamicState state_c "Average thermodynamic state of the hot fluid";
+ Medium_f.ThermodynamicState state_f "Average thermodynamic state of the cold fluid";
+ Medium_c.ThermodynamicState state_ce "Thermodynamic state of the hot fluid at the inlet";
+ Medium_c.ThermodynamicState state_cs "Thermodynamic state of the hot fluid at the outlet";
+ Medium_f.ThermodynamicState state_fe "Thermodynamic state of the cold fluid at the inlet";
+ Medium_f.ThermodynamicState state_fs "Thermodynamic state of the cold fluid at the outlet";
+
+public
+ Interfaces.Connectors.FluidInlet Ec(redeclare package Medium = Medium_c) annotation (Placement(transformation(
+ extent={{-110,-10},{-90,10}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet Ef(redeclare package Medium = Medium_f) annotation (Placement(transformation(
+ extent={{-60,-70},{-40,-50}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Sf(redeclare package Medium = Medium_f) annotation (Placement(transformation(
+ extent={{40,-70},{60,-50}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Sc(redeclare package Medium = Medium_c) annotation (Placement(transformation(
+ extent={{90,-8},{110,12}}, rotation=0)));
equation
-/* Mass flow rates */
+
+ /* 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;
+
+ Ec.Xi = Sc.Xi;
+ Ec.SubC = Sc.SubC;
+
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;
+
+ Ef.Xi = Sf.Xi;
+ Ef.SubC = Sf.SubC;
+
Qc = Ec.Q;
Qf = Ef.Q;
-/* Pressures */
+ Xc = Ec.Xi;
+ Xf = Ef.Xi;
+
+ /* 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 */
+
+ /* 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);
+ W = Qc*Medium_c.specificHeatCapacityCp(state_c)*(Tec - Tsc);
else
Tec = Tsc;
end if;
+
if (abs(Qf) > 1.e-3) then
- W = Qf*prof.cp*(Tsf - Tef);
+ W = Qf*Medium_f.specificHeatCapacityCp(state_f)*(Tsf - Tef);
else
Tef = Tsf;
end if;
-/* Difference in average temperatures */
+
+ /* 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 */
+ /* Counter-current heat exchanger */
DT1 = Tec - Tsf;
DT2 = Tsc - Tef;
elseif (exchanger_type == 2) then
-/* Co-current heat exchanger */
+ /* Co-current heat exchanger */
DT1 = Tec - Tef;
DT2 = Tsc - Tsf;
else
@@ -156,27 +170,33 @@ equation
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) */
+
+ /* Heat exchange area (for the plate heat exchanger) */
S = (nbp - 2)*Sp;
N = (nbp - 1)/2;
-/* Heat exchange coefficients */
+
+ /* 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);
+ hc = noEvent(if (qmc < 1.e-3) then 0 else 11.245*qmc^0.8*abs(muc*Medium_c.specificHeatCapacityCp(state_c)/lambdac)^0.4*lambdac);
+ hf = noEvent(if (qmf < 1.e-3) then 0 else 11.245*qmf^0.8*abs(muf*Medium_f.specificHeatCapacityCp(state_f)/lambdaf)^0.4*lambdaf);
else
hc = 0;
hf = 0;
assert(false, "StaticWaterWaterExchanger: incorrect heat exchange correlation number");
end if;
-/* Pressure losses */
+
+ /* 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;
@@ -186,44 +206,132 @@ equation
else
DPc = 0;
DPf = 0;
- assert(false, "StaticWaterWaterExchanger: incorrect pressure loss correlation number");
+ assert(false,
+ "StaticWaterWaterExchanger: incorrect pressure loss correlation number");
end if;
-/* Fluid thermodynamic properties */
+
+ /* 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;
+
+ state_c = Medium_c.setState_phX(p=Pmc, h=Hmc, X=Xc);
+ state_f = Medium_f.setState_phX(p=Pmf, h=Hmf, X=Xf);
+
+ Tmc = Medium_c.temperature(state_c);
+ Tmf = Medium_f.temperature(state_f);
+
if (p_rhoc > 0) then
rhoc = p_rhoc;
else
- rhoc = proc.d;
+ rhoc = Medium_c.density(state_c);
end if;
+
if (p_rhof > 0) then
rhof = p_rhof;
else
- rhof = prof.d;
+ rhof = Medium_f.density(state_f);
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),
+
+ muc = Medium_c.dynamicViscosity(state_c);
+ muf = Medium_f.dynamicViscosity(state_f);
+
+ lambdac = Medium_c.thermalConductivity(state_c);
+ lambdaf = Medium_f.thermalConductivity(state_f);
+
+ /* Fluid temperatures at the inlet and outlet of the exchanger */
+ state_ce = Medium_c.setState_phX(p=Ec.P, h=Ec.h, X=Xc);
+ state_cs = Medium_c.setState_phX(p=Sc.P, h=Sc.h, X=Xc);
+
+ state_fe = Medium_f.setState_phX(p=Ef.P, h=Ef.h, X=Xf);
+ state_fs = Medium_f.setState_phX(p=Sf.P, h=Sf.h, X=Xf);
+
+ Tec = Medium_c.temperature(state_ce);
+ Tsc = Medium_c.temperature(state_cs);
+ Tef = Medium_f.temperature(state_fe);
+ Tsf = Medium_f.temperature(state_fs);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -234,4 +342,4 @@ Author
Daniel Bouskela
"));
-end StaticPlateHeatExchanger;
\ No newline at end of file
+end StaticPlateHeatExchanger;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo b/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo
index bbe2ae3d..9b807b2d 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/StaticWallFlueGasesExchanger.mo
@@ -1,190 +1,229 @@
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";
- 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";
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Mixture gas medium" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 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 Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the medium composition";
+ parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the medium composition";
+ 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";
+ 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.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";
+ parameter Units.SI.MolarMass MM[Medium.nX]={Medium.fluidConstants[j].molarMass for j in 1:Medium.nX} "Component molar masses";
+ Medium.ThermodynamicState state1[N - 1] "Thermodynamic state in thermal node i";
+ Medium.ThermodynamicState state2[N] "Thermodynamic state in hydraulic node i";
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.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";
- 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)));
-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
+ Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) 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(redeclare package Medium = Medium) 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 */
+
+ assert(Medium.nX > 1, "StaticWallFlueGasesExchanger: Medium must be a gas mixture");
+ assert(iH2O > 0, "StaticWallFlueGasesExchanger: Medium.substanceNames must contain H2O/Water for radiative heat transfer");
+ assert(iCO2 > 0, "StaticWallFlueGasesExchanger: Medium.substanceNames must contain CO2/Carbondioxide for radiative heat transfer");
+
+ /* Wall boundary */
CTh.W = -dW1;
- CTh.T = Tp;
-/* Pipe boundaries */
+ Tp = CTh.T;
+
+ /* 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) */
+
+ C1.Xi = C2.Xi;
+ C1.SubC = C2.SubC;
+
+ Xh2o = C1.Xi[iH2O];
+ Xco2 = C1.Xi[iCO2];
+
+ /* Volume fractions */
+ Xvco2 = Xco2/MM[iCO2]/sum({C1.Xi[k]/MM[k] for k in 1:Medium.nX});
+ Xvh2o = Xh2o/MM[iH2O]/sum({C1.Xi[k]/MM[k] for k in 1:Medium.nX});
+
+ /* Total molar mass */
+ Mmt = sum({C1.Xi[k]/MM[k] for k in 1:Medium.nX})^(-1);
+
+ /* Mass and energy balance equations (thermal nodes) */
for i in 1:N - 1 loop
-/* Mass balance equation */
+ /* Mass balance equation */
0 = Q[i] - Q[i + 1];
-/* Energy balance equation */
+
+ /* 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 */
+
+ /* 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;
+
+ /* Partial gas pressures */
+ Ph2o[i] = P[i + 1]*Xvh2o;
+ Pco2[i] = P[i + 1]*Xvco2;
+
if (abs(Q[i]) >= Qmin) then
-/* Convective heat exchange coefficient */
+ /* Convective heat exchange coefficient */
if (exchanger_type == 1) then
-/* Crossed flux */
+ /* Crossed flux */
Kcc[i] = ThermoSysPro.Correlations.Thermal.WBCrossedCurrentConvectiveHeatTransferCoefficient(TFilm[i], abs(Q[i]), Xh2o*100, Sgaz, Dext, Fa);
else
-/* Longitudinal flux */
+ /* 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 */
+
+ /* 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 */
+
+ /* Film temperature */
TFilm[i] = (T1[i] + Tp[i])/2;
-/* Power exchanged for each section */
+
+ /* Power exchanged for each section */
dW1[i] = Coeff*K*(T1[i] - Tp[i])*Surf_ext;
-/* Flow reversal */
+
+ /* 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 */
+
+ /* 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
+ 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;
@@ -195,44 +234,80 @@ equation
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);
+
+ /* Fluid thermodynamic properties */
+ state1[i] = Medium.setState_phX(p=P[i + 1], h=h[i + 1], X=C1.Xi);
+ T1[i] = Medium.temperature(state1[i]);
end for;
-/* Momentum balance equations (hydraulic nodes) */
+
+ /* 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 */
+ /* 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 */
+
+ /* Fluid thermodynamic properties */
+ state2[i] = Medium.setState_phX(p=(P[i] + P[i + 1])/2, h=hb[i], X=C1.Xi);
+
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);
+ rho2[i] = Medium.density(state2[i]);
end if;
- T2[i] = ThermoSysPro.Properties.Fluid.Temperature_Ph((P[i] + P[i + 1])/2, hb[i], fluid, 0, Xco2, Xh2o, Xo2, Xso2);
+
+ T2[i] = Medium.temperature(state2[i]);
end for;
-/* Total heat exchange coefficient ??? */
+
+ /* 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 */
+
+ /* Convective and radiative heat exchange coefficients */
Kc = sum(Kcc)*Surf_ext/Surf_tot;
Kr = sum(Krr)*Surf_ext/Surf_tot;
-/* Total power exchanged */
+
+ /* Total power exchanged */
W = sum(dW1);
-/* Total fluid diffusion resistance */
+
+ /* 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}})}),
+
+ 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 = "
Author
@@ -242,4 +317,4 @@ Baligh El Hefni
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
"));
-end StaticWallFlueGasesExchanger;
\ No newline at end of file
+end StaticWallFlueGasesExchanger;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo
index 51b7455b..9af2f3a1 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo
+++ b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_1SG.mo
@@ -1,117 +1,457 @@
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";
- 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)));
- 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)));
- 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)));
- 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)));
-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)));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model for the secondary water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_Primary = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the primary side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ parameter Integer Ns=5 "Number of segments in tubes and riser" annotation (Dialog(tab="General", group="Geometry"));
+
+ parameter Integer n_tubes=4085 "Number of pipes in parallel" annotation (Dialog(tab="General", group="Geometry"));
+ parameter Units.SI.Area S=4669 "Heat exchange area" annotation (Dialog(tab="General", group="Geometry"));
+ parameter Units.SI.Length e_tubes=1.2e-3 "Pipe's wall thickness" annotation (Dialog(tab="General", group="Geometry"));
+ parameter Units.SI.Length Dext_tubes=22.0e-3 "Pipe's external Diameter" annotation (Dialog(tab="General", group="Geometry"));
+ parameter Units.SI.Length Leq=S/(n_tubes*(Dext_tubes - 2*e_tubes)*Modelica.Constants.pi) "Equivalent length for pipes and riser" annotation (Dialog(tab="General", group="Geometry"));
+ parameter Real hcCorr=5.0 "Corrective term for the heat exchange coefficient (hc) inside all pipes - to tune correct Tcold_primary" annotation (Dialog(tab="General", group="Geometry"));
+
+ parameter Units.SI.Volume V_sep=7.0 "Volume of the separator" annotation (Dialog(tab="General", group="Separator: from Riser volume to Dome"));
+ parameter Units.SI.Length L_sep=3.0 "Length of the separator" annotation (Dialog(tab="General", group="Separator: from Riser volume to Dome"));
+ parameter Units.SI.Length D_sep=fromVtoDeq(V_sep, L_sep, 1) "Equivalent diameter of the separator (considered one pipe)" annotation (Dialog(tab="General", group="Separator: from Riser volume to Dome"));
+
+ parameter Units.SI.Volume V_Riser=45.0 "Riser's volume " annotation (Dialog(tab="General", group="Riser (Tube bundle in the secondary)"));
+ parameter Units.SI.Length D_Riser=fromVtoDeq(
+ V_Riser,
+ Leq/2,
+ n_tubes) "Equivalent diameter of the riser" annotation (Dialog(tab="General", group="Riser (Tube bundle in the secondary)"));
+ parameter Real K_riser=10 "Pressure loss coefficient to tune correct recirculation rate" annotation (Dialog(tab="General", group="Riser (Tube bundle in the secondary)"));
+
+ parameter Units.SI.Volume V_Dome=60.0 "Volume of the dome" annotation (Dialog(tab="General", group="Dome"));
+ parameter Units.SI.Length L_Dome=5.0 "Length of the dome" annotation (Dialog(tab="General", group="Dome"));
+ parameter Units.SI.Length R_Dome=sqrt(V_Dome/(L_Dome*Modelica.Constants.pi)) "Radius of the dome" annotation (Dialog(tab="General", group="Dome"));
+
+ parameter Units.SI.Volume V_DownComer=8.0 "Volume of the downcomer" annotation (Dialog(tab="General", group="DownComer"));
+ parameter Units.SI.Diameter Dint_DownComer=4.0 "Inner diameter of the annular downcomer" annotation (Dialog(tab="General", group="DownComer"));
+ final parameter AnnularHydraulicEquivalence downComerHydraulicEquivalence=
+ fromAnnularVtoHydraulicEquivalence(
+ V_DownComer,
+ Leq/2,
+ Dint_DownComer);
+ final parameter Units.SI.Diameter Dh_DownComer=
+ downComerHydraulicEquivalence.Dh "Hydraulic diameter of the annular downcomer";
+ final parameter Real neq_DownComer=downComerHydraulicEquivalence.neq
+ "Equivalent number of circular pipes preserving the downcomer flow area";
+
+ parameter Units.SI.Volume V_MixARE=12.0 "Volume where feedwater mixes with recirculation" annotation (Dialog(tab="General", group="MixARE"));
+
+ 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";
+
+ Real CirculationRate "Circulation rate";
+ Units.SI.Power W_GV_primary "Power from primary to SG";
+ Units.SI.Power W_GV_secondary "Power from SG to secondary";
+
+public
+ ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeHotLeg(
+ redeclare package Medium = Medium_Primary,
+ L=Leq/2,
+ D=Dext_tubes - 2*e_tubes,
+ ntubes=n_tubes,
+ z2=Leq/2,
+ hcCorr=hcCorr,
+ Ns=Ns,
+ dpfCorr=0.17,
+ 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)
+ annotation (Placement(transformation(
+ origin={-67,-41.5},
+ extent={{30.5,-15},{-30.5,15}},
+ rotation=270)));
+
+ ThermoSysPro.Fluid.HeatExchangers.DynamicOnePhaseFlowPipe UtubeColdLeg(
+ redeclare package Medium = Medium_Primary,
+ L=Leq/2,
+ D=Dext_tubes - 2*e_tubes,
+ ntubes=n_tubes,
+ z1=Leq/2,
+ hcCorr=hcCorr,
+ Ns=Ns,
+ dpfCorr=0.17,
+ 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)
+ annotation (Placement(transformation(
+ origin={67,-41.5},
+ extent={{30.5,-14},{-30.5,14}},
+ rotation=90)));
+
+ ThermoSysPro.Fluid.Volumes.DynamicDrum DomeGV(
+ redeclare package Medium = Medium,
+ cpp=500,
+ L=L_Dome,
+ R=R_Dome,
+ Mp=32000,
+ dynamic_energy_balance=dynamic_energy_balance,
+ steady_state=steady_state,
+ continuous_flow_reversal=continuous_flow_reversal,
+ diffusion=diffusion,
+ Vf0=Vf0,
+ P0=P0)
+ annotation (Placement(transformation(extent={{-22,64},{22,107}},
+ rotation=0)));
+ ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DPSeparateurCyclone(
+ redeclare package Medium = Medium,
+ L=L_sep,
+ D=D_sep,
+ z2=L_sep,
+ lambda=0.03,
+ inertia=inertia)
+ annotation (Placement(transformation(
+ origin={0,42},
+ extent={{-5,-10},{5,10}},
+ rotation=90)));
+public
+ ThermoSysPro.Fluid.Volumes.VolumeC MixAlimDomeGV(
+ redeclare package Medium = Medium,
+ V=V_MixARE,
+ dynamic_energy_balance=dynamic_energy_balance,
+ steady_state=steady_state,
+ dynamic_mass_balance=dynamic_mass_balance,
+ continuous_flow_reversal=continuous_flow_reversal,
+ diffusion=diffusion) " "
+ annotation (Placement(transformation(
+ origin={94,63},
+ extent={{-8,-8},{8,8}},
+ rotation=270)));
+ ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_AlimDwnc(
+ redeclare package Medium = Medium,
+ K=1e-4)
+ annotation (Placement(transformation(
+ origin={94,88},
+ extent={{-6,-7},{6,7}},
+ rotation=270)));
+ ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_DomeDwnc(
+ redeclare package Medium = Medium,
+ p_rho=0,
+ K=0.172144) annotation (Placement(transformation(extent={{53,53},
+ {63,73}}, rotation=0)));
+
+public
+ ThermoSysPro.Fluid.Sensors.SensorP CapteurPAlim(redeclare package Medium = Medium)
+ annotation (Placement(transformation(
+ origin={99,26},
+ extent={{-6,-6},{6,6}},
+ rotation=270)));
+
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI(redeclare package Medium = Medium)
+ annotation (Placement(transformation(extent={{-10,139},{10,159}}, rotation=
+ 0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{42,102},{62,122}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet fluidInlet1(redeclare package Medium = Medium_Primary) annotation (
+ Placement(transformation(extent={{-56,-132},{-36,-112}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI1(redeclare package Medium = Medium_Primary)
+ annotation (Placement(transformation(extent={{36,-132},{56,-112}}, rotation=
+ 0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet fluidOutletI_purge(redeclare package Medium = Medium) "Purge outlet (optional)"
+ annotation (Placement(transformation(extent={{140,-130},{160,-110}}, rotation=0), iconTransformation(extent={{36,-100},{56,-80}})));
+ ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal outputReal
+ annotation (Placement(transformation(extent={{-42,86},{-62,106}}, rotation=
+ 0)));
+public
+ ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe DownComerGV(
+ redeclare package Medium = Medium,
+ p_rho=0,
+ L=Leq/2,
+ D=Dh_DownComer,
+ ntubes=neq_DownComer,
+ z1=Leq/2,
+ lambda=0.09,
+ inertia=inertia) "DownComerGV" annotation (Placement(transformation(
+ origin={94.5,-41},
+ extent={{-31,16.5},{31,-16.5}},
+ rotation=270)));
+ Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall(
+ ntubes=UtubeHotLeg.ntubes,
+ L=UtubeHotLeg.L,
+ D=UtubeHotLeg.D,
+ e=e_tubes,
+ Ns=UtubeHotLeg.Ns,
+ lambda=23,
+ cpw=503,
+ rhow=8430,
+ dynamic_energy_balance=dynamic_energy_balance)
+ annotation (Placement(transformation(
+ origin={-44,-41},
+ extent={{-33,-16},{33,16}},
+ rotation=270)));
+ Thermal.HeatTransfer.HeatExchangerWall heatExchangerWall1(
+ ntubes=UtubeColdLeg.ntubes,
+ L=UtubeColdLeg.L,
+ D=UtubeColdLeg.D,
+ e=e_tubes,
+ Ns=UtubeColdLeg.Ns,
+ lambda=23,
+ cpw=503,
+ rhow=8430,
+ dynamic_energy_balance=dynamic_energy_balance)
+ annotation (Placement(transformation(
+ origin={44,-41},
+ extent={{-33,16},{33,-16}},
+ rotation=270)));
+
+ ThermoSysPro.Fluid.HeatExchangers.DynamicTwoPhaseFlowRiser RiserGV(
+ redeclare package Medium = Medium,
+ L=Leq/2,
+ D=D_Riser,
+ ntubes=n_tubes,
+ z2=Leq/2,
+ hcCorr=hcCorr,
+ Ns=Ns,
+ dpfCorr=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,
+ option_temperature=option_temperature)
+ annotation (Placement(
+ transformation(
+ origin={-2.5,-41},
+ extent={{-32,31.5},{32,-31.5}},
+ rotation=90)));
+
+ ThermoSysPro.Fluid.Volumes.VolumeA volumeA(
+ redeclare package Medium = Medium,
+ P0=68.4935e5,
+ 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) annotation (Placement(transformation(
+ origin={1,-110},
+ extent={{-10,-10},{10,10}},
+ rotation=90)));
+ ThermoSysPro.Fluid.Volumes.VolumeC volumeA1(
+ redeclare package Medium = Medium,
+ V=0.1,
+ dynamic_energy_balance=dynamic_energy_balance,
+ steady_state=steady_state,
+ dynamic_mass_balance=dynamic_mass_balance,
+ continuous_flow_reversal=continuous_flow_reversal,
+ diffusion=diffusion) annotation (
+ Placement(transformation(
+ origin={0,18},
+ extent={{-10,-10},{10,10}},
+ rotation=90)));
+ ThermoSysPro.Fluid.PressureLosses.SingularPressureLoss DPnulle_Tcirc(
+ redeclare package Medium = Medium,
+ p_rho=0,
+ K=K_riser) annotation (Placement(transformation(
+ extent={{-6,-7},{6,7}},
+ rotation=90,
+ origin={1,-86})));
+
+ function fromVtoDeq "Equivalent diameter of ntubes circular pipes of total volume V and length L"
+ input Units.SI.Volume V;
+ input Units.SI.Length L;
+ input Integer ntubes;
+ output Units.SI.Length D;
+ algorithm
+ D := sqrt((4*V)/(L*Modelica.Constants.pi*ntubes));
+ end fromVtoDeq;
+
+ record AnnularHydraulicEquivalence "Hydraulic equivalence of an annular duct"
+ Units.SI.Diameter Dh "Hydraulic diameter";
+ Real neq "Equivalent number of circular pipes preserving the flow area";
+ end AnnularHydraulicEquivalence;
+
+ function fromAnnularVtoHydraulicEquivalence "Hydraulic diameter and equivalent number of pipes of an annular duct of volume V, length L and inner diameter Dint"
+ input Units.SI.Volume V;
+ input Units.SI.Length L;
+ input Units.SI.Diameter Dint;
+ output AnnularHydraulicEquivalence hydraulicEquivalence;
+ protected
+ Units.SI.Area A;
+ Units.SI.Diameter Dext;
+ algorithm
+ assert(V > 0, "The annular volume must be strictly positive");
+ assert(L > 0, "The annular length must be strictly positive");
+ assert(Dint >= 0, "The annular inner diameter must be positive or zero");
+ A := V/L;
+ Dext := sqrt(Dint^2 + 4*A/Modelica.Constants.pi);
+ hydraulicEquivalence.Dh := Dext - Dint;
+ hydraulicEquivalence.neq :=
+ A/(Modelica.Constants.pi*hydraulicEquivalence.Dh^2/4);
+ end fromAnnularVtoHydraulicEquivalence;
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})}),
+ CirculationRate = DownComerGV.Q/fluidOutletI.Q;
+ W_GV_primary = (fluidInlet1.h - fluidOutletI1.h)*fluidInlet1.Q;
+ W_GV_secondary = -(fluidInlet.h - fluidOutletI.h)*fluidInlet.Q;
+
+ /* Unconnected purge outlet */
+ if (cardinality(fluidOutletI_purge) == 1) then
+ fluidOutletI_purge.Q = 0;
+ fluidOutletI_purge.h_vol_2 = 1.e5;
+ fluidOutletI_purge.diff_res_2 = 0;
+ fluidOutletI_purge.diff_on_2 = false;
+ end if;
+
+ connect(UtubeHotLeg.C2, UtubeColdLeg.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(UtubeColdLeg.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, UtubeColdLeg.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,-128},{1,-128},{1,-120}}, color={0,0,255}));
+ connect(volumeA.Cs1, DPnulle_Tcirc.C1) annotation (Line(points={{1,-100},{1,-92}}, color={0,0,255}));
+ connect(DPnulle_Tcirc.C2, RiserGV.C1) annotation (Line(points={{1,-80},{0.65,-80},{0.65,-73}}, color={0,0,255}));
+ connect(volumeA.Cs2, fluidOutletI_purge) annotation (Line(points={{11,-110},{130,-110},{130,-120},{150,-120}}, 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.Cd, DPnulle_DomeDwnc.C1) annotation (Line(points={{22,64},{40,64},{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=
+ "= 1 SG")}),
+ Icon(coordinateSystem(
+ preserveAspectRatio=false,
+ extent={{-150,-150},{150,150}},
+ initialScale=0.1), graphics={
+ Ellipse(
+ extent={{-42,150},{42,108}},
+ lineColor={0,0,0},
+ fillPattern=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 = "
Author
@@ -121,4 +461,4 @@ Baligh El Hefni
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
"));
-end SteamGenerator_1SG;
\ No newline at end of file
+end SteamGenerator_1SG;
diff --git a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo b/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo
deleted file mode 100644
index 5bf8a9e0..00000000
--- a/ThermoSysPro/Fluid/HeatExchangers/SteamGenerator_4SG.mo
+++ /dev/null
@@ -1,128 +0,0 @@
-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";
- 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)));
- 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)));
- 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)));
- 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)));
-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)));
-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 = "
-Author
-
-Baligh El Hefni
-
- ", info = "
-## Copyright © EDF 2002 - 2026
-## ThermoSysPro Version 4.2
- "));
-end SteamGenerator_4SG;
\ No newline at end of file
diff --git a/ThermoSysPro/Fluid/HeatExchangers/package.order b/ThermoSysPro/Fluid/HeatExchangers/package.order
index 74e2004c..0198cde3 100644
--- a/ThermoSysPro/Fluid/HeatExchangers/package.order
+++ b/ThermoSysPro/Fluid/HeatExchangers/package.order
@@ -23,4 +23,3 @@ StaticExchangerKS
StaticPlateHeatExchanger
StaticWallFlueGasesExchanger
SteamGenerator_1SG
-SteamGenerator_4SG
diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo
index 6f069bd8..ceb0c3f5 100644
--- a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo
+++ b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidInlet.mo
@@ -1,16 +1,14 @@
within ThermoSysPro.Fluid.Interfaces.Connectors;
connector FluidInlet "Fluid inlet connector"
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation(choicesAllMatching = true, Dialog(tab = "Fluid", group = "Medium"));
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";
+ Medium.ExtraProperty SubC[Medium.nC] "Substances concentration (ppm) of the fluid crossing the boundary of the control volume";
+ Medium.MassFraction Xi[Medium.nXi] "Independent mixture mass fractions m_i/m 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";
@@ -27,4 +25,4 @@ Author
Daniel Bouskela
"));
-end FluidInlet;
\ No newline at end of file
+end FluidInlet;
diff --git a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo
index 402bbbd8..76cbab14 100644
--- a/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo
+++ b/ThermoSysPro/Fluid/Interfaces/Connectors/FluidOutlet.mo
@@ -1,16 +1,14 @@
within ThermoSysPro.Fluid.Interfaces.Connectors;
connector FluidOutlet "Fluid outlet connector"
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialThermoSysProMedium "Medium model" annotation(choicesAllMatching = true, Dialog(tab = "Fluid", group = "Medium"));
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";
+ Medium.ExtraProperty SubC[Medium.nC] "Substances concentration (ppm) of the fluid crossing the boundary of the control volume";
+ Medium.MassFraction Xi[Medium.nXi] "Independent mixture mass fractions m_i/m 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";
@@ -27,4 +25,4 @@ Author
Daniel Bouskela
"));
-end FluidOutlet;
\ No newline at end of file
+end FluidOutlet;
diff --git a/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo b/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo
index 8012586d..0fc54605 100644
--- a/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo
+++ b/ThermoSysPro/Fluid/Junctions/DeheaterMixer2.mo
@@ -1,25 +1,23 @@
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"));
- 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";
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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";
+
+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)";
+
+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";
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";
@@ -30,23 +28,14 @@ model DeheaterMixer2
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";
- 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)));
- ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce annotation(
- Placement(transformation(extent = {{-110, 50}, {-90, 70}}, rotation = 0)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_mix(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-9,-110},{11,-90}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,50},{110,70}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) 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 */
+
+ /* Mass balance equation */
0 = Ce.Q + Ce_mix.Q - Cs.Q;
P = Ce.P;
P = Ce_mix.P;
@@ -62,17 +51,14 @@ equation
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 */
+
+ /* Fluid composition balance equations */
+ Cs.Xi*Cs.Q = Ce.Xi*Ce.Q + Ce_mix.Xi*Ce_mix.Q;
+
+ /* Traces composition balance equations */
+ Cs.SubC*Cs.Q = Ce.SubC*Ce.Q + Ce_mix.SubC*Ce_mix.Q;
+
+ /* 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
@@ -107,13 +93,46 @@ equation
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),
+
+ /* Fluid thermodynamic properties */
+ T = Medium.temperature_phX(P, h, Cs.Xi);
+
+ hmax = Medium.specificEnthalpy_pTX(P, Tmax, Cs.Xi);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -124,4 +143,4 @@ Baligh El Hefni
Daniel Bouskela
"));
-end DeheaterMixer2;
\ No newline at end of file
+end DeheaterMixer2;
diff --git a/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo b/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo
index 80474a59..054bfbaf 100644
--- a/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo
+++ b/ThermoSysPro/Fluid/Junctions/MassFlowMultiplier.mo
@@ -1,28 +1,25 @@
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"));
- Units.SI.AbsolutePressure P(start = 10e5) "Fluid pressure";
- Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy";
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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"));
+
+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)";
+
+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.Density rho(start=998) "Fluid density";
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";
@@ -30,21 +27,15 @@ model MassFlowMultiplier "Mass flow multipliier"
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";
- 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)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) 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 */
+
+ /* Mass balance equation */
0 = alpha*Ce.Q - Cs.Q;
P = Ce.P;
P = Cs.P;
@@ -52,17 +43,13 @@ 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 */
+
+ /* Fluid composition */
+ Ce.Xi*alpha*Ce.Q = Cs.Xi*Cs.Q;
+
+ Ce.SubC*alpha*Ce.Q = Cs.SubC*Cs.Q;
+
+ /* 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
@@ -89,12 +76,14 @@ equation
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);
+
+ /* Fluid thermodynamic properties */
+ T = Medium.temperature_phX(P, h, Cs.Xi);
+
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);
+ rho = Medium.density_phX(P,h,Cs.Xi);
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")}),
diff --git a/ThermoSysPro/Fluid/Junctions/Mixer2.mo b/ThermoSysPro/Fluid/Junctions/Mixer2.mo
index 019a85a5..93d2a4c1 100644
--- a/ThermoSysPro/Fluid/Junctions/Mixer2.mo
+++ b/ThermoSysPro/Fluid/Junctions/Mixer2.mo
@@ -1,24 +1,23 @@
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"));
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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
+ 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
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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
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";
@@ -29,27 +28,22 @@ model Mixer2 "Mixer with two inlets"
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";
- 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)));
- 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)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-50,-110},{-30,-90}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{90,-10},{110,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) 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 */
+
+ /* Unconnected connectors */
if (cardinality(Ialpha1) == 0) then
Ialpha1.signal = 0.5;
end if;
@@ -63,17 +57,16 @@ equation
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 */
+
+ /* Fluid composition balance equations */
+ fill(0,Medium.nXi) = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs.Xi*Cs.Q;
+
+ Cs.Xi = X;
+
+ /* Traces composition balance equations */
+ Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC = Cs.Q*Cs.SubC;
+
+ /* Mass flow at the outlet */
if (cardinality(Ialpha1) <> 0) then
Ce1.Q = Ialpha1.signal*Cs.Q;
end if;
@@ -114,12 +107,46 @@ equation
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),
+
+ /* Fluid thermodynamic properties */
+ T = Medium.temperature_phX(p=P, h=h, X=X);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -131,4 +158,4 @@ Baligh El Hefni
Daniel Bouskela
"));
-end Mixer2;
\ No newline at end of file
+end Mixer2;
diff --git a/ThermoSysPro/Fluid/Junctions/Mixer3.mo b/ThermoSysPro/Fluid/Junctions/Mixer3.mo
index 8a2c8dfa..3c409f78 100644
--- a/ThermoSysPro/Fluid/Junctions/Mixer3.mo
+++ b/ThermoSysPro/Fluid/Junctions/Mixer3.mo
@@ -1,25 +1,23 @@
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"));
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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
+ 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
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";
@@ -33,34 +31,19 @@ model Mixer3 "Mixer with three inlets"
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 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)));
- 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)));
- 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)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,-110},{-30,-90}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-50,90},{-30,110}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, 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)));
+ 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 */
+
+ /* Unconnected connectors */
if (cardinality(Ialpha1) == 0) then
Ialpha1.signal = 0.3;
end if;
@@ -70,6 +53,7 @@ equation
/* Mass balance equation */
0 = Ce1.Q + Ce2.Q + Ce3.Q - Cs.Q;
P = Ce1.P;
+
P = Ce2.P;
P = Ce3.P;
P = Cs.P;
@@ -90,17 +74,13 @@ equation
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 */
+
+ /* Fluid composition balance equations */
+ Cs.Xi*Cs.Q = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q;
+
+ Cs.SubC*Cs.Q = Ce1.SubC*Ce1.Q + Ce2.SubC*Ce2.Q + Ce3.SubC*Ce3.Q;
+
+ /* 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
@@ -143,12 +123,48 @@ equation
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),
+
+ /* Fluid thermodynamic properties */
+ T = Medium.temperature_phX(P, h, Cs.Xi);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -160,4 +176,4 @@ Baligh El Hefni
Daniel Bouskela
"));
-end Mixer3;
\ No newline at end of file
+end Mixer3;
diff --git a/ThermoSysPro/Fluid/Junctions/Mixer8.mo b/ThermoSysPro/Fluid/Junctions/Mixer8.mo
index c4354ca9..b5445bee 100644
--- a/ThermoSysPro/Fluid/Junctions/Mixer8.mo
+++ b/ThermoSysPro/Fluid/Junctions/Mixer8.mo
@@ -1,23 +1,20 @@
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"));
- Units.SI.AbsolutePressure P(start = 10e5) "Fluid pressure";
- Units.SI.SpecificEnthalpy h(start = 10e5) "Fluid specific enthalpy";
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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
+ 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(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";
@@ -45,62 +42,45 @@ model Mixer8 "Mixer with eight inlets"
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)));
-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";
+ Real rs
+ "Value of r(Q/gamma) for outlet s";
+
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce5(redeclare package Medium = Medium) annotation (layer=
+ "icon", Placement(transformation(extent={{-110,-50},{-90,-30}},
+ rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce6(redeclare package Medium = Medium) annotation (layer=
+ "icon", Placement(transformation(extent={{-112,-109},{-92,-89}},
+ rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce7(redeclare package Medium = Medium) annotation (layer=
+ "icon", Placement(transformation(extent={{-40,-109},{-20,-89}},
+ rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (layer=
+ "icon", Placement(transformation(extent={{-112,90},{-92,110}}, rotation=
+ 0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (layer=
+ "icon", Placement(transformation(extent={{-40,90},{-20,110}}, rotation=
+ 0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (layer=
+ "icon", Placement(transformation(extent={{20,92},{40,112}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (layer=
+ "icon", Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce8(redeclare package Medium = Medium) annotation (layer=
+ "icon", Placement(transformation(extent={{20,-109},{40,-89}}, rotation=
+ 0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce4(redeclare package Medium = Medium) 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 */
+
+ /* 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;
+ Ce1.Xi = Medium.X_default[1:Medium.nXi];
+ Ce1.SubC = Medium.C_default;
end if;
if (cardinality(Ce2) == 0) then
Ce2.Q = 0;
@@ -108,11 +88,8 @@ equation
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;
+ Ce2.Xi = Medium.X_default[1:Medium.nXi];
+ Ce2.SubC = Medium.C_default;
end if;
if (cardinality(Ce3) == 0) then
Ce3.Q = 0;
@@ -120,11 +97,8 @@ equation
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;
+ Ce3.Xi = Medium.X_default[1:Medium.nXi];
+ Ce3.SubC = Medium.C_default;
end if;
if (cardinality(Ce4) == 0) then
Ce4.Q = 0;
@@ -132,11 +106,8 @@ equation
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;
+ Ce4.Xi = Medium.X_default[1:Medium.nXi];
+ Ce4.SubC = Medium.C_default;
end if;
if (cardinality(Ce5) == 0) then
Ce5.Q = 0;
@@ -144,11 +115,8 @@ equation
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;
+ Ce5.Xi = Medium.X_default[1:Medium.nXi];
+ Ce5.SubC = Medium.C_default;
end if;
if (cardinality(Ce6) == 0) then
Ce6.Q = 0;
@@ -156,11 +124,8 @@ equation
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;
+ Ce6.Xi = Medium.X_default[1:Medium.nXi];
+ Ce6.SubC = Medium.C_default;
end if;
if (cardinality(Ce7) == 0) then
Ce7.Q = 0;
@@ -168,11 +133,8 @@ equation
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;
+ Ce7.Xi = Medium.X_default[1:Medium.nXi];
+ Ce7.SubC = Medium.C_default;
end if;
if (cardinality(Ce8) == 0) then
Ce8.Q = 0;
@@ -180,11 +142,8 @@ equation
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;
+ Ce8.Xi = Medium.X_default[1:Medium.nXi];
+ Ce8.SubC = Medium.C_default;
end if;
if (cardinality(Cs) == 0) then
Cs.Q = 0;
@@ -214,17 +173,13 @@ equation
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 */
+
+ /* Fluid composition balance equations */
+ Cs.Xi*Cs.Q = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q + Ce4.Xi*Ce4.Q + Ce5.Xi*Ce5.Q + Ce6.Xi*Ce6.Q + Ce7.Xi*Ce7.Q + Ce8.Xi*Ce8.Q;
+
+ Cs.SubC*Cs.Q = Ce1.SubC*Ce1.Q + Ce2.SubC*Ce2.Q + Ce3.SubC*Ce3.Q + Ce4.SubC*Ce4.Q + Ce5.SubC*Ce5.Q + Ce6.SubC*Ce6.Q + Ce7.SubC*Ce7.Q + Ce8.SubC*Ce8.Q;
+
+ /* 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
@@ -307,12 +262,84 @@ equation
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),
+
+ /* Fluid thermodynamic properties */
+ T = Medium.temperature_phX(P, h, Cs.Xi);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -324,4 +351,4 @@ Baligh El Hefni
Daniel Bouskela
"));
-end Mixer8;
\ No newline at end of file
+end Mixer8;
diff --git a/ThermoSysPro/Fluid/Junctions/Splitter2.mo b/ThermoSysPro/Fluid/Junctions/Splitter2.mo
index fcf24e17..ba8dcd89 100644
--- a/ThermoSysPro/Fluid/Junctions/Splitter2.mo
+++ b/ThermoSysPro/Fluid/Junctions/Splitter2.mo
@@ -1,24 +1,23 @@
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"));
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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
+ 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
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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
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";
@@ -29,27 +28,22 @@ model Splitter2 "Splitter with two outlets"
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";
- 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)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{30,90},{50,110}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) 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 */
+
+ /* Unconnected connectors */
if (cardinality(Ialpha1) == 0) then
Ialpha1.signal = 0.5;
end if;
@@ -63,22 +57,19 @@ equation
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 */
+
+ /* Fluid composition balance equations */
+ fill(0,Medium.nXi) = Ce.Xi*Ce.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q;
+
+ Cs1.Xi = X;
+ Cs2.Xi = X;
+
+ /* Traces composition balance equations */
+ Cs1.Q*Cs1.SubC + Cs2.Q*Cs2.SubC = Ce.Q*Ce.SubC;
+
+ Cs2.SubC = Cs1.SubC;
+
+ /* Mass flow at outlet 1 */
if (cardinality(Ialpha1) <> 0) then
Cs1.Q = Ialpha1.signal*Ce.Q;
end if;
@@ -121,12 +112,46 @@ equation
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),
+
+ /* Fluid thermodynamic properties */
+ T = Medium.temperature_phX(p=P, h=h, X=X);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -139,4 +164,4 @@ Daniel Bouskela
"),
DymolaStoredErrors);
-end Splitter2;
\ No newline at end of file
+end Splitter2;
diff --git a/ThermoSysPro/Fluid/Junctions/Splitter3.mo b/ThermoSysPro/Fluid/Junctions/Splitter3.mo
index 36d80092..90e2be64 100644
--- a/ThermoSysPro/Fluid/Junctions/Splitter3.mo
+++ b/ThermoSysPro/Fluid/Junctions/Splitter3.mo
@@ -1,25 +1,23 @@
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"));
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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
+ 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
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";
@@ -33,34 +31,19 @@ model Splitter3 "Splitter with three outlets"
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";
- 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)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-108,-10},{-88,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{30,90},{50,110}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) 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 */
+
+ /* Unconnected connectors */
if (cardinality(Ialpha1) == 0) then
Ialpha1.signal = 0.3;
end if;
@@ -90,27 +73,18 @@ equation
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 */
+
+ /* Fluid composition balance equations */
+ Ce.Xi*Ce.Q = Cs1.Xi*Cs1.Q + Cs2.Xi*Cs2.Q + Cs3.Xi*Cs3.Q;
+ Cs1.Xi = Cs2.Xi;
+ Cs1.Xi = Cs3.Xi;
+
+ /* Traces composition balance equations */
+ Ce.SubC*Ce.Q = Cs1.SubC*Cs1.Q + Cs2.SubC*Cs2.Q + Cs3.SubC*Cs3.Q;
+ Cs1.SubC = Cs2.SubC;
+ Cs1.SubC = Cs3.SubC;
+
+ /* 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);
@@ -157,11 +131,84 @@ equation
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")}),
+
+ /* Fluid thermodynamic properties */
+ T = Medium.temperature_phX(P, h, Ce.Xi);
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -173,4 +220,4 @@ Baligh El Hefni
Daniel Bouskela
"));
-end Splitter3;
\ No newline at end of file
+end Splitter3;
diff --git a/ThermoSysPro/Fluid/Junctions/StaticDrum.mo b/ThermoSysPro/Fluid/Junctions/StaticDrum.mo
index 30478631..84af9fbd 100644
--- a/ThermoSysPro/Fluid/Junctions/StaticDrum.mo
+++ b/ThermoSysPro/Fluid/Junctions/StaticDrum.mo
@@ -1,22 +1,28 @@
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";
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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)";
+
+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.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";
+ Medium.MassFraction X[Medium.nXi] "Fluid mass fraction";
+ Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames) "Liquid phase trace substances";
+ Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames) "Vapor phase trace substances";
+ Medium.ExtraProperty SubCs_sur[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace substances at the steam/reheater outlet";
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";
@@ -42,57 +48,44 @@ model StaticDrum "Static drum"
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";
- 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)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_eva(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{-104,-44},{-84,-24}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_eco(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{-50,-104},{-30,-84}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_sup(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{84,24},{104,44}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_eva(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{30,-104},{50,-84}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_sur(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{28,84},{48,104}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs_purg(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{84,-44},{104,-24}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_steam(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{-48,84},{-28,104}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce_sup(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{-104,26},{-84,46}}, rotation=0)));
+ Thermal.Connectors.ThermalPort Cth annotation (Placement(transformation(
+ extent={{-10,-10},{10,10}}, rotation=0)));
+
+ Medium.SaturationProperties sat;
+ Medium.ThermodynamicState state_e_steam "Steam inlet state";
+ Medium.ThermodynamicState state_e_sup "Extra inlet state";
+ Medium.ThermodynamicState state_e_eva "Evaporator inlet state";
+ Medium.ThermodynamicState state_e_eco "Economizer inlet state";
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 */
+
+ /* 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;
+ Ce_steam.Xi = Medium.X_default[1:Medium.nXi];
+ Ce_steam.SubC = Medium.C_default;
end if;
/* Extra input */
if (cardinality(Ce_sup) == 0) then
@@ -101,11 +94,8 @@ equation
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;
+ Ce_sup.Xi = Medium.X_default[1:Medium.nXi];
+ Ce_sup.SubC = Medium.C_default;
end if;
/* Input from evaporator */
if (cardinality(Ce_eva) == 0) then
@@ -114,11 +104,8 @@ equation
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;
+ Ce_eva.Xi = Medium.X_default[1:Medium.nXi];
+ Ce_eva.SubC = Medium.C_default;
end if;
/* Input from the economizer */
if (cardinality(Ce_eco) == 0) then
@@ -127,11 +114,8 @@ equation
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;
+ Ce_eco.Xi = Medium.X_default[1:Medium.nXi];
+ Ce_eco.SubC = Medium.C_default;
end if;
/* Output to the evaporator */
if (cardinality(Cs_eva) == 0) then
@@ -181,32 +165,31 @@ equation
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 */
+
+ /* Fluid composition balance equations */
+ fill(0,Medium.nXi) = Ce_steam.Xi*Ce_steam.Q + Ce_sup.Xi*Ce_sup.Q + Ce_eva.Xi*Ce_eva.Q + Ce_eco.Xi*Ce_eco.Q - Cs_sur.Xi*Cs_sur.Q - Cs_sup.Xi*Cs_sup.Q - Cs_purg.Xi*Cs_purg.Q - Cs_eva.Xi*Cs_eva.Q;
+
+ X = Cs_eva.Xi;
+ X = Cs_purg.Xi;
+ X = Cs_sup.Xi;
+ X = Cs_sur.Xi;
+
+ /* Traces composition balance equations */
+ /* Overall trace balance of the drum, and phase equilibrium between its
+ liquid and gas phases (Medium.relativeVolatility) */
+ fill(0, Medium.nC) = Ce_steam.Q*Ce_steam.SubC + Ce_sup.Q*Ce_sup.SubC + Ce_eva.Q*Ce_eva.SubC + Ce_eco.Q*Ce_eco.SubC
+ - Cs_eva.Q*Cs_eva.SubC - Cs_purg.Q*Cs_purg.SubC - Cs_sup.Q*Cs_sup.SubC - Cs_sur.Q*Cs_sur.SubC;
+
+ SubCv = Medium.relativeVolatility(sat.Tsat) .* SubCl;
+
+ SubCs_sur = (1 - x)*SubCl + x*SubCv;
+
+ Cs_eva.SubC = SubCl;
+ Cs_purg.SubC = SubCl;
+ Cs_sup.SubC = SubCl;
+ Cs_sur.SubC = SubCs_sur;
+
+ /* 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);
@@ -287,11 +270,18 @@ equation
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;
+
+ /* Fluid thermodynamic properties */
+ state_e_steam = Medium.setState_phX(p=P, h=Ce_steam.h, X=Medium.reference_X);
+ state_e_sup = Medium.setState_phX(p=P, h=Ce_sup.h, X=Medium.reference_X);
+ state_e_eva = Medium.setState_phX(p=P, h=Ce_eva.h, X=Medium.reference_X);
+ state_e_eco = Medium.setState_phX(p=P, h=Ce_eco.h, X=Medium.reference_X);
+ sat = Medium.setSat_p(P);
+
+ hl = Medium.bubbleEnthalpy(sat);
+ hv = Medium.dewEnthalpy(sat);
+ T = sat.Tsat;
+
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")}),
diff --git a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo
index f3c10b71..9317ee38 100644
--- a/ThermoSysPro/Fluid/Junctions/SteamDryer.mo
+++ b/ThermoSysPro/Fluid/Junctions/SteamDryer.mo
@@ -1,24 +1,31 @@
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"));
- 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";
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC = Cev.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium"));
+ replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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";
+
+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)";
+ Medium.C_BiPhase C_e "Trace partition of the inlet mixture";
+ Real xsv "Vapor mass fraction at the vapor outlet";
+
+public
+ Units.SI.AbsolutePressure P(start=10e5) "Fluid pressure";
+ Units.SI.SpecificEnthalpy h(start=10e5) "Fluid specific enthalpy";
+ Units.SI.Density rho(start=1.0) "Fluid density at inlet";
+ Real xe(start=1.0) "Vapor mass fraction at the inlet";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
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";
@@ -29,30 +36,20 @@ model SteamDryer "Steam dryer"
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";
- 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)));
-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
+ Medium.SaturationProperties sat;
+ Medium.ThermodynamicState state_e;
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cev(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-109,30},{-89,50}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Csv(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{89,30},{109,50}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Csl(redeclare package Medium = Medium) 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 */
+
+ /* 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);
@@ -65,23 +62,29 @@ 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 */
+ Csl.h_vol_1 = noEvent(if (xe > 0) then Medium.bubbleEnthalpy(sat) else Cev.h);
+
+ /* Fluid composition balance equations*/
+ Cev.Xi*Cev.Q = Csv.Xi*Csv.Q + Csl.Xi*Csl.Q;
+
+ Csv.Xi = X;
+ Csl.Xi = X;
+
+ /* Traces composition balance equations */
+ /* Equilibrium partition of the inlet traces (Medium.relativeVolatility). The vapor
+ outlet keeps the liquid not removed by the dryer (eta < 1): it carries the mixture
+ concentration at its own vapor mass fraction xsv. The liquid outlet follows from the balance. */
+ if Medium.nC > 0 then
+ C_e = tracePartition(Cev.SubC, xe, sat.Tsat);
+ end if;
+ xsv = noEvent(if (xe > 0) then xe/(1 - eta*(1 - xe)) else 0);
+ Csv.SubC = xsv*C_e.Cg + (1 - xsv)*C_e.Cl;
+
+ Csv.Q*Csv.SubC + Csl.Q*Csl.SubC = Cev.Q*Cev.SubC + SubCSaS * Cev.Q;
+
+ SubCSaS = SaS();
+
+ /* 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);
@@ -118,16 +121,41 @@ equation
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),
+
+ /* Fluid thermodynamic properties */
+ state_e=Medium.setState_phX(p=Cev.P, h=Cev.h, X=Cev.Xi);
+ rho = state_e.d;
+
+ /* Vapor mass fraction at the inlet */
+ xe=Medium.vapourQuality(state_e);
+
+ /* Fluid thermodynamic properties at the saturation point */
+ sat = Medium.setSat_p(Cev.P);
+
+ annotation (
+ Diagram(coordinateSystem(
+ preserveAspectRatio=false,
+ extent={{-100,-100},{100,100}},
+ grid={2,2}), graphics={Polygon(
+ points={{-98,40},{-18,-100},{22,-100},{102,40},{-98,40}},
+ lineColor={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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -139,4 +167,4 @@ Baligh El Hefni
Daniel Bouskela
"));
-end SteamDryer;
\ No newline at end of file
+end SteamDryer;
diff --git a/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo b/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo
index 9cb1a362..a9d51eba 100644
--- a/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo
+++ b/ThermoSysPro/Fluid/Junctions/SteamExtractionSplitter.mo
@@ -1,24 +1,31 @@
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"));
- 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";
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC = Ce.SubC) annotation (choicesAllMatching=true,Dialog(tab="Fluid", group="Medium"));
+ replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+
+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)";
+ Medium.C_BiPhase C_e "Trace partition of the inlet mixture";
+
+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";
+ Real xe(start=1.0) "Vapor mass fraction at the inlet";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
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";
@@ -29,30 +36,17 @@ model SteamExtractionSplitter "Splitter for steam extraction"
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";
- 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)));
-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";
+
+ Medium.SaturationProperties sat;
+ Medium.ThermodynamicState state_e;
+
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-113,-10},{-93,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{93,-10},{113,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cex(redeclare package Medium = Medium) "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 */
+ /* Mass balance equation */
0 = Ce.Q - Cs.Q - Cex.Q;
P = Ce.P;
P = Cs.P;
@@ -61,23 +55,28 @@ 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 */
+ Cex.h_vol_1 = if noEvent(x_ex < 1) then (1 - x_ex)*Medium.bubbleEnthalpy(sat)+ x_ex*Medium.dewEnthalpy(sat) else h;
+
+ /* Traces composition balance equations */
+ /* Equilibrium partition of the inlet traces (Medium.relativeVolatility). The extraction
+ carries the mixture concentration at its vapor mass fraction x_ex = alpha*xe.
+ The main outlet follows from the balance. */
+ if Medium.nC > 0 then
+ C_e = tracePartition(Ce.SubC, xe, sat.Tsat);
+ end if;
+ Cex.SubC = x_ex*C_e.Cg + (1 - x_ex)*C_e.Cl;
+
+ Cs.Q*Cs.SubC + Cex.Q*Cex.SubC = Ce.Q*Ce.SubC + SubCSaS * Ce.Q;
+
+ SubCSaS = SaS();
+
+ /* Fluid composition */
+ Ce.Xi*Ce.Q = Cs.Xi*Cs.Q + Cex.Xi*Cex.Q;
+
+ Cs.Xi = X;
+ Cex.Xi = X;
+
+ /* 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);
@@ -114,16 +113,43 @@ equation
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),
+
+ /* Fluid thermodynamic properties at the inlet */
+ state_e=Medium.setState_phX(p=P, h=Ce.h, X=Ce.Xi);
+ xe = Medium.vapourQuality(state_e);
+
+ /* Vapor mass fraction at the extraction outlet */
+ x_ex = alpha*xe;
+
+ /* Fluid thermodynamic properties at the saturation point */
+ sat = Medium.setSat_p(P);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -134,4 +160,4 @@ Baligh El Hefni
Daniel Bouskela
"));
-end SteamExtractionSplitter;
\ No newline at end of file
+end SteamExtractionSplitter;
diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo
index 796f1555..c0b914c2 100644
--- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo
+++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerH.mo
@@ -1,36 +1,74 @@
within ThermoSysPro.Fluid.LoopBreakers;
-
model LoopBreakerH "Specific enthalpy loop breaker"
- 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)));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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),
+
+ C1.Xi = C2.Xi;
+
+ C1.SubC = C2.SubC;
+
+ 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 = "
-## Copyright © EDF 2002 - 2026
-## ThermoSysPro Version 4.2
+## Copyright © EDF 2002 - 2026
+## ThermoSysPro Version 4.2
", revisions = "
-Authors
+Authors
-Baligh El Hefni
-Daniel Bouskela
+Baligh El Hefni
+Daniel Bouskela
"));
-end LoopBreakerH;
\ No newline at end of file
+end LoopBreakerH;
diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo
index f05c8d99..8f75ad67 100644
--- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo
+++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerP.mo
@@ -1,36 +1,74 @@
within ThermoSysPro.Fluid.LoopBreakers;
-
model LoopBreakerP "Pressure loop breaker"
- 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)));
+
+replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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),
+
+ C1.Xi = C2.Xi;
+
+ C1.SubC = C2.SubC;
+
+ 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 = "
-## Copyright © EDF 2002 - 2026
-## ThermoSysPro Version 4.2
+## Copyright © EDF 2002 - 2026
+## ThermoSysPro Version 4.2
", revisions = "
-Authors
+Authors
-Baligh El Hefni
-Daniel Bouskela
+Baligh El Hefni
+Daniel Bouskela
"));
-end LoopBreakerP;
\ No newline at end of file
+end LoopBreakerP;
diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo
index 1479dfb5..f4e7b425 100644
--- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo
+++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerQ.mo
@@ -1,36 +1,74 @@
within ThermoSysPro.Fluid.LoopBreakers;
-
model LoopBreakerQ "Mass flow loop breaker"
- 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)));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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),
+
+ C1.Xi = C2.Xi;
+
+ C1.SubC = C2.SubC;
+
+ 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 = "
-## Copyright © EDF 2002 - 2026
-## ThermoSysPro Version 4.2
+## Copyright © EDF 2002 - 2026
+## ThermoSysPro Version 4.2
", revisions = "
-Authors
+Authors
-Baligh El Hefni
-Daniel Bouskela
+Baligh El Hefni
+Daniel Bouskela
"));
-end LoopBreakerQ;
\ No newline at end of file
+end LoopBreakerQ;
diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo
new file mode 100644
index 00000000..e0f4a410
--- /dev/null
+++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerSubC.mo
@@ -0,0 +1,71 @@
+within ThermoSysPro.Fluid.LoopBreakers;
+model LoopBreakerSubC "Fluid Traces loop breaker"
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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.Xi = C2.Xi;
+
+ 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="C"),
+ 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="C"),
+ 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 = "
+## Copyright © EDF 2002 - 2026
+## ThermoSysPro Version 4.2
+ ", revisions = "
+Authors
+
+Baligh El Hefni
+Daniel Bouskela
+
+ "));
+end LoopBreakerSubC;
diff --git a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo
index f5fcaf65..5ba82ceb 100644
--- a/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo
+++ b/ThermoSysPro/Fluid/LoopBreakers/LoopBreakerXgas.mo
@@ -1,33 +1,71 @@
within ThermoSysPro.Fluid.LoopBreakers;
-
model LoopBreakerXgas "Fluid composition loop breaker"
- 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)));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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),
+
+ C1.SubC = C2.SubC;
+
+ 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 = "
-## Copyright © EDF 2002 - 2026
-## ThermoSysPro Version 4.2
+## Copyright © EDF 2002 - 2026
+## ThermoSysPro Version 4.2
", revisions = "
-Authors
+Authors
-Baligh El Hefni
-Daniel Bouskela
+Baligh El Hefni
+Daniel Bouskela
"));
-end LoopBreakerXgas;
\ No newline at end of file
+end LoopBreakerXgas;
diff --git a/ThermoSysPro/Fluid/LoopBreakers/package.order b/ThermoSysPro/Fluid/LoopBreakers/package.order
index 4b729fa7..82432aa5 100644
--- a/ThermoSysPro/Fluid/LoopBreakers/package.order
+++ b/ThermoSysPro/Fluid/LoopBreakers/package.order
@@ -2,3 +2,4 @@ LoopBreakerH
LoopBreakerP
LoopBreakerQ
LoopBreakerXgas
+LoopBreakerSubC
diff --git a/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo b/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo
index 6fdbf079..7a2590b1 100644
--- a/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo
+++ b/ThermoSysPro/Fluid/Machines/CHPEngineBarkantineSystem.mo
@@ -1,81 +1,275 @@
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)));
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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(
+ redeclare package Medium = Medium,
+ h0=293e3,
+ Q0=11.8,
+ P0=300000) annotation (Placement(transformation(extent={{62,-46},{40,-24}},
+ rotation=0)));
+ ThermoSysPro.Fluid.Machines.InternalCombustionEngine Engine(
+ redeclare package Medium = Medium,
+ redeclare package Medium_FlueGases = Medium_FlueGases,
+ 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(
+ redeclare package Medium_c = Medium,
+ redeclare package Medium_f = Medium,
+ 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(
+ redeclare package Medium = Medium,
+ L=0.0001)
+ annotation (Placement(transformation(
+ origin={-60,-10},
+ extent={{10,-10},{-10,10}},
+ rotation=90)));
+ ThermoSysPro.Fluid.BoundaryConditions.Sink WaterSteamSink(
+ redeclare package Medium = Medium,
+ option_temperature=true,
+ T0=320) annotation (
+ Placement(transformation(extent={{-22,-72},{-44,-48}}, rotation=0)));
+ ThermoSysPro.Fluid.PressureLosses.LumpedStraightPipe PDC2(
+ redeclare package Medium = Medium,
+ L=0.0001)
+ annotation (Placement(transformation(
+ origin={-80,-10},
+ extent={{10,-10},{-10,10}},
+ rotation=270)));
+ ThermoSysPro.Fluid.HeatExchangers.StaticExchangerDTorWorEff
+ ExchangerWaterFlueGases(
+ redeclare package Medium_c = Medium_FlueGases,
+ redeclare package Medium_f = Medium,
+ 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(
+ redeclare package Medium = Medium_FlueGases,
+ K=20)
+ annotation (Placement(transformation(
+ origin={-39,16},
+ extent={{10,-9},{-10,9}},
+ rotation=270)));
+ Interfaces.Connectors.FluidOutlet outletWaterSteam(redeclare package Medium =
+ Medium) annotation (Placement(
+ transformation(extent={{180,80},{220,120}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet inletWaterSteam(redeclare package Medium =
+ Medium) annotation (Placement(
+ transformation(extent={{-220,80},{-180,120}}, rotation=0)));
+ BoundaryConditions.Sink FlueGasesSink(
+ redeclare package Medium = Medium_FlueGases,
+ option_temperature=true,
+ T0=400) annotation (Placement(transformation(extent={{-56,86},{-80,110}},
+ rotation=0)));
+ BoundaryConditions.SourcePQ AirSource(
+ redeclare package Medium = Medium_FlueGases,
+ X0={0.765,0.23,0.005,0,0},
+ h0=40000,
+ 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)}),
+ 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 = "
Authors
@@ -87,4 +281,4 @@ Bruno Péchiné
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
"));
-end CHPEngineBarkantineSystem;
\ No newline at end of file
+end CHPEngineBarkantineSystem;
diff --git a/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo b/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo
index 8a386b11..4aa6dc1f 100644
--- a/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo
+++ b/ThermoSysPro/Fluid/Machines/CentrifugalPump.mo
@@ -1,38 +1,83 @@
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)";
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 Integer mode_car=2
+ "1:nominal values and coef. c given by parameters - 2:nominal values and coef. c computed from semi-parabolic characteristics";
+ parameter Integer mode_car_hn=2
+ "1:complete pump head characteristics - 2:semi-parabolic pump head characteristics";
+ parameter Integer mode_car_Cr=2
+ "1:complete torque characteristics - 2:analytic formula";
+
+ parameter Units.SI.VolumeFlowRate Qv_nom_p=0.4781
+ "Nominal volumetric flow (active if mode_car=1)";
+ parameter Units.SI.Height hn_nom_p=22.879
+ "Nominal pump head (active if mode_car=1)";
+ parameter Units.SI.Height rh_nom_p=0.863
+ "Nominal pump efficiency (active if mode_car=1)";
+
+ parameter Real F_t[:]={ 0.634, 0.643, 0.646, 0.640, 0.629, 0.613, 0.595, 0.575, 0.552, 0.533, 0.516, 0.505,
+ 0.504, 0.510, 0.512, 0.522, 0.539, 0.559, 0.580, 0.601, 0.630, 0.662, 0.692, 0.722,
+ 0.753, 0.782, 0.808, 0.832, 0.857, 0.879, 0.904, 0.930, 0.959, 0.996, 1.027, 1.060,
+ 1.090, 1.124, 1.165, 1.204, 1.238, 1.258, 1.271, 1.282, 1.288, 1.281, 1.260, 1.225,
+ 1.172, 1.107, 1.031, 0.942, 0.842, 0.733, 0.617, 0.500, 0.368, 0.240, 0.125, 0.011,
+ -0.102,-0.168,-0.255,-0.342,-0.423,-0.494,-0.556,-0.620,-0.655,-0.670,-0.670,-0.660,
+ -0.655,-0.640,-0.600,-0.570,-0.520,-0.470,-0.430,-0.360,-0.275,-0.160,-0.040, 0.130,
+ 0.295, 0.430, 0.550, 0.620, 0.634}
+ "Head characteristics (active if mode_car_hn=1)";
+
+ parameter Real G_t[:]={-0.684,-0.547,-0.414,-0.292,-0.187,-0.105,-0.053,-0.012, 0.042, 0.097, 0.156, 0.227,
+ 0.300, 0.371, 0.444, 0.522, 0.596, 0.672, 0.738, 0.763, 0.797, 0.837, 0.865, 0.883,
+ 0.886, 0.877, 0.859, 0.838, 0.804, 0.758, 0.703, 0.645, 0.583, 0.520, 0.454, 0.408,
+ 0.370, 0.343, 0.331, 0.329, 0.338, 0.354, 0.372, 0.405, 0.450, 0.486, 0.520, 0.552,
+ 0.579, 0.603, 0.616, 0.617, 0.606, 0.582, 0.546, 0.500, 0.432, 0.360, 0.288, 0.214,
+ 0.123, 0.037,-0.053,-0.161,-0.248,-0.314,-0.372,-0.580,-0.740,-0.880,-1.000,-1.120,
+ -1.250,-1.370,-1.490,-1.590,-1.660,-1.690,-1.770,-1.650,-1.590,-1.520,-1.420,-1.320,
+ -1.230,-1.100,-0.980,-0.820, -0.684}
+ "Torque characteristics (active if mode_car_Cr=1)";
+
+ parameter Real c_p=1.288
+ "Dimensionless coef. of the semi-parabolic pump head characteristics (active if mode_car=1 and mode_car_hn=2)";
+ constant Real b=2
+ "Dimensionless coef. of the parabolic pump efficiency characteristics";
+
+ parameter Real hn_coef[2]={-88.67, 43.15}
+ "Coef. of the semi-parabolic pump head characteristics (active if mode_car=2)";
+ parameter Real rh_coef[2]={-3.7751, 3.61}
+ "Coef. of the parabolic pump efficiency characteristics (active if mode_car=2)";
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ constant Real pi=Modelica.Constants.pi "pi";
+ parameter Units.SI.AngularVelocity w_a_min=1.e-4 "Small angular velocity";
+ parameter Units.SI.VolumeFlowRate Qv_a_min=1.e-4 "Small volume flow rate";
+ parameter Real rh_min=0.05 "Minimum efficiency";
+
+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";
+ 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";
@@ -42,82 +87,95 @@ model CentrifugalPump "Centrifugal pump"
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.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";
+ 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)));
-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";
+ 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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
+
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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;
+
+ C1.Xi = C2.Xi;
+
+ X = C1.Xi;
+
+ C1.SubC = C2.SubC;
+
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 */
+
+ /* 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));
+ 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 */
+
+ /* Nominal quantities */
w_nom = pi/30*N_nom;
+
if (mode_car == 1) then
Qv_nom = Qv_nom_p;
hn_nom = hn_nom_p;
@@ -129,14 +187,17 @@ equation
else
assert(false, "CentrifugalPump: invalid option");
end if;
+
Cr_nom = rho*g*Qv_nom*hn_nom/rh_nom/w_nom;
-/* Dimensionless quantities */
+
+ /* 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 */
+
+ /* Dimensionless coef. c */
if (mode_car == 1) then
c = c_p;
elseif (mode_car == 2) then
@@ -144,24 +205,38 @@ equation
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);
+
+ /* 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 */
+
+ /* Pump head */
if (mode_car_hn == 1) then
- F = ThermoSysPro.Functions.SplineInterpolation(1:size(F_t, 1), F_t[:], i_h);
+ 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);
+ 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 */
+
+ /* Pump resistive torque */
if (mode_car_Cr == 1) then
- G = ThermoSysPro.Functions.SplineInterpolation(1:size(G_t, 1), G_t[:], i_t);
+ 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
@@ -171,35 +246,73 @@ equation
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 */
+
+ /* 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 */
+
+ /* Resistive hydraulic power */
Wr = Cr*w;
-/* Kinetic energy of the rotating masses */
+
+ /* Kinetic energy of the rotating masses */
Ec = 1/2*J*w^2;
-/* Rotating mass equation */
+
+ /* 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 */
+
+ /* 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);
+ rho = Medium.density_phX(p=Pm, h=h, X=X);
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)}),
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -210,6 +323,5 @@ Authors
Daniel Bouskela
Baligh El Hefni
- "),
- DymolaStoredErrors);
-end CentrifugalPump;
\ No newline at end of file
+ "));
+end CentrifugalPump;
diff --git a/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo b/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo
index cb9c16bc..0bcad5a2 100644
--- a/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo
+++ b/ThermoSysPro/Fluid/Machines/CombustionTurbine.mo
@@ -1,91 +1,128 @@
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)";
- 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";
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby Modelica.Media.Interfaces.PartialMixtureMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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";
- 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)));
- ThermoSysPro.InstrumentationAndControl.Connectors.InputReal CompressorPower annotation(
- Placement(transformation(extent = {{-120, -50}, {-100, -30}}, rotation = 0)));
- ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower annotation(
- Placement(transformation(extent = {{100, -100}, {120, -80}}, rotation = 0)));
+
+public
+ Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+ ThermoSysPro.InstrumentationAndControl.Connectors.InputReal CompressorPower annotation (Placement(transformation(extent={{-120,-50},{-100,-30}}, rotation=0)));
+ ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal MechPower annotation (Placement(transformation(extent={{100,-100},{120,-80}}, rotation=0)));
+
+ Medium.ThermodynamicState state_e;
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;
+
+ Ce.SubC = Cs.SubC;
+
+ Ce.Xi = Cs.Xi;
+
Q = Ce.Q;
+
Pe = Ce.P;
Ps = Cs.P;
+
He = Ce.h;
Hs = Cs.h;
- ftype = Ce.ftype;
-/* Input compressor power (negative value) */
+
+ /* Input compressor power (negative value) */
Wcp = CompressorPower.signal;
-/* Expansion rate */
+
+ /* Expansion rate */
tau = Ps/Pe;
-/* Expansion rates ratio */
+
+ /* Expansion rates ratio */
Xtau = tau/tau_n;
-/* Isentropic efficiency */
+
+ /* Isentropic efficiency */
is_eff = (A3*Xtau^3 + A2*Xtau^2 + A1*Xtau + A0)*is_eff_n;
-/* Reduced mass flow rate */
+
+ /* Reduced mass flow rate */
Qred = (Q*sqrt(Te))/Pe;
-/* Turbine power */
+
+ /* Turbine power */
Wturb = Q*(He - Hs);
-/* Mechanical power */
+
+ /* 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)}),
+
+ /* Temperature at the inlet */
+ state_e = Medium.setState_phX(Pe,He,Ce.Xi);
+ Te=Medium.temperature(state_e);
+
+ /* Specific entropy at the inlet */
+ Se = Medium.specificEntropy(state_e);
+
+ /* Specific enthalpy after the isentropic expansion */
+ Tis=Medium.temperature(Medium.setState_psX(Ps,Se,Ce.Xi));
+ His = Medium.specificEnthalpy_pTX(Ps,Tis,Ce.Xi);
+
+ /* Specific enthalpy at the outlet */
+ Hs = is_eff*(His - He) + He;
+
+ /* Temperature at the outlet */
+ Ts = Medium.temperature_phX(Ps,Hs,Ce.Xi);
+
+ 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 = "
Author
@@ -96,4 +133,4 @@ Baligh El Hefni
## ThermoSysPro Version 4.2
This component model is documented in Sect. 11.4 of the ThermoSysPro book.
"));
-end CombustionTurbine;
\ No newline at end of file
+end CombustionTurbine;
diff --git a/ThermoSysPro/Fluid/Machines/Compressor.mo b/ThermoSysPro/Fluid/Machines/Compressor.mo
index a1a72a35..6afeb328 100644
--- a/ThermoSysPro/Fluid/Machines/Compressor.mo
+++ b/ThermoSysPro/Fluid/Machines/Compressor.mo
@@ -1,101 +1,133 @@
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)";
- 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";
- 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)));
- ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Power annotation(
- Placement(transformation(extent = {{80, -40}, {100, -20}}, rotation = 0)));
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby Modelica.Media.Interfaces.PartialMixtureMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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";
+ 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";
+
+public
+ Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{80,-10},{100,10}}, rotation=0)));
+ ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal Power annotation (Placement(transformation(extent={{80,-40},{100,-20}}, rotation=0)));
+
+ Medium.ThermodynamicState state_e;
+ Medium.ThermodynamicState state_s;
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;
+
+ Ce.SubC = Cs.SubC;
+
+ Ce.Xi = Cs.Xi;
+
Q = Ce.Q;
+
Pe = Ce.P;
Ps = Cs.P;
+
He = Ce.h;
Hs = Cs.h;
- ftype = Ce.ftype;
-/* Compression rate */
+
+ /* Compression rate */
tau = Ps/Pe;
-/* Compression rates ratio */
+
+ /* Compression rates ratio */
Xtau = tau/tau_n;
-/* Isentropic efficiency */
+
+ /* Isentropic efficiency */
is_eff = (A4*Xtau^4 + A3*Xtau^3 + A2*Xtau^2 + A1*Xtau + A0)*is_eff_n;
-/* Compressor power */
+
+ /* Compressor power */
Wcp = Q*(He - Hs);
Power.signal = Wcp;
-/* Volume flow rate at the inlet */
+
+ /* 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 */
+
+ /* Specific enthalpy at the inlet */
+ // Call implicitly to avoid function that cannot be differentiated.
+ state_e = Medium.setState_pTX(Pe,Te,Ce.Xi);
+ He = Medium.specificEnthalpy_pTX(Pe,Te,Ce.Xi);
+ /* Specific entropy at the inlet */
+ Se = Medium.specificEntropy(state_e);
+
+ /* Specific enthalpy after the isentropic compression */
+ state_s= Medium.setState_psX(Ps,Se,Ce.Xi);
+ Tis = Medium.temperature(state_s);
+ His = Medium.specificEnthalpy(state_s);
+
+ /* Fluid density at the inlet */
+ rho_e = Medium.density(state_e);
+
+ /* 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)}),
+
+ /* Temperature at the outlet */
+ // Call implicitly to avoid function that cannot be differentiated.
+ Hs= Medium.specificEnthalpy_pTX(Ps,Ts,Ce.Xi);
+ 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 = "
Author
@@ -106,4 +138,4 @@ Baligh El Hefni
## ThermoSysPro Version 4.2
This component model is documented in Sect. 11.3 of the ThermoSysPro book.
"));
-end Compressor;
\ No newline at end of file
+end Compressor;
diff --git a/ThermoSysPro/Fluid/Machines/GasTurbine.mo b/ThermoSysPro/Fluid/Machines/GasTurbine.mo
index 7d1e4138..beb0057d 100644
--- a/ThermoSysPro/Fluid/Machines/GasTurbine.mo
+++ b/ThermoSysPro/Fluid/Machines/GasTurbine.mo
@@ -1,65 +1,142 @@
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)));
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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(
+ redeclare package Medium = Medium_FlueGases)
+ annotation (Placement(transformation(
+ origin={-84,30},
+ extent={{-10,-10},{10,10}},
+ rotation=270)));
+ ThermoSysPro.Fluid.Machines.Compressor Compresseur(
+ redeclare package Medium = Medium_FlueGases,
+ 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(
+ redeclare package Medium = Medium,
+ redeclare package Medium_FlueGases = Medium_FlueGases,
+ 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(
+ redeclare package Medium = Medium_FlueGases,
+ 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(redeclare package Medium =
+ Medium_FlueGases) annotation (Placement(
+ transformation(extent={{-104,-4},{-96,4}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Sortie_fumees(redeclare package Medium =
+ Medium_FlueGases) annotation (Placement(
+ transformation(extent={{96,-4},{104,4}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet Entree_eau_combustion(redeclare package
+ Medium = Medium) 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})}),
+ 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 = "
Author
@@ -69,4 +146,4 @@ Baligh El Hefni
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
"));
-end GasTurbine;
\ No newline at end of file
+end GasTurbine;
diff --git a/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo b/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo
index 36bc9dc9..adc3c2ec 100644
--- a/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo
+++ b/ThermoSysPro/Fluid/Machines/HeatPumpCompressor.mo
@@ -1,72 +1,105 @@
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)";
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.C3H3F5 constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium
+ "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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.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)));
- 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)));
+ Real xm(start=1.0) "Average vapor mass fraction";
+
+ Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{-110,-10},{-90,10}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{90,-10},{110,10}}, rotation=0)));
+public
+ Medium.ThermodynamicState state_e "Fluid thermodynamic state before the compression";
+ Medium.ThermodynamicState state_s "Fluid thermodynamic state after the compression";
+ Medium.ThermodynamicState state_is
+ "Fluid thermodynamic state after the isentropic compression";
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;
+
+ C1.SubC = C2.SubC;
+ C1.Xi = C2.Xi;
+
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 */
+
+ /* 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 */
+
+ /* Average vapor mass fraction */
+ xm = (Medium.vapourQuality(state_e) + Medium.vapourQuality(state_s))/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),
+
+ /* Fluid thermodynamic properties before the compression */
+ state_e = Medium.setState_phX(Pe, C1.h, C1.Xi);
+ Te = Medium.temperature(state_e);
+
+ /* Fluid thermodynamic properties after the compression */
+ state_s = Medium.setState_phX(Ps, C2.h, C2.Xi);
+ Ts = Medium.temperature(state_s);
+
+ /* Fluid thermodynamic properties after the identropic compression */
+ state_is = Medium.setState_psX(Ps, Medium.specificEntropy(state_e), C1.Xi);
+ His = Medium.specificEnthalpy(state_is);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -77,4 +110,4 @@ Benoît Bride
Daniel Bouskela
"));
-end HeatPumpCompressor;
\ No newline at end of file
+end HeatPumpCompressor;
diff --git a/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo b/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo
index 9fc0d703..bddec6ab 100644
--- a/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo
+++ b/ThermoSysPro/Fluid/Machines/InternalCombustionEngine.mo
@@ -1,85 +1,119 @@
-within ThermoSysPro.Fluid.Machines;
-
+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";
- 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";
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the water/steam side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable package Medium_FlueGases = ThermoSysPro.Properties.Media.FlueGases constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model for the flue gases side" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 Integer iN2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"N2", "Nitrogen", "nitrogen"}) "Index of nitrogen in the flue gases composition";
+ parameter Integer iO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"O2", "Oxygen", "oxygen"}) "Index of oxygen in the flue gases composition";
+ parameter Integer iH2O=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"H2O", "Water", "water"}) "Index of water vapor in the flue gases composition";
+ parameter Integer iCO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"CO2", "Carbondioxide", "Carbon dioxide", "carbondioxide"}) "Index of carbon dioxide in the flue gases composition";
+ parameter Integer iSO2=ThermoSysPro.Properties.Media.Functions.findSubstanceIndex(Medium_FlueGases.substanceNames, {"SO2", "Sulfurdioxide", "Sulfur dioxide", "sulfurdioxide"}) "Index of sulfur dioxide in the flue gases composition";
+ 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.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)";
+ 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";
@@ -87,54 +121,62 @@ model InternalCombustionEngine "Internal combustion engine with electrical outpu
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";
- 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)));
-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)";
+ Medium.MassFraction Xws[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Water/steam mass fractions";
+ Medium_FlueGases.MassFraction Xea[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Air inlet mass fractions";
+ Medium_FlueGases.MassFraction Xsf[Medium_FlueGases.nX](start=Medium_FlueGases.X_default) "Flue gases outlet mass fractions";
+ Medium_FlueGases.ThermodynamicState state_air_in "Air inlet thermodynamic state";
+ Medium_FlueGases.ThermodynamicState state_fg_out "Flue gases outlet thermodynamic state";
+ Medium.ExtraProperty SubCws[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Water/steam trace substances";
+ Medium_FlueGases.ExtraProperty SubCfg[Medium_FlueGases.nC](quantity=Medium_FlueGases.extraPropertiesNames, start=Medium_FlueGases.C_default) "Flue gases trace substances";
+
+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(redeclare package Medium = Medium_FlueGases) "Air inlet"
+ annotation (
+ Placement(transformation(extent={{-10,-100},{10,-80}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cfg(redeclare package Medium = Medium_FlueGases) "Flue gases outlet"
+ annotation (
+ Placement(transformation(extent={{-10,80},{10,100}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Cws1(redeclare package Medium = Medium) "Water inlet"
+ annotation (
+ Placement(transformation(extent={{-100,-10},{-80,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cws2(redeclare package Medium = Medium)
+ "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");
+
+ assert(Medium_FlueGases.nX > 1, "InternalCombustionEngine: Medium_FlueGases must be a gas mixture");
+ assert(iN2 > 0 and iO2 > 0 and iH2O > 0 and iCO2 > 0 and iSO2 > 0, "InternalCombustionEngine: Medium_FlueGases.substanceNames must contain nitrogen, oxygen, water, carbon dioxide and sulfur dioxide");
+
+ // ----------------
+ // Water/steam side
+
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;
+
+ Cws1.Xi = Cws2.Xi;
+ Cws1.SubC = Cws2.SubC;
+ Xws = Cws1.Xi;
+ SubCws = Cws1.SubC;
+
Qe = Cws1.Q;
Hev = Cws1.h;
Hsv = Cws2.h;
-// ---------------
-// Combustion side
-/* Fuel inlet */
+
+ // ---------------
+ // Combustion side
+
+ /* Fuel inlet */
Qcomb = Cfuel.Q;
Tcomb = Cfuel.T;
XCcomb = Cfuel.Xc;
@@ -145,115 +187,230 @@ equation
XCDcomb = Cfuel.Xashes;
PCIcomb = Cfuel.LHV;
Cpcomb = Cfuel.cp;
-/* Air inlet */
+
+ /* 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 */
+ Hea = Cair.h; /***/
+
+ Xea[1:Medium_FlueGases.nXi] = Cair.Xi;
+ if Medium_FlueGases.nXi < Medium_FlueGases.nX then
+ Xea[Medium_FlueGases.nX] = 1 - sum(Cair.Xi);
+ end if;
+ XeaCO2 = Xea[iCO2];
+ XeaH2O = Xea[iH2O];
+ XeaO2 = Xea[iO2];
+ XeaSO2 = Xea[iSO2];
+
+ /* Flue gases outlet */
Qsf = Cfg.Q;
Psf = Cfg.P;
Hsf = Cfg.h;
-/* Mass balance equation for the flue gases */
+
+ /* Mass balance equation for the flue gases */
0 = Qcomb + Qea - Qsf;
-/* Energy balance equation for the flue gases */
+
+ /* 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 */
+
+ /* Thermal losses */
Wpth_ref = Qcomb*PCIcomb*(Xpth + Xref);
Qe*(Hsv - Hev) = Qcomb*PCIcomb*Xref;
-/* Fuel thermal power available */
+
+ /* Fuel thermal power available */
PCScomb = PCIcomb + 224.3e5*XHcomb + 25.1e5*XEAUcomb;
Wcomb = Qcomb*PCIcomb;
-/* Flue gases composition balance equations */
+
+ /* 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 */
+
+ Xsf[iN2] = 1 - XsfCO2 - XsfH2O - XsfO2 - XsfSO2;
+ Xsf[iO2] = XsfO2;
+ Xsf[iH2O] = XsfH2O;
+ Xsf[iCO2] = XsfCO2;
+ Xsf[iSO2] = XsfSO2;
+ Cfg.Xi = Xsf[1:Medium_FlueGases.nXi];
+ Cfg.SubC = Cair.SubC;
+ SubCfg = Cfg.SubC;
+
+ /* No flow reversal */
Cfg.h = Cfg.h_vol_1;
-/* Diffusion power */
+
+ /* 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 */
+
+ /* Air thermodynamic properties at the inlet */
+ state_air_in = Medium_FlueGases.setState_pTX(p=Pea, T=Tea, X=Xea);
+ Hea = Medium_FlueGases.specificEnthalpy(state_air_in);
+ Cpair = Medium_FlueGases.specificHeatCapacityCp(state_air_in);
+ rhoea = Medium_FlueGases.density(state_air_in);
+
+ /* Flue gases thermodynamic properties at the outlet */
+ state_fg_out = Medium_FlueGases.setState_pTX(p=Psf, T=Tsf, X=Xsf);
+ Hsf = Medium_FlueGases.specificEnthalpy(state_fg_out);
+ rhosf = Medium_FlueGases.density(state_fg_out);
+
+ // --------------------
+ // 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 */
+
+ /* (2) Polytropic compression */
Tfcp = Tm*RV^(Kc - 1);
Pfcp = Pea*RV^Kc;
-/* (3) Constant volume combustion (point mort haut) */
+
+ /* (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 */
+ //Tfcb = (Wcomb - Wpth_ref)/ThermoSysPro.Properties.FlueGases.FlueGases_cp(Pfcp, (Tfcp + Tfcb)/2, XsfCO2, XsfH2O, XsfO2, XsfSO2)/0.75/Qsf + Tfcp;
+ Tfcb = Wcomb/Medium_FlueGases.specificHeatCapacityCp(Medium_FlueGases.setState_pTX(p=Pfcp, T=(Tfcp + Tfcb)/2, X=Xsf))/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 */
+
+ // --------------------
+
+ /* 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;
+ 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;
+ Rmeca = ((Qcomb*(Hcomb - Hrcomb + PCIcomb) + Qea*(Hea - Hrair))
+ -(Qsf*(Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=Tfe, X=Xsf)
+ -Hrfum) + Wpth_ref))/Wcomb;
end if;
+
Wmeca = Rmeca*Wcomb;
-/* Combustion air ratio */
+
+ /* 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 */
+
+ /* 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*/
+
+ /* Electrical power produced and active power*/
Welec = Wmeca*Relec;
Wact = Welec*Cosphi;
-/* Reference specific enthalpies */
- Hrair = 2501.569e3*XeaH2O;
+
+ /* Reference specific enthalpies */
+ /* Air and flue gases reference enthalpies: Medium_FlueGases enthalpy of the same mixture at 0.01 degC,
+ i.e. the zero of ThermoSysPro.Properties.FlueGases.FlueGases_h used with the lower heating value */
+ Hrair = Medium_FlueGases.specificEnthalpy_pTX(p=Pea, T=273.16, X=Xea);
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)}),
+ Hrfum = Medium_FlueGases.specificEnthalpy_pTX(p=Psf, T=273.16, X=Xsf);
+
+ 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 = "
Author
@@ -264,4 +421,4 @@ Benoît Bride
## ThermoSysPro Version 4.2
This component model is documented in Chapter 15 of the ThermoSysPro book.
"));
-end InternalCombustionEngine;
\ No newline at end of file
+end InternalCombustionEngine;
diff --git a/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo b/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo
index 75948fb9..f527ac45 100644
--- a/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo
+++ b/ThermoSysPro/Fluid/Machines/StaticCentrifugalPump.mo
@@ -1,53 +1,77 @@
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.)";
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ parameter 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 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 Real a1=-88.67
+ "x^2 coef. of the pump characteristics hn = f(vol_flow) (s2/m5)";
+ parameter Real a2=0
+ "x coef. of the pump characteristics hn = f(vol_flow) (s/m2)";
+ parameter Real a3=43.15
+ "Constant coef. of the pump characteristics hn = f(vol_flow) (m)";
+
+ parameter Real b1=-3.7751
+ "x^2 coef. of the pump efficiency characteristics rh = f(vol_flow) (s2/m6)";
+ parameter Real b2=3.61
+ "x coef. of the pump efficiency characteristics rh = f(vol_flow) (s/m3)";
+ parameter Real b3=-0.0075464
+ "Constant coef. of the pump efficiency characteristics rh = f(vol_flow) (s.u.)";
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n
+ "Gravity constant";
+ parameter Real eps=1.e-6 "Small number";
+ parameter Real rhmin=0.20 "Minimum efficiency to avoid zero crossings";
+
+public
Real rh "Hydraulic efficiency";
- Units.SI.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.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)));
-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";
+ Units.nonSI.AngularVelocity_rpm Vr "Rotational speed";
+ Units.SI.Density rho(start=998) "Fluid density";
+ 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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
+
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package
+ Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package
+ Medium = Medium) 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
@@ -58,25 +82,32 @@ equation
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;
+
+ C1.Xi = C2.Xi;
+
+ X = C1.Xi;
+
+ C1.SubC = C2.SubC;
+
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 */
+
+ /* 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
@@ -84,33 +115,66 @@ equation
else
assert(false, "StaticCentrifugalPump: incorrect option");
end if;
-/* Energy balance equation */
+
+ /* Energy balance equation */
if adiabatic_compression then
deltaH = 0;
else
deltaH = g*hn/rh;
end if;
-/* Reduced rotational speed */
+
+ /* Reduced rotational speed */
R = Vr/VRotn;
-/* Pump characteristics */
+
+ /* 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 */
+
+ /* Mechanical power */
Wm = Q*deltaH/rm;
-/* Hydraulic power */
+
+ /* Hydraulic power */
Wh = Qv*deltaP/rh;
-/* Fluid thermodynamic properties */
+
+ /* 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);
+ rho = Medium.density_phX(p=Pm, h=h, X=X);
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}})}),
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -121,6 +185,5 @@ Authors
Daniel Bouskela
Baligh El Hefni
- "),
- DymolaStoredErrors);
-end StaticCentrifugalPump;
\ No newline at end of file
+ "));
+end StaticCentrifugalPump;
diff --git a/ThermoSysPro/Fluid/Machines/StaticFan.mo b/ThermoSysPro/Fluid/Machines/StaticFan.mo
index 3a2ebb0c..c1f94568 100644
--- a/ThermoSysPro/Fluid/Machines/StaticFan.mo
+++ b/ThermoSysPro/Fluid/Machines/StaticFan.mo
@@ -1,103 +1,165 @@
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.)";
- Real rh(start = 0.5) "Hydraulic efficiency";
- Units.SI.Length hn(start = 10) "Pump head";
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.FlueGases constrainedby Modelica.Media.Interfaces.PartialMixtureMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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.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";
- 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)));
-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";
+ 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";
+
+public
+ ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical commandeFan
+ annotation (Placement(transformation(
+ origin={0,110},
+ extent={{-10,-10},{10,10}},
+ rotation=270)));
+ Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{-110,-10},{-90,10}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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;
+
+ C1.SubC = C2.SubC;
+
+ C1.Xi = C2.Xi;
+
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) */
+
+ /* Pump position (started or stopped) */
R = if commandeFan.signal then VRotation.signal/VRotn else 0;
-/* Pump characteristics */
+
+ /* 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 */
+
+ /* Mechanical power */
Wm = Q*deltaH/rm;
-/* Hydraulic power */
+
+ /* Hydraulic power */
Wh = Qv*deltaP/rh;
-/* Fluid thermodynamic properties */
+
+ /* 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);
+
+ // Temperature
+ h = Medium.specificEnthalpy_pTX(P, T, C2.Xi);
+
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);
+ rho = Medium.density_pTX(P, T, C2.Xi);
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)}),
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -107,6 +169,5 @@ Authors
Daniel Bouskela
Baligh El Hefni
- "),
- DymolaStoredErrors);
-end StaticFan;
\ No newline at end of file
+ "));
+end StaticFan;
diff --git a/ThermoSysPro/Fluid/Machines/SteamEngine.mo b/ThermoSysPro/Fluid/Machines/SteamEngine.mo
index 5edf52fd..22366c7f 100644
--- a/ThermoSysPro/Fluid/Machines/SteamEngine.mo
+++ b/ThermoSysPro/Fluid/Machines/SteamEngine.mo
@@ -1,68 +1,71 @@
within ThermoSysPro.Fluid.Machines;
-
model SteamEngine "Steam engine"
- import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
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"));
+
+ 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(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(tab="Fluid", group="Fluid properties"));
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+
+ Integer phase_e=if Integer(region_e) == 0 then 0 else if Integer(region_e)==4 then 2 else 1;
+ Integer phase_s=if Integer(region_s) == 0 then 0 else if Integer(region_s)==4 then 2 else 1;
+
+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";
+ 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.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";
- 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)));
-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";
+ Real xm(start=1.0,min=0) "Average vapor mass fraction (n.u.)";
+
+
+ Medium.ThermodynamicState state_e;
+ Medium.ThermodynamicState state_s;
+ Medium.ThermodynamicState state_ps;
+
+public
+ Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-80,-10},{-60,10}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{60,-10},{80,10}}, 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;
+
+ C1.SubC = C2.SubC;
+
+ C1.Xi = C2.Xi;
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 */
+
+ /* Average vapor mass fraction during the expansion */
+ xm = (Medium.vapourQuality(state_e) + Medium.vapourQuality(state_s)) /2.0;
+
+ /* Mass flow */
if (option_interpolation == 1) then
Q = ThermoSysPro.Functions.LinearInterpolation(caract[:, 1], caract[:, 2], deltaP);
elseif (option_interpolation == 2) then
@@ -70,23 +73,81 @@ equation
else
assert(false, "SteamEngine: incorrect interpolation option");
end if;
-/* Fluid specific enthalpy at the outlet */
+
+ /* Fluid specific enthalpy at the outlet */
C2.h - C1.h = xm*eta_is*(His - C1.h);
-/* Mechanical power produced by the engine */
+
+ /* 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),
+
+ /* Fluid thermodynamic properties before the expansion */
+ state_e = Medium.setState_ph(Pe,C1.h, phase=phase_e);
+ Te=Medium.temperature(state_e);
+
+ /* Fluid thermodynamic properties after the expansion */
+ state_s = Medium.setState_ph(Ps, C2.h, phase=phase_s);
+ Ts=Medium.temperature(state_s);
+
+ /* Fluid thermodynamic properties after the isentropic expansion */
+ state_ps = Medium.setState_ps(Ps, Medium.specificEntropy(state_e), phase=phase_s);
+ His=Medium.specificEnthalpy(state_ps);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -97,4 +158,4 @@ Benoît Bride
Daniel Bouskela
"));
-end SteamEngine;
\ No newline at end of file
+end SteamEngine;
diff --git a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo
index 977d23f3..3bd92400 100644
--- a/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo
+++ b/ThermoSysPro/Fluid/Machines/StodolaTurbine.mo
@@ -1,130 +1,186 @@
within ThermoSysPro.Fluid.Machines;
-
model StodolaTurbine "Multistage turbine group using Stodola's ellipse"
- import ThermoSysPro.Fluid.Interfaces.PropertyInterfaces.FluidType;
+extends ThermoSysPro.Fluid.Interfaces.IconColors;
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
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"));
- Real eta_is(start = 0.85) "Isentropic efficiency";
- Real eta_is_wet(start = 0.83) "Isentropic efficiency for wet steam";
+
+ 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(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(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(tab="Fluid", group="Fluid properties"));
+
+
+protected
+ Integer phase_e=if Integer(region_e) == 0 then 0 else if Integer(region_e)==4 then 2 else 1;
+ Integer phase_s=if Integer(region_s) == 0 then 0 else if Integer(region_s)==4 then 2 else 1;
+ Integer phase_ps=if Integer(region_ps) == 0 then 0 else if Integer(region_ps)==4 then 2 else 1;
+ 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.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";
- 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)));
-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";
+ Units.SI.Density rhos(start=200) "Fluid density at the outlet";
+ Real xm(start=1.0,min=0) "Average vapor mass fraction";
+
+public
+ Medium.ThermodynamicState state_e;
+ Medium.ThermodynamicState state_s1;
+ Medium.ThermodynamicState state_s;
+ Medium.ThermodynamicState state_ps;
+ Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{-111,-10},{-91,10}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{91,-10},{111,10}}, 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)));
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;
+
+ /* Fluid composition balance equations*/
+ Ce.Xi = Cs.Xi;
+
+
+ Ce.SubC = Cs.SubC;
+
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;
+
+
+ /* 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 */
+
+ /* 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;
+ xm = (Medium.vapourQuality(state_e) + Medium.vapourQuality(state_s1))/2.0;
end if;
-/* Stodola's ellipse law */
+
+ /* 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));
+ Q = sqrt((Pe^2 - Ps^2)/(Cst*Te*Medium.vapourQuality(state_e)));
end if;
-/* Fluid specific enthalpy after the expansion */
+
+ /* Fluid specific enthalpy after the expansion */
Hrs - Ce.h = xm*eta_is*(His - Ce.h);
-/* Fluid specific enthalpy at the outlet of the nozzle */
+
+ /* 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 */
+
+ /* 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),
+
+ /* Fluid thermodynamic properties before the expansion */
+ state_e=Medium.setState_ph(p=Pe, h=Ce.h, phase=phase_e);
+
+ Te = state_e.T;
+
+ /* Fluid thermodynamic properties after the expansion */
+ state_s1 = Medium.setState_ph(p=Ps, h=Hrs, phase=phase_s);
+
+ /* Fluid thermodynamic properties at the outlet of the nozzle */
+ state_s = Medium.setState_ph(p=Ps, h=Cs.h, phase=phase_s);
+
+ Ts = state_s.T;
+ rhos = state_s.d;
+
+ /* Fluid thermodynamic properties after the isentropic expansion */
+ state_ps = Medium.setState_ps(p=Ps, s=Medium.specificEntropy(state_e), phase=phase_ps);
+ His = state_ps.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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -136,4 +192,4 @@ Daniel Bouskela
Baligh El Hefni
"));
-end StodolaTurbine;
\ No newline at end of file
+end StodolaTurbine;
diff --git a/ThermoSysPro/Fluid/PressureLosses/Bend.mo b/ThermoSysPro/Fluid/PressureLosses/Bend.mo
index 5a0b2a03..6d13fb05 100644
--- a/ThermoSysPro/Fluid/PressureLosses/Bend.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/Bend.mo
@@ -1,26 +1,33 @@
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"));
+
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ parameter Units.SI.Diameter D=0.2 "Pipe diameter";
+ parameter Units.SI.Radius R0=0.2 "Pipe radius";
+ parameter 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"));
+
+protected
+ constant Real pi=Modelica.Constants.pi "pi";
+ 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.PressureDifference deltaP "Presure loss";
Units.SI.MassFlowRate Q "Mass flow rate";
Units.SI.ReynoldsNumber Re "Reynolds number";
Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
@@ -33,80 +40,180 @@ model Bend "Bend"
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";
- 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)));
-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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
+ Medium.ThermodynamicState state;
+
+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(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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;
+
+ C1.Xi = C2.Xi;
+
+ X = C1.Xi;
+
+
+ C1.SubC = C2.SubC;
+
Q = C1.Q;
h = C1.h;
C1.P - C2.P = deltaP;
- ftype = C1.ftype;
-/* Pressure loss */
+
+ /* 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). */
+
+ /* 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°");
+ 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;
+ 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;
+
+ 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;
+ 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 */
+
+ /* 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);
+
+ T = Medium.temperature(state);
+
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);
+ rho = Medium.density(state);
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),
+
+ state=Medium.setState_phX(p=Pm, h=h, X=X);
+ mu = Medium.dynamicViscosity(state);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -118,4 +225,4 @@ Daniel Bouskela
Baligh El Hefni
"));
-end Bend;
\ No newline at end of file
+end Bend;
diff --git a/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo
index 970bf0c6..03260ab8 100644
--- a/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/CheckValve.mo
@@ -1,78 +1,127 @@
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"));
- 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)));
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ parameter Units.SI.PressureDifference dPOuvert=10
+ "Pressure difference when the valve opens";
+ parameter Units.SI.PressureDifference dPFerme=0
+ "Pressure difference when the valve closes";
+ parameter 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"));
+
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 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";
+ 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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
+
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-120,-10},{-100,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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;
+
+ C1.Xi = C2.Xi;
+
+ X = C1.Xi;
+
+ C1.SubC = C2.SubC;
+
Q = C1.Q;
h = C1.h;
deltaP = C1.P - C2.P;
- ftype = C1.ftype;
-/* Pressure loss */
+
+ /* 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
+
+ when {pre(tferme),pre(touvert)} then
ouvert = pre(touvert);
end when;
-/* Fluid thermodynamic properties */
+
+ /* 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);
+
+ T = Medium.temperature_phX(p=Pm, h=h, X=X);
+
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);
+ rho = Medium.density_phX(p=Pm, h=h, X=X);
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),
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -82,6 +131,5 @@ Author
Daniel Bouskela
- "),
- DymolaStoredErrors);
-end CheckValve;
\ No newline at end of file
+ "));
+end CheckValve;
diff --git a/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo b/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo
index 7ee2674b..7326b6e7 100644
--- a/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/ControlValve.mo
@@ -1,58 +1,75 @@
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 [USG/min] (active if mode_caract=0)";
- parameter Real caract[:, 2] = [0, 0; 1, Cvmax] "Position vs. Cv [USG/min] 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"));
- ThermoSysPro.Units.xSI.Cv Cv(start = 100) "Cv [USG/min]";
- 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";
- 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)));
+extends ThermoSysPro.Fluid.Interfaces.IconColors;
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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"));
+
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";
+ 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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
+
+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(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-70},{-90,-50}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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;
+
+ C1.Xi = C2.Xi;
+
+ X = C1.Xi;
+
+
+ C1.SubC = C2.SubC;
+
Q = C1.Q;
h = C1.h;
deltaP = C1.P - C2.P;
- ftype = C1.ftype;
-/* Pressure loss */
+
+
+
+ /* 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
@@ -60,7 +77,8 @@ equation
else
assert(false, "ControlValve - option_rho_water: invalid option");
end if;
-/* Cv as a function of the valve position */
+
+ /* Cv as a function of the valve position */
if (mode_caract == 0) then
Cv = Ouv.signal*Cvmax;
elseif (mode_caract == 1) then
@@ -74,18 +92,73 @@ equation
else
assert(false, "ControlValve: invalid option");
end if;
-/* Fluid thermodynamic properties */
+
+ /* 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);
+
+ T = Medium.temperature_phX(p=Pm, h=h, X=X);
+
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);
+ rho = Medium.density_phX(p=Pm, h=h, X=X);
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),
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
diff --git a/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo b/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo
index cef96f85..7a2ffb3f 100644
--- a/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/Diaphragm.mo
@@ -1,19 +1,21 @@
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"));
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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"));
+
+protected
+ constant Real pi=Modelica.Constants.pi "pi";
+ 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.PressureDifference deltaP "Pressure loss";
Units.SI.MassFlowRate Q "Mass flow rate";
Units.SI.ReynoldsNumber Re "Reynolds number";
Units.SI.ReynoldsNumber Relim "Limit Reynolds number";
@@ -22,54 +24,110 @@ model Diaphragm "Diaphragm"
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";
- 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)));
-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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
+ Medium.ThermodynamicState state;
+
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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;
+
+ C1.Xi = C2.Xi;
+
+ X = C1.Xi;
+
+
+ C1.SubC = C2.SubC;
+
Q = C1.Q;
h = C1.h;
C1.P - C2.P = deltaP;
- ftype = C1.ftype;
-/* Pressure loss */
+
+ /* 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) */
+
+ /* 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 */
+
+ /* 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);
+
+ T = Medium.temperature(state);
+
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);
+ rho = Medium.density(state);
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),
+
+ state=Medium.setState_phX(p=Pm, h=h, X=X);
+ mu = Medium.dynamicViscosity(state);
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -80,4 +138,4 @@ Author
Daniel Bouskela
"));
-end Diaphragm;
\ No newline at end of file
+end Diaphragm;
diff --git a/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo
index e734b560..30fd4031 100644
--- a/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/DynamicCheckValve.mo
@@ -1,63 +1,64 @@
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 [USG/min]";
- parameter Real caract[:, 2] = [0, 0; 1, Cvmax] "Position vs. Cv [USG/min] 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"));
- Boolean libre(start = true) "Indicator whether the flap is free to move in both directions";
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ parameter 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"));
+
+protected
+ constant Real pi=Modelica.Constants.pi "pi";
+ parameter Units.SI.Acceleration g=Modelica.Constants.g_n
+ "Gravity constant";
+ parameter Real eps=1.e-3 "Small number for pressure loss equation";
+ parameter Units.SI.Radius r=sqrt(A/pi) "Flap radius";
+ parameter Units.SI.Angle theta_min=0
+ "Minimum flap aperture angle";
+ parameter Units.SI.Angle theta_max=pi/2
+ "Maximum flap aperture angle";
+ parameter Units.SI.Angle theta_m=(theta_min + theta_max)/2;
+
+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.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 [USG/min]";
- 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";
- 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)));
-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";
+ Units.xSI.Cv Cv(start=Cvmax) "Cv";
+ Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+ 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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
+
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{90,-10},{110,10}}, rotation=0)));
initial equation
if mech_steady_state then
der(theta) = 0;
@@ -67,44 +68,61 @@ initial equation
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;
+
+ C1.Xi = C2.Xi;
+
+ X = C1.Xi;
+
+ C1.SubC = C2.SubC;
+
Q = C1.Q;
h = C1.h;
deltaP = C1.P - C2.P;
- ftype = C1.ftype;
-/* Flap angle */
+
+ /* 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));
+
+ 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
+
+ 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 */
+
+ /* 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
@@ -118,18 +136,57 @@ equation
else
assert(false, "ClapetDyn : mode de calcul du Cv incorrect");
end if;
-/* Fluid thermodynamic properties */
+
+ /* 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);
+
+ T = Medium.temperature_phX(p=Pm, h=h, X=X);
+
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);
+ rho = Medium.density_phX(p=Pm, h=h, X=X);
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),
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
diff --git a/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo b/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo
index 6579b727..0cbf2b52 100644
--- a/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/DynamicReliefValve.mo
@@ -1,75 +1,81 @@
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 [USG/min]";
- parameter Real caract[:, 2] = [0, 0; 1, Cvmax] "Position vs. Cv [USG/min] 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"));
- Boolean clapper_is_free(start = true) "true if clapper is free to move in both directions, false otherwise";
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 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"));
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n
+ "Gravity constant";
+ constant Real pi=Modelica.Constants.pi "pi";
+ constant Units.SI.Density rho60F=998.98 "Water density at 60°F";
+ constant Real K=1.733e12 "Valve constant";
+ parameter Real eps=1.e-0 "Small number for pressure loss equation";
+ parameter Units.SI.Length z_min=0 "Minimum clapper elevation";
+
+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";
+ 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 [USG/min]";
- 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.xSI.Cv Cv "Cv";
+ Units.SI.MassFlowRate Q(start=500) "Mass flow rate";
+ 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";
- 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}})));
-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";
+ Real Re=rho*(vh - v)*sqrt(4*A/pi)/ThermoSysPro.Properties.WaterSteam.IF97.DynamicViscosity_rhoT(rho, T) "Clapper Reynolds";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
+
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-10,-108},{10,-88}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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;
@@ -78,58 +84,78 @@ initial equation
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;
+
+ C1.Xi = C2.Xi;
+
+ X = C1.Xi;
+
+
+ C1.SubC = C2.SubC;
+
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
+
+
+ /* 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 */
+
+ /* Dynamic pressure on the valve */
Pdyn = Cd*rho/2*(vh - v)^2;
-/* Dissipated kinetic energy */
+
+ /* Dissipated kinetic energy */
der(Wdyn) = Fdyn*v;
-/* Fluid velocity through the valve */
+
+ /* Fluid velocity through the valve */
rho*vh*A = Q;
-/* Force balance */
+
+ /* 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 */
+
+ /* 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
+
+ when {z <= z_min,z >= z_max} then
reinit(v, 0);
end when;
-/* Pressure that opens the valve */
+
+ /* Pressure that opens the valve */
m*g - Fr_min = Popen*A1 - Pout*A2;
-/* Valve position */
+
+ /* Valve position */
Ouv = (z - z_min)/(z_max - z_min);
-/* Pressure loss */
+
+ /* Pressure loss */
deltaP*Cv*abs(Cv) = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/(rho*rho60F);
-/* Cv as a function of the valve position */
+
+ /* Cv as a function of the valve position */
if (mode_caract == 0) then
Cv = Ouv*Cvmax;
elseif (mode_caract == 1) then
@@ -145,18 +171,59 @@ equation
else
assert(false, "DynamicReliefValve : incorrect Cv computation mode");
end if;
-/* Fluid thermodynamic properties */
+
+ /* 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);
+
+ T = Medium.temperature_phX(p=Pm, h=h, X=X);
+
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);
+ rho = Medium.density_phX(p=Pm, h=h, X=X);
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),
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
diff --git a/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo b/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo
index 0578d3df..ac2d1c71 100644
--- a/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/IdealCheckValve.mo
@@ -1,53 +1,106 @@
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)";
- Boolean ouvert(start = true, fixed = true) "Valve state";
- discrete Boolean touvert(start = false, fixed = true);
- discrete Boolean tferme(start = false, fixed = true);
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ parameter 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)));
+ Units.SI.SpecificEnthalpy h(start=100000)
+ "Fluid specific enthalpy";
+ Units.SI.PressureDifference deltaP
+ "Pressure difference between the inlet and the outlet";
+
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{90,-10},{110,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) 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;
+
+ C1.Xi = C2.Xi;
+
+ C1.SubC = C2.SubC;
+
Q = C1.Q;
h = C1.h;
deltaP = C1.P - C2.P;
-/* Pressure loss */
+
+ /* Pressure loss */
if ouvert then
deltaP = 0;
else
- Q - Qmin = 0;
+ Q - Qmin = 0;
end if;
+
touvert = (deltaP > dPOuvert);
tferme = (not (Q > 0));
- when {pre(tferme), pre(touvert)} then
+
+ 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),
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -58,4 +111,4 @@ Daniel Bouskela
Baligh El Hefni
"));
-end IdealCheckValve;
\ No newline at end of file
+end IdealCheckValve;
diff --git a/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo b/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo
index 608b6f5a..4d33f8b8 100644
--- a/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/IdealSwitchValve.mo
@@ -1,45 +1,110 @@
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)";
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
- 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)));
+ Units.SI.SpecificEnthalpy h(start=100000)
+ "Fluid specific enthalpy";
+ Units.SI.PressureDifference deltaP
+ "Pressure difference between the inlet and the outlet";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
+public
+ ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv
+ annotation (Placement(transformation(
+ origin={0,70},
+ extent={{-10,-10},{10,10}},
+ rotation=270)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-70},{-90,-50}}, rotation=0),
+ iconTransformation(extent={{-110,-70},{-90,-50}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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;
+
+ C1.Xi = C2.Xi;
+
+ X = C1.Xi;
+
+ C1.SubC = C2.SubC;
+
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),
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -49,4 +114,4 @@ Author
Daniel Bouskela
"));
-end IdealSwitchValve;
\ No newline at end of file
+end IdealSwitchValve;
diff --git a/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo
index 33a68c82..daad34ac 100644
--- a/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/InvSingularPressureLoss.mo
@@ -1,65 +1,109 @@
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"));
- 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";
- 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)));
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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"));
+
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";
+ 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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
+
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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;
+
+ C1.Xi = C2.Xi;
+ X = C1.Xi;
+
+ C1.SubC = C2.SubC;
+
Q = C1.Q;
h = C1.h;
deltaP = C1.P - C2.P;
- ftype = C1.ftype;
-/* Pressure loss */
+
+ /* Pressure loss */
deltaP = if noEvent(abs(Q) < Qeps) then 1.e-10 else K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
-/* Fluid thermodynamic properties */
+
+ /* 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);
+
+ T = Medium.temperature_phX(p=Pm, h=h, X=X);
+
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);
+ rho = Medium.density_phX(p=Pm, h=h, X=X);
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),
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -70,4 +114,4 @@ Baligh El Hefni
Daniel Bouskela
"));
-end InvSingularPressureLoss;
\ No newline at end of file
+end InvSingularPressureLoss;
diff --git a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo
index 4410eacc..2b705551 100644
--- a/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/LumpedStraightPipe.mo
@@ -1,28 +1,38 @@
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"));
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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"));
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ constant Real pi=Modelica.Constants.pi "pi";
+ parameter Real eps=1.e-3 "Small number for pressure loss equation";
+ parameter Units.SI.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.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";
@@ -31,55 +41,60 @@ model LumpedStraightPipe "Lumped straight pipe (circular duct)"
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";
- 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)));
-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)";
+ 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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
+ Medium.ThermodynamicState state "Fluid thermodynamic state";
+
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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;
+
+ C1.Xi = C2.Xi;
+ X = C1.Xi;
+
+ C1.SubC = C2.SubC;
+
Q = C1.Q;
h = C1.h;
deltaP = C1.P - C2.P;
- ftype = C1.ftype;
-/* Diffusion resistance */
+
+ /* Diffusion resistance */
gamma_diff = A*k/cp/L;
-/* Pressure loss */
+
+ /* 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). */
+
+ /* 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
@@ -89,23 +104,49 @@ equation
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 */
+
+ /* Fluid thermodynamic properties */
Pm = (C1.P + C2.P)/2;
+ state = Medium.setState_phX(p=Pm, h=h, X=X);
+
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);
+ rho = Medium.density(state);
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),
+
+ T = Medium.temperature(state);
+ mu = Medium.dynamicViscosity(state);
+ k = Medium.thermalConductivity(state);
+ cp = Medium.specificHeatCapacityCp(state);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -117,4 +158,4 @@ Daniel Bouskela
Baligh El Hefni
"));
-end LumpedStraightPipe;
\ No newline at end of file
+end LumpedStraightPipe;
diff --git a/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo
index 8c9b250f..5d13a8c4 100644
--- a/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/PipePressureLoss.mo
@@ -1,70 +1,110 @@
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"));
+
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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"));
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ 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";
- 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)));
-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";
+ 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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
+
+public
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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;
+
+ C1.Xi = C2.Xi;
+
+ C1.SubC = C2.SubC;
+
Q = C1.Q;
h = C1.h;
+ X = C1.Xi;
deltaP = C1.P - C2.P;
- ftype = C1.ftype;
-/* Pressure loss */
+
+ /* Pressure loss */
deltaPf = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
deltaPg = rho*g*(z2 - z1);
deltaP = deltaPf + deltaPg;
-/* Fluid thermodynamic properties */
+
+ /* 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);
+
+ T = Medium.temperature_phX(p=Pm, h=h, X=X);
+
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);
+ rho = Medium.density_phX(p=Pm, h=h, X=X);
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),
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -76,4 +116,4 @@ Daniel Bouskela
Baligh El Hefni
"));
-end PipePressureLoss;
\ No newline at end of file
+end PipePressureLoss;
diff --git a/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo b/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo
index 4220477e..f863a184 100644
--- a/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/SingularPressureLoss.mo
@@ -1,63 +1,110 @@
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"));
- 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)));
+extends ThermoSysPro.Fluid.Interfaces.IconColors;
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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"));
+
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 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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
+
+
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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;
+
+ C1.Xi = C2.Xi;
+
+ X = C1.Xi;
+
+
+ C1.SubC = C2.SubC;
+
Q = C1.Q;
h = C1.h;
deltaP = C1.P - C2.P;
- ftype = C1.ftype;
-/* Pressure loss */
+
+
+ /* Pressure loss */
deltaP = K*ThermoSysPro.Functions.ThermoSquare(Q, eps)/rho;
-/* Fluid thermodynamic properties */
+
+ /* 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);
+
+ T = Medium.temperature_phX(p=Pm, h=h, X=X);
+
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);
+ rho = Medium.density_phX(p=Pm, h=h, X=X);
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),
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -69,4 +116,4 @@ Baligh El Hefni
Daniel Bouskela
"));
-end SingularPressureLoss;
\ No newline at end of file
+end SingularPressureLoss;
diff --git a/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo b/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo
index 39728c09..fdaded47 100644
--- a/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/SwitchValve.mo
@@ -1,70 +1,131 @@
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"));
- 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";
- 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}})));
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ parameter 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"));
+
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 Real eps=1.e-3 "Small number for pressure loss equation";
+
+public
+ Units.SI.MassFlowRate Q(start=100) "Mass flow rate";
+ 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";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Mass fractions";
+
+
+public
+ ThermoSysPro.InstrumentationAndControl.Connectors.InputLogical Ouv
+ annotation (Placement(transformation(
+ origin={0,72},
+ extent={{-10,-10},{10,10}},
+ rotation=270)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-70},{-90,-50}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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;
+
+ C1.Xi = C2.Xi;
+
+ X = C1.Xi;
+
+
+ C1.SubC = C2.SubC;
+
Q = C1.Q;
h = C1.h;
deltaP = C1.P - C2.P;
- ftype = C1.ftype;
-/* Pressure loss */
+
+ /* 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 */
+
+ /* 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);
+
+ T = Medium.temperature_phX(p=Pm, h=h, X=X);
+
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);
+ rho = Medium.density_phX(p=Pm, h=h, X=X);
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),
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -75,4 +136,4 @@ Author
Daniel Bouskela
"));
-end SwitchValve;
\ No newline at end of file
+end SwitchValve;
diff --git a/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo b/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo
index 23c7a6d8..9311e85b 100644
--- a/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo
+++ b/ThermoSysPro/Fluid/PressureLosses/ThreeWayValve.mo
@@ -1,90 +1,118 @@
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 [USG/min]";
- parameter ThermoSysPro.Units.xSI.Cv Cvmax2 = 8005.42 "Valve 2 max CV [USG/min]";
- parameter Real caract1[:, 2] = [0, 0; 1, Cvmax1] "Valve 1 - Position vs. Cv [USG/min] characteristics (active if mode_caract1=true)";
- parameter Real caract2[:, 2] = [0, 0; 1, Cvmax2] "Valve 2 - Position vs. Cv [USG/min] 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 "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" 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)));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 Boolean dynamic_composition_balance=false
+ "true: dynamic fluid composition balance equation
false: static fluid composition balance equation" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+
+ parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default
+ "Initial composition values" annotation (Evaluate=true, Dialog(
+ enable=dynamic_composition_balance,
+ tab="Fluid",
+ group="Medium"));
+
+ ThermoSysPro.InstrumentationAndControl.Connectors.InputReal Ouv
+ annotation (Placement(transformation(
+ origin={0,110},
+ extent={{-10,-10},{10,10}},
+ rotation=270)));
+ Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (layer="icon", Placement(
+ transformation(extent={{-110,-50},{-90,-30}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) annotation (layer="icon", Placement(
+ transformation(extent={{90,-50},{110,-30}}, rotation=0)));
+ ThermoSysPro.Fluid.PressureLosses.ControlValve Valve1(
+ redeclare package Medium = Medium,
+ Cvmax=Cvmax1,
+ caract=caract1,
+ mode_caract=mode_caract1,
+ p_rho=p_rho,
+ gamma_diff=gamma_diff)
+ annotation (Placement(transformation(
+ origin={-6,-50},
+ extent={{10,-10},{-10,10}},
+ rotation=90)));
+ Interfaces.Connectors.FluidOutlet C3(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{-10,-110},{10,-90}}, rotation=0)));
+ ThermoSysPro.Fluid.PressureLosses.ControlValve Valve2(
+ redeclare package Medium = Medium,
+ Cvmax=Cvmax2,
+ caract=caract2,
+ mode_caract=mode_caract2,
+ p_rho=p_rho,
+ 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(
+ redeclare package Medium = Medium,
+ V=V,
+ p_rho=p_rho,
+ dynamic_energy_balance=dynamic_energy_balance,
+ diffusion=diffusion,
+ continuous_flow_reversal=continuous_flow_reversal,
+ dynamic_composition_balance=dynamic_composition_balance,
+ X0=X0) annotation (Placement(transformation(extent={{-10,
+ -10},{10,10}}, rotation=0)));
+ ThermoSysPro.Fluid.PressureLosses.PipePressureLoss PerteDP1(redeclare package Medium = Medium, K=0, 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 = "
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
This component model is documented in Sect. 13.9 of the ThermoSysPro book.
@@ -94,7 +122,54 @@ Author
Daniel Bouskela
"),
- 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));
+ 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));
end ThreeWayValve;
diff --git a/ThermoSysPro/Fluid/Sensors/SensorH.mo b/ThermoSysPro/Fluid/Sensors/SensorH.mo
index 83c4e5a9..0240fa77 100644
--- a/ThermoSysPro/Fluid/Sensors/SensorH.mo
+++ b/ThermoSysPro/Fluid/Sensors/SensorH.mo
@@ -1,41 +1,85 @@
within ThermoSysPro.Fluid.Sensors;
-
model SensorH "Specific enthalpy sensor"
- 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)));
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+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(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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 */
+
+ C1.Xi = C2.Xi;
+
+ C1.SubC = C2.SubC;
+
+ /* 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")}),
+ 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 = "
-## Copyright © EDF 2002 - 2026
-## ThermoSysPro Version 4.2
+## Copyright © EDF 2002 - 2026
+## ThermoSysPro Version 4.2
", revisions = "
-Authors
+Authors
-Daniel Bouskela
-Baligh El Hefni
+Daniel Bouskela
+Baligh El Hefni
"));
-end SensorH;
\ No newline at end of file
+end SensorH;
diff --git a/ThermoSysPro/Fluid/Sensors/SensorP.mo b/ThermoSysPro/Fluid/Sensors/SensorP.mo
index d4abbf1a..286166d9 100644
--- a/ThermoSysPro/Fluid/Sensors/SensorP.mo
+++ b/ThermoSysPro/Fluid/Sensors/SensorP.mo
@@ -1,41 +1,79 @@
within ThermoSysPro.Fluid.Sensors;
-
model SensorP "Pressure sensor"
- 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)));
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+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(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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 */
+
+ C1.Xi = C2.Xi;
+ C1.SubC = C2.SubC;
+
+ /* 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")}),
+
+ 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 = "
-## Copyright © EDF 2002 - 2026
-## ThermoSysPro Version 4.2
+## Copyright © EDF 2002 - 2026
+## ThermoSysPro Version 4.2
", revisions = "
-Authors
+Authors
-Daniel Bouskela
-Baligh El Hefni
+Daniel Bouskela
+Baligh El Hefni
"));
-end SensorP;
\ No newline at end of file
+end SensorP;
diff --git a/ThermoSysPro/Fluid/Sensors/SensorQ.mo b/ThermoSysPro/Fluid/Sensors/SensorQ.mo
index 855d1616..469a96f5 100644
--- a/ThermoSysPro/Fluid/Sensors/SensorQ.mo
+++ b/ThermoSysPro/Fluid/Sensors/SensorQ.mo
@@ -1,41 +1,86 @@
within ThermoSysPro.Fluid.Sensors;
-
model SensorQ "Mass flow sensor"
- 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)));
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+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(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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 */
+
+ C1.Xi = C2.Xi;
+
+ C1.SubC = C2.SubC;
+
+ /* 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")}),
+ 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 = "
-## Copyright © EDF 2002 - 2026
-## ThermoSysPro Version 4.2
+## Copyright © EDF 2002 - 2026
+## ThermoSysPro Version 4.2
", revisions = "
-Authors
+Authors
-Daniel Bouskela
-Baligh El Hefni
+Daniel Bouskela
+Baligh El Hefni
"));
-end SensorQ;
\ No newline at end of file
+end SensorQ;
diff --git a/ThermoSysPro/Fluid/Sensors/SensorQv.mo b/ThermoSysPro/Fluid/Sensors/SensorQv.mo
index 7941fb24..671464eb 100644
--- a/ThermoSysPro/Fluid/Sensors/SensorQv.mo
+++ b/ThermoSysPro/Fluid/Sensors/SensorQv.mo
@@ -1,65 +1,102 @@
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"));
- 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";
- 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)));
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ parameter Integer output_unit=1 "Sensor outpu unit - 1: m3/h, other: m3/s";
+
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";
+ parameter 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.Density rho(start=998) "Fluid density";
+
+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(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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;
+
+ C1.Xi = C2.Xi;
+
+ C1.SubC = C2.SubC;
+
Q = C1.Q;
- ftype = C1.ftype;
-/* Sensor signal */
+
+ /* 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")}),
+
+ /* Fluid thermodynamic properties */
+ rho = Medium.density_phX(p=C1.P, h=C1.h, X=C1.Xi);
+
+ 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 = "
-## Copyright © EDF 2002 - 2026
-## ThermoSysPro Version 4.2
+## Copyright © EDF 2002 - 2026
+## ThermoSysPro Version 4.2
", revisions = "
-Authors
+Authors
-Daniel Bouskela
-Baligh El Hefni
+Daniel Bouskela
+Baligh El Hefni
"));
-end SensorQv;
\ No newline at end of file
+end SensorQv;
diff --git a/ThermoSysPro/Fluid/Sensors/SensorSubC.mo b/ThermoSysPro/Fluid/Sensors/SensorSubC.mo
new file mode 100644
index 00000000..603834b7
--- /dev/null
+++ b/ThermoSysPro/Fluid/Sensors/SensorSubC.mo
@@ -0,0 +1,80 @@
+within ThermoSysPro.Fluid.Sensors;
+model SensorSubC "SubC sensor"
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+public
+ ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal[Medium.nC] Measure
+ annotation (Placement(transformation(
+ origin={0,102},
+ extent={{-10,-10},{10,10}},
+ rotation=90)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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.Xi = C2.Xi;
+
+ C1.SubC = C2.SubC;
+
+ /* Sensor signal */
+ Measure.signal = C1.SubC;
+
+ 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=
+ "C")}),
+ 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=
+ "C")}),
+ Documentation(info = "
+## Copyright © EDF 2002 - 2026
+## ThermoSysPro Version 4.2
+ ", revisions = "
+Authors
+
+Daniel Bouskela
+Baligh El Hefni
+
+ "));
+end SensorSubC;
diff --git a/ThermoSysPro/Fluid/Sensors/SensorT.mo b/ThermoSysPro/Fluid/Sensors/SensorT.mo
index 02635062..d55b15a6 100644
--- a/ThermoSysPro/Fluid/Sensors/SensorT.mo
+++ b/ThermoSysPro/Fluid/Sensors/SensorT.mo
@@ -1,63 +1,95 @@
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"));
- Units.SI.MassFlowRate Q(start = 500) "Mass flow rate";
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+public
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";
- 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)));
-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
+ 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(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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 */
+
+ C1.Xi = C2.Xi;
+
+ C1.SubC = C2.SubC;
+
+ /* 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),
+
+ /* Fluid thermodynamic properties */
+ T = Medium.temperature_phX(p=C1.P, h=C1.h, X=C1.Xi);
+
+ 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 = "
-## Copyright © EDF 2002 - 2026
-## ThermoSysPro Version 4.2
+## Copyright © EDF 2002 - 2026
+## ThermoSysPro Version 4.2
", revisions = "
-Authors
+Authors
-Daniel Bouskela
-Baligh El Hefni
+Daniel Bouskela
+Baligh El Hefni
"));
-end SensorT;
\ No newline at end of file
+end SensorT;
diff --git a/ThermoSysPro/Fluid/Sensors/SensorX.mo b/ThermoSysPro/Fluid/Sensors/SensorX.mo
new file mode 100644
index 00000000..3700c6d2
--- /dev/null
+++ b/ThermoSysPro/Fluid/Sensors/SensorX.mo
@@ -0,0 +1,80 @@
+within ThermoSysPro.Fluid.Sensors;
+model SensorX "X sensor"
+ extends ThermoSysPro.Fluid.Interfaces.IconColors;
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+public
+ ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal[Medium.nXi] Measure
+ annotation (Placement(transformation(
+ origin={0,102},
+ extent={{-10,-10},{10,10}},
+ rotation=90)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet C1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-90},{-90,-70}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet C2(redeclare package Medium = Medium) 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.Xi = C2.Xi;
+
+ C1.SubC = C2.SubC;
+
+ /* Sensor signal */
+ Measure.signal = C1.Xi;
+
+ 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=
+ "X")}),
+ 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=
+ "X")}),
+ Documentation(info = "
+## Copyright © EDF 2002 - 2026
+## ThermoSysPro Version 4.2
+ ", revisions = "
+Authors
+
+Daniel Bouskela
+Baligh El Hefni
+
+ "));
+end SensorX;
diff --git a/ThermoSysPro/Fluid/Sensors/package.order b/ThermoSysPro/Fluid/Sensors/package.order
index f2873124..eefb8c73 100644
--- a/ThermoSysPro/Fluid/Sensors/package.order
+++ b/ThermoSysPro/Fluid/Sensors/package.order
@@ -3,3 +3,5 @@ SensorQ
SensorQv
SensorH
SensorT
+SensorSubC
+SensorX
diff --git a/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo b/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo
index 45b104c8..026c886e 100644
--- a/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo
+++ b/ThermoSysPro/Fluid/Volumes/DynamicDrum.mo
@@ -1,34 +1,62 @@
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";
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+ parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default
+ "Initial liquid phase trace substances"
+ annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+ parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default
+ "Initial vapor phase trace substances"
+ annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+
+protected
+ constant Real pi=Modelica.Constants.pi "pi";
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ parameter Units.SI.Volume V=pi*R^2*L "Drum volume";
+ parameter Units.SI.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;
+ Medium.C_BiPhase C_m "Trace partition of the evaporation loop mixture (Cm)";
+ Medium.C_BiPhase C_l "Trace partition of the liquid phase";
+ Medium.C_BiPhase C_v "Trace partition of the gas phase";
+
+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";
@@ -60,8 +88,8 @@ model DynamicDrum "Dynamic drum"
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.Area Avl(start=1.0)
+ "Heat exchange surface between the liquid and gas phases";
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";
@@ -85,46 +113,55 @@ model DynamicDrum "Dynamic drum"
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)));
- 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)));
- 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)));
-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;
+ Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Right hand side of the trace balance equation of the liquid phase";
+ Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Right hand side of the trace balance equation of the vapor phase";
+ Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default)
+ "Liquid phase trace substances";
+ Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default)
+ "Vapor phase trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Trace modification in the trace balance equation";
+
+ Medium.ThermodynamicState state_l "Liquid state in the drum";
+ Medium.ThermodynamicState state_v "Vapor state in the drum";
+ Medium.ThermodynamicState state_m "Evaporation loop state";
+ Medium.ThermodynamicState state_out_l "Downcomer outlet state";
+ Medium.SaturationProperties sat "Saturation properties at drum pressure";
+ Units.SI.SpecificEnthalpy hlsat "Bubble enthalpy at drum pressure";
+ Units.SI.SpecificEnthalpy hvsat "Dew enthalpy at drum pressure";
+ Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy";
+ Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure";
+ Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy";
+ Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure";
+public
+ Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) "Feedwater input 1" annotation (
+ Placement(transformation(extent={{-110,90},{-90,110}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet Cm(redeclare package Medium = Medium) "Evaporation loop outlet" annotation (
+ Placement(transformation(extent={{90,-110},{110,-90}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cd(redeclare package Medium = Medium) "Evaporation loop inlet" annotation (
+ Placement(transformation(extent={{-110,-110},{-90,-90}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cv(redeclare package Medium = Medium) "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
+ Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) "Feedwater input 2" annotation (
+ Placement(transformation(extent={{-110,30},{-90,50}}, rotation=0),
+ iconTransformation(extent={{-110,30},{-90,50}})));
+ Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) "Feedwater input 3" annotation (
+ Placement(transformation(extent={{-110,-50},{-90,-30}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) "Water outlet" annotation (Placement(
+ transformation(extent={{90,-50},{110,-30}}, rotation=0)));
initial equation
if dynamic_energy_balance then
if steady_state then
@@ -133,37 +170,27 @@ initial equation
der(hv) = 0;
der(Vl) = 0;
der(Tp) = 0;
+ der(SubCl) = fill(0, Medium.nC);
+ der(SubCv) = fill(0, Medium.nC);
else
P = P0;
- hl = lsat.h;
- hv = vsat.h;
+ hl = hlsat;
+ hv = hvsat;
Vl = Vf0*V;
der(Tp) = 0;
+ SubCl = SubCl0;
+ SubCv = SubCv0;
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 */
+ /* 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;
+ Ce1.SubC = Medium.C_default;
end if;
if (cardinality(Ce2) == 0) then
Ce2.Q = 0;
@@ -171,11 +198,7 @@ equation
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;
+ Ce2.SubC = Medium.C_default;
end if;
if (cardinality(Ce3) == 0) then
Ce3.Q = 0;
@@ -183,11 +206,7 @@ equation
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;
+ Ce3.SubC = Medium.C_default;
end if;
if (cardinality(Cm) == 0) then
Cm.Q = 0;
@@ -195,11 +214,7 @@ equation
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;
+ Cm.SubC = Medium.C_default;
end if;
if (cardinality(Cd) == 0) then
Cd.Q = 0;
@@ -240,19 +255,21 @@ equation
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 */
+
+ /* Pressure at the bottom of the drum */
+ Pfond = P + Medium.density(state_out_l)*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;
+ rhol*der(Vl) + Vl*(ddphl*der(P) + ddhpl*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;
+ rhov*der(Vv) + Vv*(ddphv*der(P) + ddhpv*der(hv)) = BQv;
else
0 = BQv;
end if;
@@ -266,17 +283,26 @@ equation
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;
+
+ /* 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 hlsat else Cm.h) - (hl - P/rhol))
+ + Qcond*(hlsat - (hl - P/rhol)) - Qevap*(hvsat - (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;
+ Vl*((P/rhol*ddphl - 1)*der(P) + (P/rhol*ddhpl + 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;
+
+ /* Gas phase energy balance equation */
+ BHv = xmv*Cm.Q*((if (xmv < 1) then hvsat else Cm.h) - (hv - P/rhov))
+ - Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(hvsat - (hv - P/rhov)) - Qcond*(hlsat - (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;
+ Vv*((P/rhov*ddphv - 1)*der(P) + (P/rhov*ddhpv + rhov)*der(hv)) = BHv;
else
0 = BHv;
end if;
@@ -284,7 +310,7 @@ equation
Ce2.h_vol_2 = hl;
Ce3.h_vol_2 = hl;
Cm.h_vol_2 = hl;
- Cd.h_vol_1 = noEvent(min(lsat.h, hl));
+ Cd.h_vol_1 = noEvent(min(hlsat, hl));
Cs.h_vol_1 = hl;
Cv.h_vol_1 = hv;
/* Energy balance equation at the wall */
@@ -301,23 +327,36 @@ equation
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 */
+
+ /* Traces composition balance equations */
+ /* Equilibrium partition of the traces (Medium.relativeVolatility) applied to
+ every mass transfer between phases. Each transfer removes from one phase
+ exactly what it adds to the other: the balance is exact for any volatility. */
+ if Medium.nC > 0 then
+ C_m = tracePartition(Cm.SubC, xmv, sat.Tsat);
+ C_l = tracePartition(SubCl, xl, sat.Tsat);
+ C_v = tracePartition(SubCv, xv, sat.Tsat);
+ end if;
+ SubCSaS = SaS();
+
+ BSubCl = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC
+ - Cd.Q*Cd.SubC - Cs.Q*Cs.SubC + Cm.Q*Cm.SubC - xmv*Cm.Q*C_m.Cg
+ + Qcond*C_v.Cl - Qevap*C_l.Cg;
+ BSubCv = xmv*Cm.Q*C_m.Cg - Cv.Q*Cv.SubC + Qevap*C_l.Cg - Qcond*C_v.Cl;
+
+ if dynamic_energy_balance then
+ rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl;
+ rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv;
+ else
+ SubCl*BQl = BSubCl;
+ SubCv*BQv + rhov*Vv*SubCSaS = BSubCv;
+ end if;
+
+ Cd.SubC = SubCl;
+ Cs.SubC = SubCl;
+ Cv.SubC = SubCv;
+
+ /* 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);
@@ -389,19 +428,31 @@ equation
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;
+
+ /* Fluid thermodynamic properties */
+ state_l = Medium.setState_phX(p=P, h=hl, X=Medium.reference_X);
+ state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X);
+ state_out_l = Medium.setState_phX(p=Pfond, h=Cd.h, X=Medium.reference_X);
+ state_m = Medium.setState_phX(p=P, h=Cm.h, X=Medium.reference_X);
+ sat = Medium.setSat_p(P);
+ hlsat = Medium.bubbleEnthalpy(sat);
+ hvsat = Medium.dewEnthalpy(sat);
+
+ ddphl = Medium.density_derp_h(state_l);
+ ddhpl = Medium.density_derh_p(state_l);
+ ddphv = Medium.density_derp_h(state_v);
+ ddhpv = Medium.density_derh_p(state_v);
+
+ Tl = Medium.temperature(state_l);
+ rhol = Medium.density(state_l);
+ xl = noEvent(max(0, min(1, (hl - hlsat)/(hvsat - hlsat))));
+
+ Tv = Medium.temperature(state_v);
+ rhov = Medium.density(state_v);
+ xv = noEvent(max(0, min(1, (hv - hlsat)/(hvsat - hlsat))));
+
+ xmv = if noEvent(Cm.Q > 0) then noEvent(max(0, min(1, (Cm.h - hlsat)/(hvsat - hlsat)))) else 0;
+
Cth.T = Tl;
Cex.T = Ta;
Cex.W = Wpa;
diff --git a/ThermoSysPro/Fluid/Volumes/Pressurizer.mo b/ThermoSysPro/Fluid/Volumes/Pressurizer.mo
index ac4b6587..397466a4 100644
--- a/ThermoSysPro/Fluid/Volumes/Pressurizer.mo
+++ b/ThermoSysPro/Fluid/Volumes/Pressurizer.mo
@@ -1,33 +1,58 @@
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";
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+ parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default
+ "Initial liquid phase trace substances"
+ annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+ parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default
+ "Initial vapor phase trace substances"
+ annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+
+protected
+ constant Real pi=Modelica.Constants.pi "Pi";
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ 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";
+ Medium.C_BiPhase C_l "Trace partition of the liquid phase";
+ Medium.C_BiPhase C_v "Trace partition of the gas phase";
+ Real xl "Vapor mass fraction in the liquid phase";
+ Real xv "Vapor mass fraction in the gas phase";
+
+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";
@@ -50,15 +75,20 @@ model Pressurizer "Pressurizer"
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.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";
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";
@@ -70,32 +100,45 @@ model Pressurizer "Pressurizer"
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)));
- 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)));
-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";
+ Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Right hand side of the trace balance equation of the liquid phase";
+ Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Right hand side of the trace balance equation of the vapor phase";
+ Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default)
+ "Liquid phase trace substances";
+ Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default)
+ "Vapor phase trace substances";
+ Medium.ExtraProperty Jcond[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Trace flow carried by Qcond from the gas phase to the liquid phase";
+ Medium.ExtraProperty Jevap[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Trace flow carried by Qevap from the liquid phase to the gas phase";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Trace modification in the trace balance equation";
+ Medium.ThermodynamicState state_l "Liquid state in the pressurizer";
+ Medium.ThermodynamicState state_v "Vapor state in the pressurizer";
+ Medium.SaturationProperties sat "Saturation properties at pressurizer pressure";
+ Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy";
+ Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure";
+ Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy";
+ Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure";
+
+ Interfaces.Connectors.FluidInlet Cas(redeclare package Medium = Medium) "Water input" annotation (Placement(
+ transformation(extent={{-8,92},{8,108}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) "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(redeclare package Medium = Medium) "Water output" annotation (Placement(
+ transformation(extent={{-8,-108},{8,-92}}, rotation=0)));
initial equation
if dynamic_energy_balance then
if steady_state then
@@ -104,33 +147,27 @@ initial equation
der(hv) = 0;
der(y) = 0;
der(Tp) = 0;
+ der(SubCl) = fill(0, Medium.nC);
+ der(SubCv) = fill(0, Medium.nC);
else
P = P0;
hl = hls;
hv = hvs;
Yw = Yw0;
der(Tp) = 0;
+ SubCl = SubCl0;
+ SubCv = SubCv0;
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 */
+ /* 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;
+ Cas.SubC = Medium.C_default;
end if;
if (cardinality(Cex) == 0) then
Cex.Q = 0;
@@ -161,14 +198,14 @@ equation
/* 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;
+ rhol*Ap*Zm*der(y) + Vl*ddphl*der(P) + Vl*ddhpl*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;
+ -rhov*Ap*Zm*der(y) + Vv*ddphv*der(P) + Vv*ddhpv*der(hv) = BQv;
else
0 = BQv;
end if;
@@ -209,18 +246,42 @@ equation
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 */
+
+ /* Traces composition balance equations */
+ /* Equilibrium partition of the traces (Medium.relativeVolatility) applied to
+ every mass transfer between phases. Each transfer removes from one phase
+ exactly what it adds to the other: the balance is exact for any volatility.
+ Each transfer carries the concentration of the phase it leaves, in the
+ state given by the energy balances: Qcond is saturated liquid (hls),
+ Qevap saturated vapour (hvs), in both directions. Qevap is negative when
+ the liquid phase is subcooled (vapour of the gas phase condenses into it,
+ at C_v.Cg); Qcond is negative when the gas phase is superheated (liquid
+ of the liquid phase moves to the gas phase, at C_l.Cl). */
+ xl = noEvent(max(0, min(1, (hl - hls)/(hvs - hls))));
+ xv = noEvent(max(0, min(1, (hv - hls)/(hvs - hls))));
+ if Medium.nC > 0 then
+ C_l = tracePartition(SubCl, xl, sat.Tsat);
+ C_v = tracePartition(SubCv, xv, sat.Tsat);
+ end if;
+ Jcond = noEvent(max(Qcond, 0))*C_v.Cl + noEvent(min(Qcond, 0))*C_l.Cl;
+ Jevap = noEvent(max(Qevap, 0))*C_l.Cg + noEvent(min(Qevap, 0))*C_v.Cg;
+ SubCSaS = SaS();
+
+ BSubCl = Cas.Q*Cas.SubC - Cex.Q*Cex.SubC + Jcond - Jevap;
+ BSubCv = Jevap - Cs.Q*Cs.SubC - Jcond;
+
+ if dynamic_energy_balance then
+ rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl;
+ rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv;
+ else
+ SubCl*BQl = BSubCl;
+ SubCv*BQv + rhov*Vv*SubCSaS = BSubCv;
+ end if;
+
+ Cex.SubC = SubCl;
+ Cs.SubC = SubCv;
+
+ /* 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);
@@ -258,19 +319,105 @@ equation
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})}),
+
+ /* Fluid thermodynamic properties */
+ state_l = Medium.setState_phX(p=P, h=hl, X=Medium.reference_X);
+ state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X);
+ sat = Medium.setSat_p(P);
+
+ ddphl = Medium.density_derp_h(state_l);
+ ddhpl = Medium.density_derh_p(state_l);
+ ddphv = Medium.density_derp_h(state_v);
+ ddhpv = Medium.density_derh_p(state_v);
+
+ Tl = Medium.temperature(state_l);
+ Tv = Medium.temperature(state_v);
+ rhol = Medium.density(state_l);
+ rhov = Medium.density(state_v);
+ hls = Medium.bubbleEnthalpy(sat);
+ hvs = Medium.dewEnthalpy(sat);
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -282,4 +429,4 @@ Daniel Bouskela
Baligh El Hefni
"));
-end Pressurizer;
\ No newline at end of file
+end Pressurizer;
diff --git a/ThermoSysPro/Fluid/Volumes/Tank.mo b/ThermoSysPro/Fluid/Volumes/Tank.mo
index 876d747f..623bbc8b 100644
--- a/ThermoSysPro/Fluid/Volumes/Tank.mo
+++ b/ThermoSysPro/Fluid/Volumes/Tank.mo
@@ -1,61 +1,63 @@
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 "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" 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)"));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS (SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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=Medium.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 Boolean dynamic_composition_balance=false
+ "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+
+ parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog(
+ enable=dynamic_composition_balance,
+ tab="Fluid",
+ group="Medium"));
+
+
+protected
+ 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 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.Position z "Fluid level";
Units.SI.Temperature T "Fluid temperature";
Units.SI.AbsolutePressure P(start = 1.e5) "Fluid average pressure";
@@ -63,6 +65,10 @@ model Tank "Open vertical tank"
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";
+ Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation";
+ Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
+ Medium.ThermodynamicState state;
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";
@@ -77,15 +83,8 @@ model Tank "Open vertical tank"
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.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid 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";
@@ -99,27 +98,22 @@ model Tank "Open vertical tank"
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";
- 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)));
-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
+ ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+ "Water level" annotation (Placement(transformation(
+ extent={{100,10},{120,30}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,50},{-90,70}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) 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(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-70},{-90,-50}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{92,50},{112,70}}, rotation=0)));
initial equation
if dynamic_energy_balance then
if steady_state then
@@ -133,19 +127,12 @@ initial equation
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;
+
+ if dynamic_composition_balance then
+ if steady_state then
+ der(X) = fill(0, Medium.nX);
+ else
+ X = X0[1:Medium.nXi];
end if;
end if;
equation
@@ -153,24 +140,15 @@ equation
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;
+ Ce1.Xi = Medium.X_default[1:Medium.nXi];
+ Ce1.SubC = Medium.C_default;
end if;
if (cardinality(Ce2) == 0) then
Ce2.Q = 0;
@@ -178,11 +156,8 @@ equation
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;
+ Ce2.Xi = Medium.X_default[1:Medium.nXi];
+ Ce2.SubC = Medium.C_default;
end if;
if (cardinality(Cs1) == 0) then
Cs1.Q = 0;
@@ -198,8 +173,9 @@ equation
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;
+
+ if Medium.isCompressible and dynamic_energy_balance and dynamic_mass_balance then
+ A*(ddph*der(P) + ddhp*der(h))*z + A*rho*der(z) = BQ;
else
A*rho*der(z) = BQ;
end if;
@@ -220,17 +196,19 @@ equation
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;
+
+ /* Energy balance equation */
+ BH = Ce1.Q*((Ce1.h - h)) + Ce2.Q*((Ce2.h - h)) - Cs1.Q*((Cs1.h - h)) - Cs2.Q*((Cs2.h - h)) + Cth.W + 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;
+ A*z*((P/rho*ddph - 1)*der(P) + (P/rho*ddhp + rho)*der(h)) = BH;
else
- A*z*rho*der(h - Xh2o*hr) = BH;
+ A*z*rho*der(h) = BH;
end if;
else
- der(h - Xh2o*hr) = 0;
+ der(h) = 0;
end if;
else
BH = 0;
@@ -242,40 +220,33 @@ equation
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;
+
+ /* Fluid composition balance equations */
+ BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q;
+
+ if dynamic_composition_balance then
+ A*z*rho*der(X) + X*BQ = BX;
+ else
+ X*BQ = BX;
+ end if;
+
+ Cs1.Xi = X;
+ Cs2.Xi = X;
+
+ /* Traces composition balance equations */
+ BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC;
+
+ SubCSaS = SaS();
+ if dynamic_mass_balance then
+ A*z*rho*der(SubC) + SubC*BQ + A*z*rho*SubCSaS = BSubC;
else
- Xco2 = 0;
- Xh2o = 0;
- Xo2 = 0;
- Xso2 = 0;
+ A*z*rho*SubCSaS = BSubC;
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 */
+
+ Cs1.SubC = SubC;
+ Cs2.SubC = SubC;
+
+ /* 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);
@@ -322,23 +293,49 @@ equation
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);
+
+ state = Medium.setState_phX(
+ p=P,
+ h=h,
+ X=X);
+
+ T = Medium.temperature(state);
+
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);
+ rho = Medium.density(state);
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);
+ ddph = Medium.density_derp_h(state);
+ ddhp = Medium.density_derh_p(state);
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),
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -349,4 +346,4 @@ Author
Daniel Bouskela
"));
-end Tank;
\ No newline at end of file
+end Tank;
diff --git a/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo b/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo
index ed80401f..bba3f456 100644
--- a/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo
+++ b/ThermoSysPro/Fluid/Volumes/TankHorizontal.mo
@@ -1,58 +1,65 @@
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 "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" 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)"));
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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=Medium.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 Boolean dynamic_composition_balance=false
+ "true: dynamic fluid composition balance equation
false: static fluid composition balance equation" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+
+ parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog(
+ enable=dynamic_composition_balance,
+ tab="Fluid",
+ group="Medium"));
+
+protected
+ 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 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.Position z "Fluid level";
Units.SI.Area A "Surface of the liquid in the tank";
Units.SI.Angle theta "Angle";
@@ -73,15 +80,12 @@ model TankHorizontal "Open horizontal tank"
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";
+ Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation";
+ Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
+ Medium.ThermodynamicState state;
+ Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid 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";
@@ -95,28 +99,22 @@ model TankHorizontal "Open horizontal tank"
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";
- 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)));
-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
+ ThermoSysPro.InstrumentationAndControl.Connectors.OutputReal yLevel
+ "Water level" annotation (Placement(transformation(
+ extent={{102,-9},{122,11}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,40},{-90,60}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) 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(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-60},{-90,-40}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{92,39},{112,59}}, rotation=0)));
initial equation
if dynamic_energy_balance then
if steady_state then
@@ -130,40 +128,23 @@ initial equation
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;
+
+ if dynamic_composition_balance then
+ if steady_state then
+ der(X) = fill(0, Medium.nX);
+ else
+ X = X0[1:Medium.nXi];
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;
+ Ce1.Xi = Medium.X_default[1:Medium.nXi];
+ Ce1.SubC = Medium.C_default;
end if;
if (cardinality(Ce2) == 0) then
Ce2.Q = 0;
@@ -171,11 +152,8 @@ equation
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;
+ Ce2.Xi = Medium.X_default[1:Medium.nXi];
+ Ce2.SubC = Medium.C_default;
end if;
if (cardinality(Cs1) == 0) then
Cs1.Q = 0;
@@ -200,8 +178,9 @@ equation
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;
+
+ if Medium.isCompressible and dynamic_energy_balance and dynamic_mass_balance then
+ A*(ddph*der(P) + ddhp*der(h))*z + A*rho*der(z) = BQ;
else
A*rho*der(z) = BQ;
end if;
@@ -234,17 +213,19 @@ equation
(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;
+
+ /* Energy balance equation */
+ BH = Ce1.Q*(Ce1.h - h) + Ce2.Q*(Ce2.h - h) - Cs1.Q*(Cs1.h - h) - Cs2.Q*(Cs2.h - h) + Cth.W + 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;
+ A*z*((P/rho*ddph - 1)*der(P) + (P/rho*ddhp + rho)*der(h)) = BH;
else
- A*z*rho*der(h - Xh2o*hr) = BH;
+ A*z*rho*der(h) = BH;
end if;
else
- der(h - Xh2o*hr) = 0;
+ der(h) = 0;
end if;
else
BH = 0;
@@ -256,40 +237,33 @@ equation
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;
+
+ /* Fluid composition balance equations */
+ BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q;
+
+ if dynamic_composition_balance then
+ A*z*rho*der(X) + X*BQ = BX;
else
- Xco2 = 0;
- Xh2o = 0;
- Xo2 = 0;
- Xso2 = 0;
+ X*BQ = BX;
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 */
+
+ Cs1.Xi = X;
+ Cs2.Xi = X;
+
+ /* Traces composition balance equations */
+ BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC;
+
+ SubCSaS = SaS();
+ if dynamic_mass_balance then
+ A*z*rho*der(SubC) + SubC*BQ + A*z*rho*SubCSaS = BSubC;
+ else
+ A*z*rho*SubCSaS = BSubC;
+ end if;
+
+ Cs1.SubC = SubC;
+ Cs2.SubC = SubC;
+
+ /* 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);
@@ -336,15 +310,22 @@ equation
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);
+
+ state = Medium.setState_phX(
+ p=P,
+ h=h,
+ X=X);
+
+ T = Medium.temperature(state);
+
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);
+ rho = Medium.density(state);
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);
+ ddph = Medium.density_derp_h(state);
+ ddhp = Medium.density_derh_p(state);
else
ddph = 0;
ddhp = 0;
@@ -362,4 +343,4 @@ Author
Baligh El Hefni
"));
-end TankHorizontal;
\ No newline at end of file
+end TankHorizontal;
diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo
index b1c2732d..0b39c728 100644
--- a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo
+++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavity.mo
@@ -1,57 +1,90 @@
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";
- Units.SI.Length L(start = 15) "Cavity length";
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+ parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default
+ "Initial liquid phase trace substances"
+ annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+ parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default
+ "Initial vapor phase trace substances"
+ annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+
+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 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)";
+ Medium.C_BiPhase C_in "Trace partition of the water inlet mixture (Ce)";
+ Medium.C_BiPhase C_l "Trace partition of the liquid phase";
+ Medium.C_BiPhase C_v "Trace partition of the gas phase";
+
+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";
@@ -94,21 +127,27 @@ model TwoPhaseCavity "TwoPhaseCavity for one shell pass "
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.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));
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";
@@ -120,42 +159,59 @@ model TwoPhaseCavity "TwoPhaseCavity for one shell pass "
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}})));
- 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}})));
- 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)));
-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)";
+ Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Right hand side of the trace balance equation of the liquid phase";
+ Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Right hand side of the trace balance equation of the vapor phase";
+ Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default)
+ "Liquid phase trace substances";
+ Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default)
+ "Vapor phase trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Trace modification in the trace balance equation";
+
+ Medium.ThermodynamicState state_l "Liquid state in the cavity";
+ Medium.ThermodynamicState state_v "Vapor state in the cavity";
+ Medium.ThermodynamicState state_in_l "Water inlet state";
+ Medium.ThermodynamicState state_out_l "Water outlet state";
+ Medium.SaturationProperties sat "Saturation properties at cavity pressure";
+ Medium.SaturationProperties sat_wall "Saturation properties for wall heat transfer correlations";
+ Units.SI.SpecificEnthalpy hlsat "Bubble enthalpy at cavity pressure";
+ Units.SI.SpecificEnthalpy hvsat "Dew enthalpy at cavity pressure";
+ Units.SI.Density rholsat "Bubble density at cavity pressure";
+ Units.SI.Density rhovsat "Dew density at cavity pressure";
+ Units.SI.Temperature Tsat "Saturation temperature at cavity pressure";
+ Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy";
+ Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure";
+ Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy";
+ Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure";
+
+ Interfaces.Connectors.FluidInlet Cv(redeclare package Medium = Medium) "Steam input" annotation (Placement(
+ transformation(extent={{-88,50},{-68,70}}, rotation=0),
+ iconTransformation(extent={{-88,50},{-68,70}})));
+ Interfaces.Connectors.FluidOutlet Cl(redeclare package Medium = Medium) "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
+ Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) "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}})));
+
initial equation
if dynamic_energy_balance then
if steady_state then
@@ -164,33 +220,27 @@ initial equation
der(Vl) = 0;
der(P) = 0;
der(Tp) = 0;
+ der(SubCl) = fill(0, Medium.nC);
+ der(SubCv) = fill(0, Medium.nC);
else
- hl = lsat.h;
- hv = vsat.h;
+ hl = hlsat;
+ hv = hvsat;
Vl = Vf0*V;
P = P0;
der(Tp) = 0;
+ SubCl = SubCl0;
+ SubCv = SubCv0;
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 */
+ /* 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;
+ Ce.SubC = Medium.C_default;
end if;
if (cardinality(Cv) == 0) then
Cv.Q = 0;
@@ -198,11 +248,7 @@ equation
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;
+ Cv.SubC = Medium.C_default;
end if;
if (cardinality(Cl) == 0) then
Cl.Q = 0;
@@ -247,36 +293,45 @@ equation
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;
+
+ /* Pressure at the bottom of the cavity */
+ Pfond = P + Medium.density(state_out_l)*g*zl;
+
+ /* Liquid phase mass balance equation */
+ BQl = -Cl.Q + Qcond - Qevap + (1 - Medium.vapourQuality(state_in_l))*Ce.Q;
+
if dynamic_energy_balance then
- rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
+ rhol*der(Vl) + Vl*(ddphl*der(P) + ddhpl*der(hl)) = BQl;
else
0 = BQl;
end if;
-/* Vapor phase mass balance equation */
- BQv = Cv.Q + Qevap - Qcond + proe.x*Ce.Q;
+
+ /* Vapor phase mass balance equation */
+ BQv = Cv.Q + Qevap - Qcond + Medium.vapourQuality(state_in_l)*Ce.Q;
+
if dynamic_energy_balance then
- rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
+ rhov*der(Vv) + Vv*(ddphv*der(P) + ddhpv*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;
+
+ /* Liquid phase energy balance equation */
+ BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(hlsat - (hl - P/rhol)) - Qevap*(hvsat - (hl - P/rhol)) + (1 - Medium.vapourQuality(state_in_l))*Ce.Q*((if (Medium.vapourQuality(state_in_l) > 0) then hlsat 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;
+ Vl*((P/rhol*ddphl - 1)*der(P) + (P/rhol*ddhpl + 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;
+
+ /* Gas phase energy balance equation */
+ BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(hvsat - (hv - P/rhov)) - Qcond*(hlsat - (hv - P/rhov)) + Medium.vapourQuality(state_in_l)*Ce.Q*((if (Medium.vapourQuality(state_in_l) < 1) then hvsat 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;
+ Vv*((P/rhov*ddphv - 1)*der(P) + (P/rhov*ddhpv + rhov)*der(hv)) = BHv;
else
0 = BHv;
end if;
@@ -307,14 +362,19 @@ equation
/* 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;
+
+ QS = Cl.Q /(DIc*Lc*(PasL - Dext)/PasL);
+
+ Rel = noEvent( abs(QS*DH/mul));
+ Prl = mul*Medium.specificHeatCapacityCp(state_l)/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*/
+ mult[i] = Medium.dynamicViscosity(Medium.setState_pTX(p=P, T=Tp1[i], X=Medium.reference_X));
+
+ 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);
@@ -322,14 +382,14 @@ equation
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;
+ /* 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*rholsat*(rholsat - rhovsat)*kl^3*(hvsat - hlsat))/(max(L2, 1)*mul*abs(Tsat - Tp2[i] + 1e-6)), 2.225e15))^0.25, 20000));
+ else
+ // Nusselt corelation
+ hcond2[i] = COPv*noEvent(min(0.728*(max((g*rholsat*(rholsat - rhovsat)*kl^3*(hvsat - hlsat))/(NbTubV*mul*Dext*abs(Tsat - Tp2[i] + 1e-6)), 2.225e15))^0.25, 20000));
+ end if;
else
hcond2[i] = COPv*hcond;
end if;
@@ -348,14 +408,14 @@ equation
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;
+ /* 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*rholsat*(rholsat - rhovsat)*kl^3*(hvsat - hlsat))/(max(L3,1)*mul*abs(Tsat - Tp3[i] + 1e-6)), 2.225e15))^0.25, 20000));
+ else
+ // Nusselt corelation
+ hcond3[i] = COPv*noEvent(min(0.728*(max((g*rholsat*(rholsat - rhovsat)*kl^3*(hvsat - hlsat))/(NbTubV*mul*Dext*abs(Tsat - Tp3[i] + 1e-6)), 2.225e15))^0.25, 20000));
+ end if;
else
hcond3[i] = COPv*hcond;
end if;
@@ -369,15 +429,35 @@ equation
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 */
+
+ /* Total power exchanged for Deheating*/
+ W4t = noEvent(if (Cv.h > hvsat) then -Cv.Q*(Cv.h - hvsat) else -0.0001);
+
+ /* Traces composition balance equations */
+ /* Equilibrium partition of the traces (Medium.relativeVolatility) applied to
+ every mass transfer between phases. Each transfer removes from one phase
+ exactly what it adds to the other: the balance is exact for any volatility. */
+ if Medium.nC > 0 then
+ C_in = tracePartition(Ce.SubC, Medium.vapourQuality(state_in_l), Tsat);
+ C_l = tracePartition(SubCl, xl, Tsat);
+ C_v = tracePartition(SubCv, xv, Tsat);
+ end if;
+ SubCSaS = SaS();
+
+ BSubCl = Ce.Q*Ce.SubC - Medium.vapourQuality(state_in_l)*Ce.Q*C_in.Cg - Cl.Q*Cl.SubC + Qcond*C_v.Cl - Qevap*C_l.Cg;
+ BSubCv = Cv.Q*Cv.SubC + Medium.vapourQuality(state_in_l)*Ce.Q*C_in.Cg + Qevap*C_l.Cg - Qcond*C_v.Cl;
+
+ if dynamic_energy_balance then
+ rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl;
+ rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv;
+ else
+ SubCl*BQl = BSubCl;
+ SubCv*BQv + rhov*Vv*SubCSaS = BSubCv;
+ end if;
+
+ Cl.SubC = SubCl;
+
+ /* 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
@@ -413,25 +493,447 @@ equation
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),
+
+ /* Fluid thermodynamic properties */
+ state_in_l = Medium.setState_phX(p=P, h=Ce.h, X=Medium.reference_X);
+ state_l = Medium.setState_phX(p=(P + Pfond)/2, h=hl, X=Medium.reference_X);
+ state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X);
+ state_out_l = Medium.setState_phX(p=Pfond, h=Cl.h, X=Medium.reference_X);
+ sat = Medium.setSat_p(P);
+ sat_wall = Medium.setSat_p(P);
+ hlsat = Medium.bubbleEnthalpy(sat);
+ hvsat = Medium.dewEnthalpy(sat);
+ rholsat = Medium.bubbleDensity(sat_wall);
+ rhovsat = Medium.dewDensity(sat_wall);
+ Tsat = Medium.saturationTemperature(P);
+
+ ddphl = Medium.density_derp_h(state_l);
+ ddhpl = Medium.density_derh_p(state_l);
+ ddphv = Medium.density_derp_h(state_v);
+ ddhpv = Medium.density_derh_p(state_v);
+
+ Tl = Medium.temperature(state_l);
+ rhol = Medium.density(state_l);
+ xl = noEvent(max(0, min(1, (hl - hlsat)/(hvsat - hlsat))));
+
+ Tv = Medium.temperature(state_v);
+ rhov = Medium.density(state_v);
+ xv = noEvent(max(0, min(1, (hv - hlsat)/(hvsat - hlsat))));
+
+ mul = Medium.dynamicViscosity(state_l);
+ kl = noEvent(Medium.thermalConductivity(state_l));
+
+ 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -443,4 +945,4 @@ Baligh El Hefni
Daniel Bouskela
"));
-end TwoPhaseCavity;
\ No newline at end of file
+end TwoPhaseCavity;
diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo
index 5fbe5664..d735a0cc 100644
--- a/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo
+++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseCavityOnePipe.mo
@@ -1,65 +1,97 @@
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";
- 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";
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+ parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default
+ "Initial liquid phase trace substances"
+ annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+ parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default
+ "Initial vapor phase trace substances"
+ annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ constant Real pi=Modelica.Constants.pi;
+ 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)";
+ Medium.C_BiPhase C_in "Trace partition of the water inlet mixture (Ce)";
+ Medium.C_BiPhase C_bp "Trace partition of the steam inlet mixture CvBP";
+ Medium.C_BiPhase C_gct "Trace partition of the steam inlet mixture CvGCT";
+ Medium.C_BiPhase C_v "Trace partition of the gas phase";
+ Medium.C_BiPhase C_l "Trace partition of the liquid phase";
+
+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";
@@ -74,18 +106,21 @@ model TwoPhaseCavityOnePipe "TwoPhaseCavity for one shell pass "
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.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";
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";
@@ -100,37 +135,47 @@ model TwoPhaseCavityOnePipe "TwoPhaseCavity for one shell pass "
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)));
- 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)));
-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)";
+ Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Right hand side of the trace balance equation of the liquid phase";
+ Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Right hand side of the trace balance equation of the vapor phase";
+ Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default)
+ "Liquid phase trace substances";
+ Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default)
+ "Vapor phase trace substances";
+ Medium.ExtraProperty Jcond[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Trace flow carried by Qcond from the gas phase to the liquid phase";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Trace modification in the trace balance equation";
+
+ Medium.ThermodynamicState state_l "Liquid state in the cavity";
+ Medium.ThermodynamicState state_v "Vapor state in the cavity";
+ Medium.ThermodynamicState state_in_l "Water inlet state";
+ Medium.ThermodynamicState state_in_v "Average vapor inlet state";
+ Medium.ThermodynamicState state_out_l "Water outlet state";
+ Medium.SaturationProperties sat "Saturation properties at cavity pressure";
+ Units.SI.SpecificEnthalpy hlsat "Bubble enthalpy at cavity pressure";
+ Units.SI.SpecificEnthalpy hvsat "Dew enthalpy at cavity pressure";
+ Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy";
+ Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure";
+ Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy";
+ Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure";
+
+ Interfaces.Connectors.FluidInlet CvBP(redeclare package Medium = Medium) "Steam input" annotation (Placement(
+ transformation(extent={{-86,50},{-66,70}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cl(redeclare package Medium = Medium) "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
+ Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) "Water input" annotation (Placement(
+ transformation(extent={{-219,19},{-199,39}}, rotation=0)));
+ Interfaces.Connectors.FluidInlet CvGCT(redeclare package Medium = Medium) "Steam input" annotation (Placement(
+ transformation(extent={{-160,50},{-140,70}}, rotation=0)));
initial equation
if dynamic_energy_balance then
if steady_state then
@@ -142,35 +187,28 @@ initial equation
der(P) = 0;
der(Tp) = 0;
der(hvIn) = 0;
+ der(SubCl) = fill(0, Medium.nC);
+ der(SubCv) = fill(0, Medium.nC);
else
- hl = lsat.h;
- hv = vsat.h;
+ hl = hlsat;
+ hv = hvsat;
Vl = Vf0*V;
P = P0;
Tp = 320;
hvIn = hv;
+ SubCl = SubCl0;
+ SubCv = SubCv0;
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 */
+ /* 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;
+ Ce.SubC = Medium.C_default;
end if;
if (cardinality(CvGCT) == 0) then
CvGCT.Q = 0;
@@ -178,11 +216,7 @@ equation
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;
+ CvGCT.SubC = Medium.C_default;
end if;
if (cardinality(CvBP) == 0) then
CvBP.Q = 0;
@@ -190,11 +224,7 @@ equation
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;
+ CvBP.SubC = Medium.C_default;
end if;
if (cardinality(Cl) == 0) then
Cl.Q = 0;
@@ -226,19 +256,24 @@ equation
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;
+
+ /* Pressure at the bottom of the cavity */
+ Pfond = P + Medium.density(state_out_l)*g*zl;
+
+ /* Liquid phase mass balance equation */
+ BQl = -Cl.Q + Qcond + QcondS + (1 - Medium.vapourQuality(state_in_l))*Ce.Q;
+
if dynamic_energy_balance then
- rhol*der(Vl) + Vl*(prol.ddph*der(P) + prol.ddhp*der(hl)) = BQl;
+ rhol*der(Vl) + Vl*(ddphl*der(P) + ddhpl*der(hl)) = BQl;
else
0 = BQl;
end if;
-/* Vapor phase mass balance equation */
- BQv = CvBP.Q + CvGCT.Q - Qcond - QcondS + proe.x*Ce.Q;
+
+ /* Vapor phase mass balance equation */
+ BQv = CvBP.Q + CvGCT.Q - Qcond - QcondS + Medium.vapourQuality(state_in_l)*Ce.Q;
+
if dynamic_energy_balance then
- rhov*der(Vv) + Vv*(prov.ddph*der(P) + prov.ddhp*der(hv)) = BQv;
+ rhov*der(Vv) + Vv*(ddphv*der(P) + ddhpv*der(hv)) = BQv;
else
0 = BQv;
end if;
@@ -246,17 +281,21 @@ equation
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;
+
+ /* Liquid phase energy balance equation */
+ BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + (Qcond + QcondS)*(hlsat - (hl - P/rhol)) + (1 - Medium.vapourQuality(state_in_l))*Ce.Q*((if (Medium.vapourQuality(state_in_l) > 0) then hlsat 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;
+ Vl*((P/rhol*ddphl - 1)*der(P) + (P/rhol*ddhpl + 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;
+
+ /* Gas phase energy balance equation */
+ BHv = CvBP.Q*(CvBP.h - (hv - P/rhov)) + CvGCT.Q*(CvGCT.h - (hv - P/rhov)) - (Qcond + QcondS)*(hlsat - (hv - P/rhov)) + Medium.vapourQuality(state_in_l)*Ce.Q*((if (Medium.vapourQuality(state_in_l) < 1) then hvsat 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;
+ Vv*((P/rhov*ddphv - 1)*der(P) + (P/rhov*ddhpv + rhov)*der(hv)) = BHv;
else
0 = BHv;
end if;
@@ -264,24 +303,58 @@ equation
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);
+
+ /* Condensation mass flow rates */
+ // Only the power used to condensate steam
+ Qcond = (-Wt + Wt2 + noEvent(max(Wvl, 0)) + Wvp)/(hvsat - hlsat);
+
+ QcondS = (1 - Medium.vapourQuality(state_in_v))*(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));
+ 0.1*Medium.density(state_in_v)*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 */
+
+ /* Traces composition balance equations */
+ /* Equilibrium partition of the traces (Medium.relativeVolatility) applied to
+ every mass transfer between phases. Each transfer removes from one phase
+ exactly what it adds to the other: the balance is exact for any volatility.
+ Each transfer carries the concentration of the phase it leaves, in the
+ state given by the energy balances. Qcond is transferred at hlsat: it is
+ saturated liquid in both directions. It is negative when the tubes heat
+ the gas phase; liquid of the liquid phase then moves to the gas phase,
+ at C_l.Cl. */
+ if Medium.nC > 0 then
+ C_in = tracePartition(Ce.SubC, Medium.vapourQuality(state_in_l), sat.Tsat);
+ C_bp = tracePartition(CvBP.SubC, Medium.vapourQuality(state_in_v), sat.Tsat);
+ C_gct = tracePartition(CvGCT.SubC, Medium.vapourQuality(state_in_v), sat.Tsat);
+ C_v = tracePartition(SubCv, xv, sat.Tsat);
+ C_l = tracePartition(SubCl, xl, sat.Tsat);
+ end if;
+ Jcond = noEvent(max(Qcond, 0))*C_v.Cl + noEvent(min(Qcond, 0))*C_l.Cl;
+ SubCSaS = SaS();
+
+ /* The liquid part QcondS of the incoming steam carries the liquid share of its traces */
+ BSubCl = Ce.Q*Ce.SubC - Medium.vapourQuality(state_in_l)*Ce.Q*C_in.Cg
+ + CvBP.Q*CvBP.SubC + CvGCT.Q*CvGCT.SubC - Medium.vapourQuality(state_in_v)*(CvBP.Q*C_bp.Cg + CvGCT.Q*C_gct.Cg)
+ - Cl.Q*Cl.SubC + Jcond;
+ BSubCv = Medium.vapourQuality(state_in_v)*(CvBP.Q*C_bp.Cg + CvGCT.Q*C_gct.Cg)
+ + Medium.vapourQuality(state_in_l)*Ce.Q*C_in.Cg - Jcond;
+
+ if dynamic_energy_balance then
+ rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl;
+ rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv;
+ else
+ SubCl*BQl = BSubCl;
+ SubCv*BQv + rhov*Vv*SubCSaS = BSubCv;
+ end if;
+
+ Cl.SubC = SubCl;
+
+ /* 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
@@ -325,35 +398,52 @@ equation
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*/
+
+ /* Fluid thermodynamic properties*/
+ state_in_l = Medium.setState_phX(p=P, h=Ce.h, X=Medium.reference_X);
+ state_l = Medium.setState_phX(p=(P + Pfond)/2, h=hl, X=Medium.reference_X);
+ state_in_v = Medium.setState_phX(p=P, h=hvIn, X=Medium.reference_X);
+ state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X);
+ state_out_l = Medium.setState_phX(p=Pfond, h=Cl.h, X=Medium.reference_X);
+ sat = Medium.setSat_p(P);
+ hlsat = Medium.bubbleEnthalpy(sat);
+ hvsat = Medium.dewEnthalpy(sat);
+
+ ddphl = Medium.density_derp_h(state_l);
+ ddhpl = Medium.density_derh_p(state_l);
+ ddphv = Medium.density_derp_h(state_v);
+ ddhpv = Medium.density_derh_p(state_v);
+
+ Tl = Medium.temperature(state_l);
+ rhol = Medium.density(state_l);
+ xl = noEvent(max(0, min(1, (hl - hlsat)/(hvsat - hlsat))));
+
+ Tv = Medium.temperature(state_v);
+ rhov = Medium.density(state_v);
+ xv = noEvent(max(0, min(1, (hv - hlsat)/(hvsat - hlsat))));
+
+ muv = Medium.dynamicViscosity(state_in_v);
+ mul = Medium.dynamicViscosity(state_l);
+ kl = noEvent(Medium.thermalConductivity(state_l));
+ kv = noEvent(Medium.thermalConductivity(state_in_v));
+
+ /* 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 */
+
+ Klp = 0.037*kl*Rel^0.8*(mul*Medium.specificHeatCapacityCp(state_l)/kl)^0.3333/zl;
+
+ /* Heat transfer coefficient between steam and wall*/
+ Rev = noEvent(abs((CvBP.Q + CvGCT.Q + Medium.vapourQuality(state_in_l)*Ce.Q)*(L - zl)/(pi*R^2*muv)));
+ Revl = noEvent(abs((CvBP.Q + CvGCT.Q + Medium.vapourQuality(state_in_l)*Ce.Q)*(2*R)/(pi*R^2*muv)));
+
+ Kvp = 0.037*kv*Rev^0.8*(muv*Medium.specificHeatCapacityCp(state_v)/kv)^0.3333/(L - zl);
+
+ /* Heat transfer coefficient between steam and liquid */
+ Kvl = 0.105*kv*Revl^0.68*(muv*Medium.specificHeatCapacityCp(state_v)/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
@@ -370,8 +460,10 @@ equation
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);
+ // Nusselt corelation
+ hcond3[i] = ThermoSysPro.Functions.SmoothCond(Tv - Tp1[i],
+ COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(hvsat - hlsat))/(NbTubV*mul*Dext*ThermoSysPro.Functions.SmoothMax((Tv-Tp1[i]), 0.1)))^0.25,
+ COP*0.728*((g*rhol*(rhol - rhov)*kl^3*(hvsat - hlsat))/(NbTubV*mul*Dext*0.1))^0.25);
else
hcond3[i] = hcond;
end if;
@@ -379,13 +471,167 @@ equation
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),
+
+ /* Total power exchanged for deheating*/
+ /* This equation is not valid for mass flow rate in the pipes = 0 */
+ Wt2 = noEvent(if (hvIn > hvsat) then -(CvBP.Q + CvGCT.Q)*(hvIn - hvsat) 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 = "
## Copyright © EDF 2002 - 2026
## ThermoSysPro Version 4.2
@@ -396,4 +642,4 @@ Baligh El Hefni
Daniel Bouskela
"));
-end TwoPhaseCavityOnePipe;
\ No newline at end of file
+end TwoPhaseCavityOnePipe;
diff --git a/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo b/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo
index f411209e..89501ffb 100644
--- a/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo
+++ b/ThermoSysPro/Fluid/Volumes/TwoPhaseVolume.mo
@@ -1,29 +1,50 @@
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";
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialTwoPhaseThermoSysProMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC = SubCv) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function tracePartition = Medium.equilibriumPartition constrainedby Medium.partialPartition "Liquid/vapour partition law of the traces (default: phase equilibrium)" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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";
+ parameter Medium.ExtraProperty SubCl0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default
+ "Initial liquid phase trace substances"
+ annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+ parameter Medium.ExtraProperty SubCv0[Medium.nC](quantity=Medium.extraPropertiesNames)=Medium.C_default
+ "Initial vapor phase trace substances"
+ annotation (Evaluate=true, Dialog(enable=dynamic_energy_balance and not steady_state));
+
+protected
+ constant Units.SI.Acceleration g=Modelica.Constants.g_n "Gravity constant";
+ 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)";
+ Medium.C_BiPhase C_l "Trace partition of the liquid phase";
+ Medium.C_BiPhase C_v "Trace partition of the gas phase";
+
+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";
@@ -32,18 +53,24 @@ model TwoPhaseVolume "TwoPhaseVolume"
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";
+ 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";
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";
@@ -55,30 +82,40 @@ model TwoPhaseVolume "TwoPhaseVolume"
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)));
- 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)));
-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)";
+
+ Medium.ExtraProperty BSubCl[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Right hand side of the trace balance equation of the liquid phase";
+ Medium.ExtraProperty BSubCv[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Right hand side of the trace balance equation of the vapor phase";
+ Medium.ExtraProperty SubCl[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default)
+ "Liquid phase trace substances";
+ Medium.ExtraProperty SubCv[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default)
+ "Vapor phase trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames)
+ "Trace modification in the trace balance equation";
+ Medium.ThermodynamicState state_l "Liquid state in the volume";
+ Medium.ThermodynamicState state_v "Vapor state in the volume";
+ Medium.ThermodynamicState state_out_l "Liquid outlet state";
+ Medium.SaturationProperties sat "Saturation properties at volume pressure";
+ Units.SI.SpecificEnthalpy hlsat "Bubble enthalpy at volume pressure";
+ Units.SI.SpecificEnthalpy hvsat "Dew enthalpy at volume pressure";
+ Real ddphl "Liquid density derivative wrt. pressure at constant enthalpy";
+ Real ddhpl "Liquid density derivative wrt. enthalpy at constant pressure";
+ Real ddphv "Vapor density derivative wrt. pressure at constant enthalpy";
+ Real ddhpv "Vapor density derivative wrt. enthalpy at constant pressure";
+ Interfaces.Connectors.FluidInlet Cv(redeclare package Medium = Medium) "Steam input" annotation (Placement(
+ transformation(extent={{-10,90},{10,110}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cl(redeclare package Medium = Medium) "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
+ Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) "Water input" annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
initial equation
if dynamic_energy_balance then
if steady_state then
@@ -86,32 +123,26 @@ initial equation
der(hl) = 0;
der(hv) = 0;
der(Vl) = 0;
+ der(SubCl) = fill(0, Medium.nC);
+ der(SubCv) = fill(0, Medium.nC);
else
P = P0;
- hl = lsat.h;
- hv = vsat.h;
+ hl = hlsat;
+ hv = hvsat;
Vl = Vf0*V;
+ SubCl = SubCl0;
+ SubCv = SubCv0;
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 */
+ /* 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;
+ Ce.SubC = Medium.C_default;
end if;
if (cardinality(Cv) == 0) then
Cv.Q = 0;
@@ -119,11 +150,7 @@ equation
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;
+ Cv.SubC = Medium.C_default;
end if;
if (cardinality(Cl) == 0) then
Cl.Q = 0;
@@ -133,39 +160,47 @@ equation
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 */
+
+ /* Pressure at the bottom of the cavity */
+ Pfond = P + Medium.density(state_out_l)*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;
+ rhol*der(Vl) + Vl*(ddphl*der(P) + ddhpl*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;
+ rhov*der(Vv) + Vv*(ddphv*der(P) + ddhpv*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;
+
+ /* 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;
+
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;
+
+ /* Liquid phase energy balance equation */
+ BHl = -Cl.Q*(Cl.h - (hl - P/rhol)) + Qcond*(hlsat - (hl - P/rhol)) - Qevap*(hvsat - (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;
+ Vl*((P/rhol*ddphl - 1)*der(P) + (P/rhol*ddhpl + 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;
+
+ /* Gas phase energy balance equation */
+ BHv = Cv.Q*(Cv.h - (hv - P/rhov)) + Qevap*(hvsat - (hv - P/rhov)) - Qcond*(hlsat - (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;
+ Vv*((P/rhov*ddphv - 1)*der(P) + (P/rhov*ddhpv + rhov)*der(hv)) = BHv;
else
0 = BHv;
end if;
@@ -176,13 +211,31 @@ equation
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 */
+
+ /* Traces composition balance equations */
+ /* Equilibrium partition of the traces (Medium.relativeVolatility) applied to
+ every mass transfer between phases. Each transfer removes from one phase
+ exactly what it adds to the other: the balance is exact for any volatility. */
+ if Medium.nC > 0 then
+ C_l = tracePartition(SubCl, xl, sat.Tsat);
+ C_v = tracePartition(SubCv, xv, sat.Tsat);
+ end if;
+ SubCSaS = SaS();
+
+ BSubCl = Ce.Q*Ce.SubC - Cl.Q*Cl.SubC + Qcond*C_v.Cl - Qevap*C_l.Cg;
+ BSubCv = Cv.Q*Cv.SubC + Qevap*C_l.Cg - Qcond*C_v.Cl;
+
+ if dynamic_energy_balance then
+ rhol*Vl*der(SubCl) + SubCl*BQl = BSubCl;
+ rhov*Vv*der(SubCv) + SubCv*BQv + rhov*Vv*SubCSaS = BSubCv;
+ else
+ SubCl*BQl = BSubCl;
+ SubCv*BQv + rhov*Vv*SubCSaS = BSubCv;
+ end if;
+
+ Cl.SubC = SubCl;
+
+ /* 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
@@ -218,17 +271,28 @@ equation
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;
+
+ /* Fluid thermodynamic properties */
+ state_l = Medium.setState_phX(p=(P + Pfond)/2, h=hl, X=Medium.reference_X);
+ state_v = Medium.setState_phX(p=P, h=hv, X=Medium.reference_X);
+ state_out_l = Medium.setState_phX(p=Pfond, h=Cl.h, X=Medium.reference_X);
+ sat = Medium.setSat_p(P);
+ hlsat = Medium.bubbleEnthalpy(sat);
+ hvsat = Medium.dewEnthalpy(sat);
+
+ ddphl = Medium.density_derp_h(state_l);
+ ddhpl = Medium.density_derh_p(state_l);
+ ddphv = Medium.density_derp_h(state_v);
+ ddhpv = Medium.density_derh_p(state_v);
+
+ Tl = Medium.temperature(state_l);
+ rhol = Medium.density(state_l);
+ xl = noEvent(max(0, min(1, (hl - hlsat)/(hvsat - hlsat))));
+
+ Tv = Medium.temperature(state_v);
+ rhov = Medium.density(state_v);
+ xv = noEvent(max(0, min(1, (hv - hlsat)/(hvsat - hlsat))));
+
Cth.T = Tv;
annotation(
Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}, grid = {2, 2}), graphics),
@@ -244,4 +308,4 @@ Daniel Bouskela
Baligh El Hefni
"));
-end TwoPhaseVolume;
\ No newline at end of file
+end TwoPhaseVolume;
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeA.mo b/ThermoSysPro/Fluid/Volumes/VolumeA.mo
index b5901ab8..92936079 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeA.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeA.mo
@@ -1,66 +1,65 @@
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 "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" 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)"));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 Boolean dynamic_composition_balance=false
+ "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+
+ parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog(
+ enable=dynamic_composition_balance,
+ tab="Fluid",
+ group="Medium"));
+
+protected
+ constant Boolean isCompressible = Medium.isCompressible;
+ 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.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.DerDensityByPressure ddph
+ "density derivative wrt pressure at constant specific enthalpy";
+ Units.SI.DerDensityByEnthalpy ddhp
+ "density derivative wrt specific enthalpy at constant pressure";
+ Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction";
+ Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation";
+ Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
+ Medium.ThermodynamicState state;
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";
@@ -74,19 +73,17 @@ model VolumeA "Mixing volume with 2 inlets and 2 outlets"
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";
- 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)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1( redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2( redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-10,90},{10,110}}, rotation=0),
+ iconTransformation(extent={{-10,90},{10,110}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1( redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2( redeclare package Medium = Medium) 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
@@ -102,19 +99,12 @@ initial equation
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;
+
+ if dynamic_composition_balance then
+ if steady_state then
+ der(X) = fill(0,Medium.nX);
+ else
+ X = X0[1:Medium.nXi];
end if;
end if;
equation
@@ -122,25 +112,16 @@ equation
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 */
+
+ /* 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;
+ Ce1.Xi = Medium.X_default[1:Medium.nXi];
+ Ce1.SubC = Medium.C_default;
end if;
if (cardinality(Ce2) == 0) then
Ce2.Q = 0;
@@ -148,11 +129,8 @@ equation
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;
+ Ce2.Xi = Medium.X_default[1:Medium.nXi];
+ Ce2.SubC = Medium.C_default;
end if;
if (cardinality(Cs1) == 0) then
Cs1.Q = 0;
@@ -169,7 +147,7 @@ equation
/* 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;
+ V*(ddph*der(P) + ddhp*der(h)) = BQ;
else
0 = BQ;
end if;
@@ -177,13 +155,15 @@ equation
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;
+
+ /* Energy balance equation */
+ BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + 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;
+ V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH;
else
- V*rho*der(h - Xh2o*hr) = BH;
+ V*rho*der(h) = BH;
end if;
else
BH = 0;
@@ -192,40 +172,34 @@ equation
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;
+
+ /* Fluid composition balance equations */
+ BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q;
+
+ if dynamic_composition_balance then
+ V*rho*der(X) + X*BQ = BX;
+ else
+ X*BQ = BX;
+ end if;
+
+ Cs1.Xi = X;
+
+ Cs2.Xi = X;
+
+ /* Traces composition balance equations */
+ BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC;
+
+ SubCSaS = SaS();
+ if dynamic_mass_balance then
+ V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC;
else
- Xco2 = 0;
- Xh2o = 0;
- Xo2 = 0;
- Xso2 = 0;
+ V*rho*SubCSaS = BSubC;
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 */
+
+ Cs1.SubC = SubC;
+ Cs2.SubC = SubC;
+
+ /* 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);
@@ -270,19 +244,24 @@ equation
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);
+
+ /* Fluid thermodynamic properties */
+ if isCompressible and dynamic_mass_balance then
+ ddph = Medium.density_derp_h(state);
+ ddhp = Medium.density_derh_p(state);
else
ddph = 0;
ddhp = 0;
end if;
- T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+ state = Medium.setState_phX(p=P, h=h, X=X);
+
+ T = Medium.temperature(state);
+
if (p_rho > 0) then
rho = p_rho;
else
- rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+ rho = Medium.density(state);
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)}),
@@ -299,4 +278,4 @@ Daniel Bouskela
Baligh El Hefni
"));
-end VolumeA;
\ No newline at end of file
+end VolumeA;
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeATh.mo b/ThermoSysPro/Fluid/Volumes/VolumeATh.mo
index 2b40e378..b8228250 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeATh.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeATh.mo
@@ -1,66 +1,63 @@
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 "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" 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)"));
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 Boolean dynamic_composition_balance=false
+ "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+
+ parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog(
+ enable=dynamic_composition_balance,
+ tab="Fluid",
+ group="Medium"));
+
+protected
+ constant Boolean isCompressible = Medium.isCompressible;
+ 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.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.DerDensityByPressure ddph
+ "density derivative wrt pressure at constant specific enthalpy";
+ Units.SI.DerDensityByEnthalpy ddhp
+ "density derivative wrt specific enthalpy at constant pressure";
+ Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction";
+ Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation";
+ Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
+ Medium.ThermodynamicState state;
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";
@@ -74,21 +71,21 @@ model VolumeATh "Mixing volume with 2 inlets, 2 outlets and 1 thermal input"
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";
- 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)));
- Thermal.Connectors.ThermalPort Cth annotation(
- Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1( redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2( redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-10,90},{10,110}}, rotation=0),
+ iconTransformation(extent={{-10,90},{10,110}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1( redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{90,-10},{110,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2( redeclare package Medium = Medium) 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
@@ -104,19 +101,12 @@ initial equation
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;
+
+ if dynamic_composition_balance then
+ if steady_state then
+ der(X) = fill(0,Medium.nX);
+ else
+ X = X0[1:Medium.nXi];
end if;
end if;
equation
@@ -124,25 +114,16 @@ equation
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 */
+
+ /* 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;
+ Ce1.Xi = Medium.X_default[1:Medium.nXi];
+ Ce1.SubC = Medium.C_default;
end if;
if (cardinality(Ce2) == 0) then
Ce2.Q = 0;
@@ -150,11 +131,8 @@ equation
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;
+ Ce2.Xi = Medium.X_default[1:Medium.nXi];
+ Ce2.SubC = Medium.C_default;
end if;
if (cardinality(Cs1) == 0) then
Cs1.Q = 0;
@@ -171,7 +149,7 @@ equation
/* 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;
+ V*(ddph*der(P) + ddhp*der(h)) = BQ;
else
0 = BQ;
end if;
@@ -179,13 +157,15 @@ equation
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;
+
+ /* Energy balance equation */
+ BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + 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;
+ V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH;
else
- V*rho*der(h - Xh2o*hr) = BH;
+ V*rho*der(h) = BH;
end if;
else
BH = 0;
@@ -194,40 +174,33 @@ equation
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;
+
+ /* Fluid composition balance equations */
+ BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q;
+
+ if dynamic_composition_balance then
+ V*rho*der(X) + X*BQ = BX;
+ else
+ X*BQ = BX;
+ end if;
+
+ Cs1.Xi = X;
+ Cs2.Xi = X;
+
+ /* Traces composition balance equations */
+ BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC;
+
+ SubCSaS = SaS();
+ if dynamic_mass_balance then
+ V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC;
else
- Xco2 = 0;
- Xh2o = 0;
- Xo2 = 0;
- Xso2 = 0;
+ V*rho*SubCSaS = BSubC;
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 */
+
+ Cs1.SubC = SubC;
+ Cs2.SubC = SubC;
+
+ /* 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);
@@ -274,18 +247,22 @@ equation
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);
+ ddph = Medium.density_derp_h(state);
+ ddhp = Medium.density_derh_p(state);
else
ddph = 0;
ddhp = 0;
end if;
- T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+ state = Medium.setState_phX(p=P, h=h, X=X);
+
+ T = Medium.temperature(state);
+
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);
+ rho = Medium.density(state);
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)}),
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeB.mo b/ThermoSysPro/Fluid/Volumes/VolumeB.mo
index 87664eef..361f0ceb 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeB.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeB.mo
@@ -1,49 +1,49 @@
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 "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" 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)"));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 Boolean dynamic_composition_balance=false
+ "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+
+ parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog(
+ enable=dynamic_composition_balance,
+ tab="Fluid",
+ group="Medium"));
+
+protected
+ constant Boolean isCompressible = Medium.isCompressible;
+ 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.Temperature T "Fluid temperature";
Units.SI.AbsolutePressure P(start = 1.e5) "Fluid pressure";
Units.SI.SpecificEnthalpy h(start = 100000) "Fluid specific enthalpy";
@@ -52,15 +52,12 @@ model VolumeB "Mixing volume with 2 inlets and 2 outlets"
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.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction";
+ Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation";
+ Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
+ Medium.ThermodynamicState state;
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";
@@ -74,19 +71,18 @@ model VolumeB "Mixing volume with 2 inlets and 2 outlets"
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";
- 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)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1( redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2( redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{90,-10},{110,10}}, rotation=0),
+ iconTransformation(extent={{90,-10},{110,10}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1( redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{-10,90},{10,110}}, rotation=0),
+ iconTransformation(extent={{-10,90},{10,110}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2( redeclare package Medium = Medium) 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
@@ -102,19 +98,12 @@ initial equation
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;
+
+ if dynamic_composition_balance then
+ if steady_state then
+ der(X) = fill(0,Medium.nX);
+ else
+ X = X0[1:Medium.nXi];
end if;
end if;
equation
@@ -122,25 +111,16 @@ equation
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 */
+
+ /* 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;
+ Ce1.Xi = Medium.X_default[1:Medium.nXi];
+ Ce1.SubC = Medium.C_default;
end if;
if (cardinality(Ce2) == 0) then
Ce2.Q = 0;
@@ -148,11 +128,8 @@ equation
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;
+ Ce2.Xi = Medium.X_default[1:Medium.nXi];
+ Ce2.SubC = Medium.C_default;
end if;
if (cardinality(Cs1) == 0) then
Cs1.Q = 0;
@@ -169,7 +146,7 @@ equation
/* 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;
+ V*(ddph*der(P) + ddhp*der(h)) = BQ;
else
0 = BQ;
end if;
@@ -177,13 +154,15 @@ equation
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;
+
+ /* Energy balance equation */
+ BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + 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;
+ V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH;
else
- V*rho*der(h - Xh2o*hr) = BH;
+ V*rho*der(h) = BH;
end if;
else
BH = 0;
@@ -192,40 +171,34 @@ equation
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;
+
+ /* Fluid composition balance equations */
+ BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q;
+
+ if dynamic_composition_balance then
+ V*rho*der(X) + X*BQ = BX;
+ else
+ X*BQ = BX;
+ end if;
+
+ Cs1.Xi = X;
+
+ Cs2.Xi = X;
+
+ /* Traces composition balance equations */
+ BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC;
+
+ SubCSaS = SaS();
+ if dynamic_mass_balance then
+ V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC;
else
- Xco2 = 0;
- Xh2o = 0;
- Xo2 = 0;
- Xso2 = 0;
+ V*rho*SubCSaS = BSubC;
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 */
+
+ Cs1.SubC = SubC;
+ Cs2.SubC = SubC;
+
+ /* 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);
@@ -272,17 +245,21 @@ equation
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);
+ ddph = Medium.density_derp_h(state);
+ ddhp = Medium.density_derh_p(state);
else
ddph = 0;
ddhp = 0;
end if;
- T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+ state = Medium.setState_phX(p=P, h=h, X=X);
+
+ T = Medium.temperature(state);
+
if (p_rho > 0) then
rho = p_rho;
else
- rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+ rho = Medium.density(state);
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)}),
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo b/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo
index b31ae04b..e998b221 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeBTh.mo
@@ -1,66 +1,63 @@
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 "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" 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)"));
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 Boolean dynamic_composition_balance=false
+ "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+
+ parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog(
+ enable=dynamic_composition_balance,
+ tab="Fluid",
+ group="Medium"));
+
+protected
+ constant Boolean isCompressible = Medium.isCompressible;
+ 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.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.DerDensityByPressure ddph
+ "density derivative wrt pressure at constant specific enthalpy";
+ Units.SI.DerDensityByEnthalpy ddhp
+ "density derivative wrt specific enthalpy at constant pressure";
+ Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction";
+ Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation";
+ Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
+ Medium.ThermodynamicState state;
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";
@@ -74,21 +71,21 @@ model VolumeBTh "Mixing volume with 2 inlets, 2 outlets and 1 thermal input"
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";
- 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)));
- Thermal.Connectors.ThermalPort Cth annotation(
- Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1( redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2( redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{90,-10},{110,10}}, rotation=0),
+ iconTransformation(extent={{90,-10},{110,10}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1( redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2( redeclare package Medium = Medium) 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
@@ -104,19 +101,12 @@ initial equation
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;
+
+ if dynamic_composition_balance then
+ if steady_state then
+ der(X) = fill(0,Medium.nX);
+ else
+ X = X0[1:Medium.nXi];
end if;
end if;
equation
@@ -124,25 +114,16 @@ equation
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 */
+
+ /* 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;
+ Ce1.Xi = Medium.X_default[1:Medium.nXi];
+ Ce1.SubC = Medium.C_default;
end if;
if (cardinality(Ce2) == 0) then
Ce2.Q = 0;
@@ -150,11 +131,8 @@ equation
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;
+ Ce2.Xi = Medium.X_default[1:Medium.nXi];
+ Ce2.SubC = Medium.C_default;
end if;
if (cardinality(Cs1) == 0) then
Cs1.Q = 0;
@@ -171,7 +149,7 @@ equation
/* 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;
+ V*(ddph*der(P) + ddhp*der(h)) = BQ;
else
0 = BQ;
end if;
@@ -179,13 +157,15 @@ equation
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;
+
+ /* Energy balance equation */
+ BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h + 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;
+ V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH;
else
- V*rho*der(h - Xh2o*hr) = BH;
+ V*rho*der(h) = BH;
end if;
else
BH = 0;
@@ -194,40 +174,34 @@ equation
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;
+
+ /* Fluid composition balance equations */
+ BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q;
+
+ if dynamic_composition_balance then
+ V*rho*der(X) + X*BQ = BX;
else
- Xco2 = 0;
- Xh2o = 0;
- Xo2 = 0;
- Xso2 = 0;
+ X*BQ = BX;
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 */
+
+ Cs1.Xi = X;
+
+ Cs2.Xi = X;
+
+ /* Traces composition balance equations */
+ BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC;
+
+ SubCSaS = SaS();
+ if dynamic_mass_balance then
+ V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC;
+ else
+ V*rho*SubCSaS = BSubC;
+ end if;
+
+ Cs1.SubC = SubC;
+ Cs2.SubC = SubC;
+
+ /* 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);
@@ -274,18 +248,22 @@ equation
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);
+ ddph = Medium.density_derp_h(state);
+ ddhp = Medium.density_derh_p(state);
else
ddph = 0;
ddhp = 0;
end if;
- T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+ state = Medium.setState_phX(p=P, h=h, X=X);
+
+ T = Medium.temperature(state);
+
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);
+ rho = Medium.density(state);
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)}),
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeC.mo b/ThermoSysPro/Fluid/Volumes/VolumeC.mo
index 9dae4b66..9e28a6ac 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeC.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeC.mo
@@ -1,66 +1,62 @@
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 "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" 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)"));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ 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 Boolean dynamic_composition_balance=false
+ "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+ parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog(
+ enable=dynamic_composition_balance,
+ tab="Fluid",
+ group="Medium"));
+
+protected
+ constant Boolean isCompressible = Medium.isCompressible;
+ 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.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.DerDensityByPressure ddph
+ "density derivative wrt pressure at constant specific enthalpy";
+ Units.SI.DerDensityByEnthalpy ddhp
+ "density derivative wrt specific enthalpy at constant pressure";
+ Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction";
+ Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation";
+ Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
+ Medium.ThermodynamicState state;
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";
@@ -74,19 +70,18 @@ model VolumeC "Mixing volume with 3 inlets and 1 outlet"
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}})));
-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";
+
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0),
+ iconTransformation(extent={{-110,-10},{-90,10}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-10,90},{10,110}}, rotation=0),
+ iconTransformation(extent={{-10,90},{10,110}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{90,-10},{110,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) 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
@@ -102,19 +97,12 @@ initial equation
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;
+
+ if dynamic_composition_balance then
+ if steady_state then
+ der(X) = fill(0,Medium.nX);
+ else
+ X = X0[1:Medium.nXi];
end if;
end if;
equation
@@ -122,25 +110,16 @@ equation
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 */
+
+ /* 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;
+ Ce1.Xi = Medium.X_default[1:Medium.nXi];
+ Ce1.SubC = Medium.C_default;
end if;
if (cardinality(Ce2) == 0) then
Ce2.Q = 0;
@@ -148,11 +127,8 @@ equation
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;
+ Ce2.Xi = Medium.X_default[1:Medium.nXi];
+ Ce2.SubC = Medium.C_default;
end if;
if (cardinality(Ce3) == 0) then
Ce3.Q = 0;
@@ -160,11 +136,8 @@ equation
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;
+ Ce3.Xi = Medium.X_default[1:Medium.nXi];
+ Ce3.SubC = Medium.C_default;
end if;
if (cardinality(Cs) == 0) then
Cs.Q = 0;
@@ -175,7 +148,7 @@ equation
/* 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;
+ V*(ddph*der(P) + ddhp*der(h)) = BQ;
else
0 = BQ;
end if;
@@ -183,13 +156,15 @@ equation
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;
+
+ /* Energy balance equation */
+ BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h - Cs.Q*Cs.h + 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;
+ V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH;
else
- V*rho*der(h - Xh2o*hr) = BH;
+ V*rho*der(h) = BH;
end if;
else
BH = 0;
@@ -198,35 +173,32 @@ equation
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;
+
+ /* Fluid composition balance equations */
+ BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q - Cs.Xi*Cs.Q;
+
+ if dynamic_composition_balance then
+ V*rho*der(X) + X*BQ = BX;
+ else
+ X*BQ = BX;
+ end if;
+
+
+ /* Traces composition balance equations */
+ BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC - Cs.Q*Cs.SubC;
+
+ SubCSaS = SaS();
+ if dynamic_mass_balance then
+ V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC;
else
- Xco2 = 0;
- Xh2o = 0;
- Xo2 = 0;
- Xso2 = 0;
+ V*rho*SubCSaS = BSubC;
end if;
- Cs.ftype = ftype;
- Cs.Xco2 = Xco2;
- Cs.Xh2o = Xh2o;
- Cs.Xo2 = Xo2;
- Cs.Xso2 = Xso2;
-/* Flow reversal */
+
+ Cs.SubC = SubC;
+
+ Cs.Xi = X;
+
+ /* 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
@@ -271,17 +243,21 @@ equation
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);
+ ddph = Medium.density_derp_h(state);
+ ddhp = Medium.density_derh_p(state);
else
ddph = 0;
ddhp = 0;
end if;
- T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+ state = Medium.setState_phX(p=P, h=h, X=X);
+
+ T = Medium.temperature(state);
+
if (p_rho > 0) then
rho = p_rho;
else
- rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+ rho = Medium.density(state);
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)}),
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo b/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo
index 8e61caa9..8e10d009 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeCTh.mo
@@ -1,66 +1,62 @@
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 "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" 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)"));
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 Boolean dynamic_composition_balance=false
+ "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+ parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog(
+ enable=dynamic_composition_balance,
+ tab="Fluid",
+ group="Medium"));
+
+protected
+ constant Boolean isCompressible = Medium.isCompressible;
+ 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.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.DerDensityByPressure ddph
+ "density derivative wrt pressure at constant specific enthalpy";
+ Units.SI.DerDensityByEnthalpy ddhp
+ "density derivative wrt specific enthalpy at constant pressure";
+ Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction";
+ Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation";
+ Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
+ Medium.ThermodynamicState state;
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";
@@ -74,21 +70,22 @@ model VolumeCTh "Mixing volume with 3 inlets, 1 outlet and 1 thermal input"
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}})));
- Thermal.Connectors.ThermalPort Cth annotation(
- Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0)));
-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";
+
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0),
+ iconTransformation(extent={{-110,-10},{-90,10}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-10,90},{10,110}}, rotation=0),
+ iconTransformation(extent={{-10,90},{10,110}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{90,-10},{110,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) 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
@@ -104,19 +101,12 @@ initial equation
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;
+
+ if dynamic_composition_balance then
+ if steady_state then
+ der(X) = fill(0,Medium.nX);
+ else
+ X = X0[1:Medium.nXi];
end if;
end if;
equation
@@ -124,25 +114,16 @@ equation
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 */
+
+ /* 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;
+ Ce1.Xi = Medium.X_default[1:Medium.nXi];
+ Ce1.SubC = Medium.C_default;
end if;
if (cardinality(Ce2) == 0) then
Ce2.Q = 0;
@@ -150,11 +131,8 @@ equation
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;
+ Ce2.Xi = Medium.X_default[1:Medium.nXi];
+ Ce2.SubC = Medium.C_default;
end if;
if (cardinality(Ce3) == 0) then
Ce3.Q = 0;
@@ -162,11 +140,8 @@ equation
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;
+ Ce3.Xi = Medium.X_default[1:Medium.nXi];
+ Ce3.SubC = Medium.C_default;
end if;
if (cardinality(Cs) == 0) then
Cs.Q = 0;
@@ -177,7 +152,7 @@ equation
/* 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;
+ V*(ddph*der(P) + ddhp*der(h)) = BQ;
else
0 = BQ;
end if;
@@ -185,13 +160,15 @@ equation
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;
+
+ /* Energy balance equation */
+ BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h - Cs.Q*Cs.h + 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;
+ V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH;
else
- V*rho*der(h - Xh2o*hr) = BH;
+ V*rho*der(h) = BH;
end if;
else
BH = 0;
@@ -200,35 +177,32 @@ equation
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;
+
+ /* Fluid composition balance equations */
+ BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q - Cs.Xi*Cs.Q;
+
+ if dynamic_composition_balance then
+ V*rho*der(X) + X*BQ = BX;
+ else
+ X*BQ = BX;
+ end if;
+
+
+ /* Traces composition balance equations */
+ BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC - Cs.Q*Cs.SubC;
+
+ SubCSaS = SaS();
+ if dynamic_mass_balance then
+ V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC;
else
- Xco2 = 0;
- Xh2o = 0;
- Xo2 = 0;
- Xso2 = 0;
+ V*rho*SubCSaS = BSubC;
end if;
- Cs.ftype = ftype;
- Cs.Xco2 = Xco2;
- Cs.Xh2o = Xh2o;
- Cs.Xo2 = Xo2;
- Cs.Xso2 = Xso2;
-/* Flow reversal */
+
+ Cs.SubC = SubC;
+
+ Cs.Xi = X;
+
+ /* 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
@@ -273,18 +247,22 @@ equation
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);
+ ddph = Medium.density_derp_h(state);
+ ddhp = Medium.density_derh_p(state);
else
ddph = 0;
ddhp = 0;
end if;
- T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+ state = Medium.setState_phX(p=P, h=h, X=X);
+
+ T = Medium.temperature(state);
+
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);
+ rho = Medium.density(state);
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)}),
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeD.mo b/ThermoSysPro/Fluid/Volumes/VolumeD.mo
index 1856bc72..e46ca9ef 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeD.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeD.mo
@@ -1,66 +1,64 @@
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 "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" 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)"));
+
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 Boolean dynamic_composition_balance=false
+ "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+ parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog(
+ enable=dynamic_composition_balance,
+ tab="Fluid",
+ group="Medium"));
+
+
+protected
+ constant Boolean isCompressible = Medium.isCompressible;
+ 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.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.DerDensityByPressure ddph
+ "density derivative wrt pressure at constant specific enthalpy";
+ Units.SI.DerDensityByEnthalpy ddhp
+ "density derivative wrt specific enthalpy at constant pressure";
+ Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction";
+ Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation";
+ Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
+ Medium.ThermodynamicState state;
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";
@@ -74,19 +72,16 @@ model VolumeD "Mixing volume with 1 inlet and 3 outlets"
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";
- 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}})));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium)
+ annotation (Placement(transformation(extent={{90,-10},{110,10}})));
initial equation
if dynamic_energy_balance and dynamic_mass_balance then
if steady_state then
@@ -102,19 +97,12 @@ initial equation
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;
+
+ if dynamic_composition_balance then
+ if steady_state then
+ der(X) = fill(0,Medium.nX);
+ else
+ X = X0[1:Medium.nXi];
end if;
end if;
equation
@@ -122,25 +110,16 @@ equation
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 */
+
+ /* 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;
+ Ce.Xi = Medium.X_default[1:Medium.nXi];
+ Ce.SubC = Medium.C_default;
end if;
if (cardinality(Cs1) == 0) then
Cs1.Q = 0;
@@ -163,7 +142,7 @@ equation
/* 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;
+ V*(ddph*der(P) + ddhp*der(h)) = BQ;
else
0 = BQ;
end if;
@@ -171,13 +150,15 @@ equation
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;
+
+ /* Energy balance equation */
+ BH = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h + 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;
+ V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH;
else
- V*rho*der(h - Xh2o*hr) = BH;
+ V*rho*der(h) = BH;
end if;
else
BH = 0;
@@ -186,45 +167,36 @@ equation
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;
+
+ /* Fluid composition balance equations */
+ BX = Ce.Xi*Ce.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q - Cs3.Xi*Cs3.Q;
+
+ if dynamic_composition_balance then
+ V*rho*der(X) + X*BQ = BX;
else
- Xco2 = 0;
- Xh2o = 0;
- Xo2 = 0;
- Xso2 = 0;
+ X*BQ = BX;
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 */
+
+
+ /* Traces composition balance equations */
+ BSubC = Ce.Q*Ce.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC - Cs3.Q*Cs3.SubC;
+
+ SubCSaS = SaS();
+ if dynamic_mass_balance then
+ V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC;
+ else
+ V*rho*SubCSaS = BSubC;
+ end if;
+
+ Cs1.SubC = SubC;
+ Cs2.SubC = SubC;
+ Cs3.SubC = SubC;
+
+ Cs1.Xi = X;
+ Cs2.Xi = X;
+ Cs3.Xi = X;
+
+ /* 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);
@@ -273,17 +245,21 @@ equation
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);
+ ddph = Medium.density_derp_h(state);
+ ddhp = Medium.density_derh_p(state);
else
ddph = 0;
ddhp = 0;
end if;
- T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+ state = Medium.setState_phX(p=P, h=h, X=X);
+
+ T = Medium.temperature(state);
+
if (p_rho > 0) then
rho = p_rho;
else
- rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+ rho = Medium.density(state);
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)}),
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo b/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo
index 71665b1d..b3d4e8c1 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeDTh.mo
@@ -1,66 +1,62 @@
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 "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" 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)"));
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 Boolean dynamic_composition_balance=false
+ "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+ parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog(
+ enable=dynamic_composition_balance,
+ tab="Fluid",
+ group="Medium"));
+
+protected
+ constant Boolean isCompressible = Medium.isCompressible;
+ 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.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.DerDensityByPressure ddph
+ "density derivative wrt pressure at constant specific enthalpy";
+ Units.SI.DerDensityByEnthalpy ddhp
+ "density derivative wrt specific enthalpy at constant pressure";
+ Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction";
+ Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation";
+ Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
+ Medium.ThermodynamicState state;
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";
@@ -74,21 +70,19 @@ model VolumeDTh "Mixing volume with 1 inlet, 3 outlets and 1 thermal input"
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";
- 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)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{-10,90},{10,110}}, rotation=0)));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{-10,-110},{10,-90}}, rotation=0)));
+ Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium)
+ 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
@@ -104,19 +98,12 @@ initial equation
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;
+
+ if dynamic_composition_balance then
+ if steady_state then
+ der(X) = fill(0,Medium.nX);
+ else
+ X = X0[1:Medium.nXi];
end if;
end if;
equation
@@ -124,25 +111,16 @@ equation
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 */
+
+ /* 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;
+ Ce.Xi = Medium.X_default[1:Medium.nXi];
+ Ce.SubC = Medium.C_default;
end if;
if (cardinality(Cs1) == 0) then
Cs1.Q = 0;
@@ -165,7 +143,7 @@ equation
/* 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;
+ V*(ddph*der(P) + ddhp*der(h)) = BQ;
else
0 = BQ;
end if;
@@ -173,13 +151,15 @@ equation
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;
+
+ /* Energy balance equation */
+ BH = Ce.Q*Ce.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h + 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;
+ V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH;
else
- V*rho*der(h - Xh2o*hr) = BH;
+ V*rho*der(h) = BH;
end if;
else
BH = 0;
@@ -188,45 +168,35 @@ equation
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;
+
+ /* Fluid composition balance equations */
+ BX = Ce.Xi*Ce.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q - Cs3.Xi*Cs3.Q;
+
+ if dynamic_composition_balance then
+ V*rho*der(X) + X*BQ = BX;
+ else
+ X*BQ = BX;
+ end if;
+
+ /* Traces composition balance equations */
+ BSubC = Ce.Q*Ce.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC - Cs3.Q*Cs3.SubC;
+
+ SubCSaS = SaS();
+ if dynamic_mass_balance then
+ V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC;
else
- Xco2 = 0;
- Xh2o = 0;
- Xo2 = 0;
- Xso2 = 0;
+ V*rho*SubCSaS = BSubC;
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 */
+
+ Cs1.SubC = SubC;
+ Cs2.SubC = SubC;
+ Cs3.SubC = SubC;
+
+ Cs1.Xi = X;
+ Cs2.Xi = X;
+ Cs3.Xi = X;
+
+ /* 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);
@@ -275,18 +245,22 @@ equation
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);
+ ddph = Medium.density_derp_h(state);
+ ddhp = Medium.density_derh_p(state);
else
ddph = 0;
ddhp = 0;
end if;
- T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+ state = Medium.setState_phX(p=P, h=h, X=X);
+
+ T = Medium.temperature(state);
+
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);
+ rho = Medium.density(state);
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)}),
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeI.mo b/ThermoSysPro/Fluid/Volumes/VolumeI.mo
index da5bb52e..485e432b 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeI.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeI.mo
@@ -1,66 +1,65 @@
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 "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" 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)"));
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 Boolean dynamic_composition_balance=false
+ "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+ parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog(
+ enable=dynamic_composition_balance,
+ tab="Fluid",
+ group="Medium"));
+
+protected
+ constant Boolean isCompressible = Medium.isCompressible;
+ 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.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.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";
+ Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction";
+ Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation";
+ Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
+ Medium.ThermodynamicState state;
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";
@@ -86,27 +85,33 @@ model VolumeI "Mixing volume with 4 inlets and 4 outlets"
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";
- 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}})));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,70},{-90,90}}, rotation=0),
+ iconTransformation(extent={{-110,70},{-90,90}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}},
+ rotation=0),
+ iconTransformation(extent={{-110,-10},{-90,10}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{90,70},{110,90}}, rotation=0),
+ iconTransformation(extent={{90,70},{110,90}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{90,-10},{110,10}}, rotation=0),
+ iconTransformation(extent={{90,-10},{110,10}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-90},{-90,-70}}), iconTransformation(
+ extent={{-110,-90},{-90,-70}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce4(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-10,-110},{10,-90}}), iconTransformation(extent=
+ {{-10,-110},{10,-90}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{90,-90},{110,-70}}), iconTransformation(
+ extent={{90,-90},{110,-70}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs4(redeclare package Medium = Medium) 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
@@ -122,19 +127,12 @@ initial equation
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;
+
+ if dynamic_composition_balance then
+ if steady_state then
+ der(X) = fill(0,Medium.nX);
+ else
+ X = X0[1:Medium.nXi];
end if;
end if;
equation
@@ -142,29 +140,16 @@ equation
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 */
+
+ /* 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;
+ Ce1.Xi = Medium.X_default[1:Medium.nXi];
+ Ce1.SubC = Medium.C_default;
end if;
if (cardinality(Ce2) == 0) then
Ce2.Q = 0;
@@ -172,11 +157,8 @@ equation
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;
+ Ce2.Xi = Medium.X_default[1:Medium.nXi];
+ Ce2.SubC = Medium.C_default;
end if;
if (cardinality(Ce3) == 0) then
Ce3.Q = 0;
@@ -184,11 +166,8 @@ equation
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;
+ Ce3.Xi = Medium.X_default[1:Medium.nXi];
+ Ce3.SubC = Medium.C_default;
end if;
if (cardinality(Ce4) == 0) then
Ce4.Q = 0;
@@ -196,11 +175,8 @@ equation
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;
+ Ce4.Xi = Medium.X_default[1:Medium.nXi];
+ Ce4.SubC = Medium.C_default;
end if;
if (cardinality(Cs1) == 0) then
Cs1.Q = 0;
@@ -229,7 +205,7 @@ equation
/* 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;
+ V*(ddph*der(P) + ddhp*der(h)) = BQ;
else
0 = BQ;
end if;
@@ -241,13 +217,15 @@ equation
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;
+
+ /* Energy balance equation */
+ BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h - Cs4.Q*Cs4.h + 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;
+ V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH;
else
- V*rho*der(h - Xh2o*hr) = BH;
+ V*rho*der(h) = BH;
end if;
else
BH = 0;
@@ -260,50 +238,38 @@ equation
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;
+
+ /* Fluid composition balance equations */
+ BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q + Ce4.Xi*Ce4.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q - Cs3.Xi*Cs3.Q - Cs4.Xi*Cs4.Q;
+
+ if dynamic_composition_balance then
+ V*rho*der(X) + X*BQ = BX;
+ else
+ X*BQ = BX;
+ end if;
+
+ /* Traces composition balance equations */
+ BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC + Ce4.Q*Ce4.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC - Cs3.Q*Cs3.SubC - Cs4.Q*Cs4.SubC;
+
+ SubCSaS = SaS();
+ if dynamic_mass_balance then
+ V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC;
else
- Xco2 = 0;
- Xh2o = 0;
- Xo2 = 0;
- Xso2 = 0;
+ V*rho*SubCSaS = BSubC;
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 */
+
+ Cs1.SubC = SubC;
+ Cs2.SubC = SubC;
+ Cs3.SubC = SubC;
+ Cs4.SubC = SubC;
+
+ Cs1.Xi = X;
+ Cs2.Xi = X;
+ Cs3.Xi = X;
+ Cs4.Xi = X;
+
+
+ /* 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);
@@ -386,17 +352,21 @@ equation
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);
+ ddph = Medium.density_derp_h(state);
+ ddhp = Medium.density_derh_p(state);
else
ddph = 0;
ddhp = 0;
end if;
- T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+ state = Medium.setState_phX(p=P, h=h, X=X);
+
+ T = Medium.temperature(state);
+
if (p_rho > 0) then
rho = p_rho;
else
- rho = ThermoSysPro.Properties.Fluid.Density_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+ rho = Medium.density(state);
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}})}),
diff --git a/ThermoSysPro/Fluid/Volumes/VolumeITh.mo b/ThermoSysPro/Fluid/Volumes/VolumeITh.mo
index 1e4eca4f..03f48d70 100644
--- a/ThermoSysPro/Fluid/Volumes/VolumeITh.mo
+++ b/ThermoSysPro/Fluid/Volumes/VolumeITh.mo
@@ -1,66 +1,63 @@
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 "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" 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)"));
+ replaceable package Medium = ThermoSysPro.Properties.Media.WaterSteam constrainedby ThermoSysPro.Properties.Media.PartialSubCMedium "Medium model" annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+ replaceable function SaS = Medium.noSaS(SubC=SubC) annotation (choicesAllMatching=true, Dialog(tab="Fluid", group="Medium"));
+
+ 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 Boolean dynamic_composition_balance=false
+ "true: dynamic fluid composition balance equation
false: static fluid composition balance equation (active for flue gases)" annotation(Evaluate=true, Dialog(tab="Fluid", group="Fluid properties"));
+ parameter Medium.MassFraction X0[Medium.nX]=Medium.X_default "Initial composition values" annotation (Evaluate=true, Dialog(
+ enable=dynamic_composition_balance,
+ tab="Fluid",
+ group="Medium"));
+
+
+protected
+ constant Boolean isCompressible = Medium.isCompressible;
+ 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.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.DerDensityByPressure ddph
+ "density derivative wrt pressure at constant specific enthalpy";
+ Units.SI.DerDensityByEnthalpy ddhp
+ "density derivative wrt specific enthalpy at constant pressure";
+ Units.SI.MassFlowRate BX[Medium.nXi] "Right hand side of the X balance equation";
+ Medium.MassFraction X[Medium.nXi](start=Medium.X_default[1:Medium.nXi]) "Fluid mass fraction";
+ Medium.ExtraProperty BSubC[Medium.nC](quantity=Medium.extraPropertiesNames) "Right hand side of the trace balance equation";
+ Medium.ExtraProperty SubC[Medium.nC](quantity=Medium.extraPropertiesNames, start=Medium.C_default) "Fluid trace substances";
+ Medium.ExtraProperty SubCSaS[Medium.nC](quantity=Medium.extraPropertiesNames) "Trace modification in the trace balance equation";
+ Medium.ThermodynamicState state;
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";
@@ -86,29 +83,35 @@ model VolumeITh "Mixing volume with 4 inlets, 4 outlets and 1 thermal input"
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";
- 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)));
-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
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce1(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,70},{-90,90}}, rotation=0),
+ iconTransformation(extent={{-110,70},{-90,90}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidInlet Ce2(redeclare package Medium = Medium) annotation (Placement(
+ transformation(extent={{-110,-10},{-90,10}},
+ rotation=0),
+ iconTransformation(extent={{-110,-10},{-90,10}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs1(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{90,70},{110,90}}, rotation=0),
+ iconTransformation(extent={{90,70},{110,90}})));
+ ThermoSysPro.Fluid.Interfaces.Connectors.FluidOutlet Cs2(redeclare package Medium = Medium) annotation (
+ Placement(transformation(extent={{90,-10},{110,10}}, rotation=0),
+ iconTransformation(extent={{90,-10},{110,10}})));
+ Interfaces.Connectors.FluidInlet Ce3(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{-110,-90},{-90,-70}}), iconTransformation(extent={{-110,-90},
+ {-90,-70}})));
+ Interfaces.Connectors.FluidInlet Ce4(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{-10,-110},{10,-90}}), iconTransformation(extent={{-10,-110},{
+ 10,-90}})));
+ Interfaces.Connectors.FluidOutlet Cs3(redeclare package Medium = Medium) annotation (Placement(transformation(
+ extent={{90,-90},{110,-70}}), iconTransformation(extent={{90,-90},{110,
+ -70}})));
+ Interfaces.Connectors.FluidOutlet Cs4(redeclare package Medium = Medium) 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
@@ -124,19 +127,12 @@ initial equation
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;
+
+ if dynamic_composition_balance then
+ if steady_state then
+ der(X) = fill(0,Medium.nX);
+ else
+ X = X0[1:Medium.nXi];
end if;
end if;
equation
@@ -144,29 +140,16 @@ equation
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 */
+
+ /* 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;
+ Ce1.Xi = Medium.X_default[1:Medium.nXi];
+ Ce1.SubC = Medium.C_default;
end if;
if (cardinality(Ce2) == 0) then
Ce2.Q = 0;
@@ -174,11 +157,8 @@ equation
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;
+ Ce2.Xi = Medium.X_default[1:Medium.nXi];
+ Ce2.SubC = Medium.C_default;
end if;
if (cardinality(Ce3) == 0) then
Ce3.Q = 0;
@@ -186,11 +166,8 @@ equation
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;
+ Ce3.Xi = Medium.X_default[1:Medium.nXi];
+ Ce3.SubC = Medium.C_default;
end if;
if (cardinality(Ce4) == 0) then
Ce4.Q = 0;
@@ -198,11 +175,8 @@ equation
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;
+ Ce4.Xi = Medium.X_default[1:Medium.nXi];
+ Ce4.SubC = Medium.C_default;
end if;
if (cardinality(Cs1) == 0) then
Cs1.Q = 0;
@@ -231,7 +205,7 @@ equation
/* 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;
+ V*(ddph*der(P) + ddhp*der(h)) = BQ;
else
0 = BQ;
end if;
@@ -243,13 +217,15 @@ equation
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;
+
+ /* Energy balance equation */
+ BH = Ce1.Q*Ce1.h + Ce2.Q*Ce2.h + Ce3.Q*Ce3.h + Ce4.Q*Ce4.h - Cs1.Q*Cs1.h - Cs2.Q*Cs2.h - Cs3.Q*Cs3.h - Cs4.Q*Cs4.h + Cth.W + 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;
+ V*((h*ddph - 1)*der(P) + (h*ddhp + rho)*der(h)) = BH;
else
- V*rho*der(h - Xh2o*hr) = BH;
+ V*rho*der(h) = BH;
end if;
else
BH = 0;
@@ -262,50 +238,38 @@ equation
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;
+
+ /* Fluid composition balance equations */
+ BX = Ce1.Xi*Ce1.Q + Ce2.Xi*Ce2.Q + Ce3.Xi*Ce3.Q + Ce4.Xi*Ce4.Q - Cs1.Xi*Cs1.Q - Cs2.Xi*Cs2.Q - Cs3.Xi*Cs3.Q - Cs4.Xi*Cs4.Q;
+
+ if dynamic_composition_balance then
+ V*rho*der(X) + X*BQ = BX;
+ else
+ X*BQ = BX;
+ end if;
+
+ /* Traces composition balance equations */
+ BSubC = Ce1.Q*Ce1.SubC + Ce2.Q*Ce2.SubC + Ce3.Q*Ce3.SubC + Ce4.Q*Ce4.SubC - Cs1.Q*Cs1.SubC - Cs2.Q*Cs2.SubC - Cs3.Q*Cs3.SubC - Cs4.Q*Cs4.SubC;
+
+ SubCSaS = SaS();
+ if dynamic_mass_balance then
+ V*rho*der(SubC) + SubC*BQ + V*rho*SubCSaS = BSubC;
else
- Xco2 = 0;
- Xh2o = 0;
- Xo2 = 0;
- Xso2 = 0;
+ V*rho*SubCSaS = BSubC;
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 */
+
+ Cs1.SubC = SubC;
+ Cs2.SubC = SubC;
+ Cs3.SubC = SubC;
+ Cs4.SubC = SubC;
+
+ Cs1.Xi = X;
+ Cs2.Xi = X;
+ Cs3.Xi = X;
+ Cs4.Xi = X;
+
+
+ /* 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);
@@ -388,18 +352,22 @@ equation
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);
+ ddph = Medium.density_derp_h(state);
+ ddhp = Medium.density_derh_p(state);
else
ddph = 0;
ddhp = 0;
end if;
- T = ThermoSysPro.Properties.Fluid.Temperature_Ph(P, h, fluid, mode, Xco2, Xh2o, Xo2, Xso2);
+
+ state = Medium.setState_phX(p=P, h=h, X=X);
+
+ T = Medium.temperature(state);
+
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);
+ rho = Medium.density(state);
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}})}),
diff --git a/ThermoSysPro/Properties/Media/C3H3F5/package.mo b/ThermoSysPro/Properties/Media/C3H3F5/package.mo
new file mode 100644
index 00000000..1f4cef83
--- /dev/null
+++ b/ThermoSysPro/Properties/Media/C3H3F5/package.mo
@@ -0,0 +1,605 @@
+within ThermoSysPro.Properties.Media;
+package C3H3F5 "C3H3F5 medium using the legacy ThermoSysPro property functions"
+
+ extends PartialTwoPhaseThermoSysProMedium(
+ isCompressible=true,
+ mediumName="C3H3F5",
+ substanceNames={"C3H3F5"},
+ singleState=false,
+ SpecificEnthalpy(start=3.0e5, nominal=3.0e5, min=h_min, max=h_max),
+ Density(start=1000, nominal=1000),
+ AbsolutePressure(start=10e5, nominal=10e5, min=p_min, max=p_crit),
+ Temperature(start=300, nominal=300),
+ smoothModel=false,
+ onePhase=false,
+ fluidConstants={c3h3f5Constants},
+ ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.ph);
+
+ constant AbsolutePressure p_min=1 "Lower pressure bound of the legacy fit";
+ constant AbsolutePressure p_crit=3640000 "Critical pressure used by the legacy fit";
+ constant SpecificEnthalpy h_min=100000 "Lower enthalpy bound of the legacy fit";
+ constant SpecificEnthalpy h_max=640000 "Upper enthalpy bound of the legacy fit";
+ constant Temperature T_min=200 "Lower temperature search bound";
+ constant Temperature T_max=6000 "Upper temperature search bound";
+
+ constant FluidConstants c3h3f5Constants(
+ iupacName="C3H3F5",
+ casRegistryNumber="",
+ chemicalFormula="C3H3F5",
+ structureFormula="",
+ molarMass=0.134047);
+
+ redeclare record extends SaturationProperties
+ end SaturationProperties;
+
+ redeclare record extends ThermodynamicState "Thermodynamic state"
+ SpecificEnthalpy h "Specific enthalpy";
+ Density d "Density";
+ Temperature T "Temperature";
+ AbsolutePressure p "Pressure";
+ end ThermodynamicState;
+
+protected
+ function saturationTemperature_p
+ input AbsolutePressure p "Pressure";
+ output Temperature T "Saturation temperature";
+ protected
+ AbsolutePressure Pcalc;
+ algorithm
+ if p > p_crit then
+ Pcalc := p_crit/100000;
+ elseif p <= 0 then
+ Pcalc := 1/100000;
+ else
+ Pcalc := p/100000;
+ end if;
+
+ T := -0.0000033655*Pcalc^6 + 0.0004044854*Pcalc^5 - 0.0190328128*Pcalc^4
+ + 0.4443722095*Pcalc^3 - 5.4337547883*Pcalc^2
+ + 36.7572359309*Pcalc + 246.4280421048;
+ annotation (Inline=true);
+ end saturationTemperature_p;
+
+ function temperatureResidual_h
+ extends Modelica.Math.Nonlinear.Interfaces.partialScalarFunction;
+ input AbsolutePressure p "Pressure";
+ input Temperature T "Temperature";
+ protected
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro;
+ algorithm
+ pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, u);
+ y := pro.T - T;
+ end temperatureResidual_h;
+
+ function saturationPressureResidual_p
+ extends Modelica.Math.Nonlinear.Interfaces.partialScalarFunction;
+ input Temperature T "Saturation temperature";
+ algorithm
+ y := saturationTemperature_p(u) - T;
+ end saturationPressureResidual_p;
+
+public
+ redeclare replaceable model extends BaseProperties(
+ h(stateSelect=StateSelect.prefer),
+ d(stateSelect=StateSelect.default),
+ T(stateSelect=StateSelect.default),
+ p(stateSelect=StateSelect.prefer))
+ "Base properties of C3H3F5"
+ Integer phase(
+ min=0,
+ max=2,
+ start=1,
+ fixed=false) "2 for two-phase, 1 for one-phase, 0 if not known";
+ protected
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro;
+ equation
+ pro = ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h);
+ MM = fluidConstants[1].molarMass;
+ R_s = Modelica.Constants.R/fluidConstants[1].molarMass;
+
+ phase = if pro.x > 0 and pro.x < 1 then 2 else 1;
+ sat = setSat_p(p);
+ state = ThermodynamicState(
+ p=p,
+ h=h,
+ T=pro.T,
+ d=pro.d,
+ phase=phase);
+
+ T = pro.T;
+ d = pro.d;
+ u = h - p/d;
+ end BaseProperties;
+
+ redeclare function density_ph
+ "Computes density as a function of pressure and specific enthalpy"
+ extends Modelica.Icons.Function;
+ input AbsolutePressure p "Pressure";
+ input SpecificEnthalpy h "Specific enthalpy";
+ input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known";
+ output Density d "Density";
+ protected
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro;
+ algorithm
+ pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h);
+ d := pro.d;
+ annotation (Inline=true);
+ end density_ph;
+
+ redeclare function temperature_ph
+ "Computes temperature as a function of pressure and specific enthalpy"
+ extends Modelica.Icons.Function;
+ input AbsolutePressure p "Pressure";
+ input SpecificEnthalpy h "Specific enthalpy";
+ input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known";
+ output Temperature T "Temperature";
+ protected
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro;
+ algorithm
+ pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h);
+ T := pro.T;
+ annotation (Inline=true);
+ end temperature_ph;
+
+ redeclare function extends setState_phX
+ "Return thermodynamic state as function of p and h"
+ protected
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro;
+ algorithm
+ pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h);
+ state := ThermodynamicState(
+ p=p,
+ h=h,
+ T=pro.T,
+ d=pro.d,
+ phase=if pro.x > 0 and pro.x < 1 then 2 else 1);
+ annotation (Inline=true);
+ end setState_phX;
+
+ redeclare function extends setState_psX
+ "Return thermodynamic state as function of p and s"
+ protected
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro;
+ algorithm
+ pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p, s);
+ state := ThermodynamicState(
+ p=p,
+ h=pro.h,
+ T=pro.T,
+ d=pro.d,
+ phase=if pro.x > 0 and pro.x < 1 then 2 else 1);
+ annotation (Inline=true);
+ end setState_psX;
+
+ redeclare function specificEnthalpy_pT
+ "Compute specific enthalpy from p and T by inverting the legacy C3H3F5_Ph fit"
+ extends Modelica.Icons.Function;
+ input AbsolutePressure p "Pressure";
+ input Temperature T "Temperature";
+ input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known";
+ output SpecificEnthalpy h "Specific enthalpy";
+ protected
+ Temperature Tlow;
+ Temperature Thigh;
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proLow;
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph proHigh;
+ algorithm
+ proLow := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h_min);
+ proHigh := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h_max);
+ Tlow := proLow.T;
+ Thigh := proHigh.T;
+
+ if T <= Tlow then
+ h := h_min;
+ elseif T >= Thigh then
+ h := h_max;
+ else
+ h := Modelica.Math.Nonlinear.solveOneNonlinearEquation(
+ function temperatureResidual_h(p=p, T=T),
+ h_min,
+ h_max);
+ end if;
+ end specificEnthalpy_pT;
+
+ redeclare function specificEnthalpy_pTX
+ "Return specific enthalpy from pressure and temperature"
+ extends Modelica.Icons.Function;
+ input AbsolutePressure p "Pressure";
+ input Temperature T "Temperature";
+ input MassFraction X[:] "Mass fractions";
+ input FixedPhase phase=0
+ "2 for two-phase, 1 for one-phase, 0 if not known";
+ output SpecificEnthalpy h "Specific enthalpy at p, T, X";
+ algorithm
+ h := specificEnthalpy_pT(p, T, phase);
+ annotation (Inline=true);
+ end specificEnthalpy_pTX;
+
+ redeclare function density_pT
+ "Computes density as a function of pressure and temperature"
+ extends Modelica.Icons.Function;
+ input AbsolutePressure p "Pressure";
+ input Temperature T "Temperature";
+ input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known";
+ output Density d "Density";
+ algorithm
+ d := density_ph(p, specificEnthalpy_pT(p, T, phase), phase);
+ annotation (Inline=true);
+ end density_pT;
+
+ redeclare function extends setState_pTX
+ "Return thermodynamic state as function of p and T"
+ protected
+ SpecificEnthalpy h;
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro;
+ algorithm
+ h := specificEnthalpy_pT(p, T, phase);
+ pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(p, h);
+ state := ThermodynamicState(
+ p=p,
+ h=h,
+ T=pro.T,
+ d=pro.d,
+ phase=if pro.x > 0 and pro.x < 1 then 2 else 1);
+ annotation (Inline=true);
+ end setState_pTX;
+
+ redeclare function extends setState_dTX
+ "Return thermodynamic state as function of d and T"
+ algorithm
+ assert(false, "C3H3F5: setState_dTX is not available in the legacy ThermoSysPro implementation");
+ state := ThermodynamicState(
+ p=p_min,
+ h=h_min,
+ T=T,
+ d=d,
+ phase=phase);
+ end setState_dTX;
+
+ redeclare function extends setSmoothState
+ "Return a smooth thermodynamic state"
+ import Modelica.Media.Common.smoothStep;
+ algorithm
+ state := ThermodynamicState(
+ p=smoothStep(x, state_a.p, state_b.p, x_small),
+ h=smoothStep(x, state_a.h, state_b.h, x_small),
+ T=temperature_ph(
+ smoothStep(x, state_a.p, state_b.p, x_small),
+ smoothStep(x, state_a.h, state_b.h, x_small)),
+ d=density_ph(
+ smoothStep(x, state_a.p, state_b.p, x_small),
+ smoothStep(x, state_a.h, state_b.h, x_small)),
+ phase=0);
+ annotation (Inline=true);
+ end setSmoothState;
+
+ redeclare function temperature_ps
+ "Compute temperature from pressure and specific entropy"
+ extends Modelica.Icons.Function;
+ input AbsolutePressure p "Pressure";
+ input SpecificEntropy s "Specific entropy";
+ input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known";
+ output Temperature T "Temperature";
+ protected
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro;
+ algorithm
+ pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p, s);
+ T := pro.T;
+ annotation (Inline=true);
+ end temperature_ps;
+
+ redeclare function density_ps
+ "Computes density as a function of pressure and specific entropy"
+ extends Modelica.Icons.Function;
+ input AbsolutePressure p "Pressure";
+ input SpecificEntropy s "Specific entropy";
+ input FixedPhase phase=0 "2 for two-phase, 1 for one-phase, 0 if not known";
+ output Density d "Density";
+ protected
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro;
+ algorithm
+ pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p, s);
+ d := pro.d;
+ annotation (Inline=true);
+ end density_ps;
+
+ redeclare function extends pressure "Return pressure"
+ algorithm
+ p := state.p;
+ annotation (Inline=true);
+ end pressure;
+
+ redeclare function extends temperature "Return temperature"
+ algorithm
+ T := state.T;
+ annotation (Inline=true);
+ end temperature;
+
+ redeclare function extends density "Return density"
+ algorithm
+ d := state.d;
+ annotation (Inline=true);
+ end density;
+
+ redeclare function extends specificEnthalpy "Return specific enthalpy"
+ algorithm
+ h := state.h;
+ annotation (Inline=true);
+ end specificEnthalpy;
+
+ redeclare function extends specificInternalEnergy
+ "Return specific internal energy"
+ algorithm
+ u := state.h - state.p/state.d;
+ annotation (Inline=true);
+ end specificInternalEnergy;
+
+ redeclare function extends specificEntropy "Specific entropy"
+ protected
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro;
+ algorithm
+ pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(state.p, state.h);
+ s := pro.s;
+ annotation (Inline=true);
+ end specificEntropy;
+
+ redeclare function extends specificGibbsEnergy "Return specific Gibbs energy"
+ algorithm
+ g := state.h - state.T*specificEntropy(state);
+ annotation (Inline=true);
+ end specificGibbsEnergy;
+
+ redeclare function extends specificHelmholtzEnergy
+ "Return specific Helmholtz energy"
+ algorithm
+ f := state.h - state.p/state.d - state.T*specificEntropy(state);
+ annotation (Inline=true);
+ end specificHelmholtzEnergy;
+
+ redeclare function extends specificHeatCapacityCp
+ "Approximate specific heat capacity at constant pressure"
+ protected
+ constant Temperature dT=0.1;
+ algorithm
+ cp := (specificEnthalpy_pT(state.p, state.T + dT) - specificEnthalpy_pT(state.p, state.T - dT))/(2*dT);
+ annotation (Inline=true);
+ end specificHeatCapacityCp;
+
+ redeclare function extends specificHeatCapacityCv
+ "Approximate specific heat capacity at constant volume"
+ algorithm
+ cv := specificHeatCapacityCp(state);
+ annotation (Inline=true);
+ end specificHeatCapacityCv;
+
+ redeclare function extends velocityOfSound
+ "Velocity of sound is not available in the legacy C3H3F5 implementation"
+ algorithm
+ assert(false, "C3H3F5: velocityOfSound is not available in the legacy ThermoSysPro implementation");
+ a := 0;
+ end velocityOfSound;
+
+ redeclare function extends isentropicEnthalpy "Compute h(s,p)"
+ protected
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ps pro;
+ algorithm
+ pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ps(p_downstream, specificEntropy(refState));
+ h_is := pro.h;
+ annotation (Inline=true);
+ end isentropicEnthalpy;
+
+ redeclare function extends dynamicViscosity
+ "Dynamic viscosity is not available in the legacy C3H3F5 implementation"
+ algorithm
+ assert(false, "C3H3F5: dynamicViscosity is not available in the legacy ThermoSysPro implementation");
+ eta := 0;
+ end dynamicViscosity;
+
+ redeclare function extends thermalConductivity
+ "Thermal conductivity is not available in the legacy C3H3F5 implementation"
+ algorithm
+ assert(false, "C3H3F5: thermalConductivity is not available in the legacy ThermoSysPro implementation");
+ lambda := 0;
+ end thermalConductivity;
+
+ redeclare function extends surfaceTension
+ "Surface tension is not available in the legacy C3H3F5 implementation"
+ algorithm
+ assert(false, "C3H3F5: surfaceTension is not available in the legacy ThermoSysPro implementation");
+ sigma := 0;
+ end surfaceTension;
+
+ redeclare function extends saturationTemperature
+ "Saturation temperature"
+ algorithm
+ T := saturationTemperature_p(p);
+ annotation (Inline=true);
+ end saturationTemperature;
+
+ redeclare function extends saturationTemperature_derp
+ "Derivative of saturation temperature w.r.t. pressure"
+ protected
+ constant AbsolutePressure dp=1;
+ algorithm
+ dTp := (saturationTemperature_p(p + dp) - saturationTemperature_p(p - dp))/(2*dp);
+ annotation (Inline=true);
+ end saturationTemperature_derp;
+
+ redeclare function extends saturationPressure
+ "Saturation pressure"
+ protected
+ Temperature Tlow;
+ Temperature Thigh;
+ algorithm
+ Tlow := saturationTemperature_p(p_min);
+ Thigh := saturationTemperature_p(p_crit);
+
+ if T <= Tlow then
+ p := p_min;
+ elseif T >= Thigh then
+ p := p_crit;
+ else
+ p := Modelica.Math.Nonlinear.solveOneNonlinearEquation(
+ function saturationPressureResidual_p(T=T),
+ p_min,
+ p_crit);
+ end if;
+ end saturationPressure;
+
+ redeclare function setSat_p
+ "Return saturation properties from pressure"
+ extends Modelica.Icons.Function;
+ input AbsolutePressure p "Pressure";
+ output SaturationProperties sat "Saturation property record";
+ algorithm
+ sat := SaturationProperties(
+ psat=p,
+ Tsat=saturationTemperature_p(p));
+ annotation (Inline=true);
+ end setSat_p;
+
+ redeclare function setSat_T
+ "Return saturation properties from temperature"
+ extends Modelica.Icons.Function;
+ input Temperature T "Temperature";
+ output SaturationProperties sat "Saturation property record";
+ algorithm
+ sat := SaturationProperties(
+ psat=saturationPressure(T),
+ Tsat=T);
+ annotation (Inline=true);
+ end setSat_T;
+
+ redeclare function extends bubbleEnthalpy
+ "Boiling curve specific enthalpy"
+ protected
+ AbsolutePressure Pcalc;
+ algorithm
+ Pcalc := max(p_min, min(p_crit, sat.psat))/100000;
+ hl := 1000*(-0.0000039275*Pcalc^6 + 0.0004780040*Pcalc^5
+ - 0.0227439765*Pcalc^4 + 0.5370471515*Pcalc^3
+ - 6.6496487588*Pcalc^2 + 46.8685173786*Pcalc
+ + 166.7823742593);
+ annotation (Inline=true);
+ end bubbleEnthalpy;
+
+ redeclare function extends dewEnthalpy
+ "Dew curve specific enthalpy"
+ protected
+ AbsolutePressure Pcalc;
+ algorithm
+ Pcalc := max(p_min, min(p_crit, sat.psat))/100000;
+ hv := 1000*(-0.00000274*Pcalc^6 + 0.00032217*Pcalc^5
+ - 0.01489673*Pcalc^4 + 0.34258030*Pcalc^3
+ - 4.15381744*Pcalc^2 + 27.64876596*Pcalc
+ + 385.22149853);
+ annotation (Inline=true);
+ end dewEnthalpy;
+
+ redeclare function extends bubbleDensity
+ "Boiling curve density"
+ protected
+ AbsolutePressure Pcalc;
+ algorithm
+ Pcalc := max(p_min, min(p_crit, sat.psat))/100000;
+ dl := 0.0000057803*Pcalc^6 - 0.0007528646*Pcalc^5
+ + 0.0377373800*Pcalc^4 - 0.9314090824*Pcalc^3
+ + 11.9184348938*Pcalc^2 - 89.9582798898*Pcalc
+ + 1467.5902188299;
+ annotation (Inline=true);
+ end bubbleDensity;
+
+ redeclare function extends dewDensity
+ "Dew curve density"
+ protected
+ AbsolutePressure Pcalc;
+ algorithm
+ Pcalc := max(p_min, min(p_crit, sat.psat))/100000;
+ dv := 0.00000207*Pcalc^6 - 0.00019163*Pcalc^5
+ + 0.00675913*Pcalc^4 - 0.10924667*Pcalc^3
+ + 0.84661954*Pcalc^2 + 2.83415571*Pcalc
+ + 2.12959146;
+ annotation (Inline=true);
+ end dewDensity;
+
+ redeclare function extends bubbleEntropy
+ "Boiling curve specific entropy"
+ protected
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro;
+ algorithm
+ pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(sat.psat, bubbleEnthalpy(sat));
+ sl := pro.s;
+ annotation (Inline=true);
+ end bubbleEntropy;
+
+ redeclare function extends dewEntropy
+ "Dew curve specific entropy"
+ protected
+ ThermoSysPro.Properties.WaterSteam.Common.ThermoProperties_ph pro;
+ algorithm
+ pro := ThermoSysPro.Properties.C3H3F5.C3H3F5_Ph(sat.psat, dewEnthalpy(sat));
+ sv := pro.s;
+ annotation (Inline=true);
+ end dewEntropy;
+
+ redeclare function extends setBubbleState
+ "Set the thermodynamic state on the bubble line"
+ algorithm
+ state := setState_phX(sat.psat, bubbleEnthalpy(sat), fill(0, 0), phase);
+ annotation (Inline=true);
+ end setBubbleState;
+
+ redeclare function extends setDewState
+ "Set the thermodynamic state on the dew line"
+ algorithm
+ state := setState_phX(sat.psat, dewEnthalpy(sat), fill(0, 0), phase);
+ annotation (Inline=true);
+ end setDewState;
+
+ redeclare function extends dBubbleDensity_dPressure
+ "Bubble point density derivative"
+ algorithm
+ ddldp := 0;
+ annotation (Inline=true);
+ end dBubbleDensity_dPressure;
+
+ redeclare function extends dDewDensity_dPressure
+ "Dew point density derivative"
+ algorithm
+ ddvdp := 0;
+ annotation (Inline=true);
+ end dDewDensity_dPressure;
+
+ redeclare function extends dBubbleEnthalpy_dPressure
+ "Bubble point specific enthalpy derivative"
+ algorithm
+ dhldp := 0;
+ annotation (Inline=true);
+ end dBubbleEnthalpy_dPressure;
+
+ redeclare function extends dDewEnthalpy_dPressure
+ "Dew point specific enthalpy derivative"
+ algorithm
+ dhvdp := 0;
+ annotation (Inline=true);
+ end dDewEnthalpy_dPressure;
+
+ redeclare function extends density_derh_p
+ "Density derivative by specific enthalpy"
+ algorithm
+ ddhp := -1e6;
+ annotation (Inline=true);
+ end density_derh_p;
+
+ redeclare function extends density_derp_h
+ "Density derivative by pressure"
+ algorithm
+ ddph := 1e-8;
+ annotation (Inline=true);
+ end density_derp_h;
+
+ annotation (Documentation(info="
+
Copyright © EDF 2002 - 2024
+ThermoSysPro Version 4.1
+")); +end C3H3F5; diff --git a/ThermoSysPro/Properties/Media/C3H3F5/package.order b/ThermoSysPro/Properties/Media/C3H3F5/package.order new file mode 100644 index 00000000..5018ecc8 --- /dev/null +++ b/ThermoSysPro/Properties/Media/C3H3F5/package.order @@ -0,0 +1,59 @@ +p_min +p_crit +h_min +h_max +T_min +T_max +c3h3f5Constants +SaturationProperties +ThermodynamicState +saturationTemperature_p +temperatureResidual_h +saturationPressureResidual_p +BaseProperties +density_ph +temperature_ph +setState_phX +setState_psX +specificEnthalpy_pT +specificEnthalpy_pTX +density_pT +setState_pTX +setState_dTX +setSmoothState +temperature_ps +density_ps +pressure +temperature +density +specificEnthalpy +specificInternalEnergy +specificEntropy +specificGibbsEnergy +specificHelmholtzEnergy +specificHeatCapacityCp +specificHeatCapacityCv +velocityOfSound +isentropicEnthalpy +dynamicViscosity +thermalConductivity +surfaceTension +saturationTemperature +saturationTemperature_derp +saturationPressure +setSat_p +setSat_T +bubbleEnthalpy +dewEnthalpy +bubbleDensity +dewDensity +bubbleEntropy +dewEntropy +setBubbleState +setDewState +dBubbleDensity_dPressure +dDewDensity_dPressure +dBubbleEnthalpy_dPressure +dDewEnthalpy_dPressure +density_derh_p +density_derp_h diff --git a/ThermoSysPro/Properties/Media/DryAirIdealGas/package.mo b/ThermoSysPro/Properties/Media/DryAirIdealGas/package.mo new file mode 100644 index 00000000..8b0cc9af --- /dev/null +++ b/ThermoSysPro/Properties/Media/DryAirIdealGas/package.mo @@ -0,0 +1,254 @@ +within ThermoSysPro.Properties.Media; +package DryAirIdealGas "Dry air ideal gas medium using the legacy ThermoSysPro property functions" + + extends PartialThermoSysProMedium( + isCompressible=true, + mediumName="DryAirIdealGas", + substanceNames={"DryAirIdealGas"}, + singleState=false, + SpecificEnthalpy(start=3e5, nominal=3e5), + Density(start=1, nominal=1), + AbsolutePressure(start=1e5, nominal=1e5), + Temperature(start=300, nominal=300), + ThermoStates=Modelica.Media.Interfaces.Choices.IndependentVariables.ph); + + constant ThermoSysPro.Properties.DryAirIdealGas.DryAirIdealGas data; + constant FluidConstants dryAirConstants( + iupacName="Dry air", + casRegistryNumber="", + chemicalFormula="", + structureFormula="", + molarMass=data.molarMass); + constant FluidConstants fluidConstants[1]={dryAirConstants}; + + redeclare record extends ThermodynamicState + SpecificEnthalpy h; + Density d; + Temperature T; + AbsolutePressure p; + end ThermodynamicState; + + redeclare replaceable model extends BaseProperties( + h(stateSelect=StateSelect.prefer), + d(stateSelect=StateSelect.default), + T(stateSelect=StateSelect.default), + p(stateSelect=StateSelect.prefer)) + equation + T = ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + d = ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T); + u = h - data.specificGasConstant*T; + MM = fluidConstants[1].molarMass; + R_s = data.specificGasConstant; + state = ThermodynamicState( + p=p, + h=h, + T=T, + d=d); + end BaseProperties; + + redeclare function extends setState_phX + protected + Temperature T; + algorithm + T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T)); + annotation (Inline=true); + end setState_phX; + + redeclare function extends setState_pTX + protected + SpecificEnthalpy h; + algorithm + h := ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T)); + annotation (Inline=true); + end setState_pTX; + + redeclare function extends setState_psX + algorithm + assert(false, "DryAirIdealGas: setState_psX is not available in the legacy ThermoSysPro implementation"); + state := ThermodynamicState( + p=p, + h=0, + T=0, + d=0); + end setState_psX; + + redeclare function extends setState_dTX + algorithm + state := ThermodynamicState( + p=d*data.specificGasConstant*T, + h=ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T), + T=T, + d=d); + annotation (Inline=true); + end setState_dTX; + + redeclare function extends setSmoothState + import Modelica.Media.Common.smoothStep; + protected + SpecificEnthalpy h; + AbsolutePressure p; + Temperature T; + algorithm + h := smoothStep( + x, + state_a.h, + state_b.h, + x_small); + p := smoothStep( + x, + state_a.p, + state_b.p, + x_small); + T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + state := ThermodynamicState( + p=p, + h=h, + T=T, + d=ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T)); + annotation (Inline=true); + end setSmoothState; + + redeclare function extends pressure + algorithm + p := state.p; + annotation (Inline=true); + end pressure; + + redeclare function extends temperature + algorithm + T := state.T; + annotation (Inline=true); + end temperature; + + redeclare function extends density + algorithm + d := state.d; + annotation (Inline=true); + end density; + + redeclare function extends specificEnthalpy + algorithm + h := state.h; + annotation (Inline=true); + end specificEnthalpy; + + redeclare function extends specificInternalEnergy + algorithm + u := state.h - data.specificGasConstant*state.T; + annotation (Inline=true); + end specificInternalEnergy; + + redeclare function extends specificEntropy + algorithm + assert(false, "DryAirIdealGas: specificEntropy is not available in the legacy ThermoSysPro implementation"); + s := 0; + end specificEntropy; + + redeclare function extends specificGibbsEnergy + algorithm + g := state.h - state.T*specificEntropy(state); + end specificGibbsEnergy; + + redeclare function extends specificHelmholtzEnergy + algorithm + f := state.h - data.specificGasConstant*state.T - state.T*specificEntropy(state); + end specificHelmholtzEnergy; + + redeclare function extends specificHeatCapacityCp + algorithm + cp := ThermoSysPro.Properties.DryAirIdealGas.SpecificHeatCp_T(state.T); + annotation (Inline=true); + end specificHeatCapacityCp; + + redeclare function extends specificHeatCapacityCv + algorithm + cv := specificHeatCapacityCp(state) - data.specificGasConstant; + annotation (Inline=true); + end specificHeatCapacityCv; + + redeclare function extends dynamicViscosity + algorithm + eta := ThermoSysPro.Properties.DryAirIdealGas.DynamicViscosity_Trho(T=state.T, rho=state.d); + annotation (Inline=true); + end dynamicViscosity; + + redeclare function extends thermalConductivity + algorithm + lambda := ThermoSysPro.Properties.DryAirIdealGas.ThermalConductivity_Trho(T=state.T, rho=state.d); + annotation (Inline=true); + end thermalConductivity; + + redeclare function extends velocityOfSound + algorithm + a := sqrt(specificHeatCapacityCp(state)/specificHeatCapacityCv(state)*data.specificGasConstant*state.T); + annotation (Inline=true); + end velocityOfSound; + + redeclare function extends isentropicEnthalpy + algorithm + assert(false, "DryAirIdealGas: isentropicEnthalpy is not available in the legacy ThermoSysPro implementation"); + h_is := refState.h; + end isentropicEnthalpy; + + redeclare function specificEnthalpy_pTX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input Temperature T; + input MassFraction X[:]; + output SpecificEnthalpy h; + algorithm + h := ThermoSysPro.Properties.DryAirIdealGas.SpecificEnthalpy_T(T); + annotation (Inline=true); + end specificEnthalpy_pTX; + + redeclare function temperature_phX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input MassFraction X[:]; + output Temperature T; + algorithm + T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + annotation (Inline=true); + end temperature_phX; + + redeclare function density_phX + extends Modelica.Icons.Function; + input AbsolutePressure p; + input SpecificEnthalpy h; + input MassFraction X[:]; + output Density d; + protected + Temperature T; + algorithm + T := ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(h); + d := ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=p, T=T); + annotation (Inline=true); + end density_phX; + + redeclare function extends density_derh_p + protected + SpecificEnthalpy delta_h=0.01*state.h; + algorithm + ddhp := (ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=state.p, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(state.h + delta_h)) - ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=state.p, T=ThermoSysPro.Properties.DryAirIdealGas.Temperature_h(state.h - delta_h)))/(2*delta_h); + annotation (Inline=true); + end density_derh_p; + + redeclare function extends density_derp_h + protected + AbsolutePressure delta_P=0.0001*state.p; + algorithm + ddph := (ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=state.p + delta_P, T=state.T) - ThermoSysPro.Properties.DryAirIdealGas.Density_PT(P=state.p - delta_P, T=state.T))/(2*delta_P); + annotation (Inline=true); + end density_derp_h; +end DryAirIdealGas; diff --git a/ThermoSysPro/Properties/Media/DryAirIdealGas/package.order b/ThermoSysPro/Properties/Media/DryAirIdealGas/package.order new file mode 100644 index 00000000..79f7605f --- /dev/null +++ b/ThermoSysPro/Properties/Media/DryAirIdealGas/package.order @@ -0,0 +1,29 @@ +data +dryAirConstants +fluidConstants +ThermodynamicState +BaseProperties +setState_phX +setState_pTX +setState_psX +setState_dTX +setSmoothState +pressure +temperature +density +specificEnthalpy +specificInternalEnergy +specificEntropy +specificGibbsEnergy +specificHelmholtzEnergy +specificHeatCapacityCp +specificHeatCapacityCv +dynamicViscosity +thermalConductivity +velocityOfSound +isentropicEnthalpy +specificEnthalpy_pTX +temperature_phX +density_phX +density_derh_p +density_derp_h diff --git a/ThermoSysPro/Properties/Media/FlueGases/package.mo b/ThermoSysPro/Properties/Media/FlueGases/package.mo new file mode 100644 index 00000000..5deca97c --- /dev/null +++ b/ThermoSysPro/Properties/Media/FlueGases/package.mo @@ -0,0 +1,74 @@ +within ThermoSysPro.Properties.Media; +package FlueGases "Flue gases library inherited from Modelica.Media" + import Modelica.Media.Interfaces.Choices.ReferenceEnthalpy; + + extends PartialSubCMedium(nSubC=nC,isCompressible=true); + extends Modelica.Media.IdealGases.Common.MixtureGasNasa( + mediumName="MediaMonomeld", + data={Modelica.Media.IdealGases.Common.SingleGasesData.N2,Modelica.Media.IdealGases.Common.SingleGasesData.O2, + Modelica.Media.IdealGases.Common.SingleGasesData.H2O,Modelica.Media.IdealGases.Common.SingleGasesData.CO2, + Modelica.Media.IdealGases.Common.SingleGasesData.SO2}, + fluidConstants={Modelica.Media.IdealGases.Common.FluidData.N2,Modelica.Media.IdealGases.Common.FluidData.O2, + Modelica.Media.IdealGases.Common.FluidData.H2O,Modelica.Media.IdealGases.Common.FluidData.CO2, + Modelica.Media.IdealGases.Common.FluidData.SO2}, + substanceNames={"Nitrogen","Oxygen","Water","Carbondioxide","Sulfurdioxide"}, + reference_X={0.768,0.232,0.0,0.0,0.0}, + referenceChoice=ReferenceEnthalpy.UserDefined, + h_offset = hr - hr_FlueGases + Modelica.Media.IdealGases.Common.SingleGasesData.H2O.H0); + + constant Units.SI.SpecificEnthalpy hr=2501569 "ThermoSysPro Water/steam reference specific enthalpy at 0.01°C"; + constant Units.SI.SpecificEnthalpy hr_FlueGases=503298 "FlueGases reference specific enthalpy, computed from ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEnthalpy(state0) at (0.006112 bars, 0.01°C)"; + + redeclare function extends density_derh_p "Density derivative by specific enthalpy" + + protected + Units.SI.SpecificEntropy s "Flue gases specific entropy"; + Units.SI.Density rho "Flue gaases density"; + Units.SI.SpecificHeatCapacity cp "Specific heat capacity"; + Units.SI.SpecificHeatCapacity R "gas constant"; + Units.SI.DerDensityByEnthalpy drhodh + "Derivative of the density wrt. the specific enthalpy at constant pressure"; + + algorithm + s := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificEntropy(state); + rho := ThermoSysPro.Properties.ModelicaMediaFlueGases.density(state); + cp := ThermoSysPro.Properties.ModelicaMediaFlueGases.specificHeatCapacityCp(state); + R := ThermoSysPro.Properties.ModelicaMediaFlueGases.gasConstant(state); + + drhodh := -rho*rho*R/(state.p*cp); + ddhp := drhodh; + + annotation ( + smoothOrder=2, + Icon(graphics), + Documentation(info=" +Copyright © EDF 2002 - 2010
+ + +ThermoSysPro Version 2.0
+ +