Skip to content

Commit

Permalink
Merge pull request #1881 from ibpsa/issue1880_moverEfficiencyFixAndVa…
Browse files Browse the repository at this point in the history
…lidationRework

Issue1880 mover efficiency fix and validation rework
  • Loading branch information
mwetter authored Jun 19, 2024
2 parents b794181 + 670a1db commit addf290
Show file tree
Hide file tree
Showing 32 changed files with 520 additions and 77 deletions.
29 changes: 17 additions & 12 deletions IBPSA/Fluid/Movers/BaseClasses/FlowMachineInterface.mo
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,15 @@ model FlowMachineInterface

Modelica.Blocks.Interfaces.RealOutput etaHyd(
final quantity="Efficiency",
final unit="1") "Hydraulic efficiency"
final unit="1",
start = 0.7) "Hydraulic efficiency"
annotation (Placement(transformation(extent={{100,-90},{120,-70}}),
iconTransformation(extent={{100,-90},{120,-70}})));

Modelica.Blocks.Interfaces.RealOutput etaMot(
final quantity="Efficiency",
final unit="1") "Motor efficiency"
final unit="1",
start = 0.7) "Motor efficiency"
annotation (Placement(transformation(extent={{100,-110},{120,-90}}),
iconTransformation(extent={{100,-110},{120,-90}})));

Expand Down Expand Up @@ -611,7 +613,7 @@ equation
P_internal=PEle;
eta_internal=eta;
WHyd = WFlo / IBPSA.Utilities.Math.Functions.smoothMax(
x1=etaMot, x2=1E-2, deltaX=1E-3);
x1=etaHyd, x2=1E-2, deltaX=1E-3);
end if;
if per.etaHydMet==
IBPSA.Fluid.Movers.BaseClasses.Types.HydraulicEfficiencyMethod.Power_VolumeFlowRate then
Expand Down Expand Up @@ -642,21 +644,15 @@ equation
else
eta_internal = cha.efficiency(per=per.efficiency, V_flow=V_flow, d=etaDer, r_N=r_N, delta=delta);
end if;
if per.powerOrEfficiencyIsHydraulic then
P_internal=WFlo/IBPSA.Utilities.Math.Functions.smoothMax(
x1=eta_internal, x2=1E-2, deltaX=1E-3);
else
P_internal=WHyd/IBPSA.Utilities.Math.Functions.smoothMax(
x1=eta_internal, x2=1E-2, deltaX=1E-3);
end if;
P_internal=WFlo/IBPSA.Utilities.Math.Functions.smoothMax(
x1=eta_internal, x2=1E-2, deltaX=1E-3);
else // Not provided
if per.powerOrEfficiencyIsHydraulic then
eta_internal=0.7;
P_internal=WFlo/eta_internal;
else
eta_internal=0.49;
P_internal=WHyd/eta_internal;
end if;
P_internal=WFlo/eta_internal;
end if;

