diff --git a/CHANGELOG.md b/CHANGELOG.md index f6074bec..1904e8c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,7 +37,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 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; diff --git a/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_direct.mo b/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_direct.mo index 06e4af5b..84647bc2 100644 --- a/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_direct.mo +++ b/MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_direct.mo @@ -3,20 +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_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_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}}))); @@ -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..d37c11c5 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.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; 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=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}))); @@ -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;