This package is similar to Buildings.Fluid.Movers.BaseClasses.Characteristics, but instead of head in meters H20, total pressure in Pascal is used. This makes the models applicable for fans as well since the flow models from Modelica.Fluid use the density of the medium model, such as the density of air instead of water, to convert head to pressure.
This package also contains higher order functions for power consumption and efficiency.
Name | Description |
---|---|
baseFlow | Base class for fan or pump flow characteristics |
basePower | Base class for fan or pump power consumption characteristics |
baseEfficiency | Base class for efficiency characteristics |
linearFlow | Linear flow characteristic |
quadraticFlow | Quadratic flow characteristic |
polynomialFlow | Polynomial flow characteristic |
linearPower | Linear power consumption characteristic |
quadraticPower | Quadratic power consumption characteristic |
polynomialPower | Polynomial power consumption characteristic |
constantEfficiency | Constant efficiency characteristic |
linearEfficiency | Linear efficiency characteristic |
quadraticEfficiency | Quadratic efficiency characteristic |
polynomialEfficiency | Polynomial efficiency characteristic |
solve | Wrapper for Modelica.Math.Matrices.solve |
der_solve | Derivative for function solve |
Examples | Examples to test implemenation of derivative function |
Type | Name | Default | Description |
---|---|---|---|
VolumeFlowRate | V_flow | Volumetric flow rate [m3/s] |
Type | Name | Description |
---|---|---|
Pressure | dp | Fan or pump total pressure [Pa] |
partial function baseFlow "Base class for fan or pump flow characteristics" extends Modelica.Icons.Function; input Modelica.SIunits.VolumeFlowRate V_flow "Volumetric flow rate"; output Modelica.SIunits.Pressure dp(displayUnit="Pa") "Fan or pump total pressure"; end baseFlow;
Type | Name | Default | Description |
---|---|---|---|
VolumeFlowRate | V_flow | Volumetric flow rate [m3/s] |
Type | Name | Description |
---|---|---|
Power | consumption | Power consumption [W] |
partial function basePower "Base class for fan or pump power consumption characteristics" extends Modelica.Icons.Function; input Modelica.SIunits.VolumeFlowRate V_flow "Volumetric flow rate"; output Modelica.SIunits.Power consumption "Power consumption"; end basePower;
Type | Name | Default | Description |
---|---|---|---|
VolumeFlowRate | V_flow | Volumetric flow rate [m3/s] |
Type | Name | Description |
---|---|---|
Real | eta | Efficiency |
partial function baseEfficiency "Base class for efficiency characteristics" extends Modelica.Icons.Function; input Modelica.SIunits.VolumeFlowRate V_flow "Volumetric flow rate"; output Real eta "Efficiency"; end baseEfficiency;
Type | Name | Default | Description |
---|---|---|---|
VolumeFlowRate | V_flow | Volumetric flow rate [m3/s] | |
VolumeFlowRate | V_flow_nominal[2] | Volume flow rate for two operating points (single fan or pump) [m3/s] | |
Pressure | dp_nominal[2] | Fan or pump total pressure for two operating points [Pa] |
Type | Name | Description |
---|---|---|
Pressure | dp | Fan or pump total pressure [Pa] |
function linearFlow "Linear flow characteristic" extends baseFlow;input Modelica.SIunits.VolumeFlowRate V_flow_nominal[2] "Volume flow rate for two operating points (single fan or pump)"; input Modelica.SIunits.Pressure dp_nominal[2](displayUnit="Pa") "Fan or pump total pressure for two operating points"; /* Linear system to determine the coefficients: dp_nominal[1] = c[1] + V_flow_nominal[1]*c[2]; dp_nominal[2] = c[1] + V_flow_nominal[2]*c[2]; */ protected Real c[2] = Buildings.Fluid.Movers.BaseClasses.Characteristics.solve( [ones(2),V_flow_nominal],dp_nominal) "Coefficients of linear total pressure curve"; algorithm // Flow equation: dp = q*c[1] + c[2]; dp := c[1] + V_flow*c[2]; end linearFlow;
Type | Name | Default | Description |
---|---|---|---|
VolumeFlowRate | V_flow | Volumetric flow rate [m3/s] | |
VolumeFlowRate | V_flow_nominal[3] | Volume flow rate for three operating points (single fan or pump) [m3/s] | |
Pressure | dp_nominal[3] | Fan or pump total pressure for three operating points [Pa] |
Type | Name | Description |
---|---|---|
Pressure | dp | Fan or pump total pressure [Pa] |
function quadraticFlow "Quadratic flow characteristic" extends baseFlow;input Modelica.SIunits.VolumeFlowRate V_flow_nominal[3] "Volume flow rate for three operating points (single fan or pump)"; input Modelica.SIunits.Pressure dp_nominal[3](displayUnit="Pa") "Fan or pump total pressure for three operating points"; protected Real V_flow_nominal2[3] = {V_flow_nominal[1]^2,V_flow_nominal[2]^2, V_flow_nominal[3]^2} "Squared nominal flow rates"; /* Linear system to determine the coefficients: dp_nominal[1] = c[1] + V_flow_nominal[1]*c[2] + V_flow_nominal[1]^2*c[3]; dp_nominal[2] = c[1] + V_flow_nominal[2]*c[2] + V_flow_nominal[2]^2*c[3]; dp_nominal[3] = c[1] + V_flow_nominal[3]*c[2] + V_flow_nominal[3]^2*c[3]; */ Real c[3] = Buildings.Fluid.Movers.BaseClasses.Characteristics.solve( [ones(3), V_flow_nominal, V_flow_nominal2],dp_nominal) "Coefficients of quadratic total pressure curve"; algorithm // Flow equation: dp = c[1] + V_flow*c[2] + V_flow^2*c[3]; dp := c[1] + V_flow*c[2] + V_flow^2*c[3]; end quadraticFlow;
Type | Name | Default | Description |
---|---|---|---|
VolumeFlowRate | V_flow | Volumetric flow rate [m3/s] | |
VolumeFlowRate | V_flow_nominal[:] | Volume flow rate for N operating points (single fan or pump) [m3/s] | |
Pressure | dp_nominal[:] | Fan or pump total pressure for N operating points [Pa] |
Type | Name | Description |
---|---|---|
Pressure | dp | Fan or pump total pressure [Pa] |
function polynomialFlow "Polynomial flow characteristic" extends baseFlow;input Modelica.SIunits.VolumeFlowRate V_flow_nominal[:] "Volume flow rate for N operating points (single fan or pump)"; input Modelica.SIunits.Pressure dp_nominal[:](displayUnit="Pa") "Fan or pump total pressure for N operating points"; protected Integer N = size(V_flow_nominal,1) "Number of nominal operating points"; Real V_flow_nominal_pow[N,N] = {{V_flow_nominal[i]^(j-1) for j in 1:N} for i in 1:N} "Rows: different operating points; columns: increasing powers"; /* Linear system to determine the coefficients (example N=3): dp_nominal[1] = c[1] + V_flow_nominal[1]*c[2] + V_flow_nominal[1]^2*c[3]; dp_nominal[2] = c[1] + V_flow_nominal[2]*c[2] + V_flow_nominal[2]^2*c[3]; dp_nominal[3] = c[1] + V_flow_nominal[3]*c[2] + V_flow_nominal[3]^2*c[3]; */ Real c[N] = Buildings.Fluid.Movers.BaseClasses.Characteristics.solve( V_flow_nominal_pow,dp_nominal) "Coefficients of polynomial total pressure curve"; algorithm // Flow equation (example N=3): dp = c[1] + V_flow*c[2] + V_flow^2*c[3]; // Note: the implementation is numerically efficient only for low values of N dp := sum(V_flow^(i-1)*c[i] for i in 1:N); end polynomialFlow;
Type | Name | Default | Description |
---|---|---|---|
VolumeFlowRate | V_flow | Volumetric flow rate [m3/s] | |
VolumeFlowRate | V_flow_nominal[2] | Volume flow rate for two operating points (single fan or pump) [m3/s] | |
Power | W_nominal[2] | Power consumption for two operating points [W] |
Type | Name | Description |
---|---|---|
Power | consumption | Power consumption [W] |
function linearPower "Linear power consumption characteristic" extends basePower; input Modelica.SIunits.VolumeFlowRate V_flow_nominal[2] "Volume flow rate for two operating points (single fan or pump)"; input Modelica.SIunits.Power W_nominal[2] "Power consumption for two operating points"; /* Linear system to determine the coefficients: W_nominal[1] = c[1] + V_flow_nominal[1]*c[2]; W_nominal[2] = c[1] + V_flow_nominal[2]*c[2]; */ protected Real c[2] = Buildings.Fluid.Movers.BaseClasses.Characteristics.solve( [ones(3),V_flow_nominal],W_nominal) "Coefficients of linear power consumption curve"; algorithm consumption := c[1] + V_flow*c[2]; end linearPower;
Type | Name | Default | Description |
---|---|---|---|
VolumeFlowRate | V_flow | Volumetric flow rate [m3/s] | |
VolumeFlowRate | V_flow_nominal[3] | Volume flow rate for three operating points (single fan or pump) [m3/s] | |
Power | W_nominal[3] | Power consumption for three operating points [W] |
Type | Name | Description |
---|---|---|
Power | consumption | Power consumption [W] |
function quadraticPower "Quadratic power consumption characteristic" extends basePower; input Modelica.SIunits.VolumeFlowRate V_flow_nominal[3] "Volume flow rate for three operating points (single fan or pump)"; input Modelica.SIunits.Power W_nominal[3] "Power consumption for three operating points"; protected Real V_flow_nominal2[3] = {V_flow_nominal[1]^2,V_flow_nominal[2]^2, V_flow_nominal[3]^2} "Squared nominal flow rates"; /* Linear system to determine the coefficients: W_nominal[1] = c[1] + V_flow_nominal[1]*c[2] + V_flow_nominal[1]^2*c[3]; W_nominal[2] = c[1] + V_flow_nominal[2]*c[2] + V_flow_nominal[2]^2*c[3]; W_nominal[3] = c[1] + V_flow_nominal[3]*c[2] + V_flow_nominal[3]^2*c[3]; */ Real c[3] = Buildings.Fluid.Movers.BaseClasses.Characteristics.solve( [ones(3),V_flow_nominal,V_flow_nominal2],W_nominal) "Coefficients of quadratic power consumption curve"; algorithm consumption := c[1] + V_flow*c[2] + V_flow^2*c[3]; end quadraticPower;
Type | Name | Default | Description |
---|---|---|---|
VolumeFlowRate | V_flow | Volumetric flow rate [m3/s] | |
VolumeFlowRate | V_flow_nominal[:] | Volume flow rate for N operating points (single fan or pump) [m3/s] | |
Power | W_nominal[:] | Power consumption for N operating points [W] |
Type | Name | Description |
---|---|---|
Power | consumption | Power consumption [W] |
function polynomialPower "Polynomial power consumption characteristic" extends basePower; input Modelica.SIunits.VolumeFlowRate V_flow_nominal[:] "Volume flow rate for N operating points (single fan or pump)"; input Modelica.SIunits.Power W_nominal[:] "Power consumption for N operating points"; protected Integer N = size(V_flow_nominal,1) "Number of nominal operating points"; Real V_flow_nominal_pow[N,N] = {{V_flow_nominal[i]^(j-1) for j in 1:N} for i in 1:N} "Rows: different operating points; columns: increasing powers"; /* Linear system to determine the coefficients (example N=3): W_nominal[1] = c[1] + V_flow_nominal[1]*c[2] + V_flow_nominal[1]^2*c[3]; W_nominal[2] = c[1] + V_flow_nominal[2]*c[2] + V_flow_nominal[2]^2*c[3]; W_nominal[3] = c[1] + V_flow_nominal[3]*c[2] + V_flow_nominal[3]^2*c[3]; */ Real c[N] = Buildings.Fluid.Movers.BaseClasses.Characteristics.solve( V_flow_nominal_pow,W_nominal) "Coefficients of polynomial power consumption curve"; algorithm // Efficiency equation (example N=3): W = c[1] + V_flow*c[2] + V_flow^2*c[3]; // Note: the implementation is numerically efficient only for low values of N consumption := sum(V_flow^(i-1)*c[i] for i in 1:N); end polynomialPower;
Type | Name | Default | Description |
---|---|---|---|
VolumeFlowRate | V_flow | Volumetric flow rate [m3/s] | |
Real | eta_nominal | Nominal efficiency |
Type | Name | Description |
---|---|---|
Real | eta | Efficiency |
function constantEfficiency "Constant efficiency characteristic" extends baseEfficiency; input Real eta_nominal(min=0, max=1) "Nominal efficiency"; algorithm eta := eta_nominal; end constantEfficiency;
Type | Name | Default | Description |
---|---|---|---|
VolumeFlowRate | V_flow | Volumetric flow rate [m3/s] | |
VolumeFlowRate | V_flow_nominal[2] | Volume flow rate for two operating points (single fan or pump) [m3/s] | |
Real | eta_nominal[2] | Nominal efficiency |
Type | Name | Description |
---|---|---|
Real | eta | Efficiency |
function linearEfficiency "Linear efficiency characteristic" extends baseEfficiency; input Modelica.SIunits.VolumeFlowRate V_flow_nominal[2] "Volume flow rate for two operating points (single fan or pump)"; input Real eta_nominal[2](min=0, max=1) "Nominal efficiency"; /* Linear system to determine the coefficients: eta_nominal[1] = c[1] + V_flow_nominal[1]*c[2]; eta_nominal[2] = c[1] + V_flow_nominal[2]*c[2]; */ protected Real c[2] = Buildings.Fluid.Movers.BaseClasses.Characteristics.solve( [ones(2),V_flow_nominal],eta_nominal) "Coefficients of linear total efficiency curve"; algorithm // Efficiency equation: eta = q*c[1] + c[2]; eta := c[1] + V_flow*c[2]; end linearEfficiency;
Type | Name | Default | Description |
---|---|---|---|
VolumeFlowRate | V_flow | Volumetric flow rate [m3/s] | |
VolumeFlowRate | V_flow_nominal[3] | Volume flow rate for three operating points (single fan or pump) [m3/s] | |
Real | eta_nominal[3] | Nominal efficiency for three operating points |
Type | Name | Description |
---|---|---|
Real | eta | Efficiency |
function quadraticEfficiency "Quadratic efficiency characteristic" extends baseEfficiency; input Modelica.SIunits.VolumeFlowRate V_flow_nominal[3] "Volume flow rate for three operating points (single fan or pump)"; input Real eta_nominal[3](min=0, max=1) "Nominal efficiency for three operating points"; protected Real V_flow_nominal2[3] = {V_flow_nominal[1]^2,V_flow_nominal[2]^2, V_flow_nominal[3]^2} "Squared nominal flow rates"; /* Linear system to determine the coefficients: eta_nominal[1] = c[1] + V_flow_nominal[1]*c[2] + V_flow_nominal[1]^2*c[3]; eta_nominal[2] = c[1] + V_flow_nominal[2]*c[2] + V_flow_nominal[2]^2*c[3]; eta_nominal[3] = c[1] + V_flow_nominal[3]*c[2] + V_flow_nominal[3]^2*c[3]; */ Real c[3] = Buildings.Fluid.Movers.BaseClasses.Characteristics.solve( [ones(3), V_flow_nominal, V_flow_nominal2],eta_nominal) "Coefficients of quadratic efficiency curve"; algorithm // Efficiency equation: eta = c[1] + V_flow*c[2] + V_flow^2*c[3]; eta := c[1] + V_flow*c[2] + V_flow^2*c[3]; end quadraticEfficiency;
Type | Name | Default | Description |
---|---|---|---|
VolumeFlowRate | V_flow | Volumetric flow rate [m3/s] | |
VolumeFlowRate | V_flow_nominal[:] | Volume flow rate for N operating points (single fan or pump) [m3/s] | |
Real | eta_nominal[:] | Nominal efficiency for N operating points |
Type | Name | Description |
---|---|---|
Real | eta | Efficiency |
function polynomialEfficiency "Polynomial efficiency characteristic" extends baseEfficiency; input Modelica.SIunits.VolumeFlowRate V_flow_nominal[:] "Volume flow rate for N operating points (single fan or pump)"; input Real eta_nominal[:](min=0, max=1) "Nominal efficiency for N operating points"; protected Integer N = size(V_flow_nominal,1) "Number of nominal operating points"; Real V_flow_nominal_pow[N,N] = {{V_flow_nominal[i]^(j-1) for j in 1:N} for i in 1:N} "Rows: different operating points; columns: increasing powers"; /* Linear system to determine the coefficients (example N=3): eta_nominal[1] = c[1] + V_flow_nominal[1]*c[2] + V_flow_nominal[1]^2*c[3]; eta_nominal[2] = c[1] + V_flow_nominal[2]*c[2] + V_flow_nominal[2]^2*c[3]; eta_nominal[3] = c[1] + V_flow_nominal[3]*c[2] + V_flow_nominal[3]^2*c[3]; */ Real c[N] = Buildings.Fluid.Movers.BaseClasses.Characteristics.solve( V_flow_nominal_pow,eta_nominal) "Coefficients of polynomial total pressure curve"; algorithm // Efficiency equation (example N=3): eta = c[1] + V_flow*c[2] + V_flow^2*c[3]; // Note: the implementation is numerically efficient only for low values of N eta := sum(V_flow^(i-1)*c[i] for i in 1:N); end polynomialEfficiency;
Type | Name | Default | Description |
---|---|---|---|
Real | A[:, size(A, 1)] | ||
Real | x[size(A, 1)] |
Type | Name | Description |
---|---|---|
Real | b[size(A, 1)] |
function solve "Wrapper for Modelica.Math.Matrices.solve" annotation(derivative=Buildings.Fluid.Movers.BaseClasses.Characteristics.der_solve); input Real A[:,size(A,1)]; input Real x[size(A,1)]; output Real b[size(A,1)]; algorithm b:=Modelica.Math.Matrices.solve(A,x);end solve;
Type | Name | Default | Description |
---|---|---|---|
Real | A[:, size(A, 1)] | ||
Real | x[size(A, 1)] | ||
Real | Ader[:, size(A, 1)] | ||
Real | xder[size(A, 1)] |
Type | Name | Description |
---|---|---|
Real | b[size(A, 1)] |
function der_solve "Derivative for function solve" input Real A[:,size(A,1)]; input Real x[size(A,1)]; input Real Ader[:,size(A,1)]; input Real xder[size(A,1)]; output Real b[size(A,1)]; algorithm b:=Modelica.Math.Matrices.solve(A,xder-Ader*Modelica.Math.Matrices.solve(A,x)); end der_solve;