// Motor efficiency etaMot
Expand Down Expand Up @@ -865,6 +861,15 @@ See discussions and an example of this situation in
revisions="<html>
<ul>
<li>
May 15, 2024, by Hongxiang Fu:<br/>
Corrected efficiency equations if
<code>powerOrEfficiencyIsHydraulic=false</code>
and specified the <code>start</code> attribute for <code>etaHyd</code>
and <code>etaMot</code> to suppress a warning.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1880\">IBPSA, #1880</a>.
</li>
<li>
August 8, 2022, by Hongxiang Fu:<br/>
<ul>
<li>
Expand Down
13 changes: 6 additions & 7 deletions IBPSA/Fluid/Movers/BaseClasses/Validation/EulerComparison.mo
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,13 @@ Its results of calculated efficiency and power are compared with those obtained
using power curves.
</p>
<p>
Note that full performance curves are needed in this validation model
because otherwise
Note that the power curve is still provided because it is required by
<a href=\"modelica://IBPSA.Fluid.Movers.BaseClasses.FlowMachineInterface\">
IBPSA.Fluid.Movers.BaseClasses.FlowMachineInterface</a>
would not know the pressure of the mover.
See <a href=\"modelica://IBPSA.Fluid.Movers.Validation.PowerEuler\">
IBPSA.Fluid.Movers.Validation.PowerEuler</a>
for a more typical use case where only the peak point itself is supplied.
IBPSA.Fluid.Movers.BaseClasses.FlowMachineInterface</a>.
See <a href=\"modelica://IBPSA.Fluid.Movers.Validation.ComparePowerHydraulic\">
IBPSA.Fluid.Movers.Validation.ComparePowerHydraulic</a>
for a use case where the mover model is agnostic to the power curve and
only the peak values are provided.
</p>
</html>", revisions="<html>
<ul>
Expand Down
44 changes: 17 additions & 27 deletions IBPSA/Fluid/Movers/UsersGuide.mo
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,10 @@ motor part load ratio requires knowing the nominal power.
** The models will ignore this record if the pressure curve is not provided
and the speed is unknown. This is because the models wouldn't be able
to compute the elctrical power correctly using similarity laws without speed.
In this case the user can mitigate the error by providing other information for
hydraulic efficiency. Compare validation models
<a href=\"modelica://IBPSA.Fluid.Movers.Validation.PowerSimplified\">
IBPSA.Fluid.Movers.Validation.PowerSimplified</a>,
<a href=\"modelica://IBPSA.Fluid.Movers.Validation.PowerExact\">
IBPSA.Fluid.Movers.Validation.PowerExact</a>,
and
<a href=\"modelica://IBPSA.Fluid.Movers.Validation.PowerEuler\">
IBPSA.Fluid.Movers.Validation.PowerEuler</a>
as an example.
In this case the user should consider using the preconfigured mover models in
<a href=\"modelica://IBPSA.Fluid.Movers.Preconfigured\">
IBPSA.Fluid.Movers.Preconfigured</a>
which will auto-populate a pressure curve from nominal flow rate and pressure.
</li>
</ul>
<p>
Expand Down Expand Up @@ -216,6 +210,11 @@ i.e., the fan or pump has idealized perfect control and infinite capacity.
Using these models that take as an input the head or the mass flow rate often leads
to smaller system of equations compared to using the models that take
as an input the speed.
The validation model
<a href=\"modelica://IBPSA.Fluid.Movers.Validation.ComparePowerInput\">
IBPSA.Fluid.Movers.Validation.ComparePowerInput</a>
demonstrates that the models with different input signals produce the same
power consumption estimates.
</p>
<p>
These models can be configured for three different control inputs.
Expand Down Expand Up @@ -461,10 +460,6 @@ constant. If the array has more than one element, the efficiency is interpolated
or extrapolated using
<a href=\"Modelica://IBPSA.Fluid.Movers.BaseClasses.Characteristics.efficiency\">
IBPSA.Fluid.Movers.BaseClasses.Characteristics.efficiency</a>.
See
<a href=\"Modelica://IBPSA.Fluid.Movers.Validation.PowerSimplified\">
IBPSA.Fluid.Movers.Validation.PowerSimplified</a>
as an example.
</li>
<li>
<code>Power_VolumeFlowRate</code> -
Expand All @@ -473,10 +468,6 @@ The power is interpolated or extrapolated using
<a href=\"Modelica://IBPSA.Fluid.Movers.BaseClasses.Characteristics.power\">
IBPSA.Fluid.Movers.BaseClasses.Characteristics.power</a>.
<i>&eta;<sub>hyd</sub></i> is then computed from <i>W&#775;<sub>hyd</sub></i>.
See
<a href=\"Modelica://IBPSA.Fluid.Movers.Validation.PowerExact\">
IBPSA.Fluid.Movers.Validation.PowerExact</a>
as an example.
</li>
<li>
<b><code>EulerNumber</code> (default 1)</b> -
Expand Down Expand Up @@ -523,11 +514,6 @@ IBPSA.Fluid.Movers.Examples.StaticReset</a>
specifies the peak point directly.
</li>
<li>
<a href=\"modelica://IBPSA.Fluid.Movers.Validation.PowerEuler\">
IBPSA.Fluid.Movers.Validation.PowerEuler</a>
explictly calls the function.
</li>
<li>
<a href=\"modelica://IBPSA.Fluid.Movers.BaseClasses.Validation.EulerComparison\">
IBPSA.Fluid.Movers.BaseClasses.Validation.EulerComparison</a>
implicitly calls the function when
Expand Down Expand Up @@ -571,9 +557,11 @@ The model uses a constant value <i>&eta;<sub>hyd</sub>=0.7</i>.
</ul>
<p>
These options are tested in
These options are validated in
<a href=\"modelica://IBPSA.Fluid.Movers.BaseClasses.Validation.HydraulicEfficiencyMethods\">
IBPSA.Fluid.Movers.BaseClasses.Validation.HydraulicEfficiencyMethods</a>.
IBPSA.Fluid.Movers.BaseClasses.Validation.HydraulicEfficiencyMethods</a> and
<a href=\"modelica://IBPSA.Fluid.Movers.Validation.ComparePowerHydraulic\">
IBPSA.Fluid.Movers.Validation.ComparePowerHydraulic</a>.
</p>
<p>
The model uses <code>EulerNumber</code> as the default option
Expand All @@ -587,9 +575,11 @@ This changes the default constant value to <i>&eta;=0.49</i> and also imposes
an additional constraint of <i>&eta;<sub>hyd</sub> &le; 1</i> to prevent the division
<i>&eta;<sub>hyd</sub> = &eta; &frasl; &eta;<sub>mot</sub></i>
from producing efficiency values larger than one.
This configuration is tested in
This configuration is validated in
<a href=\"modelica://IBPSA.Fluid.Movers.BaseClasses.Validation.TotalEfficiencyMethods\">
IBPSA.Fluid.Movers.BaseClasses.Validation.TotalEfficiencyMethods</a>.
IBPSA.Fluid.Movers.BaseClasses.Validation.TotalEfficiencyMethods</a> and
<a href=\"modelica://IBPSA.Fluid.Movers.Validation.ComparePowerTotal\">
IBPSA.Fluid.Movers.Validation.ComparePowerTotal</a>.
</p>
<p>
Although the Euler number method is defined for <i>&eta;<sub>hyd</sub></i>,
Expand Down
125 changes: 125 additions & 0 deletions IBPSA/Fluid/Movers/Validation/BaseClasses/ComparePower.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
within IBPSA.Fluid.Movers.Validation.BaseClasses;
model ComparePower
"Base class for validation models that compare power estimation methods"

