From fc1a554634ca06b906e358a214709181734002b2 Mon Sep 17 00:00:00 2001
From: Michael Wetter
Data record for performance data that describe volume flow rate versus
@@ -31,7 +38,8 @@ First implementation.
record flowParametersInternal
"Record for flow parameters with prescribed size"
extends Modelica.Icons.Record;
- parameter Integer n "Number of elements in each array";
+ parameter Integer n "Number of elements in each array"
+ annotation(Evaluate=true);
parameter Modelica.SIunits.VolumeFlowRate V_flow[n](each min=0)
"Volume flow rate at user-selected operating points";
parameter Modelica.SIunits.Pressure dp[n](
@@ -69,11 +77,12 @@ First implementation.
record efficiencyParameters "Record for efficiency parameters"
extends Modelica.Icons.Record;
- parameter Real r_V[:](each min=0, each max=1, each displayUnit="1")
- "Volumetric flow rate divided by nominal flow rate at user-selected operating points";
- parameter Real eta[size(r_V,1)](
- each min=0, each max=1, each displayUnit="1")
- "Fan or pump efficiency at these flow rates";
+ parameter Modelica.SIunits.VolumeFlowRate V_flow[:](
+ each min=0) "Volumetric flow rate at user-selected operating points";
+ parameter Real eta[size(V_flow,1)](
+ each min=0,
+ each max=1,
+ each displayUnit="1") "Fan or pump efficiency at these flow rates";
annotation (Documentation(info="
Data record for performance data that describe volume flow rate versus
@@ -96,10 +105,10 @@ First implementation.
record powerParameters "Record for electrical power parameters"
extends Modelica.Icons.Record;
- parameter Modelica.SIunits.VolumeFlowRate V_flow[:](each min=0)= {0}
+ parameter Modelica.SIunits.VolumeFlowRate V_flow[:](each min=0)
"Volume flow rate at user-selected operating points";
- parameter Modelica.SIunits.Power P[size(V_flow,1)](
- each min=0) = {0} "Fan or pump electrical power at these flow rates";
+ parameter Modelica.SIunits.Power P[size(V_flow,1)](each min=0)
+ "Fan or pump electrical power at these flow rates";
annotation (Documentation(info="
Data record for performance data that describe volume flow rate versus
@@ -129,7 +138,8 @@ First implementation.
"Flow vs. head characteristics for fan or pump pressure raise"
extends Modelica.Icons.Function;
input
- Annex60.Fluid.Movers.BaseClasses.Characteristics.flowParametersInternal data
+ Annex60.Fluid.Movers.BaseClasses.Characteristics.flowParametersInternal
+ per
"Pressure performance data";
input Modelica.SIunits.VolumeFlowRate V_flow "Volumetric flow rate";
input Real r_N(unit="1") "Relative revolution, r_N=N/N_nominal";
@@ -150,7 +160,7 @@ First implementation.
output Modelica.SIunits.Pressure dp "Pressure raise";
protected
- Integer dimD(min=2)=size(data.V_flow, 1) "Dimension of data vector";
+ Integer dimD(min=2)=size(per.V_flow, 1) "Dimension of data vector";
function performanceCurve "Performance curve away from the origin"
input Modelica.SIunits.VolumeFlowRate V_flow "Volumetric flow rate";
@@ -159,7 +169,7 @@ First implementation.
"Coefficients for polynomial of pressure vs. flow rate";
input
Annex60.Fluid.Movers.BaseClasses.Characteristics.flowParametersInternal
- data
+ per
"Pressure performance data";
input Integer dimD "Dimension of data vector";
@@ -175,17 +185,17 @@ First implementation.
// rat_nominal = V_flow_nominal/r_N_nominal = V_flow_nominal/1, we use
// V_flow_nominal below
for j in 1:dimD-1 loop
- if rat > data.V_flow[j] then
+ if rat > per.V_flow[j] then
i := j;
end if;
end for;
// Extrapolate or interpolate the data
dp:=r_N^2*Annex60.Utilities.Math.Functions.cubicHermiteLinearExtrapolation(
x=rat,
- x1=data.V_flow[i],
- x2=data.V_flow[i + 1],
- y1=data.dp[i],
- y2=data.dp[i + 1],
+ x1=per.V_flow[i],
+ x2=per.V_flow[i + 1],
+ y1=per.dp[i],
+ y2=per.dp[i + 1],
y1d=d[i],
y2d=d[i+1]);
annotation(smoothOrder=1);
@@ -194,7 +204,7 @@ First implementation.
algorithm
if r_N >= delta then
dp := performanceCurve(V_flow=V_flow, r_N=r_N, d=d,
- data=data, dimD=dimD);
+ per=per, dimD=dimD);
elseif r_N <= delta/2 then
dp := flowApproximationAtOrigin(r_N=r_N, V_flow=V_flow,
VDelta_flow= VDelta_flow, dpDelta=dpDelta,
@@ -202,12 +212,14 @@ First implementation.
else
dp := Modelica.Fluid.Utilities.regStep(x=r_N-0.75*delta,
y1=performanceCurve(V_flow=V_flow, r_N=r_N, d=d,
- data=data, dimD=dimD),
+ per=per, dimD=dimD),
y2=flowApproximationAtOrigin(r_N=r_N, V_flow=V_flow,
VDelta_flow=VDelta_flow, dpDelta=dpDelta,
delta=delta, cBar=cBar),
x_small=delta/4);
end if;
+ // linear equation for being able to handle r_N=0, see
+ // Annex60/Resources/Images/Fluid/Movers/UsersGuide/2013-IBPSA-Wetter.pdf
dp := dp - V_flow*kRes;
annotation(smoothOrder=1,
Documentation(info="
@@ -216,23 +228,26 @@ This function computes the fan static
pressure raise as a function of volume flow rate and revolution in the form
- Δp = rN2 s(V/rN, d)
+ Δp = rN2 s(V̇/rN, d)
- Δpr ,
where
Δp is the pressure rise,
rN is the normalized fan speed,
-V is the volume flow rate and
+V̇ is the volume flow rate and
d are performance data for fan or pump power consumption at rN=1.
The term
-Δpr = V Δpmax ⁄ Vmax δ
+Δpr = V̇ Δpmax ⁄ V̇max δ
+where δ > 0 is a pressure that is small compared to pressure raise of the
+fan at the nominal conditions,
models the flow resistance of the fan, approximated using a linear equation.
-This is done for numerical reasons to avoid a singularity at rN=0. Since δ is small, the contribution of this term is small.
+This is done for numerical reasons to avoid a singularity at rN=0.
+Since δ is small, the contribution of this term is small.
The fan and pump models in
Annex60.Fluid.Movers modify the user-supplied performance data to add the term
@@ -251,13 +266,18 @@ a singularity at the origin. The composite model is once continuously differenti
in all input variables.
@@ -292,39 +318,44 @@ First implementation.
function power "Flow vs. electrical power characteristics for fan or pump"
extends Modelica.Icons.Function;
- input Annex60.Fluid.Movers.BaseClasses.Characteristics.powerParameters data
+ input Annex60.Fluid.Movers.BaseClasses.Characteristics.powerParameters per
"Pressure performance data";
input Modelica.SIunits.VolumeFlowRate V_flow "Volumetric flow rate";
input Real r_N(unit="1") "Relative revolution, r_N=N/N_nominal";
input Real d[:] "Derivatives at support points for spline interpolation";
+ input Real delta "Small value for switching implementation around zero rpm";
output Modelica.SIunits.Power P "Power consumption";
protected
- Integer n=size(data.V_flow, 1) "Dimension of data vector";
+ Integer n=size(per.V_flow, 1) "Dimension of data vector";
Modelica.SIunits.VolumeFlowRate rat "Ratio of V_flow/r_N";
Integer i "Integer to select data interval";
algorithm
if n == 1 then
- P := r_N^3*data.P[1];
+ P := r_N^3*per.P[1];
else
i :=1;
- // Since the coefficients for the spline were evaluated for
- // rat_nominal = V_flow_nominal/r_N_nominal = V_flow_nominal/1, we use
- // V_flow_nominal below
+ // The use of the max function to avoids problems for low speeds
+ // and turned off pumps
+ rat:=V_flow/
+ Annex60.Utilities.Math.Functions.smoothMax(
+ x1=r_N,
+ x2=0.1,
+ deltaX=delta);
for j in 1:n-1 loop
- if V_flow > data.V_flow[j] then
+ if rat > per.V_flow[j] then
i := j;
end if;
end for;
// Extrapolate or interpolate the data
P:=r_N^3*Annex60.Utilities.Math.Functions.cubicHermiteLinearExtrapolation(
- x=V_flow,
- x1=data.V_flow[i],
- x2=data.V_flow[i + 1],
- y1=data.P[i],
- y2=data.P[i + 1],
+ x=rat,
+ x1=per.V_flow[i],
+ x2=per.V_flow[i + 1],
+ y1=per.P[i],
+ y2=per.P[i + 1],
y1d=d[i],
y2d=d[i+1]);
end if;
@@ -335,13 +366,13 @@ This function computes the fan power consumption for given volume flow rate,
speed and performance data. The power consumption is
- P = rN3 s(V, d),
+ P = rN3 s(V̇/rN, d),
where
P is the power consumption,
rN is the normalized fan speed,
-V is the volume flow rate and
+V̇ is the volume flow rate and
d are performance data for fan or pump power consumption at rN=1.
-"));
+"), smoothOrder=1);
end pressure;
function flowApproximationAtOrigin
@@ -272,6 +292,12 @@ First implementation.
"Coefficients for linear approximation of pressure vs. flow rate";
output Modelica.SIunits.Pressure dp "Pressure raise";
algorithm
+
+ // see equation 20 in Annex60/Resources/Images/Fluid/Movers/UsersGuide/2013-IBPSA-Wetter.pdf
+ // this equation satisfies the constraints detailed in the paper
+ // the first term is added for having a faster convergence
+ // the last term in the paper is absent here because it can be found in
+ // Annex60.Fluid.Movers.BaseClasses.Characteristics.pressure
dp := r_N * dpDelta + r_N^2 * (cBar[1] + cBar[2]*V_flow);
annotation (Documentation(info="
+Added more documentation references to paper
+
First implementation.
Implementation
@@ -353,42 +384,60 @@ If the data d define a monotone decreasing sequence, then
", revisions="
-"));
+"), smoothOrder=1);
end power;
function efficiency "Flow vs. efficiency characteristics for fan or pump"
extends Modelica.Icons.Function;
- input Annex60.Fluid.Movers.BaseClasses.Characteristics.efficiencyParameters
- data "Efficiency performance data";
- input Real r_V(unit="1")
- "Volumetric flow rate divided by nominal flow rate";
+ input
+ Annex60.Fluid.Movers.BaseClasses.Characteristics.efficiencyParameters
+ per "Efficiency performance data";
+ input Modelica.SIunits.VolumeFlowRate V_flow "Volumetric flow rate";
input Real d[:] "Derivatives at support points for spline interpolation";
+ input Real r_N(unit="1") "Relative revolution, r_N=N/N_nominal";
+ input Real delta "Small value for switching implementation around zero rpm";
output Real eta(min=0, unit="1") "Efficiency";
protected
- Integer n = size(data.r_V, 1) "Number of data points";
+ Integer n = size(per.V_flow, 1) "Number of data points";
+ Real rat "Ratio of V_flow/r_N";
Integer i "Integer to select data interval";
algorithm
if n == 1 then
- eta := data.eta[1];
+ eta := per.eta[1];
else
+ // The use of the max function to avoids problems for low speeds
+ // and turned off pumps
+ rat:=V_flow/
+ Annex60.Utilities.Math.Functions.smoothMax(
+ x1=r_N,
+ x2=0.1,
+ deltaX=delta);
i :=1;
for j in 1:n-1 loop
- if r_V > data.r_V[j] then
+ if rat > per.V_flow[j] then
i := j;
end if;
end for;
// Extrapolate or interpolate the data
eta:=Annex60.Utilities.Math.Functions.cubicHermiteLinearExtrapolation(
- x=r_V,
- x1=data.r_V[i],
- x2=data.r_V[i + 1],
- y1=data.eta[i],
- y2=data.eta[i + 1],
+ x=rat,
+ x1=per.V_flow[i],
+ x2=per.V_flow[i + 1],
+ y1=per.eta[i],
+ y2=per.eta[i + 1],
y1d=d[i],
y2d=d[i+1]);
end if;
@@ -400,12 +449,13 @@ This function computes the fan or pump efficiency for given normalized volume fl
and performance data. The efficiency is
+Changed polynomial to be evaluated at V_flow/r_N
+instead of V_flow
to properly account for the
+scaling law. See
+#202
+for a discussion and validation.
+
First implementation.
- η = s(rV, d), + η = s(V̇/rN, d),
where η is the efficiency, -rV is the normalized volume flow rate, and +rN is the normalized fan speed, +V̇ is the volume flow rate, and d are performance data for fan or pump efficiency.
V_flow
+instead of r_V
.
+r_V/r_N
+instead of r_V
to properly account for the
+scaling law. See
+#202
+for a discussion and validation.
+