Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <!--Make sure to add a link to the PR and issues related to your change-->

- 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

Expand Down
23 changes: 8 additions & 15 deletions MetroscopeModelingLibrary/Partial/Machines/Pump.mo
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
25 changes: 10 additions & 15 deletions MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_direct.mo
Original file line number Diff line number Diff line change
Expand Up @@ -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}})));
Expand All @@ -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;

Expand Down
27 changes: 11 additions & 16 deletions MetroscopeModelingLibrary/Tests/WaterSteam/Machines/Pump_reverse.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,22 @@ 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
output Real pump_a3;
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})));
Expand All @@ -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;
Expand Down