From b36d1f218027831f37ac7b21a91c99473622e160 Mon Sep 17 00:00:00 2001 From: pepmts Date: Fri, 23 Sep 2022 16:23:11 +0200 Subject: [PATCH 1/4] removed adiabatic compression Signed-off-by: pepmts --- .../Partial/Machines/Pump.mo | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/MetroscopeModelingLibrary/Partial/Machines/Pump.mo b/MetroscopeModelingLibrary/Partial/Machines/Pump.mo index 27f9d254..6a110aab 100644 --- a/MetroscopeModelingLibrary/Partial/Machines/Pump.mo +++ b/MetroscopeModelingLibrary/Partial/Machines/Pump.mo @@ -3,9 +3,6 @@ partial model Pump extends BaseClasses.FlowModel(P_out_0=10e5) annotation(IconMap(primitivesVisible=false)); extends MetroscopeModelingLibrary.Icons.Machines.PumpIcon; - parameter Boolean adiabatic_compression=false - "true: compression at constant enthalpy - false: compression with varying enthalpy"; - import MetroscopeModelingLibrary.Units; import MetroscopeModelingLibrary.Units.Inputs; import MetroscopeModelingLibrary.Constants; @@ -45,26 +42,22 @@ partial model Pump rotation=-90, origin={0,108}))); equation - Qv_in = Q / Medium.density(state_in); - DP = rho*Constants.g*hn; - - if adiabatic_compression then - W = 0; - else - h_out-h_in = Constants.g*hn/rh; - end if; - - // Reduced rotational speed - R = VRot/VRotn; + // internal variables + Qv_in = Q / rho; // Volumic flow rate + R = VRot/VRotn; // Reduced rotational speed // Pump characteristics hn = a1*Qv_in^2 + a2*Qv_in*R + a3*R^2; rh = noEvent(max(if (R > 1e-5) then b1*Qv_in^2/R^2 + b2*Qv_in/R + b3 else b3, rhmin)); + // Outlet variation + DP = rho*Constants.g*hn; + h_out-h_in = Constants.g*hn/rh; + // Mechanical power Wm = C_power.W; // C_power.W is positive since it is power fed to the component Wm = W/rm; // Wm is positive since it is the power produced by the pump // Hydraulic power - Wh = Qv_in * DP / rh; + Wh = Qv_in * DP / rh; // = Qv_in*rho * g*hn/rh = Q * (h_out - h_in) = W end Pump; From 2921d91513b60875ca5008a04f75c1b730e2453b Mon Sep 17 00:00:00 2001 From: pepmts Date: Fri, 23 Sep 2022 16:25:22 +0200 Subject: [PATCH 2/4] corrected and simplified pump's test Signed-off-by: pepmts --- .../Tests/WaterSteam/Machines/Pump_direct.mo | 17 +++++-------- .../Tests/WaterSteam/Machines/Pump_reverse.mo | 25 ++++++++----------- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_direct.mo b/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_direct.mo index 06e4af5b..bc61c01f 100644 --- a/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_direct.mo +++ b/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_direct.mo @@ -10,13 +10,8 @@ model Pump_direct // Component parameters parameter Real pump_VRotn = 1400; - parameter Real pump_rm = 0.85; - parameter Real pump_a1 = -88.67; - parameter Real pump_a2 = 0; parameter Real pump_a3 = 43.15; - parameter Real pump_b1 = -3.7751; - parameter Real pump_b2 = 3.61; - parameter Real pump_b3 = -0.0075464; + parameter Real pump_b3 = 0.8; parameter Units.Yield pump_rhmin = 0.20; .MetroscopeModelingLibrary.WaterSteam.Machines.Pump pump annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); @@ -39,12 +34,12 @@ equation // Component parameters pump.VRotn = pump_VRotn; - pump.rm = pump_rm; - pump.a1 = pump_a1; - pump.a2 = pump_a2; + pump.rm = 0.85; + pump.a1 = 0; + pump.a2 = 0; pump.a3 = pump_a3; - pump.b1 = pump_b1; - pump.b2 = pump_b2; + pump.b1 = 0; + pump.b2 = 0; pump.b3 = pump_b3; pump.rhmin = pump_rhmin; diff --git a/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_reverse.mo b/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_reverse.mo index 835a2836..238c9a2d 100644 --- a/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_reverse.mo +++ b/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_reverse.mo @@ -3,18 +3,13 @@ model Pump_reverse extends MetroscopeModelingLibrary.Icons.Tests.WaterSteamTestIcon; // Boundary conditions - input Units.Pressure source_P(start=2.3e5); - input Units.Temperature source_T(start=7.8 + 273.15); + input Units.Pressure source_P(start=2e5); + input Units.Temperature source_T(start=20 + 273.15); input Units.NegativeMassFlowRate source_Q(start=-30); // Component parameters parameter Real pump_VRot = 1400; parameter Real pump_VRotn = 1400; - parameter Real pump_rm = 0.85; - parameter Real pump_a1 = -88.67; - parameter Real pump_a2 = 0; - parameter Real pump_b1 = -3.7751; - parameter Real pump_b2 = 3.61; parameter Units.Yield pump_rhmin = 0.20; // Calibrated parameters @@ -22,8 +17,8 @@ model Pump_reverse output Real pump_b3; // Calibration inputs - input Units.Pressure pump_P_out(start=2.31e5); - input Units.Temperature pump_T_out(start=7.801+ 273.15); + input Units.Pressure pump_P_out(start=6e5); + input Units.Temperature pump_T_out(start=20.05 + 273.15); .MetroscopeModelingLibrary.WaterSteam.Machines.Pump pump annotation (Placement(transformation(extent={{-10,-10},{10,10}}, origin={-30,0}))); .MetroscopeModelingLibrary.WaterSteam.BoundaryConditions.Source source annotation (Placement(transformation(extent={{-10,-10},{10,10}}, origin={-70,0}))); @@ -47,12 +42,12 @@ equation // Component parameters pump.VRotn = pump_VRotn; - pump.rm = pump_rm; - pump.a1 = pump_a1; - pump.a2 = pump_a2; - pump.b1 = pump_b1; - pump.b2 = pump_b2; - pump.rhmin = pump_rhmin; + pump.rm = 0.85; + pump.a1 = 0; + pump.a2 = 0; + pump.b1 = 0; + pump.b2 = 0; + pump.rhmin = 0.2; // Calibrated parameters pump.a3 = pump_a3; From aa67ed401469d53619dcd287f5b321b20bd50890 Mon Sep 17 00:00:00 2001 From: pepmts <97044708+pepmts@users.noreply.github.com> Date: Fri, 23 Sep 2022 16:33:30 +0200 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a01c3e7d..b1b43b68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,7 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added Example/ReheaterLine, direct and reverse, [PR#216](https://github.com/Metroscope-dev/metroscope-modeling-library/pull/216) ### Removed - + - Removed `adiabatic_compression` parameter in `Pump`, since it was not used [288](https://github.com/Metroscope-dev/metroscope-modeling-library/issues/288) : [PR #289](https://github.com/Metroscope-dev/metroscope-modeling-library/pull/289) ## MML3-DTG-V2 From 74edb1bf3841fc0533377001edb4cfe61d465bf9 Mon Sep 17 00:00:00 2001 From: Valentin Drouet Date: Wed, 26 Oct 2022 16:54:56 +0200 Subject: [PATCH 4/4] corrected values of unit tests --- .../Tests/WaterSteam/Machines/Pump_direct.mo | 10 +++++----- .../Tests/WaterSteam/Machines/Pump_reverse.mo | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_direct.mo b/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_direct.mo index bc61c01f..84647bc2 100644 --- a/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_direct.mo +++ b/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_direct.mo @@ -3,15 +3,15 @@ model Pump_direct extends MetroscopeModelingLibrary.Icons.Tests.WaterSteamTestIcon; // Boundary conditions - input Units.Pressure source_P(start=2e5); - input Units.Temperature source_T(start=20 + 273.15); - input Units.NegativeMassFlowRate source_Q(start=-100); + input Units.Pressure source_P(start=20e5); + input Units.Temperature source_T(start= 150 + 273.15); + input Units.NegativeMassFlowRate source_Q(start=-1000); input Real pump_VRot(start=1400); // Component parameters parameter Real pump_VRotn = 1400; - parameter Real pump_a3 = 43.15; - parameter Real pump_b3 = 0.8; + parameter Real pump_a3 = 444; + parameter Real pump_b3 = 0.93; parameter Units.Yield pump_rhmin = 0.20; .MetroscopeModelingLibrary.WaterSteam.Machines.Pump pump annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); diff --git a/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_reverse.mo b/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_reverse.mo index 238c9a2d..d37c11c5 100644 --- a/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_reverse.mo +++ b/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_reverse.mo @@ -3,9 +3,9 @@ model Pump_reverse extends MetroscopeModelingLibrary.Icons.Tests.WaterSteamTestIcon; // Boundary conditions - input Units.Pressure source_P(start=2e5); - input Units.Temperature source_T(start=20 + 273.15); - input Units.NegativeMassFlowRate source_Q(start=-30); + input Units.Pressure source_P(start=20e5); + input Units.Temperature source_T(start=150 + 273.15); + input Units.NegativeMassFlowRate source_Q(start=-1000); // Component parameters parameter Real pump_VRot = 1400; @@ -17,8 +17,8 @@ model Pump_reverse output Real pump_b3; // Calibration inputs - input Units.Pressure pump_P_out(start=6e5); - input Units.Temperature pump_T_out(start=20.05 + 273.15); + input Units.Pressure pump_P_out(start=60e5); + input Units.Temperature pump_T_out(start=150.5 + 273.15); .MetroscopeModelingLibrary.WaterSteam.Machines.Pump pump annotation (Placement(transformation(extent={{-10,-10},{10,10}}, origin={-30,0}))); .MetroscopeModelingLibrary.WaterSteam.BoundaryConditions.Source source annotation (Placement(transformation(extent={{-10,-10},{10,10}}, origin={-70,0})));