package Medium = IBPSA.Media.Water "Medium model";

replaceable parameter IBPSA.Fluid.Movers.Data.Generic per
constrainedby IBPSA.Fluid.Movers.Data.Generic
"Performance records"
annotation (Placement(transformation(extent={{60,60},{80,80}})));

parameter Modelica.Units.SI.MassFlowRate m_flow_nominal =
per.peak.V_flow * rho_default
"Nominal mass flow rate";
parameter Modelica.Units.SI.PressureDifference dp_nominal =
per.peak.dp
"Nominal pressure drop";
final parameter Modelica.Units.SI.Density rho_default=
Medium.density_pTX(
p=Medium.p_default,
T=Medium.T_default,
X=Medium.X_default) "Default medium density";

replaceable IBPSA.Fluid.Movers.BaseClasses.PartialFlowMachine mov1
constrainedby IBPSA.Fluid.Movers.BaseClasses.PartialFlowMachine
"Mover (fan or pump)"
annotation (Placement(transformation(extent={{-40,30},{-20,50}})));
replaceable IBPSA.Fluid.Movers.BaseClasses.PartialFlowMachine mov2
constrainedby IBPSA.Fluid.Movers.BaseClasses.PartialFlowMachine
"Mover (fan or pump)"
annotation (Placement(transformation(extent={{-40,-30},{-20,-10}})));
replaceable IBPSA.Fluid.Movers.BaseClasses.PartialFlowMachine mov3
constrainedby IBPSA.Fluid.Movers.BaseClasses.PartialFlowMachine
"Mover (fan or pump)"
annotation (Placement(transformation(extent={{-40,-80},{-20,-60}})));

