diff --git a/Buildings/Fluid/AirFilters/BaseClasses/Characteristics/FiltrationEfficiencyParameters.mo b/Buildings/Fluid/AirFilters/BaseClasses/Characteristics/FiltrationEfficiencyParameters.mo new file mode 100644 index 00000000000..46fed1e3b7a --- /dev/null +++ b/Buildings/Fluid/AirFilters/BaseClasses/Characteristics/FiltrationEfficiencyParameters.mo @@ -0,0 +1,28 @@ +within Buildings.Fluid.AirFilters.BaseClasses.Characteristics; +record FiltrationEfficiencyParameters + "Record for filtration efficiency verse relative mass of the contaminant captured by the filter" + extends Modelica.Icons.Record; + + parameter Real rat[:,:](each final max=1, each final min=0) + "Relative mass of the contaminant captured by the filter"; + parameter Real eps[:,:](each final max=1, each final min=0) + "Filtration efficiency"; + + annotation (Documentation(info=" +

+Data record that describes the relative mass of the contaminant rat that is captured by the filter when it has the filtration efficiency +specified as eps. +The elements of the vector rat should be in ascending order, +i.e.,rat[i] < rat[i+1]. +Both vectors, rat and eps +must have the same size. +

+", revisions=" + +")); +end FiltrationEfficiencyParameters; diff --git a/Buildings/Fluid/AirFilters/BaseClasses/Characteristics/package.mo b/Buildings/Fluid/AirFilters/BaseClasses/Characteristics/package.mo new file mode 100644 index 00000000000..bd1e9a00e61 --- /dev/null +++ b/Buildings/Fluid/AirFilters/BaseClasses/Characteristics/package.mo @@ -0,0 +1,9 @@ +within Buildings.Fluid.AirFilters.BaseClasses; +package Characteristics "Functions for filter characteristics" + +annotation (Documentation(info=" +

+This package implements performance curves for air filters. +

+")); +end Characteristics; diff --git a/Buildings/Fluid/AirFilters/BaseClasses/Characteristics/package.order b/Buildings/Fluid/AirFilters/BaseClasses/Characteristics/package.order new file mode 100644 index 00000000000..454d7257860 --- /dev/null +++ b/Buildings/Fluid/AirFilters/BaseClasses/Characteristics/package.order @@ -0,0 +1 @@ +FiltrationEfficiencyParameters diff --git a/Buildings/Fluid/AirFilters/BaseClasses/Data/Generic.mo b/Buildings/Fluid/AirFilters/BaseClasses/Data/Generic.mo new file mode 100644 index 00000000000..d1180b77708 --- /dev/null +++ b/Buildings/Fluid/AirFilters/BaseClasses/Data/Generic.mo @@ -0,0 +1,31 @@ +within Buildings.Fluid.AirFilters.BaseClasses.Data; +record Generic "Generic data record for air filters" + extends Modelica.Icons.Record; + parameter Real mCon_nominal( + final unit = "kg") + "Maximum mass of the contaminant that can be captured by the filter"; + parameter String substanceName[:] = {"CO2"} + "Name of trace substance"; + parameter + Buildings.Fluid.AirFilters.BaseClasses.Characteristics.FiltrationEfficiencyParameters + filEffPar + "Filtration efficiency versus relative mass of the contaminant"; + parameter Real b = 1.1 + "Resistance coefficient"; + annotation ( + defaultComponentPrefixes = "parameter", + defaultComponentName = "per", + Documentation(revisions=" + +", info=" +

Record that contains performance parameters for air filters.

+

It is used as a template of performance data for the filter models in Buildings.Fluid.AirFilters.

+

The record includes a dataset that relates the mass of the captured contaminants to the filter's filtration efficiency (see Buildings.Fluid.AirFilters.BaseClasses.FiltrationEfficiency).

+

The record also contains a parameter that defines how the pressure drop changes with the mass of the captured contaminants (see Buildings.Fluid.AirFilters.BaseClasses.FlowCoefficientCorrection).

+")); +end Generic; diff --git a/Buildings/Fluid/AirFilters/BaseClasses/Data/package.mo b/Buildings/Fluid/AirFilters/BaseClasses/Data/package.mo new file mode 100644 index 00000000000..a93fb3fa67a --- /dev/null +++ b/Buildings/Fluid/AirFilters/BaseClasses/Data/package.mo @@ -0,0 +1,10 @@ +within Buildings.Fluid.AirFilters.BaseClasses; +package Data "Performance data for air filters" +extends Modelica.Icons.MaterialPropertiesPackage; + +annotation (Documentation(info=" +

+This package contains data for air filters. +

+")); +end Data; diff --git a/Buildings/Fluid/AirFilters/BaseClasses/Data/package.order b/Buildings/Fluid/AirFilters/BaseClasses/Data/package.order new file mode 100644 index 00000000000..8470d611953 --- /dev/null +++ b/Buildings/Fluid/AirFilters/BaseClasses/Data/package.order @@ -0,0 +1 @@ +Generic diff --git a/Buildings/Fluid/AirFilters/BaseClasses/FiltrationEfficiency.mo b/Buildings/Fluid/AirFilters/BaseClasses/FiltrationEfficiency.mo index 2b214637a70..f0d3f182ea7 100644 --- a/Buildings/Fluid/AirFilters/BaseClasses/FiltrationEfficiency.mo +++ b/Buildings/Fluid/AirFilters/BaseClasses/FiltrationEfficiency.mo @@ -1,37 +1,47 @@ within Buildings.Fluid.AirFilters.BaseClasses; model FiltrationEfficiency "Component that calculates the filtration efficiency" + parameter Real mCon_nominal( - final unit="kg") - "Maximum mass of the contaminant can be captured by the filter"; - parameter Real epsFun[:] - "Filtration efficiency curve"; + final unit = "kg") + "Maximum mass of the contaminant that can be captured by the filter"; + parameter String substanceName[:] = {"CO2"} + "Name of trace substance"; + parameter + Buildings.Fluid.AirFilters.BaseClasses.Characteristics.FiltrationEfficiencyParameters + filEffPar + "Filtration efficiency versus relative mass of the contaminant"; Buildings.Controls.OBC.CDL.Interfaces.RealInput mCon( final unit="kg") "Mass of the contaminant captured by the filter" annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - Buildings.Controls.OBC.CDL.Interfaces.RealOutput y( - final unit="1", - final min=0, - final max=1) - "Filtration efficiency" + Buildings.Controls.OBC.CDL.Interfaces.RealOutput y[nConSub]( + each final unit="1", + each final min=0, + each final max=1) "Filtration efficiency" annotation (Placement(transformation(extent={{100,-80},{140,-40}}))); Buildings.Controls.OBC.CDL.Interfaces.RealOutput rat( - final unit="1", - final min=0, - final max=1) + each final unit="1", + each final min=0, + each final max=1) "Relative mass of the contaminant captured by the filter" annotation (Placement(transformation(extent={{100,40},{140,80}}))); - +protected + parameter Integer nConSub = size(substanceName,1) + "Total types of contaminant substances"; equation - rat = Buildings.Utilities.Math.Functions.smoothMin(x1=1, x2= mCon/mCon_nominal, deltaX=0.1); - y = Buildings.Utilities.Math.Functions.polynomial(a=epsFun, x=rat); - assert( - y > 0 and y < 1, - "In " + getInstanceName() + ": The filter efficiency has to be in the range of [0, 1], - check the filter efficiency curve.", - level=AssertionLevel.error); - + rat = Buildings.Utilities.Math.Functions.smoothMin( + x1=1, + x2= mCon/mCon_nominal, + deltaX=0.1) + "Calculate the relative mass of the contaminant captured by the filter"; + for i in 1:nConSub loop + y[i] = Buildings.Utilities.Math.Functions.smoothInterpolation( + x=rat, + xSup=filEffPar.rat[i], + ySup=filEffPar.eps[i]) + "Calculate the filtration efficiency"; + end for; annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ Rectangle( extent={{-100,100},{100,-100}}, @@ -46,28 +56,26 @@ annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ defaultComponentName="eps", Documentation(info="

-This model calculates the filtration efficiency, eps, by -

-

-eps = epsFun1 + epsFun2rat + epsFun3 rat2 + ..., -

-

-where the coefficients epsFuni are declared by the parameter epsFun; +This model calculates the filtration efficiency, eps, using cubic Hermite spline interpolation of +the filter dataset (see + +Buildings.Fluid.AirFilters.BaseClasses.Characteristics.filtrationEfficiencyParameters) +with respect to rat.

-The rat is the relative mass of the contaminant captured by the filter +The rat is the relative mass of the contaminant that is captured by the filter, and is calculated by

rat = mCon/mCon_nominal,

-where mCon is the mass of the contaminant captured by the filter, -mCon_nominal is the maximum mass of the contaminant captured by the filter. +where mCon is the mass of the contaminant that is captured by the filter, and +mCon_nominal is the filter's maximum contaminant capacity.

Note: -The upper limit of rat is 1 and any value above it is overwritten by 1. +The upper limit of rat is 1 and any value exceeding 1 will be capped at 1.

", revisions="