diff --git a/BESMod/Examples/BAUSimStudy/Case1Standard.mo b/BESMod/Examples/BAUSimStudy/Case1Standard.mo index 2bca4693..1fcf94e3 100644 --- a/BESMod/Examples/BAUSimStudy/Case1Standard.mo +++ b/BESMod/Examples/BAUSimStudy/Case1Standard.mo @@ -6,9 +6,11 @@ model Case1Standard systemParameters(TOda_nominal=263.15, THydSup_nominal={328.15})); extends Modelica.Icons.Example; - annotation (experiment(StopTime=172800, - Interval=600, - Tolerance=1e-06), + annotation (experiment( + StopTime=31536000, + Interval=599.999616, + Tolerance=1e-06, + __Dymola_Algorithm="Dassl"), __Dymola_Commands(file="modelica://BESMod/Resources/Scripts/Dymola/Examples/BAUSimStudy/Case1Standard.mos" "Simulate and plot")); end Case1Standard; diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_BAUSimStudy_Case1Standard.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_BAUSimStudy_Case1Standard.txt index 59104aa4..03cdda63 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_BAUSimStudy_Case1Standard.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_BAUSimStudy_Case1Standard.txt @@ -8,7 +8,7 @@ statistics-simulation= { "linear": "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "nonlinear": "1, 1, 6, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1", - "number of continuous time states": "101", + "number of continuous time states": "113", "numerical Jacobians": "0" } time=[0e+00, 1.728e+05] diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_DesignOptimization_BES.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_DesignOptimization_BES.txt index c3f27bc0..79aff21c 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_DesignOptimization_BES.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_DesignOptimization_BES.txt @@ -8,7 +8,7 @@ statistics-simulation= { "linear": "0, 0, 0, 0, 0, 0, 0", "nonlinear": "2, 6, 1, 0, 1, 0, 1, 0, 1, 1, 1", - "number of continuous time states": "68", + "number of continuous time states": "80", "numerical Jacobians": "0" } time=[0e+00, 1.728e+05] diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_DesignOptimization_BESNoDHW.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_DesignOptimization_BESNoDHW.txt index 8343d598..709cce60 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_DesignOptimization_BESNoDHW.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_DesignOptimization_BESNoDHW.txt @@ -8,7 +8,7 @@ statistics-simulation= { "linear": "0, 0, 0, 0, 0, 0, 0", "nonlinear": "6, 1, 0, 1, 0, 1, 0, 1, 1, 1", - "number of continuous time states": "49", + "number of continuous time states": "61", "numerical Jacobians": "0" } time=[0e+00, 1.728e+05] diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_GasBoilerBuildingOnly.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_GasBoilerBuildingOnly.txt index 7b501c22..f700e725 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_GasBoilerBuildingOnly.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_GasBoilerBuildingOnly.txt @@ -8,7 +8,7 @@ statistics-simulation= { "linear": "0, 0, 0, 0, 0, 0, 0, 0", "nonlinear": "1, 6, 1, 0, 1, 0, 1, 0, 1, 1", - "number of continuous time states": "42", + "number of continuous time states": "54", "numerical Jacobians": "0" } time=[0e+00, 1.728e+05] diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_AfterBufferWithDHW.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_AfterBufferWithDHW.txt index 17b23d0d..9e784aa9 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_AfterBufferWithDHW.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_AfterBufferWithDHW.txt @@ -8,7 +8,7 @@ statistics-simulation= { "linear": "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0", "nonlinear": "1, 6, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1", - "number of continuous time states": "141", + "number of continuous time states": "153", "numerical Jacobians": "0" } time=[0e+00, 1.728e+05] diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_AfterBufferWithoutDHW.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_AfterBufferWithoutDHW.txt index acb5a2ef..bc829f5b 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_AfterBufferWithoutDHW.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_AfterBufferWithoutDHW.txt @@ -8,7 +8,7 @@ statistics-simulation= { "linear": "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "nonlinear": "1, 6, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1", - "number of continuous time states": "107", + "number of continuous time states": "119", "numerical Jacobians": "0" } time=[0e+00, 1.728e+05] diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_Parallel.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_Parallel.txt index 35f9f433..9a8c7481 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_Parallel.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_Parallel.txt @@ -8,7 +8,7 @@ statistics-simulation= { "linear": "0, 0, 0, 0, 0, 0, 0, 0", "nonlinear": "3, 6, 1, 0, 1, 0, 1, 0, 1, 1, 1", - "number of continuous time states": "75", + "number of continuous time states": "87", "numerical Jacobians": "0" } time=[0e+00, 1.728e+05] diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_Serial.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_Serial.txt index e0ddf761..efdf9017 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_Serial.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_HeatPumpAndBoiler_Serial.txt @@ -8,7 +8,7 @@ statistics-simulation= { "linear": "0, 0, 0, 0, 0, 0, 0, 0", "nonlinear": "2, 6, 1, 0, 1, 0, 1, 0, 1, 1, 1", - "number of continuous time states": "74", + "number of continuous time states": "86", "numerical Jacobians": "0" } time=[0e+00, 1.728e+05] diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_ModelicaConferencePaper_TEASERBuilding.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_ModelicaConferencePaper_TEASERBuilding.txt index 19b0b932..69e4c4c0 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_ModelicaConferencePaper_TEASERBuilding.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_ModelicaConferencePaper_TEASERBuilding.txt @@ -8,7 +8,7 @@ statistics-simulation= { "linear": "0, 0, 0, 0, 0, 0, 0", "nonlinear": "2, 1, 1, 6, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1", - "number of continuous time states": "81", + "number of continuous time states": "82", "numerical Jacobians": "0" } time=[0e+00, 8.64e+05] diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_Retrofit_Case1NoRetrofit.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_Retrofit_Case1NoRetrofit.txt index d1414bd6..58f0fd6f 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_Retrofit_Case1NoRetrofit.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_Retrofit_Case1NoRetrofit.txt @@ -8,7 +8,7 @@ statistics-simulation= { "linear": "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "nonlinear": "1, 1, 6, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1", - "number of continuous time states": "101", + "number of continuous time states": "113", "numerical Jacobians": "0" } time=[0e+00, 8.64e+04] diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_Retrofit_Case1PartialRetrofit.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_Retrofit_Case1PartialRetrofit.txt index 5517c969..63fbe84d 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_Retrofit_Case1PartialRetrofit.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_Retrofit_Case1PartialRetrofit.txt @@ -8,7 +8,7 @@ statistics-simulation= { "linear": "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "nonlinear": "1, 1, 6, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1", - "number of continuous time states": "101", + "number of continuous time states": "113", "numerical Jacobians": "0" } time=[0e+00, 8.64e+04] diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_Retrofit_Case1TotalRetrofit.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_Retrofit_Case1TotalRetrofit.txt index f209001f..be188d9b 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_Retrofit_Case1TotalRetrofit.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_Retrofit_Case1TotalRetrofit.txt @@ -8,7 +8,7 @@ statistics-simulation= { "linear": "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "nonlinear": "1, 1, 6, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1", - "number of continuous time states": "101", + "number of continuous time states": "113", "numerical Jacobians": "0" } time=[0e+00, 8.64e+04] diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_SolarThermalSystem_SolarThermalAixLib.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_SolarThermalSystem_SolarThermalAixLib.txt index ee4a6ce3..15ca2521 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_SolarThermalSystem_SolarThermalAixLib.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_SolarThermalSystem_SolarThermalAixLib.txt @@ -8,7 +8,7 @@ statistics-simulation= { "linear": "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "nonlinear": "1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1", - "number of continuous time states": "234", + "number of continuous time states": "246", "numerical Jacobians": "0" } time=[0e+00, 1.728e+05] diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_SolarThermalSystem_SolarThermalBuildings.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_SolarThermalSystem_SolarThermalBuildings.txt index e8f0f64a..39d0b3d5 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_SolarThermalSystem_SolarThermalBuildings.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_SolarThermalSystem_SolarThermalBuildings.txt @@ -8,7 +8,7 @@ statistics-simulation= { "linear": "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0", "nonlinear": "1, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1", - "number of continuous time states": "236", + "number of continuous time states": "248", "numerical Jacobians": "0" } time=[0e+00, 1.728e+05] diff --git a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_TEASERHeatLoadCalculation_Example.txt b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_TEASERHeatLoadCalculation_Example.txt index 06f2460c..c8e6517f 100644 --- a/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_TEASERHeatLoadCalculation_Example.txt +++ b/BESMod/Resources/ReferenceResults/Dymola/BESMod_Examples_TEASERHeatLoadCalculation_Example.txt @@ -7,7 +7,7 @@ statistics-simulation= { "linear": "10, 0, 0", "nonlinear": "1, 0, 1, 0, 1, 0, 1", - "number of continuous time states": "21", + "number of continuous time states": "35", "numerical Jacobians": "0" } time=[0e+00, 1.728e+05] diff --git a/BESMod/Systems/Demand/Building/Components/BaseClasses/package.mo b/BESMod/Systems/Demand/Building/Components/BaseClasses/package.mo index 6e72c7af..59756d75 100644 --- a/BESMod/Systems/Demand/Building/Components/BaseClasses/package.mo +++ b/BESMod/Systems/Demand/Building/Components/BaseClasses/package.mo @@ -1,3 +1,4 @@ within BESMod.Systems.Demand.Building.Components; package BaseClasses "Bases package for components" + extends Modelica.Icons.BasesPackage; end BaseClasses; diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index 3bf2669f..db5c62b5 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -47,115 +47,38 @@ model TEASERThermalZone Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, - origin={74,60}))); + origin={70,80}))); Modelica.Blocks.Sources.Constant constVentRate[nZones](final k=ventRate) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, - origin={74,30}))); + origin={70,20}))); - BESMod.Utilities.KPIs.EnergyKPICalculator intKPICalTraGain[nZones](each final - use_inpCon=true) if use_hydraulic and use_verboseEnergyBalance - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-30,-102}))); - BESMod.Utilities.KPIs.EnergyKPICalculator intKPICalTraLoss[nZones](each final - use_inpCon=true) if use_hydraulic and use_verboseEnergyBalance - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-30,-130}))); - Modelica.Blocks.Nonlinear.Limiter limUp[nZones](each final uMax= - Modelica.Constants.inf, each final uMin=0) if use_hydraulic and use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-80,-110},{-60,-90}}))); - Modelica.Blocks.Nonlinear.Limiter limDown[nZones](each final uMax= - 0, each final uMin=-Modelica.Constants.inf) if use_hydraulic and use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-80,-140},{-60,-120}}))); - BESMod.Utilities.KPIs.EnergyKPICalculator intKPICal[nZones](each final - use_inpCon=true) if use_verboseEnergyBalance annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={30,-150}))); - BESMod.Utilities.KPIs.EnergyKPICalculator intKPICalVentGain[nZones](each final - use_inpCon=true) if use_ventilation and use_verboseEnergyBalance - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={30,-182}))); Modelica.Blocks.Sources.RealExpression QVent[nZones](y= portVent_in.m_flow.*inStream(portVent_in.h_outflow) .+ portVent_out.m_flow .*portVent_out.h_outflow) if use_ventilation and use_verboseEnergyBalance "Internal gains" annotation ( Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={90,-196}))); - BESMod.Utilities.KPIs.EnergyKPICalculator intKPICalVentLoss[nZones](each final - use_inpCon=true) if use_ventilation and use_verboseEnergyBalance - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={30,-206}))); - Modelica.Blocks.Nonlinear.Limiter limVentUp[nZones](each final - uMax=Modelica.Constants.inf, each final uMin=0) - if use_ventilation and use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-9,-9},{9,9}}, - rotation=180, - origin={63,-185}))); - Modelica.Blocks.Nonlinear.Limiter limVentDown[nZones](each final - uMax=0, each final uMin=-Modelica.Constants.inf) - if use_ventilation and use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-9,-9},{9,9}}, - rotation=180, - origin={63,-205}))); - BESMod.Utilities.KPIs.EnergyKPICalculator intKPICalTraGain2[nZones](each final - use_inpCon=true) if use_verboseEnergyBalance annotation (Placement( - transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-30,-156}))); + origin={-90,-216}))); Modelica.Blocks.Sources.RealExpression QAirExc[nZones](y= thermalZone.airExc.Q_flow) if use_verboseEnergyBalance "Internal gains" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-90,-166}))); - BESMod.Utilities.KPIs.EnergyKPICalculator intKPICalTraLoss2[nZones](each final - use_inpCon=true) if use_verboseEnergyBalance annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-30,-186}))); - Modelica.Blocks.Nonlinear.Limiter limAirExcUp[nZones](each final - uMax=Modelica.Constants.inf, each final uMin=0) - if use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-70,-166},{-50,-146}}))); - Modelica.Blocks.Nonlinear.Limiter limAixExDown[nZones]( - each final uMax=0, each final uMin=-Modelica.Constants.inf) - if use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-70,-196},{-50,-176}}))); - Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heatFlowSensorRad[ - nZones] - annotation (Placement(transformation(extent={{-82,-70},{-62,-50}}))); + origin={-90,-160}))); + Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heaFloSenRad[nZones] + "Measure radiative heat flow" + annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}))); Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heatFlowSensorConv[ nZones] - annotation (Placement(transformation(extent={{-86,50},{-66,70}}))); + annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); Modelica.Blocks.Math.Add addTra - [nZones] - if use_hydraulic and use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-60,-80},{-40,-60}}))); - BESMod.Utilities.KPIs.ComfortCalculator comfortCalculatorCool[nZones](TComBou= - TSetZone_nominal .+ dTComfort, each for_heating=false) - annotation (Placement(transformation(extent={{-20,-60},{0,-40}}))); - BESMod.Utilities.KPIs.ComfortCalculator comfortCalculatorHea[nZones](TComBou= - TSetZone_nominal .- dTComfort, each for_heating=true) - annotation (Placement(transformation(extent={{-20,-20},{0,0}}))); - Modelica.Blocks.Math.MultiSum multiSum[nZones](each final nu=3) if use_verboseEnergyBalance annotation (Placement(transformation(extent={{-9,-9}, - {9,9}}, - rotation=180, - origin={69,-149}))); + [nZones] if use_verboseEnergyBalance + annotation (Placement(transformation(extent={{-10,10},{10,-10}}, + rotation=0, + origin={-90,-198}))); Modelica.Blocks.Routing.RealPassThrough realPassThroughIntGains[nZones,3] annotation (Placement(transformation(extent={{-100,0},{-80,20}}))); @@ -163,7 +86,7 @@ model TEASERThermalZone annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, - origin={114,62}))); + origin={70,50}))); Modelica.Blocks.Math.Add calTOpe[nZones]( each final k1=0.5, each final k2=0.5, @@ -172,41 +95,73 @@ model TEASERThermalZone annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, - origin={-70,30}))); - Utilities.KPIs.ComfortCalculator comCalHeaOpe[nZones](TComBou= - TSetZone_nominal .- dTComfort, each for_heating=true) - "Comfort calculator operative room temperature for heating" - annotation (Placement(transformation(extent={{20,-30},{40,-10}}))); - Utilities.KPIs.ComfortCalculator comCalCooOpe[nZones](TComBou= - TSetZone_nominal .+ dTComfort, each for_heating=true) - "Comfort calculator operative room temperature for cooling" - annotation (Placement(transformation(extent={{20,-70},{40,-50}}))); + origin={-70,80}))); BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={98,-120}))); + origin={82,-148}))); Modelica.Blocks.Math.Gain gain(final k=if incElePro then 1 else 0) annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={62,-120}))); + origin={68,-120}))); Modelica.Blocks.Math.MultiSum multiSumEle(final k=fill(1, multiSumEle.nu), nu=2*nZones) annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={30,-120}))); - BESMod.Utilities.KPIs.RoomControlCalculator roomControlCalculator[nZones](each final - for_heating=true, each final dTComBou=0) - annotation (Placement(transformation(extent={{50,-40},{70,-20}}))); + Utilities.KPIs.ZoneEnergyBalance zoneEneBal[nZones](each final + with_ventilation=use_ventilation) + if use_verboseEnergyBalance "Zone energy balance" + annotation (Placement(transformation(extent={{-60,-200},{-22,-140}}))); + Modelica.Blocks.Sources.RealExpression QExtWall_flow[nZones](y=thermalZone.ROM.extWall.Q_flow) + if use_verboseEnergyBalance "External wall heat flow rate" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,-110}))); + Utilities.KPIs.ZoneTemperature zonTem[nZones](each final dTComfort=dTComfort, + final TSetZone_nominal=TSetZone_nominal) + "Zone temperature KPIs for air temperature" + annotation (Placement(transformation(extent={{0,-50},{20,-30}}))); + Utilities.KPIs.ZoneTemperature zonTemOpe[nZones](each final dTComfort= + dTComfort, final TSetZone_nominal=TSetZone_nominal) + "Zone temperature KPIs for operative temperature" + annotation (Placement(transformation(extent={{0,-80},{20,-60}}))); + Modelica.Blocks.Sources.RealExpression QRoof_flow[nZones](y=thermalZone.ROM.roof.Q_flow) + if use_verboseEnergyBalance "Roof heat flow rate" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,-120}))); + Modelica.Blocks.Sources.RealExpression QFloor_flow[nZones](y=thermalZone.ROM.floor.Q_flow) + if use_verboseEnergyBalance "Floor heat flow rate" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,-134}))); + Modelica.Blocks.Sources.RealExpression QWin_flow[nZones](y=thermalZone.ROM.window.Q_flow) + if use_verboseEnergyBalance "Window heat flow rate" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,-148}))); + Modelica.Blocks.Sources.RealExpression QSol_flow[nZones](y={sum(thermalZone[i].simpleExternalShading.corrIrr) + for i in 1:nZones}) + if use_verboseEnergyBalance "Solar heat flow rate" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,-174}))); equation for i in 1:nZones loop connect(weaBus.TDryBul, realPassThroughTDry[i].u) annotation (Line( - points={{-46.895,98.11},{-46.895,96},{134,96},{134,62},{126,62}}, + points={{-46.895,98.11},{-6,98.11},{-6,98},{90,98},{90,50},{82,50}}, color={255,204,51}, thickness=0.5), Text( string="%first", @@ -222,12 +177,11 @@ equation extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); connect(thermalZone[i].QIntGains_flow[1], multiSumEle.u[2*i-1]) annotation (Line( - points={{-42.7,32.4},{-42.7,0},{-28,0},{-28,-68},{-6,-68},{-6,-134},{12, - -134},{12,-120},{20,-120}}, color={0,0,127})); - connect(thermalZone[i].QIntGains_flow[2], multiSumEle.u[2*i]) annotation (Line( - points={{-42.7,33.6},{-42.7,0},{-28,0},{-28,-68},{-6,-68},{-6,-134},{12, - -134},{12,-120},{20,-120}}, - color={0,0,127})); + points={{-42.7,33.6},{-42.7,32},{-120,32},{-120,-88},{-26,-88},{-26, + -120},{20,-120}}, color={0,0,127})); + connect(thermalZone[i].QIntGains_flow[2], multiSumEle.u[2*i]) annotation (Line( + points={{-42.7,34.8},{-42.7,32},{-120,32},{-120,-88},{-26,-88},{-26, + -120},{20,-120}}, color={0,0,127})); if use_ventilation then connect(portVent_in[i], thermalZone[i].ports[1]) annotation (Line(points={{100,38}, {82,38},{82,10},{-2,10},{-2,22.08}}, color={0,127, @@ -244,233 +198,171 @@ equation extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); end for; - connect(constTSetRoom.y, thermalZone.TSetCool) annotation (Line(points={{63,60}, - {48,60},{48,62.4},{33.52,62.4}},color={0,0,127})); - connect(constTSetRoom.y, thermalZone.TSetHeat) annotation (Line(points={{63,60}, - {48,60},{48,52.32},{33.52,52.32}},color={0,0,127})); + connect(constTSetRoom.y, thermalZone.TSetCool) annotation (Line(points={{59,80}, + {48,80},{48,62.4},{33.52,62.4}},color={0,0,127})); + connect(constTSetRoom.y, thermalZone.TSetHeat) annotation (Line(points={{59,80}, + {48,80},{48,62},{42,62},{42,52.32},{33.52,52.32}}, + color={0,0,127})); - connect(constVentRate.y, thermalZone.ventRate) annotation (Line(points={{63,30}, - {48,30},{48,32.88},{33.52,32.88}},color={0,0,127})); + connect(constVentRate.y, thermalZone.ventRate) annotation (Line(points={{59,20}, + {42,20},{42,32.88},{33.52,32.88}},color={0,0,127})); - // KPIs - if use_hydraulic then - connect(intKPICalTraGain.KPI, outBusDem.QTraGain) annotation ( - Line( - points={{-17.8,-102},{8,-102},{8,-2},{98,-2}}, - color={135,135,135}, - thickness=0.5), Text( + connect(thermalZone.intGainsConv, heatFlowSensorConv.port_b) annotation (Line( + points={{-39.74,49.44},{-49.87,49.44},{-49.87,50},{-60,50}}, color={ + 191,0,0})); + connect(heatPortCon, heatFlowSensorConv.port_a) + annotation (Line(points={{-100,60},{-84,60},{-84,50},{-80,50}}, + color={191,0,0})); + connect(heatPortRad, heaFloSenRad.port_a) + annotation (Line(points={{-100,-60},{-80,-60}}, color={191,0,0})); + connect(heaFloSenRad.port_b, thermalZone.intGainsRad) annotation (Line(points + ={{-60,-60},{-52,-60},{-52,60},{-46,60},{-46,60.24},{-39.74,60.24}}, + color={191,0,0})); + connect(heaFloSenRad.Q_flow, addTra.u2) annotation (Line(points={{-70,-71},{ + -70,-98},{-112,-98},{-112,-192},{-102,-192}}, color={0,0,127})); + connect(heatFlowSensorConv.Q_flow, addTra.u1) annotation (Line(points={{-70,39}, + {-70,-46},{-114,-46},{-114,-204},{-102,-204}}, color={0,0,127})); + connect(thermalZone.TAir, outBusDem.TZone) annotation (Line(points={{-42.7, + 76.8},{-46,76.8},{-46,76},{-48,76},{-48,-2},{98,-2}}, + color={0,0,127}), Text( string="%second", index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(intKPICalTraLoss.KPI, outBusDem.QTraLoss) annotation ( - Line( - points={{-17.8,-130},{8,-130},{8,-156},{116,-156},{116,-2},{98,-2}}, - color={135,135,135}, - thickness=0.5), Text( + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(thermalZone.TAir, buiMeaBus.TZoneMea) annotation (Line(points={{-42.7, + 76.8},{-48,76.8},{-48,88},{0,88},{0,99}}, color={0,0,127}), Text( string="%second", index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - - connect(limUp.y, intKPICalTraGain.u) - annotation (Line(points={{-59,-100},{-59,-102},{-41.8,-102}}, - color={0,0,127})); - connect(limDown.y, intKPICalTraLoss.u) annotation (Line(points={{-59,-130}, - {-41.8,-130}}, color={0,0,127})); - end if; - connect(intKPICal.KPI, outBusDem.QIntGain) annotation (Line( - points={{17.8,-150},{8,-150},{8,-2},{98,-2}}, - color={135,135,135}, - thickness=0.5), Text( + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(realPassThroughIntGains.y, thermalZone.intGains) annotation (Line( + points={{-79,10},{-32,10},{-32,14},{-31.6,14},{-31.6,17.76}}, + color={0,0, + 127})); + connect(realPassThroughTDry.y, thermalZone.ventTemp) annotation (Line(points={{59,50}, + {42,50},{42,42.24},{33.52,42.24}}, color= + {0,0,127})); + connect(calTOpe.u2, thermalZone.TAir) annotation (Line(points={{-58,86},{-48, + 86},{-48,76.8},{-42.7,76.8}}, color={0,0,127})); + connect(calTOpe.u1, thermalZone.TRad) annotation (Line(points={{-58,74},{-52, + 74},{-52,69.6},{-42.7,69.6}}, color={0,0,127})); + connect(calTOpe.y, buiMeaBus.TZoneOpeMea) annotation (Line(points={{-81,80},{ + -122,80},{-122,110},{0,110},{0,99}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(limAirExcUp.y, intKPICalTraGain2.u) - annotation (Line(points={{-49,-156},{-41.8,-156}}, color={0,0,127})); - connect(limAixExDown.y, intKPICalTraLoss2.u) annotation (Line(points={{-49, - -186},{-41.8,-186}}, color={0,0,127})); - connect(QAirExc.y, limAirExcUp.u) annotation (Line(points={{-79,-166},{-79, - -162},{-72,-162},{-72,-156}}, - color={0,0,127})); - connect(QAirExc.y, limAixExDown.u) annotation (Line(points={{-79,-166},{-74, - -166},{-74,-186},{-72,-186}}, - color={0,0,127})); - connect(intKPICalTraGain2.KPI, outBusDem.QAirExcGain) annotation ( - Line( - points={{-17.8,-156},{116,-156},{116,-18},{84,-18},{84,-2},{98,-2}}, - color={135,135,135}, - thickness=0.5), Text( + connect(calTOpe.y, outBusDem.TZoneOpe) annotation (Line(points={{-81,80},{ + -122,80},{-122,28},{-44,28},{-44,8},{-18,8},{-18,-2},{98,-2}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(intKPICalTraLoss2.KPI, outBusDem.QAirExcLoss) annotation ( - Line( - points={{-17.8,-186},{8,-186},{8,-2},{98,-2}}, - color={135,135,135}, + connect(gain.y,realToElecCon. PEleLoa) annotation (Line(points={{79,-120},{84, + -120},{84,-134},{62,-134},{62,-144},{70,-144}}, + color={0,0,127})); + connect(multiSumEle.y, gain.u) + annotation (Line(points={{41.7,-120},{56,-120}}, color={0,0,127})); + connect(realToElecCon.internalElectricalPin, internalElectricalPin) + annotation (Line( + points={{92.2,-147.8},{96,-147.8},{96,-96},{70,-96}}, + color={0,0,0}, + thickness=1)); + + connect(zoneEneBal.QAirExc_flow, QAirExc.y) + annotation (Line(points={{-63.8,-164},{-70,-164},{-70,-160},{-79,-160}}, + color={0,0,127})); + connect(QVent.y, zoneEneBal.QVen_flow) annotation (Line(points={{-79,-216},{-79, + -200},{-63.8,-200}}, color={0,0,127})); + connect(addTra.y, zoneEneBal.QTra_flow) annotation (Line(points={{-79,-198},{-79, + -194},{-63.8,-194}}, color={0,0,127})); + connect(zoneEneBal.zoneEneBal, outBusDem.eneBal) annotation (Line( + points={{-21.62,-170},{-14,-170},{-14,-2},{98,-2}}, + color={255,204,51}, thickness=0.5), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - if use_ventilation then - connect(limVentUp.y, intKPICalVentGain.u) annotation (Line(points={{53.1, - -185},{53.1,-182},{41.8,-182}}, color={0,0,127})); - connect(limVentDown.y, intKPICalVentLoss.u) annotation (Line(points={{53.1, - -205},{53.1,-206},{41.8,-206}}, color={0,0,127})); - connect(QVent.y, limVentUp.u) annotation (Line(points={{79,-196},{73.8,-196}, - {73.8,-185}},color={0,0,127})); - connect(QVent.y, limVentDown.u) annotation (Line(points={{79,-196},{79,-202}, - {73.8,-202},{73.8,-205}}, - color={0,0,127})); - connect(intKPICalVentGain.KPI, outBusDem.QVentGain) annotation ( - Line( - points={{17.8,-182},{8,-182},{8,-2},{98,-2}}, - color={135,135,135}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(intKPICalVentLoss.KPI, outBusDem.QVentLoss) annotation ( - Line( - points={{17.8,-206},{14,-206},{14,-192},{116,-192},{116,-74},{84,-74},{84, - -2},{98,-2}}, - color={135,135,135}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - end if; - - connect(thermalZone.intGainsConv, heatFlowSensorConv.port_b) annotation (Line( - points={{-39.74,49.44},{-39.74,48},{-52,48},{-52,60},{-66,60}}, color={ - 191,0,0})); - connect(heatPortCon, heatFlowSensorConv.port_a) - annotation (Line(points={{-100,60},{-86,60}}, color={191,0,0})); - connect(heatPortRad, heatFlowSensorRad.port_a) - annotation (Line(points={{-100,-60},{-82,-60}}, color={191,0,0})); - connect(heatFlowSensorRad.port_b, thermalZone.intGainsRad) annotation (Line( - points={{-62,-60},{-48,-60},{-48,48},{-50,48},{-50,60.24},{-39.74,60.24}}, - color={191,0,0})); - connect(addTra.y, limUp.u) annotation (Line(points={{-39,-70},{-36,-70},{-36, - -84},{-88,-84},{-88,-100},{-82,-100}}, - color={0,0,127})); - connect(addTra.y, limDown.u) annotation (Line(points={{-39,-70},{-26,-70},{ - -26,-80},{-96,-80},{-96,-130},{-82,-130}}, - color={0,0,127})); - connect(heatFlowSensorRad.Q_flow, addTra.u2) - annotation (Line(points={{-72,-71},{-72,-76},{-62,-76}}, color={0,0,127})); - connect(heatFlowSensorConv.Q_flow, addTra.u1) annotation (Line(points={{-76,49}, - {-76,-46},{-114,-46},{-114,-64},{-62,-64}}, color={0,0,127})); - connect(thermalZone.TAir, outBusDem.TZone) annotation (Line(points={{-42.7, - 76.8},{-48,76.8},{-48,-2},{98,-2}}, color={0,0,127}), Text( + connect(zonTem.dTComCoo, outBusDem.dTComCoo) annotation (Line(points={{21, + -44.8},{24,-44.8},{24,-2},{98,-2}}, + color={0,0,127}), Text( string="%second", index=1, - extent={{-6,3},{-6,3}}, + extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(thermalZone.TAir, comfortCalculatorHea.TZone) annotation (Line(points={{-42.7, - 76.8},{-48,76.8},{-48,-10},{-22,-10}}, color={0,0,127})); - connect(thermalZone.TAir, comfortCalculatorCool.TZone) annotation (Line( - points={{-42.7,76.8},{-48,76.8},{-48,-10},{-28,-10},{-28,-50},{-22,-50}}, - color={0,0,127})); - connect(comfortCalculatorCool.dTComSec, outBusDem.dTComCoo) annotation (Line( - points={{1,-50},{6,-50},{6,-2},{98,-2}}, color={0,0,127}), Text( + connect(zonTemOpe.dTComCoo, outBusDem.dTComCooOpe) annotation (Line(points={{21, + -74.8},{50,-74.8},{50,-74},{80,-74},{80,-2},{98,-2}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(comfortCalculatorHea.dTComSec, outBusDem.dTComHea) annotation (Line( - points={{1,-10},{0,-10},{0,-2},{98,-2}}, color={0,0,127}), Text( + connect(zonTem.dTComHea, outBusDem.dTComHea) annotation (Line(points={{21,-35}, + {78,-35},{78,-2},{98,-2}}, color={0,0,127}), Text( string="%second", index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(thermalZone.TAir, buiMeaBus.TZoneMea) annotation (Line(points={{-42.7, - 76.8},{-48,76.8},{-48,92},{0,92},{0,99}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, + extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(multiSum.y, intKPICal.u) - annotation (Line(points={{58.47,-149},{58.47,-150},{41.8,-150}}, - color={0,0,127})); - connect(multiSum.u, thermalZone.QIntGains_flow) annotation (Line(points={{78,-149}, - {78,-152},{86,-152},{86,-134},{-6,-134},{-6,-68},{-28,-68},{-28,0},{-42.7, - 0},{-42.7,33.6}}, - color={0,0,127})); - connect(realPassThroughIntGains.y, thermalZone.intGains) annotation (Line( - points={{-79,10},{-50,10},{-50,4},{-31.6,4},{-31.6,17.76}}, color={0,0, - 127})); - connect(realPassThroughTDry.y, thermalZone.ventTemp) annotation (Line(points= - {{103,62},{102,62},{102,74},{52,74},{52,42.24},{33.52,42.24}}, color= - {0,0,127})); - connect(calTOpe.u2, thermalZone.TAir) annotation (Line(points={{-58,36},{-48, - 36},{-48,76.8},{-42.7,76.8}}, color={0,0,127})); - connect(calTOpe.u1, thermalZone.TRad) annotation (Line(points={{-58,24},{-50, - 24},{-50,69.6},{-42.7,69.6}}, color={0,0,127})); - connect(comCalHeaOpe.dTComSec, outBusDem.dTComHeaOpe) annotation (Line(points - ={{41,-20},{54,-20},{54,-2},{98,-2}}, color={0,0,127}), Text( + connect(zonTemOpe.dTComHea, outBusDem.dTComHeaOpe) annotation (Line(points={{21,-65}, + {80,-65},{80,-2},{98,-2}}, color={0,0,127}), + Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(comCalHeaOpe.TZone, calTOpe.y) annotation (Line(points={{18,-20},{-32, - -20},{-32,-10},{-86,-10},{-86,30},{-81,30}}, - color={0,0,127})); - connect(comCalCooOpe.TZone, calTOpe.y) annotation (Line(points={{18,-60},{10, - -60},{10,0},{2,0},{2,2},{0,2},{0,6},{-46,6},{-46,28},{-52,28},{-52,44}, - {-88,44},{-88,30},{-81,30}}, color={0,0,127})); - connect(comCalCooOpe.dTComSec, outBusDem.dTComCooOpe) annotation (Line(points - ={{41,-60},{78,-60},{78,-2},{98,-2}}, color={0,0,127}), Text( + connect(zonTemOpe.dTCtrl, outBusDem.dTCtrlHeaOpe) annotation (Line(points={{21,-70}, + {80,-70},{80,-2},{98,-2}}, color={0,0,127}), + Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(calTOpe.y, buiMeaBus.TZoneOpeMea) annotation (Line(points={{-81,30},{ - -88,30},{-88,92},{0,92},{0,99}}, - color={0,0,127}), Text( + connect(zonTem.dTCtrl, outBusDem.dTCtrl) annotation (Line(points={{21,-40},{ + 80,-40},{80,-2},{98,-2}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(calTOpe.y, outBusDem.TZoneOpe) annotation (Line(points={{-81,30},{-88, - 30},{-88,44},{-52,44},{-52,28},{-46,28},{-46,6},{0,6},{0,2},{2,2},{2, - 0},{54,0},{54,-2},{98,-2}}, color={0,0,127}), Text( + connect(zonTemOpe.TZone, calTOpe.y) annotation (Line(points={{-2,-65},{-2,-66}, + {-50,-66},{-50,-40},{-122,-40},{-122,80},{-81,80}}, color={0,0,127})); + connect(thermalZone.TAir, zonTem.TZone) annotation (Line(points={{-42.7,76.8}, + {-44,76.8},{-44,76},{-48,76},{-48,-35},{-2,-35}}, color={0,0,127})); + connect(zonTem.TZoneSet, useProBus.TZoneSet) annotation (Line(points={{-2,-45}, + {-2,-46},{-14,-46},{-14,6},{50,6},{50,76},{51,76},{51,101}}, + color={0,0, + 127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(gain.y,realToElecCon. PEleLoa) annotation (Line(points={{73,-120},{73, - -116},{86,-116}}, color={0,0,127})); - connect(multiSumEle.y, gain.u) - annotation (Line(points={{41.7,-120},{50,-120}}, color={0,0,127})); - connect(realToElecCon.internalElectricalPin, internalElectricalPin) - annotation (Line( - points={{108.2,-119.8},{114,-119.8},{114,-96},{70,-96}}, - color={0,0,0}, - thickness=1)); - - connect(roomControlCalculator.dTComSec, outBusDem.dTControlHea) annotation ( - Line(points={{71,-30},{86,-30},{86,-16},{98,-16},{98,-2}}, color={0,0,127}), - Text( + connect(zonTemOpe.TZoneSet, useProBus.TZoneSet) annotation (Line(points={{-2,-75}, + {-2,-76},{-14,-76},{-14,6},{50,6},{50,76},{51,76},{51,101}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(roomControlCalculator.TZone, thermalZone.TAir) annotation (Line( - points={{48,-30},{2,-30},{2,-20},{-32,-20},{-32,-10},{-54,-10},{-54, - 76.8},{-42.7,76.8}}, color={0,0,127})); - connect(roomControlCalculator.TZoneSet, useProBus.TZoneSet) annotation (Line( - points={{48,-36},{42,-36},{42,102},{52,102},{52,101},{51,101}}, color={ - 0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); + connect(QExtWall_flow.y, zoneEneBal.QExtWall_flow) annotation (Line(points={{-79, + -110},{-72,-110},{-72,-140},{-63.8,-140}}, color={0,0,127})); + connect(zoneEneBal.QRoof_flow, QRoof_flow.y) annotation (Line(points={{-63.8,-146}, + {-74,-146},{-74,-120},{-79,-120}}, color={0,0,127})); + connect(QFloor_flow.y, zoneEneBal.QFloor_flow) annotation (Line(points={{-79,-134}, + {-76,-134},{-76,-152},{-63.8,-152}}, color={0,0,127})); + connect(zoneEneBal.QWin_flow, QWin_flow.y) annotation (Line(points={{-63.8,-158}, + {-74,-158},{-74,-148},{-79,-148}}, color={0,0,127})); + connect(QSol_flow.y, zoneEneBal.QSol_flow) annotation (Line(points={{-79,-174}, + {-72,-174},{-72,-170},{-63.8,-170}}, color={0,0,127})); + connect(thermalZone.QIntGains_flow[1], zoneEneBal.QLig_flow) annotation (Line( + points={{-42.7,32.4},{-120,32.4},{-120,-176},{-63.8,-176}}, color={0,0,127})); + connect(thermalZone.QIntGains_flow[3], zoneEneBal.QPer_flow) annotation (Line( + points={{-42.7,34.8},{-40,34.8},{-40,32},{-120,32},{-120,-182},{-63.8, + -182}}, color={0,0,127})); + connect(thermalZone.QIntGains_flow[2], zoneEneBal.QMac_flow) annotation (Line( + points={{-42.7,33.6},{-40,33.6},{-40,32},{-120,32},{-120,-188},{-63.8, + -188}}, color={0,0,127})); annotation (Diagram(coordinateSystem(extent={{-100,-220},{100,100}})), Documentation(info="
This model uses the reduced-order approach with the common TEASER output to model the building envelope. Relevant KPIs are calculated.
diff --git a/BESMod/Utilities/KPIs/BaseClasses/PartialKPIConnector.mo b/BESMod/Utilities/KPIs/BaseClasses/PartialKPIConnector.mo index c5fd7806..95b7b72e 100644 --- a/BESMod/Utilities/KPIs/BaseClasses/PartialKPIConnector.mo +++ b/BESMod/Utilities/KPIs/BaseClasses/PartialKPIConnector.mo @@ -10,7 +10,7 @@ partial expandable connector PartialKPIConnector "Partial emtpy KPI connector fo fillPattern=FillPattern.Solid), Text( extent={{-98,-100},{98,-140}}, textColor={135,135,135}, - textString="KPIs")}), + textString="%name%")}), Diagram(coordinateSystem( preserveAspectRatio=false, extent={{-100,-100},{100,100}}, diff --git a/BESMod/Utilities/KPIs/BaseClasses/SplitGainAndLoss.mo b/BESMod/Utilities/KPIs/BaseClasses/SplitGainAndLoss.mo new file mode 100644 index 00000000..ab61e4e0 --- /dev/null +++ b/BESMod/Utilities/KPIs/BaseClasses/SplitGainAndLoss.mo @@ -0,0 +1,65 @@ +within BESMod.Utilities.KPIs.BaseClasses; +model SplitGainAndLoss + "Model to split an energy input value into gain and loss" + Modelica.Blocks.Nonlinear.Limiter limLoss(final uMax=0, final uMin=-Modelica.Constants.inf, + strict=noEvents) + "Only use negative values (loss)" + annotation (Placement(transformation(extent={{-40,-40},{-20,-20}}))); + Modelica.Blocks.Nonlinear.Limiter limGain(final uMax=Modelica.Constants.inf, + final uMin=0, + strict=noEvents) "Only use positive values (gain)" + annotation (Placement(transformation(extent={{-40,20},{-20,40}}))); + Utilities.KPIs.EnergyKPICalculator gainKPI(final use_inpCon=true) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={30,30}))); + Utilities.KPIs.EnergyKPICalculator lossKPI(final use_inpCon=true) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={30,-30}))); + Modelica.Blocks.Interfaces.RealInput u "Energy flow" + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Utilities.KPIs.BaseClasses.KPIIntegral gain "KPIs for gain" annotation ( + Placement(transformation(extent={{102,40},{122,60}}), iconTransformation( + extent={{102,40},{122,60}}))); + Utilities.KPIs.BaseClasses.KPIIntegral loss "KPIs for loss" annotation ( + Placement(transformation(extent={{100,-40},{120,-20}}), + iconTransformation(extent={{102,-60},{122,-40}}))); + parameter Boolean noEvents=true "= true, if noEvent is used for limiter"; +equation + connect(limGain.u, u) annotation (Line(points={{-42,30},{-94,30},{-94,0},{-120, + 0}}, color={0,0,127})); + connect(limLoss.y, lossKPI.u) + annotation (Line(points={{-19,-30},{18.2,-30}}, color={0,0,127})); + connect(limGain.y, gainKPI.u) + annotation (Line(points={{-19,30},{18.2,30}}, color={0,0,127})); + connect(limLoss.u, u) annotation (Line(points={{-42,-30},{-94,-30},{-94,0},{-120, + 0}}, color={0,0,127})); + connect(lossKPI.KPI, loss) annotation (Line(points={{42.2,-30},{110,-30}}, + color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(gainKPI.KPI, gain) annotation (Line(points={{42.2,30},{78,30},{78,50}, + {112,50}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{102,-100}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid), + Text( + extent={{-102,-70},{102,-166}}, + lineColor={0,0,0}, + textString="%name%")}), Diagram(coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +Default of noEvents is true, as KPIs should only affect output values which don't feedback into system dynamics. If this model is used in a case where it's outputs affect the system, e.g. in controls, consider noEvents=false, which increases stability but also simulation time.
+")); +end SplitGainAndLoss; diff --git a/BESMod/Utilities/KPIs/BaseClasses/ZoneEnergyBalanceBus.mo b/BESMod/Utilities/KPIs/BaseClasses/ZoneEnergyBalanceBus.mo new file mode 100644 index 00000000..f71fa2d1 --- /dev/null +++ b/BESMod/Utilities/KPIs/BaseClasses/ZoneEnergyBalanceBus.mo @@ -0,0 +1,5 @@ +within BESMod.Utilities.KPIs.BaseClasses; +expandable connector ZoneEnergyBalanceBus + "Bus for energy balance of thermal zone" + extends Icons.OutputsBus; +end ZoneEnergyBalanceBus; diff --git a/BESMod/Utilities/KPIs/BaseClasses/package.order b/BESMod/Utilities/KPIs/BaseClasses/package.order index 2cc69cdb..94a28e12 100644 --- a/BESMod/Utilities/KPIs/BaseClasses/package.order +++ b/BESMod/Utilities/KPIs/BaseClasses/package.order @@ -2,3 +2,5 @@ KPIDevice KPIIcon KPIIntegral PartialKPIConnector +SplitGainAndLoss +ZoneEnergyBalanceBus diff --git a/BESMod/Utilities/KPIs/ComfortCalculator.mo b/BESMod/Utilities/KPIs/ComfortCalculator.mo index c36bb13d..d7265ba6 100644 --- a/BESMod/Utilities/KPIs/ComfortCalculator.mo +++ b/BESMod/Utilities/KPIs/ComfortCalculator.mo @@ -20,8 +20,7 @@ model ComfortCalculator "Cacluate the discomort in K*s" annotation (Placement(transformation(extent={{-26,-16},{-6,4}}))); Modelica.Blocks.Sources.Constant const(k=TComBou) annotation (Placement(transformation(extent={{-66,-30},{-46,-10}}))); - Modelica.Blocks.Interfaces.RealOutput dTComSec(unit="K.s") - "K*s discomfort" + Modelica.Blocks.Interfaces.RealOutput dTComSec(unit="K.s") "K*s discomfort" annotation (Placement(transformation(extent={{100,-10},{120,10}}))); Modelica.Blocks.Interfaces.RealInput TZone(unit="K") "Connector of Real input signal 1" diff --git a/BESMod/Utilities/KPIs/RoomControlCalculator.mo b/BESMod/Utilities/KPIs/RoomControlCalculator.mo index 74cbbd19..b28f9e6d 100644 --- a/BESMod/Utilities/KPIs/RoomControlCalculator.mo +++ b/BESMod/Utilities/KPIs/RoomControlCalculator.mo @@ -18,11 +18,10 @@ model RoomControlCalculator "Cacluate the room control quality in K*s" annotation (Placement(transformation(extent={{-26,-10},{-6,10}}))); Modelica.Blocks.Sources.Constant const(k=dTComBou) annotation (Placement(transformation(extent={{-80,-40},{-60,-20}}))); - Modelica.Blocks.Interfaces.RealOutput dTComSec(unit="K.s") - "K*s discomfort" + Modelica.Blocks.Interfaces.RealOutput dTComSec(unit="K.s") "K*s discomfort" annotation (Placement(transformation(extent={{100,-10},{120,10}}))); Modelica.Blocks.Interfaces.RealInput TZone(unit="K") - "Connector of Real input signal 1" + "Connector of Real input signal 1" annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); Modelica.Blocks.Interfaces.RealInput TZoneSet diff --git a/BESMod/Utilities/KPIs/ZoneEnergyBalance.mo b/BESMod/Utilities/KPIs/ZoneEnergyBalance.mo new file mode 100644 index 00000000..832486e8 --- /dev/null +++ b/BESMod/Utilities/KPIs/ZoneEnergyBalance.mo @@ -0,0 +1,223 @@ +within BESMod.Utilities.KPIs; +model ZoneEnergyBalance + "Model for energy KPIs relevant for a single zone" + parameter Boolean with_ventilation=true "=false to disable ventilation values"; + BaseClasses.SplitGainAndLoss tra + "KPIs for energy flow through transfer systems" + annotation (Placement(transformation(extent={{-10,-170},{10,-150}}))); + BaseClasses.SplitGainAndLoss floor "KPIs for energy flow through floor" + annotation (Placement(transformation(extent={{-10,110},{10,130}}))); + BaseClasses.SplitGainAndLoss win "KPIs for energy flow through window" + annotation (Placement(transformation(extent={{-10,70},{10,90}}))); + BaseClasses.SplitGainAndLoss roof "KPIs for energy flow through roof" + annotation (Placement(transformation(extent={{-10,150},{10,170}}))); + BaseClasses.SplitGainAndLoss extWall + "KPIs for energy flow through external walls" + annotation (Placement(transformation(extent={{-10,190},{10,210}}))); + BaseClasses.SplitGainAndLoss airExc + "KPIs for energy flow through air exchange" + annotation (Placement(transformation(extent={{-10,30},{10,50}}))); + Utilities.KPIs.EnergyKPICalculator intGaiLight(final use_inpCon=true) + "Internal gains for light" annotation (Placement(transformation(extent={{-10,-50}, + {10,-30}}, rotation=0))); + Utilities.KPIs.EnergyKPICalculator intGaiPer(final use_inpCon=true) + "Internal gains for persons" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={0,-80}))); + Utilities.KPIs.EnergyKPICalculator intGaiMac(final use_inpCon=true) + "Internal gains for machines" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={0,-120}))); + Utilities.KPIs.EnergyKPICalculator sol(final use_inpCon=true) + "Internal gains through solar" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0))); + Modelica.Blocks.Interfaces.RealInput QExtWall_flow(unit="W", displayUnit="kW") + "Heat flow through external wall" + annotation (Placement(transformation(extent={{-140,180},{-100,220}}))); + Modelica.Blocks.Interfaces.RealInput QRoof_flow(unit="W", displayUnit="kW") + "Heat flow through roof" + annotation (Placement(transformation(extent={{-140,140},{-100,180}}))); + Modelica.Blocks.Interfaces.RealInput QFloor_flow(unit="W", displayUnit="kW") + "Heat flow through floor" + annotation (Placement(transformation(extent={{-140,100},{-100,140}}))); + Modelica.Blocks.Interfaces.RealInput QWin_flow(unit="W", displayUnit="kW") + "Heat flow through window" + annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); + Modelica.Blocks.Interfaces.RealInput QAirExc_flow(unit="W", displayUnit="kW") + "Heat flow through air exchange" + annotation (Placement(transformation(extent={{-140,20},{-100,60}}))); + Modelica.Blocks.Interfaces.RealInput QSol_flow(unit="W", displayUnit="kW") + "Heat flow through solar" + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Interfaces.RealInput QLig_flow(unit="W", displayUnit="kW") + "Heat flow through lights" + annotation (Placement(transformation(extent={{-140,-60},{-100,-20}}))); + Modelica.Blocks.Interfaces.RealInput QMac_flow(unit="W", displayUnit="kW") + "Heat flow through machines" + annotation (Placement(transformation(extent={{-140,-140},{-100,-100}}))); + Modelica.Blocks.Interfaces.RealInput QPer_flow(unit="W", displayUnit="kW") + "Heat flow through persons" + annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}))); + Modelica.Blocks.Interfaces.RealInput QTra_flow(unit="W", displayUnit="kW") + "Heat flow through heat transfer" + annotation (Placement(transformation(extent={{-140,-180},{-100,-140}}))); + BaseClasses.ZoneEnergyBalanceBus zoneEneBal "Zone energy balance" + annotation (Placement(transformation(extent={{82,-20},{122,20}}))); + Modelica.Blocks.Interfaces.RealInput QVen_flow(unit="W", displayUnit="kW") + if with_ventilation + "Heat flow through ventilation system" + annotation (Placement(transformation(extent={{-140,-220},{-100,-180}}))); + BaseClasses.SplitGainAndLoss ven if with_ventilation + "KPIs for energy flow through ventilation system" + annotation (Placement(transformation(extent={{-10,-210},{10,-190}}))); +equation + connect(extWall.u, QExtWall_flow) + annotation (Line(points={{-12,200},{-120,200}}, color={0,0,127})); + connect(QTra_flow, tra.u) + annotation (Line(points={{-120,-160},{-12,-160}}, color={0,0,127})); + connect(QMac_flow, intGaiMac.u) + annotation (Line(points={{-120,-120},{-11.8,-120}}, color={0,0,127})); + connect(QPer_flow, intGaiPer.u) + annotation (Line(points={{-120,-80},{-11.8,-80}}, color={0,0,127})); + connect(QLig_flow, intGaiLight.u) + annotation (Line(points={{-120,-40},{-11.8,-40}}, color={0,0,127})); + connect(QSol_flow, sol.u) + annotation (Line(points={{-120,0},{-11.8,0}}, color={0,0,127})); + connect(QAirExc_flow, airExc.u) + annotation (Line(points={{-120,40},{-12,40}}, color={0,0,127})); + connect(QWin_flow, win.u) + annotation (Line(points={{-120,80},{-12,80}}, color={0,0,127})); + connect(QFloor_flow, floor.u) + annotation (Line(points={{-120,120},{-12,120}}, color={0,0,127})); + connect(QRoof_flow, roof.u) + annotation (Line(points={{-120,160},{-12,160}}, color={0,0,127})); + connect(extWall.gain, zoneEneBal.extWallGain) annotation (Line(points={{11.2,205}, + {76,205},{76,0},{102,0}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(extWall.loss, zoneEneBal.extWallLoss) annotation (Line(points={{11.2,195}, + {76,195},{76,0},{102,0}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(roof.gain, zoneEneBal.roofGain) annotation (Line(points={{11.2,165},{76, + 165},{76,0},{102,0}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(roof.loss, zoneEneBal.roofLoss) annotation (Line(points={{11.2,155},{76, + 155},{76,0},{102,0}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(floor.gain, zoneEneBal.floorGain) annotation (Line(points={{11.2,125}, + {76,125},{76,0},{102,0}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(floor.loss, zoneEneBal.floorLoss) annotation (Line(points={{11.2,115}, + {76,115},{76,0},{102,0}}, + color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(win.gain, zoneEneBal.winGain) annotation (Line(points={{11.2,85},{76,85}, + {76,0},{102,0}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(win.loss, zoneEneBal.winLoss) annotation (Line(points={{11.2,75},{76,75}, + {76,0},{102,0}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(airExc.gain, zoneEneBal.airExcGain) annotation (Line(points={{11.2,45}, + {76,45},{76,0},{102,0}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(airExc.loss, zoneEneBal.airExcLoss) annotation (Line(points={{11.2,35}, + {76,35},{76,0},{102,0}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(sol.KPI, zoneEneBal.solGain) annotation (Line(points={{12.2,0},{102,0}}, + color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(intGaiLight.KPI, zoneEneBal.lightGain) annotation (Line(points={{12.2, + -40},{76,-40},{76,0},{102,0}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(intGaiPer.KPI, zoneEneBal.perGain) annotation (Line(points={{12.2,-80}, + {76,-80},{76,0},{102,0}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(intGaiMac.KPI, zoneEneBal.macGain) annotation (Line(points={{12.2,-120}, + {76,-120},{76,0},{102,0}}, color={135,135,135}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(tra.gain, zoneEneBal.traGain) annotation (Line(points={{11.2,-155},{11.2, + -156},{76,-156},{76,0},{102,0}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(tra.loss, zoneEneBal.traLoss) annotation (Line(points={{11.2,-165},{11.2, + -166},{76,-166},{76,0},{102,0}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(ven.gain, zoneEneBal.venGain) annotation (Line(points={{11.2,-195},{11.2, + -196},{76,-196},{76,0},{102,0}}, + color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(ven.loss, zoneEneBal.venLoss) annotation (Line(points={{11.2,-205},{11.2, + -206},{76,-206},{76,0},{102,0}}, + color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(ven.u, QVen_flow) + annotation (Line(points={{-12,-200},{-120,-200}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-200}, + {100,200}}), graphics={ + Rectangle( + extent={{-100,202},{102,-200}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid), + Text( + extent={{-104,182},{100,86}}, + lineColor={0,0,0}, + textString="%name%")}), Diagram(coordinateSystem(preserveAspectRatio=false, extent={ + {-100,-200},{100,200}}))); +end ZoneEnergyBalance; diff --git a/BESMod/Utilities/KPIs/ZoneTemperature.mo b/BESMod/Utilities/KPIs/ZoneTemperature.mo new file mode 100644 index 00000000..8e672043 --- /dev/null +++ b/BESMod/Utilities/KPIs/ZoneTemperature.mo @@ -0,0 +1,63 @@ +within BESMod.Utilities.KPIs; +model ZoneTemperature "Model for temperature KPIs relevant for a single zone" + parameter Modelica.Units.SI.TemperatureDifference dTComfort=2 + "Temperature difference to room set temperature at which the comfort is still acceptable"; + parameter Modelica.Units.SI.Temperature TSetZone_nominal "Nominal room set temperature"; + parameter Boolean with_heating=true "=false to disable heating comfort calculation"; + parameter Boolean with_cooling=true "=false to disable cooling comfort calculation"; + + Utilities.KPIs.ComfortCalculator comHea(TComBou=TSetZone_nominal - dTComfort, + for_heating=true) if with_heating + "Comfort calculator room temperature for heating" + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + Utilities.KPIs.ComfortCalculator comCool(TComBou=TSetZone_nominal + dTComfort, + for_heating=false) if with_cooling + "Comfort calculator room temperature for cooling" + annotation (Placement(transformation(extent={{-60,-58},{-40,-38}}))); + Utilities.KPIs.RoomControlCalculator calCtrl(final for_heating=true, final + dTComBou=0) "Calculate room control quality" + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + Modelica.Blocks.Interfaces.RealOutput dTComHea "K*s discomfort" + annotation (Placement(transformation(extent={{100,40},{120,60}}))); + Modelica.Blocks.Interfaces.RealOutput dTComCoo "K*s discomfort" + annotation (Placement(transformation(extent={{100,-58},{120,-38}}))); + Modelica.Blocks.Interfaces.RealOutput dTCtrl "K*s control deviation" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Interfaces.RealInput TZone(unit="K") + "Connector of Real input signal 1" + annotation (Placement(transformation(extent={{-140,30},{-100,70}}))); + Modelica.Blocks.Interfaces.RealInput TZoneSet(unit="K") + "Zone set temperature" + annotation (Placement(transformation(extent={{-140,-70},{-100,-30}}))); +equation + connect(comHea.dTComSec, dTComHea) + annotation (Line(points={{-39,50},{110,50}}, color={0,0,127})); + connect(comCool.dTComSec, dTComCoo) + annotation (Line(points={{-39,-48},{110,-48}}, color={0,0,127})); + connect(calCtrl.dTComSec, dTCtrl) + annotation (Line(points={{-39,0},{110,0}}, color={0,0,127})); + connect(calCtrl.TZone, TZone) + annotation (Line(points={{-62,0},{-70,0},{-70,50},{-120,50}}, + color={0,0,127})); + connect(TZoneSet, calCtrl.TZoneSet) annotation (Line(points={{-120,-50},{-88, + -50},{-88,-6},{-62,-6}}, + color={0,0,127})); + connect(comCool.TZone, TZone) annotation (Line(points={{-62,-48},{-78,-48},{ + -78,50},{-120,50}}, + color={0,0,127})); + connect(comHea.TZone, TZone) annotation (Line(points={{-62,50},{-120,50}}, + color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{102,-100}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid), + Text( + extent={{-98,-74},{106,-170}}, + lineColor={0,0,0}, + textString="%name%")}), Diagram(coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +In DIN EN 15251, all temperatures below 22 °C - 2 K count as discomfort. Hence the default value. If your room set temperature is lower, consider using smaller values.
+")); +end ZoneTemperature; diff --git a/BESMod/Utilities/KPIs/package.order b/BESMod/Utilities/KPIs/package.order index 08c2049b..881759b4 100644 --- a/BESMod/Utilities/KPIs/package.order +++ b/BESMod/Utilities/KPIs/package.order @@ -3,4 +3,6 @@ CountTimeDiscomfort DeviceKPICalculator EnergyKPICalculator RoomControlCalculator +ZoneEnergyBalance +ZoneTemperature BaseClasses