IBPSA.Fluid.Actuators.Dampers.Exponential damExp1(
redeclare final package Medium = Medium,
final m_flow_nominal=m_flow_nominal,
use_inputFilter=false,
final dpDamper_nominal=dp_nominal/2,
y_start=1,
final dpFixed_nominal=dp_nominal/2) "Damper"
annotation (Placement(transformation(extent={{40,30},{60,50}})));
IBPSA.Fluid.Actuators.Dampers.Exponential damExp2(
redeclare final package Medium = Medium,
final m_flow_nominal=m_flow_nominal,
use_inputFilter=false,
final dpDamper_nominal=dp_nominal/2,
y_start=1,
final dpFixed_nominal=dp_nominal/2) "Damper"
annotation (Placement(transformation(extent={{40,-30},{60,-10}})));
IBPSA.Fluid.Actuators.Dampers.Exponential damExp3(
redeclare final package Medium = Medium,
final m_flow_nominal=m_flow_nominal,
use_inputFilter=false,
final dpDamper_nominal=dp_nominal/2,
y_start=1,
final dpFixed_nominal=dp_nominal/2) "Damper"
annotation (Placement(transformation(extent={{40,-80},{60,-60}})));

IBPSA.Fluid.Sources.Boundary_pT sou(
redeclare final package Medium = Medium,
nPorts=3)
"Source"
annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
IBPSA.Fluid.Sources.Boundary_pT sin(
redeclare final package Medium = Medium,
nPorts=3)
"Sink" annotation (Placement(transformation(extent={{100,-10},{80,10}})));
Modelica.Blocks.Sources.Ramp ramSpe(
height=1,
duration=60,
startTime=20) "Ramp signal for mover speed"
annotation (Placement(transformation(extent={{-80,70},{-60,90}})));
Modelica.Blocks.Sources.Ramp ramDam(
height=-1,
duration=60,
offset=1,
startTime=120) "Ramp signal for damper position"
annotation (Placement(transformation(extent={{0,70},{20,90}})));

equation
connect(sou.ports[1], mov1.port_a)
annotation (Line(points={{-80,-1.33333},{-80,40},{-40,40}},
color={0,127,255}));
connect(sou.ports[2], mov2.port_a)
annotation (Line(points={{-80,0},{-80,-20},{-40,-20}}, color={0,127,255}));
connect(sou.ports[3], mov3.port_a) annotation (Line(points={{-80,1.33333},{-78,
1.33333},{-78,0},{-80,0},{-80,-70},{-40,-70}}, color={0,127,255}));
connect(damExp1.port_b, sin.ports[1]) annotation (Line(points={{60,40},{80,40},
{80,-1.33333}},color={0,127,255}));
connect(ramDam.y, damExp1.y)
annotation (Line(points={{21,80},{50,80},{50,52}}, color={0,0,127}));
connect(mov2.port_b, damExp2.port_a)
annotation (Line(points={{-20,-20},{40,-20}}, color={0,127,255}));
connect(damExp2.port_b, sin.ports[2])
annotation (Line(points={{60,-20},{80,-20},{80,0}}, color={0,127,255}));
connect(mov3.port_b, damExp3.port_a)
annotation (Line(points={{-20,-70},{40,-70}}, color={0,127,255}));
connect(damExp3.port_b, sin.ports[3]) annotation (Line(points={{60,-70},{80,-70},
{80,1.33333}}, color={0,127,255}));
connect(ramDam.y, damExp2.y) annotation (Line(points={{21,80},{30,80},{30,0},
{50,0},{50,-8}}, color={0,0,127}));
connect(ramDam.y, damExp3.y) annotation (Line(points={{21,80},{30,80},{30,-50},
{50,-50},{50,-58}}, color={0,0,127}));
connect(mov1.port_b, damExp1.port_a)
annotation (Line(points={{-20,40},{40,40}}, color={0,127,255}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
coordinateSystem(preserveAspectRatio=false)),
Documentation(info="<html>
<p>
This is the base class for a number of validation models that compare
power computation of different mover model configurations.
</p>
</html>", revisions="<html>
<ul>
<li>
May 15, 2024, by Hongxiang Fu:<br/>
First implementation. This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1880\">IBPSA, #1880</a>.
</li>
</ul>
</html>"));
end ComparePower;
1 change: 1 addition & 0 deletions IBPSA/Fluid/Movers/Validation/BaseClasses/package.order
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ComparePower
ControlledFlowMachine
FlowMachine_ZeroFlow
Loading

0 comments on commit addf290

Please sign in to comment.