From 8557cd72441127eeb46112711ca3ae6ab59f5d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Thu, 23 Jun 2022 16:54:40 +0200 Subject: [PATCH 001/131] #6 Add a partial model with all connections for the integration of different high order models to the demand system --- .../BaseClasses/PartialAixLibHighOrder.mo | 54 +++++++++++++++++++ .../Demand/Building/BaseClasses/package.order | 1 + 2 files changed, 55 insertions(+) create mode 100644 BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo diff --git a/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo b/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo new file mode 100644 index 00000000..6dcaeb45 --- /dev/null +++ b/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo @@ -0,0 +1,54 @@ +within BESMod.Systems.Demand.Building.BaseClasses; +partial model PartialAixLibHighOrder + extends BESMod.Utilities.Icons.BuildingIcon; + + parameter Integer nZones(min=1) "Number of zones /rooms"; + parameter Boolean use_ventilation=true "=false to disable ventilation supply"; + + replaceable package MediumZone = IBPSA.Media.Air constrainedby + Modelica.Media.Interfaces.PartialMedium annotation (choices( + choice(redeclare package Medium = IBPSA.Media.Air "Moist air"), + choice(redeclare package Medium = IBPSA.Media.Water "Water"), + choice(redeclare package Medium = + IBPSA.Media.Antifreeze.PropyleneGlycolWater ( + property_T=293.15, + X_a=0.40) + "Propylene glycol water, 40% mass fraction"))); + + AixLib.Utilities.Interfaces.ConvRadComb heatingToRooms1[nZones] + annotation (Placement(transformation(extent={{-108,-10},{-88,10}}))); + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a groundTemp + annotation (Placement(transformation(extent={{-10,-110},{10,-90}}))); + Modelica.Fluid.Interfaces.FluidPort_a portVent_in[nZones](redeclare final + package Medium = MediumZone) + if use_ventilation + "Inlet for the demand of ventilation" + annotation (Placement(transformation(extent={{90,-76},{110,-56}}), + iconTransformation(extent={{90,-74},{110,-54}}))); + Modelica.Fluid.Interfaces.FluidPort_b portVent_out[nZones](redeclare final + package Medium = MediumZone) + if use_ventilation + "Outlet of the demand of Ventilation" + annotation (Placement(transformation(extent={{90,-102},{110,-82}}), + iconTransformation(extent={{90,-98},{110,-78}}))); + AixLib.Utilities.Interfaces.SolarRad_in West + annotation (Placement(transformation(extent={{118,-48},{98,-28}}))); + AixLib.Utilities.Interfaces.SolarRad_in South + annotation (Placement(transformation(extent={{118,-22},{98,-2}}))); + AixLib.Utilities.Interfaces.SolarRad_in East + annotation (Placement(transformation(extent={{118,4},{98,24}}))); + AixLib.Utilities.Interfaces.SolarRad_in North + annotation (Placement(transformation(extent={{118,30},{98,50}}))); + AixLib.Utilities.Interfaces.SolarRad_in SolarRadiationPort_RoofS + annotation (Placement(transformation(extent={{118,54},{98,74}}))); + AixLib.Utilities.Interfaces.SolarRad_in SolarRadiationPort_RoofN + annotation (Placement(transformation(extent={{118,80},{98,100}}))); + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a thermOutside + annotation (Placement(transformation(extent={{-108,80},{-88,100}}))); + Modelica.Blocks.Interfaces.RealInput WindSpeedPort + annotation (Placement(transformation(extent={{-126,42},{-86,82}}))); + Modelica.Blocks.Interfaces.RealInput AirExchangePort[nZones] + annotation (Placement(transformation(extent={{-126,14},{-86,54}}))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end PartialAixLibHighOrder; diff --git a/BESMod/Systems/Demand/Building/BaseClasses/package.order b/BESMod/Systems/Demand/Building/BaseClasses/package.order index 8be984b3..46196a31 100644 --- a/BESMod/Systems/Demand/Building/BaseClasses/package.order +++ b/BESMod/Systems/Demand/Building/BaseClasses/package.order @@ -1 +1,2 @@ PartialDemand +PartialAixLibHighOrder From f43c2d784ff82ebd7073f3c849f701ac5f7a0c7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Thu, 23 Jun 2022 16:57:39 +0200 Subject: [PATCH 002/131] #6 Add the high order model example of an ofd from AixLib and add all necessary connection for the demand system --- .../Demand/Building/AixLibHighOrder.mo | 232 ++++++++++++++++++ .../Building/Components/AixLibHighOrderOFD.mo | 162 ++++++++++++ .../Demand/Building/Components/package.mo | 3 + .../Demand/Building/Components/package.order | 1 + BESMod/Systems/Demand/Building/package.order | 2 + 5 files changed, 400 insertions(+) create mode 100644 BESMod/Systems/Demand/Building/AixLibHighOrder.mo create mode 100644 BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo create mode 100644 BESMod/Systems/Demand/Building/Components/package.mo create mode 100644 BESMod/Systems/Demand/Building/Components/package.order diff --git a/BESMod/Systems/Demand/Building/AixLibHighOrder.mo b/BESMod/Systems/Demand/Building/AixLibHighOrder.mo new file mode 100644 index 00000000..5ef15a8a --- /dev/null +++ b/BESMod/Systems/Demand/Building/AixLibHighOrder.mo @@ -0,0 +1,232 @@ +within BESMod.Systems.Demand.Building; +model AixLibHighOrder "High order building model from AixLib library" + + extends BaseClasses.PartialDemand( + nZones = aixLiBHighOrderOFD.nZones, + final AZone=aixLiBHighOrderOFD.AZone, + final hZone=aixLiBHighOrderOFD.hZone, + final ABui=aixLiBHighOrderOFD.ABui, + final hBui=aixLiBHighOrderOFD.hBui, + final ARoo=aixLiBHighOrderOFD.ARoof); + + + + final parameter AixLib.DataBase.Weather.SurfaceOrientation.SurfaceOrientationBaseDataDefinition SOD= + AixLib.DataBase.Weather.SurfaceOrientation.SurfaceOrientationData_N_E_S_W_RoofN_Roof_S() + "Surface orientation data" annotation(Dialog(group = "Solar radiation on oriented surfaces", descriptionLabel = true), choicesAllMatching = true); + + parameter Boolean useConstNatVentRate = false; + parameter Real ventRate[nZones]=fill(0, nZones) "Constant mechanical ventilation rate"; + parameter Modelica.Units.SI.Temperature TSoil=281.65 "Temperature of soil"; + parameter Modelica.Units.NonSI.Angle_deg Latitude "latitude of location"; + parameter Modelica.Units.NonSI.Angle_deg Longitude "longitude of location in"; + parameter Real TimeCorrection=0 "for TRY = 0.5, for TMY = 0"; + parameter Modelica.Units.NonSI.Time_hour DiffWeatherDataTime=1 "difference between local time and UTC, e.g. +1 for MET"; + parameter Real GroundReflection "ground reflection coefficient"; + + // Dynamics + parameter Modelica.Fluid.Types.Dynamics energyDynamicsWalls=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial + "Type of energy balance for wall capacities: dynamic (3 initialization options) or steady state" annotation (Dialog(tab="Dynamics")); + parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial + "Type of energy balance: dynamic (3 initialization options) or steady state" annotation (Dialog(tab="Dynamics")); + + // Initialization + parameter Modelica.Units.SI.Temperature T0_air=273.15 + 22 + "Initial temperature of air" annotation (Dialog(tab="Initialization")); + parameter Modelica.Units.SI.Temperature TWalls_start=273.15 + 16 + "Initial temperature of all walls" annotation (Dialog(tab="Initialization")); + + //Outer walls + replaceable parameter AixLib.DataBase.Walls.Collections.OFD.EnEV2009Light + wallTypes constrainedby + AixLib.DataBase.Walls.Collections.BaseDataMultiWalls + "Types of walls (contains multiple records)" + annotation (Dialog(tab="Outer walls", group="Wall"), choicesAllMatching = true); + replaceable model WindowModel = + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow + constrainedby AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); + replaceable parameter AixLib.DataBase.WindowsDoors.Simple.OWBaseDataDefinition_Simple Type_Win "Window parametrization" annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); + replaceable model CorrSolarGainWin = + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG + constrainedby AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG "Correction model for solar irradiance as transmitted radiation" annotation (choicesAllMatching=true, Dialog(tab="Outer walls", group="Windows", enable = withWindow and outside)); + parameter Boolean use_sunblind=false + "Will sunblind become active automatically?" annotation (Dialog(tab="Outer walls", group="Sunblind")); + parameter Modelica.Units.SI.CoefficientOfHeatTransfer UValOutDoors=2.5 + "U-value (thermal transmittance) of doors in outer walls" annotation (Dialog(tab="Outer walls", group="Doors")); + + //Infiltration + parameter Boolean use_infiltEN12831=true + "Use model to exchange room air with outdoor air acc. to standard" annotation (Dialog(tab="Infiltration acc. to EN 12831", group="X")); + parameter Real n50=4 "Air exchange rate at 50 Pa pressure difference" annotation (Dialog(tab="Infiltration acc. to EN 12831", group="X")); + parameter Real e=0.03 "Coefficient of windshield" annotation (Dialog(tab="Infiltration acc. to EN 12831", group="X")); + + + Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature tempOutside + annotation (Placement(transformation(extent={{4,4},{-4,-4}}, + rotation=90, + origin={-18,48}))); + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature prescrTGround(T=TSoil) + annotation (Placement(transformation(extent={{-13.5,-90},{-1,-77}}))); + AixLib.Utilities.Interfaces.Adaptors.ConvRadToCombPort convRadToCombPort[nZones] + annotation (Placement(transformation(extent={{-46,-14},{-66,-30}}))); + replaceable Components.AixLibHighOrderOFD aixLiBHighOrderOFD( + use_ventilation=use_ventilation, + redeclare package MediumZone = MediumZone, + energyDynamicsWalls=energyDynamicsWalls, + energyDynamics=energyDynamics, + T0_air=T0_air, + TWalls_start=TWalls_start, + redeclare model WindowModel = WindowModel, + redeclare model CorrSolarGainWin = CorrSolarGainWin, + use_sunblind=use_sunblind, + UValOutDoors=UValOutDoors, + use_infiltEN12831=use_infiltEN12831, + n50=n50, + e=e, + Type_Win= Type_Win, + wallTypes=wallTypes) + annotation (Placement(transformation(extent={{-22,-36},{38,34}}))); + AixLib.BoundaryConditions.WeatherData.Old.WeatherTRY.BaseClasses.Sun + Sun( + TimeCorrection=TimeCorrection, + Longitude=Longitude, + Latitude=Latitude, + DiffWeatherDataTime=DiffWeatherDataTime) annotation (Placement( + transformation(extent={{-6,50},{8,64}}))); + AixLib.BoundaryConditions.WeatherData.Old.WeatherTRY.RadiationOnTiltedSurface.RadOnTiltedSurf_Liu + RadOnTiltedSurf[SOD.nSurfaces]( + each Latitude=Latitude, + each GroundReflection=GroundReflection, + Azimut=SOD.Azimut, + Tilt=SOD.Tilt, + each WeatherFormat=1) annotation(Placement(transformation(extent={{18,48}, + {40,68}}))); + + Modelica.Blocks.Math.Add add(k1=+1, k2=-1) + annotation (Placement(transformation(extent={{4,68},{14,78}}))); + Modelica.Blocks.Sources.Constant constVentRate[nZones](final k=ventRate) + if useConstNatVentRate "Transform Volume l to massflowrate" + annotation (Placement(transformation( + extent={{5,-5},{-5,5}}, rotation=180, + origin={-59,-1}))); + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow InternalGains[nZones] + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=0, + origin={-52,-60}))); + + +equation + connect(weaBus.TDryBul, tempOutside.T) annotation (Line( + points={{-47,98},{-47,58},{-18,58},{-18,52.8}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(convRadToCombPort.portConv, heatPortCon) annotation (Line(points={{-66,-17}, + {-80,-17},{-80,60},{-100,60}}, color={191,0,0})); + connect(convRadToCombPort.portRad, heatPortRad) annotation (Line(points={{-66,-27}, + {-80,-27},{-80,-60},{-100,-60}}, color={0,0,0})); + connect(aixLiBHighOrderOFD.heatingToRooms1, convRadToCombPort.portConvRadComb) + annotation (Line(points={{-21.4,-1},{-36,-1},{-36,-22},{-46,-22}}, color={191, + 0,0})); + connect(aixLiBHighOrderOFD.thermOutside, tempOutside.port) annotation (Line( + points={{-21.4,30.5},{-18,30.5},{-18,44}}, color={191,0,0})); + connect(aixLiBHighOrderOFD.groundTemp, prescrTGround.port) annotation (Line( + points={{8,-36},{8,-83.5},{-1,-83.5}}, color={191,0,0})); + connect(aixLiBHighOrderOFD.portVent_in, portVent_in) annotation (Line(points={{38, + -23.4},{74,-23.4},{74,38},{100,38}}, color={0,127,255})); + connect(aixLiBHighOrderOFD.portVent_out, portVent_out) annotation (Line( + points={{38,-31.8},{74,-31.8},{74,-40},{100,-40}}, + color={0,127,255})); + + // Connecting n RadOnTiltedSurf + for i in 1:SOD.nSurfaces loop + connect(Sun.OutDayAngleSun, RadOnTiltedSurf[i].InDayAngleSun) annotation ( + Line(points={{7.3,57.42},{14,57.42},{14,55.9},{20.31,55.9}},color={0,0,127})); + connect(Sun.OutHourAngleSun, RadOnTiltedSurf[i].InHourAngleSun) annotation ( + Line(points={{7.3,55.18},{14,55.18},{14,53.9},{20.31,53.9}},color={0,0,127})); + connect(Sun.OutDeclinationSun, RadOnTiltedSurf[i].InDeclinationSun) annotation (Line(points={{7.3, + 53.08},{14,53.08},{14,51.9},{20.31,51.9}}, + color={0,0,127})); + connect(add.y, RadOnTiltedSurf[i].solarInput1) annotation (Line(points={{14.5, + 73},{22.29,73},{22.29,65.3}}, color={0,0,127})); + connect(weaBus.HDifHor, RadOnTiltedSurf[i].solarInput2) annotation (Line( + points={{-47,98},{-30,98},{-30,84},{33.07,84},{33.07,65.3}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + end for; + + connect(aixLiBHighOrderOFD.SolarRadiationPort_RoofN, RadOnTiltedSurf[5].OutTotalRadTilted) + annotation (Line(points={{40.4,30.5},{52,30.5},{52,62},{38.9,62}}, color={255, + 128,0})); + connect(aixLiBHighOrderOFD.SolarRadiationPort_RoofS, RadOnTiltedSurf[6].OutTotalRadTilted) + annotation (Line(points={{40.4,21.4},{52,21.4},{52,62},{38.9,62}}, color={255, + 128,0})); + connect(aixLiBHighOrderOFD.North, RadOnTiltedSurf[1].OutTotalRadTilted) + annotation (Line(points={{40.4,13},{52,13},{52,62},{38.9,62}}, color={255,128, + 0})); + connect(aixLiBHighOrderOFD.East, RadOnTiltedSurf[2].OutTotalRadTilted) + annotation (Line(points={{40.4,3.9},{52,3.9},{52,62},{38.9,62}}, color={255, + 128,0})); + connect(aixLiBHighOrderOFD.South, RadOnTiltedSurf[3].OutTotalRadTilted) + annotation (Line(points={{40.4,-5.2},{52,-5.2},{52,62},{38.9,62}}, color={255, + 128,0})); + connect(aixLiBHighOrderOFD.West, RadOnTiltedSurf[4].OutTotalRadTilted) + annotation (Line(points={{40.4,-14.3},{52,-14.3},{52,62},{38.9,62}}, color={ + 255,128,0})); + connect(weaBus.HGloHor, add.u1) annotation (Line( + points={{-47,98},{-47,76},{3,76}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(weaBus.HDifHor, add.u2) annotation (Line( + points={{-47,98},{-47,70},{3,70}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(weaBus.winSpe, aixLiBHighOrderOFD.WindSpeedPort) annotation (Line( + points={{-47,98},{-47,20.7},{-23.8,20.7}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(aixLiBHighOrderOFD.AirExchangePort, useProBus.NaturalVentilation) + annotation (Line(points={{-23.8,10.9},{-64,10.9},{-64,88},{51,88},{51,101}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + if useConstNatVentRate == false then + connect(constVentRate.y, aixLiBHighOrderOFD.AirExchangePort) annotation (Line( + points={{-53.5,-1},{-44,-1},{-44,10.9},{-23.8,10.9}}, + color={0,0,127})); + end if; + connect(InternalGains.port, convRadToCombPort.portConv) annotation (Line( + points={{-62,-60},{-72,-60},{-72,-17},{-66,-17}}, + color={191,0,0})); + connect(InternalGains.Q_flow, useProBus.intGains) annotation (Line(points={{-42,-60}, + {-30,-60},{-30,-60},{66,-60},{66,78},{51,78},{51,101}}, color={0, + 0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end AixLibHighOrder; diff --git a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo new file mode 100644 index 00000000..fecd6871 --- /dev/null +++ b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo @@ -0,0 +1,162 @@ +within BESMod.Systems.Demand.Building.Components; +model AixLibHighOrderOFD + extends Building.BaseClasses.PartialAixLibHighOrder( + final nZones=11); + + // Dynamics + parameter Modelica.Fluid.Types.Dynamics energyDynamicsWalls=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial + "Type of energy balance for wall capacities: dynamic (3 initialization options) or steady state" annotation (Dialog(tab="Dynamics")); + parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial + "Type of energy balance: dynamic (3 initialization options) or steady state" annotation (Dialog(tab="Dynamics")); + + // Initialization + parameter Modelica.Units.SI.Temperature T0_air=273.15 + 22 + "Initial temperature of air" annotation (Dialog(tab="Initialization")); + parameter Modelica.Units.SI.Temperature TWalls_start=273.15 + 16 + "Initial temperature of all walls" annotation (Dialog(tab="Initialization")); + + //Outer walls + replaceable parameter AixLib.DataBase.Walls.Collections.OFD.EnEV2009Light + wallTypes constrainedby + AixLib.DataBase.Walls.Collections.BaseDataMultiWalls + "Types of walls (contains multiple records)" + annotation (Dialog(tab="Outer walls", group="Wall"), choicesAllMatching = true); + replaceable model WindowModel = + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow + constrainedby + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); + replaceable parameter AixLib.DataBase.WindowsDoors.Simple.OWBaseDataDefinition_Simple Type_Win "Window parametrization" annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); + replaceable model CorrSolarGainWin = + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG + constrainedby + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG "Correction model for solar irradiance as transmitted radiation" annotation (choicesAllMatching=true, Dialog(tab="Outer walls", group="Windows", enable = withWindow and outside)); + parameter Boolean use_sunblind=false + "Will sunblind become active automatically?" annotation (Dialog(tab="Outer walls", group="Sunblind")); + parameter Modelica.Units.SI.CoefficientOfHeatTransfer UValOutDoors=2.5 + "U-value (thermal transmittance) of doors in outer walls" annotation (Dialog(tab="Outer walls", group="Doors")); + + //Infiltration + parameter Boolean use_infiltEN12831=true + "Use model to exchange room air with outdoor air acc. to standard" annotation (Dialog(tab="Infiltration acc. to EN 12831", group="X")); + parameter Real n50=4 "Air exchange rate at 50 Pa pressure difference" annotation (Dialog(tab="Infiltration acc. to EN 12831", group="X")); + parameter Real e=0.03 "Coefficient of windshield" annotation (Dialog(tab="Infiltration acc. to EN 12831", group="X")); + + // Rooms: + //Groundfloor - 1:LivingRoom_GF, 2:Hobby_GF, 3: Corridor_GF, 4: WC_Storage_GF, 5: Kitchen_GF, + //Upperfloor - 6: Bedroom_UF, 7: Child1_UF, 8: Corridor_UF, 9: Bath_UF, 10: Child2_UF, 11: Attic + final parameter Modelica.Units.SI.Area ABui = sum(AZone) "Total area of all zones"; + final parameter Modelica.Units.SI.Length hBui = hZone[1] + hZone[6] + hZone[11] "Total hight of building"; + final parameter Modelica.Units.SI.Area ARoof = sum(ARoofZone) "Total area of roof"; + final parameter Modelica.Units.SI.Area AZone[nZones]= + {wholeHouseBuildingEnvelope.groundFloor_Building.Livingroom.room_length * + wholeHouseBuildingEnvelope.groundFloor_Building.Livingroom.room_width, + wholeHouseBuildingEnvelope.groundFloor_Building.Hobby.room_length * + wholeHouseBuildingEnvelope.groundFloor_Building.Hobby.room_width, + wholeHouseBuildingEnvelope.groundFloor_Building.Corridor.room_length * + wholeHouseBuildingEnvelope.groundFloor_Building.Corridor.room_width, + wholeHouseBuildingEnvelope.groundFloor_Building.WC_Storage.room_length * + wholeHouseBuildingEnvelope.groundFloor_Building.WC_Storage.room_width, + wholeHouseBuildingEnvelope.groundFloor_Building.Kitchen.room_length * + wholeHouseBuildingEnvelope.groundFloor_Building.Kitchen.room_width, + wholeHouseBuildingEnvelope.upperFloor_Building.Bedroom.room_length * + wholeHouseBuildingEnvelope.upperFloor_Building.Bedroom.room_width_long, + wholeHouseBuildingEnvelope.upperFloor_Building.Children1.room_length * + wholeHouseBuildingEnvelope.upperFloor_Building.Children1.room_width_long, + wholeHouseBuildingEnvelope.upperFloor_Building.Corridor.room_length * + wholeHouseBuildingEnvelope.upperFloor_Building.Corridor.room_width_long, + wholeHouseBuildingEnvelope.upperFloor_Building.Bath.room_length * + wholeHouseBuildingEnvelope.upperFloor_Building.Bath.room_width_long, + wholeHouseBuildingEnvelope.upperFloor_Building.Children2.room_length * + wholeHouseBuildingEnvelope.upperFloor_Building.Children2.room_width_long, + wholeHouseBuildingEnvelope.attic_2Ro_5Rooms.length* + wholeHouseBuildingEnvelope.attic_2Ro_5Rooms.width}; + final parameter Modelica.Units.SI.Length hZone[nZones]= + {wholeHouseBuildingEnvelope.groundFloor_Building.Livingroom.room_height, + wholeHouseBuildingEnvelope.groundFloor_Building.Hobby.room_height, + wholeHouseBuildingEnvelope.groundFloor_Building.Corridor.room_height, + wholeHouseBuildingEnvelope.groundFloor_Building.WC_Storage.room_height, + wholeHouseBuildingEnvelope.groundFloor_Building.Kitchen.room_height, + wholeHouseBuildingEnvelope.upperFloor_Building.Bedroom.room_height_long, + wholeHouseBuildingEnvelope.upperFloor_Building.Children1.room_height_long, + wholeHouseBuildingEnvelope.upperFloor_Building.Corridor.room_height_long, + wholeHouseBuildingEnvelope.upperFloor_Building.Bath.room_height_long, + wholeHouseBuildingEnvelope.upperFloor_Building.Children2.room_height_long, + wholeHouseBuildingEnvelope.attic_2Ro_5Rooms.room_V/AZone[11]}; + final parameter Modelica.Units.SI.Area ARoofZone[nZones]= + {0,0,0,0,0, + wholeHouseBuildingEnvelope.upperFloor_Building.Bedroom.roof_width* + wholeHouseBuildingEnvelope.upperFloor_Building.Bedroom.room_length, + wholeHouseBuildingEnvelope.upperFloor_Building.Children1.roof_width* + wholeHouseBuildingEnvelope.upperFloor_Building.Children1.room_length, + wholeHouseBuildingEnvelope.upperFloor_Building.Corridor.roof_width* + wholeHouseBuildingEnvelope.upperFloor_Building.Corridor.room_length, + wholeHouseBuildingEnvelope.upperFloor_Building.Bath.roof_width* + wholeHouseBuildingEnvelope.upperFloor_Building.Bath.room_length, + wholeHouseBuildingEnvelope.upperFloor_Building.Children2.roof_width* + wholeHouseBuildingEnvelope.upperFloor_Building.Children2.room_length, + wholeHouseBuildingEnvelope.attic_2Ro_5Rooms.roof_width1* + wholeHouseBuildingEnvelope.attic_2Ro_5Rooms.length+ + wholeHouseBuildingEnvelope.attic_2Ro_5Rooms.roof_width2* + wholeHouseBuildingEnvelope.attic_2Ro_5Rooms.length}; + + AixLib.ThermalZones.HighOrder.House.OFD_MiddleInnerLoadWall.BuildingEnvelope.WholeHouseBuildingEnvelope + wholeHouseBuildingEnvelope( + wallTypes=wallTypes, + energyDynamicsWalls=energyDynamicsWalls, + T0_air=T0_air, + TWalls_start=TWalls_start, + redeclare model WindowModel = WindowModel, + Type_Win = Type_Win, + redeclare model CorrSolarGainWin = CorrSolarGainWin, + use_sunblind=use_sunblind, + use_infiltEN12831=use_infiltEN12831, + n50=n50, + energyDynamics=energyDynamics, + redeclare package Medium = MediumZone, + UValOutDoors=UValOutDoors) + annotation (Placement(transformation(extent={{-46,-40},{48,72}}))); + +equation + connect(wholeHouseBuildingEnvelope.groPlateUp, wholeHouseBuildingEnvelope.groFloDown) + annotation (Line(points={{-46,-28.8},{-54,-28.8},{-54,-15.36},{-46,-15.36}}, + color={191,0,0})); + connect(wholeHouseBuildingEnvelope.groFloUp, wholeHouseBuildingEnvelope.uppFloDown) + annotation (Line(points={{-46,16},{-54,16},{-54,29.44},{-46,29.44}}, color={ + 191,0,0})); + connect(wholeHouseBuildingEnvelope.heatingToRooms, heatingToRooms1) + annotation (Line(points={{-46,0.32},{-98,0}}, color={191,0,0})); + connect(wholeHouseBuildingEnvelope.AirExchangePort, AirExchangePort) + annotation (Line(points={{-50.7,44},{-64,44},{-64,34},{-106,34}}, color={0,0, + 127})); + connect(wholeHouseBuildingEnvelope.WindSpeedPort, WindSpeedPort) annotation ( + Line(points={{-50.7,55.2},{-72,55.2},{-72,62},{-106,62}}, color={0,0,127})); + connect(wholeHouseBuildingEnvelope.thermOutside, thermOutside) annotation ( + Line(points={{-46,70.88},{-60,70.88},{-60,90},{-98,90}}, color={191,0,0})); + + connect(wholeHouseBuildingEnvelope.West, West) annotation (Line(points={{50.82, + -5.28},{76,-5.28},{76,-38},{108,-38}}, color={255,128,0})); + connect(wholeHouseBuildingEnvelope.South, South) annotation (Line(points={{50.82, + 8.16},{86,8.16},{86,-12},{108,-12}}, color={255,128,0})); + connect(wholeHouseBuildingEnvelope.East, East) annotation (Line(points={{50.82, + 22.72},{80,22.72},{80,14},{108,14}}, color={255,128,0})); + connect(wholeHouseBuildingEnvelope.North, North) annotation (Line(points={{50.82, + 37.28},{78,37.28},{78,40},{108,40}}, color={255,128,0})); + connect(wholeHouseBuildingEnvelope.SolarRadiationPort_RoofS, + SolarRadiationPort_RoofS) annotation (Line(points={{50.82,51.84},{76,51.84}, + {76,64},{108,64}}, color={255,128,0})); + connect(wholeHouseBuildingEnvelope.SolarRadiationPort_RoofN, + SolarRadiationPort_RoofN) annotation (Line(points={{50.82,66.4},{64,66.4},{64, + 90},{108,90}}, color={255,128,0})); + connect(wholeHouseBuildingEnvelope.portVent_out, portVent_out) annotation ( + Line(points={{49.41,-31.6},{56,-31.6},{56,-92},{100,-92}}, color={0,127,255})); + connect(wholeHouseBuildingEnvelope.portVent_in, portVent_in) annotation (Line( + points={{48.47,-19.28},{68,-19.28},{68,-66},{100,-66}}, color={0,127,255})); + + for i in 1:size(wholeHouseBuildingEnvelope.groundTemp, 1) loop + connect(groundTemp, wholeHouseBuildingEnvelope.groundTemp[i]) annotation ( + Line(points={{0,-100},{0,-44},{1,-44},{1,-40}}, color={191,0,0})); + end for; + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end AixLibHighOrderOFD; diff --git a/BESMod/Systems/Demand/Building/Components/package.mo b/BESMod/Systems/Demand/Building/Components/package.mo new file mode 100644 index 00000000..f0cfca6e --- /dev/null +++ b/BESMod/Systems/Demand/Building/Components/package.mo @@ -0,0 +1,3 @@ +within BESMod.Systems.Demand.Building; +package Components +end Components; diff --git a/BESMod/Systems/Demand/Building/Components/package.order b/BESMod/Systems/Demand/Building/Components/package.order new file mode 100644 index 00000000..98c422bd --- /dev/null +++ b/BESMod/Systems/Demand/Building/Components/package.order @@ -0,0 +1 @@ +AixLibHighOrderOFD diff --git a/BESMod/Systems/Demand/Building/package.order b/BESMod/Systems/Demand/Building/package.order index 5837fc03..e6ff6c1a 100644 --- a/BESMod/Systems/Demand/Building/package.order +++ b/BESMod/Systems/Demand/Building/package.order @@ -1,5 +1,7 @@ TEASERThermalZone BuildingsRoomCase600FF +AixLibHighOrder +Components BaseClasses RecordsCollection HeatDemand From 600236b92c9e1f1056c513f8dbd7ad04908c12a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Thu, 23 Jun 2022 16:59:24 +0200 Subject: [PATCH 003/131] #6 Add a user profile for the high order model --- .../UserProfiles/AixLibHighOrderProfiles.mo | 63 +++++++++++++++++++ BESMod/Systems/UserProfiles/package.order | 1 + 2 files changed, 64 insertions(+) create mode 100644 BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo diff --git a/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo b/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo new file mode 100644 index 00000000..5d21d199 --- /dev/null +++ b/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo @@ -0,0 +1,63 @@ +within BESMod.Systems.UserProfiles; +model AixLibHighOrderProfiles "Standard TEASER Profiles" + extends BaseClasses.RecordBasedDHWUser; + parameter String fileNameIntGains=Modelica.Utilities.Files.loadResource("modelica://BESMod/Resources/InternalGains.txt") + "File where matrix is stored" + annotation (Dialog(tab="Inputs", group="Internal Gains")); + + parameter AixLib.DataBase.Profiles.ProfileBaseDataDefinition VentilationProfile = AixLib.DataBase.Profiles.Ventilation2perDayMean05perH(); + parameter AixLib.DataBase.Profiles.ProfileBaseDataDefinition TSetProfile = AixLib.DataBase.Profiles.SetTemperaturesVentilation2perDay(); + parameter Real gain[3]=fill(1, 3) "Gain value multiplied with internal gains. Used to e.g. disable single gains." annotation (Dialog(group= + "Internal Gains", tab="Inputs")); + + Modelica.Blocks.Sources.CombiTimeTable tableInternalGains( + final tableOnFile=true, + final extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, + final tableName="Internals", + final fileName=fileNameIntGains, + columns=2:4) "Profiles for internal gains" + annotation (Placement(transformation(extent={{23,23},{-23,-23}}, + rotation=180, + origin={-27,1}))); + + Modelica.Blocks.Math.Gain gainIntGains[3](k=gain) + "Profiles for internal gains" annotation (Placement(transformation( + extent={{23,23},{-23,-23}}, + rotation=180, + origin={45,1}))); + + Modelica.Blocks.Sources.CombiTimeTable NaturalVentilation( + columns={2,3,4,5,7}, + extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, + tableOnFile=false, + table=VentilationProfile.Profile) annotation(Placement(transformation(extent={{-101,49}, + {-81,69}}))); + Modelica.Blocks.Sources.CombiTimeTable TSet( + columns={2,3,4,5,6,7}, + extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, + tableOnFile=false, + table=TSetProfile.Profile) annotation(Placement(transformation(extent={{-92, + -118},{-72,-98}}))); +equation + connect(tableInternalGains.y, gainIntGains.u) annotation (Line(points={{-1.7,1}, + {-1.7,0.5},{17.4,0.5},{17.4,1}}, color={0,0,127})); + connect(gainIntGains.y, useProBus.intGains) annotation (Line(points={{70.3,1}, + {79.15,1},{79.15,-1},{115,-1}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(NaturalVentilation.y, useProBus.NaturalVentilation) annotation (Line( + points={{-80,59},{-18,59},{-18,50},{110,50},{110,-1},{115,-1}}, color={0, + 0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(TSet.y, useProBus.TZoneSet) annotation (Line(points={{-71,-108},{114, + -108},{114,-1},{115,-1}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); +end AixLibHighOrderProfiles; diff --git a/BESMod/Systems/UserProfiles/package.order b/BESMod/Systems/UserProfiles/package.order index 7eb66391..2d8cadde 100644 --- a/BESMod/Systems/UserProfiles/package.order +++ b/BESMod/Systems/UserProfiles/package.order @@ -1,5 +1,6 @@ TEASERProfiles Case600Profiles +AixLibHighOrderProfiles NoUser BaseClasses Tests From dfff4c8416c160b9d9604b9d84b43787f214f334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Thu, 23 Jun 2022 16:59:49 +0200 Subject: [PATCH 004/131] #6 Add the calculation of the heat demand for the high order model --- .../Building/HeatDemand/CalcHeaDemHOM.mo | 45 +++++++++++++++++++ .../Demand/Building/HeatDemand/package.order | 1 + 2 files changed, 46 insertions(+) create mode 100644 BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo diff --git a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo new file mode 100644 index 00000000..d85bb9ae --- /dev/null +++ b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo @@ -0,0 +1,45 @@ +within BESMod.Systems.Demand.Building.HeatDemand; +model CalcHeaDemHOM + "Calculate the heat demand for a high order model from AixLib library" + + parameter Integer TIR=1 "Thermal Insulation Regulation" annotation (Dialog( + group="Construction parameters", + compact=true, + descriptionLabel=true), choices( + choice=1 "EnEV_2009", + choice=2 "EnEV_2002", + choice=3 "WSchV_1995", + choice=4 "WSchV_1984", + radioButtons=true)); + + extends PartialCalcHeatingDemand( + TN_heater=building.zoneParam[1].TNHeat, + KR_heater=building.zoneParam[1].KRHeat, + h_heater=building.zoneParam.hHeat*10, + redeclare Examples.UseCaseHOM.HOMSystem systemParameters(TOda_nominal=259.75, + THydSup_nominal={328.15}), + redeclare AixLibHighOrder building( + nZones=1, + useConstNatVentRate=true, + ventRate=fill(0.5, nZones), + TSoil=281.65, + Latitude=weaDat.lon, + Longitude=weaDat.lon, + DiffWeatherDataTime=weaDat.timZon, + GroundReflection=0.2, + redeclare AixLib.DataBase.Walls.Collections.OFD.EnEV2009Light wallTypes, + redeclare model WindowModel = + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.WindowSimple, + redeclare AixLib.DataBase.WindowsDoors.Simple.WindowSimple_EnEV2009 + Type_Win, + redeclare model CorrSolarGainWin = + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.CorGSimple, + use_sunblind=false, + UValOutDoors=if TIR == 1 then 1.8 else 2.9, + use_infiltEN12831=true, + n50=if TIR == 1 or TIR == 2 then 3 else if TIR == 3 then 4 else 6)); + + annotation (Documentation(info=" +

In order to use this model, choose a number of zones and pass a zoneParam from TEASER for every zone. Further specify the nominal heat outdoor air temperature in the system parameters or pass your custom systemParameters record.

+")); +end CalcHeaDemHOM; diff --git a/BESMod/Systems/Demand/Building/HeatDemand/package.order b/BESMod/Systems/Demand/Building/HeatDemand/package.order index 6872c056..cd961cee 100644 --- a/BESMod/Systems/Demand/Building/HeatDemand/package.order +++ b/BESMod/Systems/Demand/Building/HeatDemand/package.order @@ -1,3 +1,4 @@ CalcHeaDemROM CalcHeaBuiRoomCase600FF +CalcHeaDemHOM PartialCalcHeatingDemand From baea39bbcc9c5e708a58f986d461e76b57f485f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Thu, 23 Jun 2022 17:00:25 +0200 Subject: [PATCH 005/131] #6 Add an example use case for the high order model --- BESMod/Examples/UseCaseHOM/HOMSystem.mo | 12 ++++++++++++ BESMod/Examples/UseCaseHOM/package.mo | 4 ++++ BESMod/Examples/UseCaseHOM/package.order | 1 + BESMod/Examples/package.order | 1 + 4 files changed, 18 insertions(+) create mode 100644 BESMod/Examples/UseCaseHOM/HOMSystem.mo create mode 100644 BESMod/Examples/UseCaseHOM/package.mo create mode 100644 BESMod/Examples/UseCaseHOM/package.order diff --git a/BESMod/Examples/UseCaseHOM/HOMSystem.mo b/BESMod/Examples/UseCaseHOM/HOMSystem.mo new file mode 100644 index 00000000..ba71a9b5 --- /dev/null +++ b/BESMod/Examples/UseCaseHOM/HOMSystem.mo @@ -0,0 +1,12 @@ +within BESMod.Examples.UseCaseHOM; +record HOMSystem + extends Systems.RecordsCollection.SystemParametersBaseDataDefinition( + use_elecHeating=false, + nZones=11, + filNamWea=Modelica.Utilities.Files.loadResource( + "modelica://BESMod/Resources/WeatherData/TRY2015_507931060546_Jahr_City_Aachen_Normal.mos"), + use_ventilation=false, + THydSup_nominal={328.15}, + TOda_nominal=265.35); + +end HOMSystem; diff --git a/BESMod/Examples/UseCaseHOM/package.mo b/BESMod/Examples/UseCaseHOM/package.mo new file mode 100644 index 00000000..c3699964 --- /dev/null +++ b/BESMod/Examples/UseCaseHOM/package.mo @@ -0,0 +1,4 @@ +within BESMod.Examples; +package UseCaseHOM "Use case of the high order model from AixLib" + extends Modelica.Icons.ExamplesPackage; +end UseCaseHOM; diff --git a/BESMod/Examples/UseCaseHOM/package.order b/BESMod/Examples/UseCaseHOM/package.order new file mode 100644 index 00000000..c48916ce --- /dev/null +++ b/BESMod/Examples/UseCaseHOM/package.order @@ -0,0 +1 @@ +HOMSystem diff --git a/BESMod/Examples/package.order b/BESMod/Examples/package.order index b2616f3b..5dad7a34 100644 --- a/BESMod/Examples/package.order +++ b/BESMod/Examples/package.order @@ -4,3 +4,4 @@ UseCaseAachen UseCaseAachenTimeBased BAUSimStudy UseCaseModelicaConferencePaper +UseCaseHOM From 301db8815e57dc2e94b2cc0a01a81e7eb83bcc05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Mon, 27 Jun 2022 12:32:15 +0200 Subject: [PATCH 006/131] #6 correct connections --- .../Demand/Building/AixLibHighOrder.mo | 93 +++++++++---------- 1 file changed, 42 insertions(+), 51 deletions(-) diff --git a/BESMod/Systems/Demand/Building/AixLibHighOrder.mo b/BESMod/Systems/Demand/Building/AixLibHighOrder.mo index 5ef15a8a..dd8418de 100644 --- a/BESMod/Systems/Demand/Building/AixLibHighOrder.mo +++ b/BESMod/Systems/Demand/Building/AixLibHighOrder.mo @@ -129,8 +129,7 @@ equation {-80,-17},{-80,60},{-100,60}}, color={191,0,0})); connect(convRadToCombPort.portRad, heatPortRad) annotation (Line(points={{-66,-27}, {-80,-27},{-80,-60},{-100,-60}}, color={0,0,0})); - connect(aixLiBHighOrderOFD.heatingToRooms1, convRadToCombPort.portConvRadComb) - annotation (Line(points={{-21.4,-1},{-36,-1},{-36,-22},{-46,-22}}, color={191, + connect(aixLiBHighOrderOFD.heatingToRooms1, convRadToCombPort.portConvRadComb) annotation (Line(points={{-21.4,-1},{-36,-1},{-36,-22},{-46,-22}}, color={191, 0,0})); connect(aixLiBHighOrderOFD.thermOutside, tempOutside.port) annotation (Line( points={{-21.4,30.5},{-18,30.5},{-18,44}}, color={191,0,0})); @@ -141,45 +140,17 @@ equation connect(aixLiBHighOrderOFD.portVent_out, portVent_out) annotation (Line( points={{38,-31.8},{74,-31.8},{74,-40},{100,-40}}, color={0,127,255})); - - // Connecting n RadOnTiltedSurf - for i in 1:SOD.nSurfaces loop - connect(Sun.OutDayAngleSun, RadOnTiltedSurf[i].InDayAngleSun) annotation ( - Line(points={{7.3,57.42},{14,57.42},{14,55.9},{20.31,55.9}},color={0,0,127})); - connect(Sun.OutHourAngleSun, RadOnTiltedSurf[i].InHourAngleSun) annotation ( - Line(points={{7.3,55.18},{14,55.18},{14,53.9},{20.31,53.9}},color={0,0,127})); - connect(Sun.OutDeclinationSun, RadOnTiltedSurf[i].InDeclinationSun) annotation (Line(points={{7.3, - 53.08},{14,53.08},{14,51.9},{20.31,51.9}}, - color={0,0,127})); - connect(add.y, RadOnTiltedSurf[i].solarInput1) annotation (Line(points={{14.5, - 73},{22.29,73},{22.29,65.3}}, color={0,0,127})); - connect(weaBus.HDifHor, RadOnTiltedSurf[i].solarInput2) annotation (Line( - points={{-47,98},{-30,98},{-30,84},{33.07,84},{33.07,65.3}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); - end for; - - connect(aixLiBHighOrderOFD.SolarRadiationPort_RoofN, RadOnTiltedSurf[5].OutTotalRadTilted) - annotation (Line(points={{40.4,30.5},{52,30.5},{52,62},{38.9,62}}, color={255, + connect(aixLiBHighOrderOFD.SolarRadiationPort_RoofN, RadOnTiltedSurf[5].OutTotalRadTilted) annotation (Line(points={{40.4,30.5},{52,30.5},{52,62},{38.9,62}}, color={255, 128,0})); - connect(aixLiBHighOrderOFD.SolarRadiationPort_RoofS, RadOnTiltedSurf[6].OutTotalRadTilted) - annotation (Line(points={{40.4,21.4},{52,21.4},{52,62},{38.9,62}}, color={255, + connect(aixLiBHighOrderOFD.SolarRadiationPort_RoofS, RadOnTiltedSurf[6].OutTotalRadTilted) annotation (Line(points={{40.4,21.4},{52,21.4},{52,62},{38.9,62}}, color={255, 128,0})); - connect(aixLiBHighOrderOFD.North, RadOnTiltedSurf[1].OutTotalRadTilted) - annotation (Line(points={{40.4,13},{52,13},{52,62},{38.9,62}}, color={255,128, + connect(aixLiBHighOrderOFD.North, RadOnTiltedSurf[1].OutTotalRadTilted) annotation (Line(points={{40.4,13},{52,13},{52,62},{38.9,62}}, color={255,128, 0})); - connect(aixLiBHighOrderOFD.East, RadOnTiltedSurf[2].OutTotalRadTilted) - annotation (Line(points={{40.4,3.9},{52,3.9},{52,62},{38.9,62}}, color={255, + connect(aixLiBHighOrderOFD.East, RadOnTiltedSurf[2].OutTotalRadTilted) annotation (Line(points={{40.4,3.9},{52,3.9},{52,62},{38.9,62}}, color={255, 128,0})); - connect(aixLiBHighOrderOFD.South, RadOnTiltedSurf[3].OutTotalRadTilted) - annotation (Line(points={{40.4,-5.2},{52,-5.2},{52,62},{38.9,62}}, color={255, + connect(aixLiBHighOrderOFD.South, RadOnTiltedSurf[3].OutTotalRadTilted) annotation (Line(points={{40.4,-5.2},{52,-5.2},{52,62},{38.9,62}}, color={255, 128,0})); - connect(aixLiBHighOrderOFD.West, RadOnTiltedSurf[4].OutTotalRadTilted) - annotation (Line(points={{40.4,-14.3},{52,-14.3},{52,62},{38.9,62}}, color={ + connect(aixLiBHighOrderOFD.West, RadOnTiltedSurf[4].OutTotalRadTilted) annotation (Line(points={{40.4,-14.3},{52,-14.3},{52,62},{38.9,62}}, color={ 255,128,0})); connect(weaBus.HGloHor, add.u1) annotation (Line( points={{-47,98},{-47,76},{3,76}}, @@ -205,28 +176,48 @@ equation index=-1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(aixLiBHighOrderOFD.AirExchangePort, useProBus.NaturalVentilation) - annotation (Line(points={{-23.8,10.9},{-64,10.9},{-64,88},{51,88},{51,101}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - if useConstNatVentRate == false then - connect(constVentRate.y, aixLiBHighOrderOFD.AirExchangePort) annotation (Line( - points={{-53.5,-1},{-44,-1},{-44,10.9},{-23.8,10.9}}, - color={0,0,127})); - end if; connect(InternalGains.port, convRadToCombPort.portConv) annotation (Line( points={{-62,-60},{-72,-60},{-72,-17},{-66,-17}}, color={191,0,0})); - connect(InternalGains.Q_flow, useProBus.intGains) annotation (Line(points={{-42,-60}, - {-30,-60},{-30,-60},{66,-60},{66,78},{51,78},{51,101}}, color={0, - 0,127}), Text( + connect(InternalGains.Q_flow, useProBus.intGains) annotation (Line(points={{-42, + -60},{60,-60},{60,70},{51,70},{51,101}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); + connect(constVentRate.y, aixLiBHighOrderOFD.AirExchangePort) annotation (Line( + points={{-53.5,-1},{-50,-1},{-50,10.9},{-23.8,10.9}}, color={0,0,127})); + + // Connecting n RadOnTiltedSurf + for i in 1:SOD.nSurfaces loop + connect(Sun.OutDayAngleSun, RadOnTiltedSurf[i].InDayAngleSun) annotation ( + Line(points={{7.3,57.42},{14,57.42},{14,55.9},{20.31,55.9}},color={0,0,127})); + connect(Sun.OutHourAngleSun, RadOnTiltedSurf[i].InHourAngleSun) annotation ( + Line(points={{7.3,55.18},{14,55.18},{14,53.9},{20.31,53.9}},color={0,0,127})); + connect(Sun.OutDeclinationSun, RadOnTiltedSurf[i].InDeclinationSun) annotation (Line(points={{7.3, + 53.08},{14,53.08},{14,51.9},{20.31,51.9}}, + color={0,0,127})); + connect(add.y, RadOnTiltedSurf[i].solarInput1) annotation (Line(points={{14.5, + 73},{22.29,73},{22.29,65.3}}, color={0,0,127})); + connect(weaBus.HDifHor, RadOnTiltedSurf[i].solarInput2) annotation (Line( + points={{-47,98},{-30,98},{-30,84},{33.07,84},{33.07,65.3}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + end for; + + if useConstNatVentRate == false then + connect(aixLiBHighOrderOFD.AirExchangePort, useProBus.NaturalVentilation) annotation (Line(points={{-23.8,10.9},{-64,10.9},{-64,88},{51,88},{51,101}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + end if; + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); end AixLibHighOrder; From f92e570d5cb1e0891300ce506417814309e0ad93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Mon, 27 Jun 2022 13:17:04 +0200 Subject: [PATCH 007/131] #6 heat demand calculation of HOM --- .../Building/HeatDemand/CalcHeaDemHOM.mo | 38 ++++++++++++------- .../UserProfiles/AixLibHighOrderProfiles.mo | 9 +++-- BESMod/Systems/UserProfiles/NoUserHOM.mo | 28 ++++++++++++++ BESMod/Systems/UserProfiles/package.order | 1 + 4 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 BESMod/Systems/UserProfiles/NoUserHOM.mo diff --git a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo index d85bb9ae..42280cf1 100644 --- a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo +++ b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo @@ -13,21 +13,25 @@ model CalcHeaDemHOM radioButtons=true)); extends PartialCalcHeatingDemand( - TN_heater=building.zoneParam[1].TNHeat, - KR_heater=building.zoneParam[1].KRHeat, - h_heater=building.zoneParam.hHeat*10, - redeclare Examples.UseCaseHOM.HOMSystem systemParameters(TOda_nominal=259.75, - THydSup_nominal={328.15}), + TN_heater=1, + KR_heater=10000, + h_heater=fill(100000,building.nZones), + redeclare Examples.UseCaseHOM.HOMSystem systemParameters( + QDHW_flow_nomial=0, + TOda_nominal=261.15, + TSetZone_nominal(displayUnit="K") = {293.15,293.15,288.15,293.15,293.15,293.15, + 293.15,288.15,297.15,293.15,250.15}, + THydSup_nominal=fill(273.15 + 55, building.nZones)), redeclare AixLibHighOrder building( - nZones=1, useConstNatVentRate=true, - ventRate=fill(0.5, nZones), - TSoil=281.65, - Latitude=weaDat.lon, - Longitude=weaDat.lon, - DiffWeatherDataTime=weaDat.timZon, + ventRate={0.5,0.5,0,0.5,0.5,0.5,0.5,0,0.5,0.5,0}, + Latitude=Modelica.Units.Conversions.to_deg(weaDat.lat), + Longitude=Modelica.Units.Conversions.to_deg(weaDat.lon), + DiffWeatherDataTime=Modelica.Units.Conversions.to_hour(weaDat.timZon), GroundReflection=0.2, - redeclare AixLib.DataBase.Walls.Collections.OFD.EnEV2009Light wallTypes, + T0_air=293.15, + TWalls_start=292.15, + redeclare AixLib.DataBase.Walls.Collections.OFD.EnEV2009Heavy wallTypes, redeclare model WindowModel = AixLib.ThermalZones.HighOrder.Components.WindowsDoors.WindowSimple, redeclare AixLib.DataBase.WindowsDoors.Simple.WindowSimple_EnEV2009 @@ -37,9 +41,15 @@ model CalcHeaDemHOM use_sunblind=false, UValOutDoors=if TIR == 1 then 1.8 else 2.9, use_infiltEN12831=true, - n50=if TIR == 1 or TIR == 2 then 3 else if TIR == 3 then 4 else 6)); + n50=if TIR == 1 or TIR == 2 then 3 else if TIR == 3 then 4 else 6), + redeclare UserProfiles.NoUserHOM heatDemandScenario(nZones=building.nZones, + TSetZone_nominal=fill(273.15 + 21, building.nZones)), + heaterCooler(each Heater_on=true)); annotation (Documentation(info="

In order to use this model, choose a number of zones and pass a zoneParam from TEASER for every zone. Further specify the nominal heat outdoor air temperature in the system parameters or pass your custom systemParameters record.

-")); +"), experiment( + StopTime=25920000, + Interval=3600, + __Dymola_Algorithm="Dassl")); end CalcHeaDemHOM; diff --git a/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo b/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo index 5d21d199..d6b88f5a 100644 --- a/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo +++ b/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo @@ -1,13 +1,13 @@ within BESMod.Systems.UserProfiles; model AixLibHighOrderProfiles "Standard TEASER Profiles" extends BaseClasses.RecordBasedDHWUser; - parameter String fileNameIntGains=Modelica.Utilities.Files.loadResource("modelica://BESMod/Resources/InternalGains.txt") + parameter String fileNameIntGains=Modelica.Utilities.Files.loadResource("modelica://BESMod/Resources/InternalGainsHOM.txt") "File where matrix is stored" annotation (Dialog(tab="Inputs", group="Internal Gains")); parameter AixLib.DataBase.Profiles.ProfileBaseDataDefinition VentilationProfile = AixLib.DataBase.Profiles.Ventilation2perDayMean05perH(); parameter AixLib.DataBase.Profiles.ProfileBaseDataDefinition TSetProfile = AixLib.DataBase.Profiles.SetTemperaturesVentilation2perDay(); - parameter Real gain[3]=fill(1, 3) "Gain value multiplied with internal gains. Used to e.g. disable single gains." annotation (Dialog(group= + parameter Real gain "Gain value multiplied with internal gains. Used to e.g. disable single gains." annotation (Dialog(group= "Internal Gains", tab="Inputs")); Modelica.Blocks.Sources.CombiTimeTable tableInternalGains( @@ -15,12 +15,13 @@ model AixLibHighOrderProfiles "Standard TEASER Profiles" final extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, final tableName="Internals", final fileName=fileNameIntGains, - columns=2:4) "Profiles for internal gains" + columns=2:nZones + 1) + "Profiles for internal gains" annotation (Placement(transformation(extent={{23,23},{-23,-23}}, rotation=180, origin={-27,1}))); - Modelica.Blocks.Math.Gain gainIntGains[3](k=gain) + Modelica.Blocks.Math.Gain gainIntGains[nZones](each k=gain) "Profiles for internal gains" annotation (Placement(transformation( extent={{23,23},{-23,-23}}, rotation=180, diff --git a/BESMod/Systems/UserProfiles/NoUserHOM.mo b/BESMod/Systems/UserProfiles/NoUserHOM.mo new file mode 100644 index 00000000..6bb584c2 --- /dev/null +++ b/BESMod/Systems/UserProfiles/NoUserHOM.mo @@ -0,0 +1,28 @@ +within BESMod.Systems.UserProfiles; +model NoUserHOM "No user" + extends BaseClasses.RecordBasedDHWUser( + final use_dhwCalc=false, + redeclare final BESMod.Systems.Demand.DHW.RecordsCollection.NoDHW + DHWProfile); + + Modelica.Blocks.Sources.Constant constZero[nZones](each k=0) + annotation (Placement(transformation(extent={{-20,-20},{18,18}}))); + Modelica.Blocks.Sources.Constant const[nZones](k=TSetZone_nominal) + "Profiles for internal gains" annotation (Placement(transformation( + extent={{23,23},{-23,-23}}, + rotation=180, + origin={-93,-31}))); +equation + connect(constZero.y, useProBus.intGains) annotation (Line(points={{19.9,-1},{ + 115,-1}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(const.y, useProBus.TZoneSet) annotation (Line(points={{-67.7,-31},{74, + -31},{74,-1},{115,-1}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); +end NoUserHOM; diff --git a/BESMod/Systems/UserProfiles/package.order b/BESMod/Systems/UserProfiles/package.order index 2d8cadde..151382a2 100644 --- a/BESMod/Systems/UserProfiles/package.order +++ b/BESMod/Systems/UserProfiles/package.order @@ -4,3 +4,4 @@ AixLibHighOrderProfiles NoUser BaseClasses Tests +NoUserHOM From e5c32d8c136da5bf350a2ebd6b56c5b1197ea644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Mon, 27 Jun 2022 13:17:19 +0200 Subject: [PATCH 008/131] #6 Internal gains for HOM --- BESMod/Resources/InternalGainsHOM.txt | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 BESMod/Resources/InternalGainsHOM.txt diff --git a/BESMod/Resources/InternalGainsHOM.txt b/BESMod/Resources/InternalGainsHOM.txt new file mode 100644 index 00000000..ab5cc0e8 --- /dev/null +++ b/BESMod/Resources/InternalGainsHOM.txt @@ -0,0 +1,38 @@ +#1 +double Internals(35, 12) +0 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +3600 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +7200 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +10800 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +14400 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +18000 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +21600 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +25190 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +25210 0 426.8 50 163.4 355 0 0 50 447.6 0 0 +28790 0 426.8 50 163.4 355 0 0 50 447.6 0 0 +28810 0 0 50 0 0 0 0 50 0 0 0 +32400 0 0 50 0 0 0 0 50 0 0 0 +36000 0 0 50 0 0 0 0 50 0 0 0 +39600 0 0 50 0 0 0 0 50 0 0 0 +43200 0 0 50 0 0 0 0 50 0 0 0 +46800 0 0 50 0 0 0 0 50 0 0 0 +50390 0 0 50 0 0 0 0 50 0 0 0 +50410 0 0 50 0 0 0 126 50 0 126 0 +54000 0 0 50 0 0 0 126 50 0 126 0 +57590 0 0 50 0 0 0 126 50 0 126 0 +57610 0 0 50 0 0 0 0 50 0 0 0 +61190 0 0 50 0 0 0 0 50 0 0 0 +61210 300.8 0 50 0 0 0 300.8 50 0 300.8 0 +64790 300.8 0 50 0 0 0 300.8 50 0 300.8 0 +64810 300.8 652.8 50 163.4 681 0 0 50 0 0 0 +68390 300.8 652.8 50 163.4 681 0 0 50 0 0 0 +68410 504.4 426.8 50 0 329 0 0 50 0 0 0 +71990 504.4 426.8 50 0 329 0 0 50 0 0 0 +72010 504.4 0 50 0 0 0 213.4 50 221.6 213.4 0 +75590 504.4 0 50 0 0 0 213.4 50 221.6 213.4 0 +75610 454.4 0 50 0 0 0 82.8 50 271.6 82.8 0 +79190 454.4 0 50 0 0 0 82.8 50 271.6 82.8 0 +79210 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +82800 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +86400 0 0 50 0 0 165.6 82.8 50 0 82.8 0 + From fe21c10f23d75da374770be48f6041a8c8d30756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Tue, 2 Aug 2022 16:46:31 +0200 Subject: [PATCH 009/131] #6 small changes within HOM and example for HOM --- BESMod/Examples/UseCaseHOM/BES_HOM.mo | 87 +++++++++++++++ BESMod/Examples/UseCaseHOM/HOMSystem.mo | 3 +- BESMod/Examples/UseCaseHOM/package.order | 1 + .../Demand/Building/AixLibHighOrder.mo | 104 ++++++++++-------- .../Building/Components/AixLibHighOrderOFD.mo | 5 +- .../Building/HeatDemand/CalcHeaDemHOM.mo | 2 +- .../Demand/Building/TEASERThermalZone.mo | 3 +- 7 files changed, 152 insertions(+), 53 deletions(-) create mode 100644 BESMod/Examples/UseCaseHOM/BES_HOM.mo diff --git a/BESMod/Examples/UseCaseHOM/BES_HOM.mo b/BESMod/Examples/UseCaseHOM/BES_HOM.mo new file mode 100644 index 00000000..4c5883da --- /dev/null +++ b/BESMod/Examples/UseCaseHOM/BES_HOM.mo @@ -0,0 +1,87 @@ +within BESMod.Examples.UseCaseHOM; +model BES_HOM + extends BESMod.Systems.BaseClasses.PartialBuildingEnergySystem( + redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, + redeclare BESMod.Systems.Demand.Building.AixLibHighOrder building( + useConstVentRate=false, + Latitude=weaDat.lat, + Longitude=weaDat.lon, + TimeCorrection=0, + DiffWeatherDataTime=weaDat.timZon, + redeclare BESMod.Systems.Demand.Building.Components.AixLibHighOrderOFD + aixLiBHighOrderOFD), + redeclare BESMod.Systems.Control.NoControl control, + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod + generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare package Medium_eva = AixLib.Media.Air, + use_pressure=false, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + heatPumpParameters( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, + scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal + /parameterStudy.QHP_flow_biv, + useAirSource=true, + dpCon_nominal=0, + dpEva_nominal=0, + use_refIne=false, + refIneFre_constant=0), + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR + heatingRodParameters, + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet")), + redeclare BESMod.Systems.Hydraulical.Control.ConstHys_OnOff_HPSControll + control( + redeclare + PCMgoesHIL.Systems.Hydraulic.Control.Components.ThermostaticValveControlHIL + thermostaticValveController, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl + safetyControl, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl + bivalentControlData, + redeclare + BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW + TSet_DHW), + redeclare + BESMod.Systems.Hydraulical.Distribution.DistributionTwoStorageParallel + distribution(redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + bufParameters(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + dhwParameters(dTLoadingHC1=10)), + redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorTransferSystem + transfer(redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + radParameters, redeclare + BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + redeclare BESMod.Systems.Demand.DHW.DHW DHW( + use_pressure=false, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic + calcmFlow), + redeclare BESMod.Systems.UserProfiles.AixLibHighOrderProfiles + userProfiles( + redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM + DHWProfile), + redeclare HOMSystem systemParameters, + redeclare PCMgoesHIL.UseCaseHOM.ParametersToChange parameterStudy, + redeclare final package MediumDHW = AixLib.Media.Water, + redeclare final package MediumZone = AixLib.Media.Air, + redeclare final package MediumHyd = AixLib.Media.Water, + redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); +end BES_HOM; diff --git a/BESMod/Examples/UseCaseHOM/HOMSystem.mo b/BESMod/Examples/UseCaseHOM/HOMSystem.mo index ba71a9b5..0efc9084 100644 --- a/BESMod/Examples/UseCaseHOM/HOMSystem.mo +++ b/BESMod/Examples/UseCaseHOM/HOMSystem.mo @@ -6,7 +6,8 @@ record HOMSystem filNamWea=Modelica.Utilities.Files.loadResource( "modelica://BESMod/Resources/WeatherData/TRY2015_507931060546_Jahr_City_Aachen_Normal.mos"), use_ventilation=false, - THydSup_nominal={328.15}, + QBui_flow_nominal={1124.867,569.6307,53.59064,679.86365,809.8547,786.87427,552.7661,0,666.1303,635.3303,0}, + THydSup_nominal=fill(328.15,nZones), TOda_nominal=265.35); end HOMSystem; diff --git a/BESMod/Examples/UseCaseHOM/package.order b/BESMod/Examples/UseCaseHOM/package.order index c48916ce..8a68712c 100644 --- a/BESMod/Examples/UseCaseHOM/package.order +++ b/BESMod/Examples/UseCaseHOM/package.order @@ -1 +1,2 @@ HOMSystem +BES_HOM diff --git a/BESMod/Systems/Demand/Building/AixLibHighOrder.mo b/BESMod/Systems/Demand/Building/AixLibHighOrder.mo index dd8418de..7a42f0fb 100644 --- a/BESMod/Systems/Demand/Building/AixLibHighOrder.mo +++ b/BESMod/Systems/Demand/Building/AixLibHighOrder.mo @@ -15,14 +15,14 @@ model AixLibHighOrder "High order building model from AixLib library" AixLib.DataBase.Weather.SurfaceOrientation.SurfaceOrientationData_N_E_S_W_RoofN_Roof_S() "Surface orientation data" annotation(Dialog(group = "Solar radiation on oriented surfaces", descriptionLabel = true), choicesAllMatching = true); - parameter Boolean useConstNatVentRate = false; - parameter Real ventRate[nZones]=fill(0, nZones) "Constant mechanical ventilation rate"; + parameter Boolean useConstVentRate; + parameter Real ventRate[nZones]=fill(0, nZones) if useConstVentRate "Constant mechanical ventilation rate" annotation (Dialog(enable=useConstVentRate)); parameter Modelica.Units.SI.Temperature TSoil=281.65 "Temperature of soil"; parameter Modelica.Units.NonSI.Angle_deg Latitude "latitude of location"; parameter Modelica.Units.NonSI.Angle_deg Longitude "longitude of location in"; parameter Real TimeCorrection=0 "for TRY = 0.5, for TMY = 0"; parameter Modelica.Units.NonSI.Time_hour DiffWeatherDataTime=1 "difference between local time and UTC, e.g. +1 for MET"; - parameter Real GroundReflection "ground reflection coefficient"; + parameter Real GroundReflection = 0.2 "ground reflection coefficient"; // Dynamics parameter Modelica.Fluid.Types.Dynamics energyDynamicsWalls=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial @@ -44,11 +44,14 @@ model AixLibHighOrder "High order building model from AixLib library" annotation (Dialog(tab="Outer walls", group="Wall"), choicesAllMatching = true); replaceable model WindowModel = AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow - constrainedby AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); + (windowarea=2) + constrainedby + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); replaceable parameter AixLib.DataBase.WindowsDoors.Simple.OWBaseDataDefinition_Simple Type_Win "Window parametrization" annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); replaceable model CorrSolarGainWin = AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG - constrainedby AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG "Correction model for solar irradiance as transmitted radiation" annotation (choicesAllMatching=true, Dialog(tab="Outer walls", group="Windows", enable = withWindow and outside)); + constrainedby + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG "Correction model for solar irradiance as transmitted radiation" annotation (choicesAllMatching=true, Dialog(tab="Outer walls", group="Windows", enable = withWindow and outside)); parameter Boolean use_sunblind=false "Will sunblind become active automatically?" annotation (Dialog(tab="Outer walls", group="Sunblind")); parameter Modelica.Units.SI.CoefficientOfHeatTransfer UValOutDoors=2.5 @@ -76,7 +79,7 @@ model AixLibHighOrder "High order building model from AixLib library" energyDynamics=energyDynamics, T0_air=T0_air, TWalls_start=TWalls_start, - redeclare model WindowModel = WindowModel, + redeclare model WindowModel = WindowModel (windowarea=2), redeclare model CorrSolarGainWin = CorrSolarGainWin, use_sunblind=use_sunblind, UValOutDoors=UValOutDoors, @@ -85,7 +88,9 @@ model AixLibHighOrder "High order building model from AixLib library" e=e, Type_Win= Type_Win, wallTypes=wallTypes) - annotation (Placement(transformation(extent={{-22,-36},{38,34}}))); + annotation (choicesAllMatching=true, Placement(transformation(extent={{-22,-36},{38,34}}))); + + AixLib.BoundaryConditions.WeatherData.Old.WeatherTRY.BaseClasses.Sun Sun( TimeCorrection=TimeCorrection, @@ -105,8 +110,7 @@ model AixLibHighOrder "High order building model from AixLib library" Modelica.Blocks.Math.Add add(k1=+1, k2=-1) annotation (Placement(transformation(extent={{4,68},{14,78}}))); Modelica.Blocks.Sources.Constant constVentRate[nZones](final k=ventRate) - if useConstNatVentRate "Transform Volume l to massflowrate" - annotation (Placement(transformation( + if useConstVentRate annotation (Placement(transformation( extent={{5,-5},{-5,5}}, rotation=180, origin={-59,-1}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow InternalGains[nZones] @@ -129,7 +133,8 @@ equation {-80,-17},{-80,60},{-100,60}}, color={191,0,0})); connect(convRadToCombPort.portRad, heatPortRad) annotation (Line(points={{-66,-27}, {-80,-27},{-80,-60},{-100,-60}}, color={0,0,0})); - connect(aixLiBHighOrderOFD.heatingToRooms1, convRadToCombPort.portConvRadComb) annotation (Line(points={{-21.4,-1},{-36,-1},{-36,-22},{-46,-22}}, color={191, + connect(aixLiBHighOrderOFD.heatingToRooms1, convRadToCombPort.portConvRadComb) + annotation (Line(points={{-21.4,-1},{-36,-1},{-36,-22},{-46,-22}}, color={191, 0,0})); connect(aixLiBHighOrderOFD.thermOutside, tempOutside.port) annotation (Line( points={{-21.4,30.5},{-18,30.5},{-18,44}}, color={191,0,0})); @@ -140,17 +145,45 @@ equation connect(aixLiBHighOrderOFD.portVent_out, portVent_out) annotation (Line( points={{38,-31.8},{74,-31.8},{74,-40},{100,-40}}, color={0,127,255})); - connect(aixLiBHighOrderOFD.SolarRadiationPort_RoofN, RadOnTiltedSurf[5].OutTotalRadTilted) annotation (Line(points={{40.4,30.5},{52,30.5},{52,62},{38.9,62}}, color={255, + + // Connecting n RadOnTiltedSurf + for i in 1:SOD.nSurfaces loop + connect(Sun.OutDayAngleSun, RadOnTiltedSurf[i].InDayAngleSun) annotation ( + Line(points={{7.3,57.42},{14,57.42},{14,55.9},{20.31,55.9}},color={0,0,127})); + connect(Sun.OutHourAngleSun, RadOnTiltedSurf[i].InHourAngleSun) annotation ( + Line(points={{7.3,55.18},{14,55.18},{14,53.9},{20.31,53.9}},color={0,0,127})); + connect(Sun.OutDeclinationSun, RadOnTiltedSurf[i].InDeclinationSun) annotation (Line(points={{7.3, + 53.08},{14,53.08},{14,51.9},{20.31,51.9}}, + color={0,0,127})); + connect(add.y, RadOnTiltedSurf[i].solarInput1) annotation (Line(points={{14.5, + 73},{22.29,73},{22.29,65.3}}, color={0,0,127})); + connect(weaBus.HDifHor, RadOnTiltedSurf[i].solarInput2) annotation (Line( + points={{-47,98},{-30,98},{-30,84},{33.07,84},{33.07,65.3}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + end for; + + connect(aixLiBHighOrderOFD.SolarRadiationPort_RoofN, RadOnTiltedSurf[5].OutTotalRadTilted) + annotation (Line(points={{40.4,30.5},{52,30.5},{52,62},{38.9,62}}, color={255, 128,0})); - connect(aixLiBHighOrderOFD.SolarRadiationPort_RoofS, RadOnTiltedSurf[6].OutTotalRadTilted) annotation (Line(points={{40.4,21.4},{52,21.4},{52,62},{38.9,62}}, color={255, + connect(aixLiBHighOrderOFD.SolarRadiationPort_RoofS, RadOnTiltedSurf[6].OutTotalRadTilted) + annotation (Line(points={{40.4,21.4},{52,21.4},{52,62},{38.9,62}}, color={255, 128,0})); - connect(aixLiBHighOrderOFD.North, RadOnTiltedSurf[1].OutTotalRadTilted) annotation (Line(points={{40.4,13},{52,13},{52,62},{38.9,62}}, color={255,128, + connect(aixLiBHighOrderOFD.North, RadOnTiltedSurf[1].OutTotalRadTilted) + annotation (Line(points={{40.4,13},{52,13},{52,62},{38.9,62}}, color={255,128, 0})); - connect(aixLiBHighOrderOFD.East, RadOnTiltedSurf[2].OutTotalRadTilted) annotation (Line(points={{40.4,3.9},{52,3.9},{52,62},{38.9,62}}, color={255, + connect(aixLiBHighOrderOFD.East, RadOnTiltedSurf[2].OutTotalRadTilted) + annotation (Line(points={{40.4,3.9},{52,3.9},{52,62},{38.9,62}}, color={255, 128,0})); - connect(aixLiBHighOrderOFD.South, RadOnTiltedSurf[3].OutTotalRadTilted) annotation (Line(points={{40.4,-5.2},{52,-5.2},{52,62},{38.9,62}}, color={255, + connect(aixLiBHighOrderOFD.South, RadOnTiltedSurf[3].OutTotalRadTilted) + annotation (Line(points={{40.4,-5.2},{52,-5.2},{52,62},{38.9,62}}, color={255, 128,0})); - connect(aixLiBHighOrderOFD.West, RadOnTiltedSurf[4].OutTotalRadTilted) annotation (Line(points={{40.4,-14.3},{52,-14.3},{52,62},{38.9,62}}, color={ + connect(aixLiBHighOrderOFD.West, RadOnTiltedSurf[4].OutTotalRadTilted) + annotation (Line(points={{40.4,-14.3},{52,-14.3},{52,62},{38.9,62}}, color={ 255,128,0})); connect(weaBus.HGloHor, add.u1) annotation (Line( points={{-47,98},{-47,76},{3,76}}, @@ -176,6 +209,14 @@ equation index=-1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); + connect(aixLiBHighOrderOFD.AirExchangePort, useProBus.NaturalVentilation) + annotation (Line(points={{-23.8,10.9},{-64,10.9},{-64,88},{51,88},{51,101}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(InternalGains.port, convRadToCombPort.portConv) annotation (Line( points={{-62,-60},{-72,-60},{-72,-17},{-66,-17}}, color={191,0,0})); @@ -187,37 +228,6 @@ equation horizontalAlignment=TextAlignment.Left)); connect(constVentRate.y, aixLiBHighOrderOFD.AirExchangePort) annotation (Line( points={{-53.5,-1},{-50,-1},{-50,10.9},{-23.8,10.9}}, color={0,0,127})); - - // Connecting n RadOnTiltedSurf - for i in 1:SOD.nSurfaces loop - connect(Sun.OutDayAngleSun, RadOnTiltedSurf[i].InDayAngleSun) annotation ( - Line(points={{7.3,57.42},{14,57.42},{14,55.9},{20.31,55.9}},color={0,0,127})); - connect(Sun.OutHourAngleSun, RadOnTiltedSurf[i].InHourAngleSun) annotation ( - Line(points={{7.3,55.18},{14,55.18},{14,53.9},{20.31,53.9}},color={0,0,127})); - connect(Sun.OutDeclinationSun, RadOnTiltedSurf[i].InDeclinationSun) annotation (Line(points={{7.3, - 53.08},{14,53.08},{14,51.9},{20.31,51.9}}, - color={0,0,127})); - connect(add.y, RadOnTiltedSurf[i].solarInput1) annotation (Line(points={{14.5, - 73},{22.29,73},{22.29,65.3}}, color={0,0,127})); - connect(weaBus.HDifHor, RadOnTiltedSurf[i].solarInput2) annotation (Line( - points={{-47,98},{-30,98},{-30,84},{33.07,84},{33.07,65.3}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); - end for; - - if useConstNatVentRate == false then - connect(aixLiBHighOrderOFD.AirExchangePort, useProBus.NaturalVentilation) annotation (Line(points={{-23.8,10.9},{-64,10.9},{-64,88},{51,88},{51,101}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); end AixLibHighOrder; diff --git a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo index fecd6871..a3db0ee8 100644 --- a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo +++ b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo @@ -1,5 +1,5 @@ within BESMod.Systems.Demand.Building.Components; -model AixLibHighOrderOFD +model AixLibHighOrderOFD "High order OFD" extends Building.BaseClasses.PartialAixLibHighOrder( final nZones=11); @@ -23,6 +23,7 @@ model AixLibHighOrderOFD annotation (Dialog(tab="Outer walls", group="Wall"), choicesAllMatching = true); replaceable model WindowModel = AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow + (windowarea=2) constrainedby AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); replaceable parameter AixLib.DataBase.WindowsDoors.Simple.OWBaseDataDefinition_Simple Type_Win "Window parametrization" annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); @@ -105,7 +106,7 @@ model AixLibHighOrderOFD energyDynamicsWalls=energyDynamicsWalls, T0_air=T0_air, TWalls_start=TWalls_start, - redeclare model WindowModel = WindowModel, + redeclare model WindowModel = WindowModel (windowarea=2), Type_Win = Type_Win, redeclare model CorrSolarGainWin = CorrSolarGainWin, use_sunblind=use_sunblind, diff --git a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo index 42280cf1..a365e390 100644 --- a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo +++ b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo @@ -23,7 +23,7 @@ model CalcHeaDemHOM 293.15,288.15,297.15,293.15,250.15}, THydSup_nominal=fill(273.15 + 55, building.nZones)), redeclare AixLibHighOrder building( - useConstNatVentRate=true, + useConstVentRate=true, ventRate={0.5,0.5,0,0.5,0.5,0.5,0.5,0,0.5,0.5,0}, Latitude=Modelica.Units.Conversions.to_deg(weaDat.lat), Longitude=Modelica.Units.Conversions.to_deg(weaDat.lon), diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index a74e4801..c34ebc16 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -34,14 +34,13 @@ model TEASERThermalZone transformation(extent={{35,12},{-39,84}}, rotation=0))); Modelica.Blocks.Sources.Constant constTSetRoom[nZones](final k= - TSetZone_nominal) "Transform Volume l to massflowrate" annotation ( + TSetZone_nominal) annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={74,60}))); Modelica.Blocks.Sources.Constant constVentRate[nZones](final k=ventRate) - "Transform Volume l to massflowrate" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={74,30}))); From 9ff0b63e70ab39f36a077bcd33d5d1343385f57f Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 15 Aug 2022 10:07:40 +0200 Subject: [PATCH 010/131] Update dependencies.json and fix Example extend order --- BESMod/Examples/BAUSimStudy/Case1Standard.mo | 3 ++- BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BESModel.mo | 2 +- BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo | 2 +- BESMod/Examples/UseCaseAachen/BES.mo | 2 +- .../UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mo | 2 +- .../Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mo | 2 +- dependencies.json | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/BESMod/Examples/BAUSimStudy/Case1Standard.mo b/BESMod/Examples/BAUSimStudy/Case1Standard.mo index 62710f93..fc7689e8 100644 --- a/BESMod/Examples/BAUSimStudy/Case1Standard.mo +++ b/BESMod/Examples/BAUSimStudy/Case1Standard.mo @@ -1,8 +1,9 @@ within BESMod.Examples.BAUSimStudy; model Case1Standard - extends Modelica.Icons.Example; extends PartialCase(building(redeclare Buildings.Case_1_standard oneZoneParam), systemParameters(QBui_flow_nominal={16308.1}, TOda_nominal=263.15, THydSup_nominal={328.15})); + extends Modelica.Icons.Example; + annotation (experiment( StopTime=86400, Interval=600, diff --git a/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BESModel.mo b/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BESModel.mo index 65c82720..8353efbd 100644 --- a/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BESModel.mo +++ b/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BESModel.mo @@ -1,6 +1,5 @@ within BESMod.Examples.MyOwnHeatingRodEfficiencyStudy; model BESModel - extends Modelica.Icons.Example; extends Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare BESMod.Systems.Demand.Building.TEASERThermalZone @@ -74,6 +73,7 @@ model BESModel systemParameters( THydSup_nominal={328.15}, use_ventilation=false, use_elecHeating=false)); + extends Modelica.Icons.Example; annotation (experiment( StopTime=86400, diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo index a2124423..6fa814dd 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo @@ -1,6 +1,5 @@ within BESMod.Examples.SolarThermalSystem; model SolarThermalHPS "HPS which is supported by a solar thermal collector" - extends Modelica.Icons.Example; extends BESMod.Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare @@ -89,6 +88,7 @@ model SolarThermalHPS "HPS which is supported by a solar thermal collector" BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile), redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + extends Modelica.Icons.Example; annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, diff --git a/BESMod/Examples/UseCaseAachen/BES.mo b/BESMod/Examples/UseCaseAachen/BES.mo index d917a1d4..dade08ee 100644 --- a/BESMod/Examples/UseCaseAachen/BES.mo +++ b/BESMod/Examples/UseCaseAachen/BES.mo @@ -1,6 +1,5 @@ within BESMod.Examples.UseCaseAachen; model BES - extends Modelica.Icons.Example; extends Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare @@ -83,6 +82,7 @@ model BES redeclare final package MediumHyd = AixLib.Media.Water, redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + extends Modelica.Icons.Example; annotation (experiment( StopTime=31536000, diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mo index 709877ff..ce48d3b4 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mo @@ -1,6 +1,5 @@ within BESMod.Examples.UseCaseModelicaConferencePaper; model BuildingsLibraryRoom "System using the buildings libraries room model" - extends Modelica.Icons.Example; extends PartialModelicaConferenceUseCase( redeclare BESMod.Systems.Demand.Building.BuildingsRoomCase600FF @@ -9,6 +8,7 @@ model BuildingsLibraryRoom "System using the buildings libraries room model" userProfiles(redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile), systemParameters(QBui_flow_nominal={2504})); + extends Modelica.Icons.Example; annotation(__Dymola_Commands(file="modelica://BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mos" "Simulate and plot")); diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mo index 6ab9e73d..4620037e 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mo @@ -1,6 +1,5 @@ within BESMod.Examples.UseCaseModelicaConferencePaper; model TEASERBuilding - extends Modelica.Icons.Example; extends PartialModelicaConferenceUseCase( redeclare Systems.Demand.Building.TEASERThermalZone building( AZone={185.9548}, @@ -12,6 +11,7 @@ model TEASERBuilding userProfiles(redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile), systemParameters(use_hydraulic=true, use_ventilation=true)); + extends Modelica.Icons.Example; initial equation building.thermalZone[1].ROM.extWallRC.thermCapExt[1].T = 293.15; building.thermalZone[1].ROM.floorRC.thermCapExt[1].T = 293.15; diff --git a/dependencies.json b/dependencies.json index 9bf5b7b0..840e76aa 100644 --- a/dependencies.json +++ b/dependencies.json @@ -9,7 +9,7 @@ "optional": { "AixLib": { "url": "https://github.com/RWTH-EBC/AixLib", - "commit": "c33191e2dc862f9d652463527c810c1f143f92d3", + "commit": "b21102ec1245c8d407681aaf6b847aa9f9ceacff", "mo": "AixLib//package.mo" }, "Buildings": { From 6dd1f8f76b3679c12a1f56e9b966e2d13c3f35fe Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 19 Aug 2022 22:37:12 +0200 Subject: [PATCH 011/131] chore: add more tests to ci --- BESMod/Components/UFH/PanelHeating.mo | 2 +- .../HeatDemand/CalcHeaBuiRoomCase600FF.mo | 2 ++ .../Building/HeatDemand/CalcHeaDemROM.mo | 2 ++ .../HeatDemand/PartialCalcHeatingDemand.mo | 1 - .../Demand/Building/TEASERThermalZone.mo | 4 +-- .../Generation/Tests/PVSystemMultiSub.mo | 1 + .../Generation/Tests/PartialTest.mo | 1 - .../Generation/Tests/TestNoGeneration.mo | 2 ++ .../Transfer/NoElectricalTransfer.mo | 9 ++++- .../Transfer/Tests/NoElectricalTransfer.mo | 6 ++-- .../Electrical/Transfer/Tests/PartialTest.mo | 21 ++++++----- .../Distribution/Tests/TestCombiStorage.mo | 2 ++ .../Distribution/Tests/TestDirectLoading.mo | 2 ++ .../Distribution/Tests/TestIndirectLoading.mo | 2 ++ .../Distribution/Tests/TestOnlyBuilding.mo | 2 ++ .../Distribution/Tests/TestOnlyDHW.mo | 2 ++ .../Distribution/Tests/TestSimpleStorages.mo | 2 ++ .../Generation/Tests/ElectricalHeater.mo | 2 ++ .../Hydraulical/Generation/Tests/GasBoiler.mo | 8 ++--- .../Generation/Tests/HeatPumpAndHeatingRod.mo | 2 ++ .../SolarThermalAndHeatPumpAndHeatingRod.mo | 2 ++ .../Hydraulical/Generation/package.order | 2 +- .../Hydraulical/Transfer/Tests/PartialTest.mo | 2 +- .../Tests/TestIdealValveRadiatorSystem.mo | 1 + .../Transfer/Tests/TestPressureBasedSystem.mo | 1 + .../Transfer/Tests/TestUnderfloorHeating.mo | 1 + .../Hydraulical/Transfer/UFHTransferSystem.mo | 31 ++++++++-------- .../UserProfiles/Tests/Case600Profiles.mo | 2 ++ .../Systems/UserProfiles/Tests/NoUserTest.mo | 2 ++ .../Systems/UserProfiles/Tests/PartialTest.mo | 1 - .../UserProfiles/Tests/TEASERProfileTest.mo | 2 ++ .../Tests/ControlledDomesticVentilation.mo | 3 ++ .../02_UnitTests/simulate_model.gitlab-ci.yml | 35 +++++++++++++++++++ 33 files changed, 120 insertions(+), 40 deletions(-) diff --git a/BESMod/Components/UFH/PanelHeating.mo b/BESMod/Components/UFH/PanelHeating.mo index 590feece..87dbfe47 100644 --- a/BESMod/Components/UFH/PanelHeating.mo +++ b/BESMod/Components/UFH/PanelHeating.mo @@ -102,7 +102,7 @@ model PanelHeating each final isFloor=isFloor, each final calcMethod=calcMethod, each final hCon_const=hCon_const, - A_floor=A) annotation (Placement(transformation(extent={{-58,1},{-8,51}}))); + each final A_floor=A) annotation (Placement(transformation(extent={{-58,1},{-8,51}}))); AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.PressureDropPH pressureDrop( redeclare package Medium = Medium, diff --git a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaBuiRoomCase600FF.mo b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaBuiRoomCase600FF.mo index 832a7506..3d3513f8 100644 --- a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaBuiRoomCase600FF.mo +++ b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaBuiRoomCase600FF.mo @@ -9,6 +9,8 @@ model CalcHeaBuiRoomCase600FF redeclare BESMod.Systems.Demand.Building.BuildingsRoomCase600FF building(natInf=0.5, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)); + extends Modelica.Icons.Example; + annotation (Documentation(info="

In order to use this model, choose a number of zones and pass a zoneParam from TEASER for every zone. Further specify the nominal heat outdoor air temperature in the system parameters or pass your custom systemParameters record.

")); diff --git a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemROM.mo b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemROM.mo index d5a7d2cf..8942871c 100644 --- a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemROM.mo +++ b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemROM.mo @@ -16,6 +16,8 @@ model CalcHeaDemROM redeclare BESMod.Examples.BAUSimStudy.Buildings.Case_1_standard oneZoneParam, final ventRate=0.5 .- building.zoneParam.baseACH)); + extends Modelica.Icons.Example; + annotation (Documentation(info="

In order to use this model, choose a number of zones and pass a zoneParam from TEASER for every zone. Further specify the nominal heat outdoor air temperature in the system parameters or pass your custom systemParameters record.

")); diff --git a/BESMod/Systems/Demand/Building/HeatDemand/PartialCalcHeatingDemand.mo b/BESMod/Systems/Demand/Building/HeatDemand/PartialCalcHeatingDemand.mo index b047e1ec..e0355dd0 100644 --- a/BESMod/Systems/Demand/Building/HeatDemand/PartialCalcHeatingDemand.mo +++ b/BESMod/Systems/Demand/Building/HeatDemand/PartialCalcHeatingDemand.mo @@ -1,7 +1,6 @@ within BESMod.Systems.Demand.Building.HeatDemand; partial model PartialCalcHeatingDemand "Model to calculate the heating demand for a given building record" - extends Modelica.Icons.Example; parameter Real h_heater[building.nZones] "Upper limit controller output of the heater"; parameter Real KR_heater=1000 "Gain of the heating controller"; parameter Modelica.Units.SI.Time TN_heater=1 diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index a74e4801..ad6c0e74 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -101,8 +101,8 @@ model TEASERThermalZone rotation=180, origin={25,-97}))); 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 + 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}}, diff --git a/BESMod/Systems/Electrical/Generation/Tests/PVSystemMultiSub.mo b/BESMod/Systems/Electrical/Generation/Tests/PVSystemMultiSub.mo index a6dbce67..55483f16 100644 --- a/BESMod/Systems/Electrical/Generation/Tests/PVSystemMultiSub.mo +++ b/BESMod/Systems/Electrical/Generation/Tests/PVSystemMultiSub.mo @@ -10,6 +10,7 @@ model PVSystemMultiSub alt=1, timZon=weaDat.timZon, ARoof=50)); + extends Modelica.Icons.Example; annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, diff --git a/BESMod/Systems/Electrical/Generation/Tests/PartialTest.mo b/BESMod/Systems/Electrical/Generation/Tests/PartialTest.mo index cb5387cd..921cf9af 100644 --- a/BESMod/Systems/Electrical/Generation/Tests/PartialTest.mo +++ b/BESMod/Systems/Electrical/Generation/Tests/PartialTest.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Electrical.Generation.Tests; partial model PartialTest - extends Modelica.Icons.Example; replaceable BESMod.Systems.Electrical.Generation.BaseClasses.PartialGeneration generation constrainedby BaseClasses.PartialGeneration diff --git a/BESMod/Systems/Electrical/Generation/Tests/TestNoGeneration.mo b/BESMod/Systems/Electrical/Generation/Tests/TestNoGeneration.mo index 6a0e4533..e9f7ea18 100644 --- a/BESMod/Systems/Electrical/Generation/Tests/TestNoGeneration.mo +++ b/BESMod/Systems/Electrical/Generation/Tests/TestNoGeneration.mo @@ -2,6 +2,8 @@ within BESMod.Systems.Electrical.Generation.Tests; model TestNoGeneration extends PartialTest(redeclare BESMod.Systems.Electrical.Generation.NoGeneration generation); + extends Modelica.Icons.Example; + annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, diff --git a/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo b/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo index 8a056d0d..82f578ff 100644 --- a/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo +++ b/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo @@ -3,13 +3,20 @@ model NoElectricalTransfer "No transfer system" extends BESMod.Systems.Electrical.Transfer.BaseClasses.PartialTransfer; Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{16,64},{36,84}}))); + Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow fixedHeatFlow[ + nParallelDem](each final Q_flow=0) + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); equation connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( Line( points={{36,74},{48,74},{48,100}}, color={0,0,0}, thickness=1)); + connect(fixedHeatFlow.port, heatPortCon) annotation (Line(points={{60,0},{86, + 0},{86,38},{100,38}}, color={191,0,0})); + connect(fixedHeatFlow.port, heatPortRad) annotation (Line(points={{60,0},{86, + 0},{86,-38},{100,-38}}, color={191,0,0})); annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); end NoElectricalTransfer; diff --git a/BESMod/Systems/Electrical/Transfer/Tests/NoElectricalTransfer.mo b/BESMod/Systems/Electrical/Transfer/Tests/NoElectricalTransfer.mo index b382dfd0..f8eb4868 100644 --- a/BESMod/Systems/Electrical/Transfer/Tests/NoElectricalTransfer.mo +++ b/BESMod/Systems/Electrical/Transfer/Tests/NoElectricalTransfer.mo @@ -1,9 +1,9 @@ within BESMod.Systems.Electrical.Transfer.Tests; model NoElectricalTransfer + extends PartialTest(redeclare + BESMod.Systems.Electrical.Transfer.NoElectricalTransfer transfer( + nParallelDem=1)); extends Modelica.Icons.Example; - BESMod.Systems.Electrical.Transfer.NoElectricalTransfer - noElectricalTransfer(nParallelDem=1) - annotation (Placement(transformation(extent={{-44,-32},{48,52}}))); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, diff --git a/BESMod/Systems/Electrical/Transfer/Tests/PartialTest.mo b/BESMod/Systems/Electrical/Transfer/Tests/PartialTest.mo index d0531922..7580d4c9 100644 --- a/BESMod/Systems/Electrical/Transfer/Tests/PartialTest.mo +++ b/BESMod/Systems/Electrical/Transfer/Tests/PartialTest.mo @@ -1,20 +1,23 @@ within BESMod.Systems.Electrical.Transfer.Tests; partial model PartialTest - extends Modelica.Icons.Example; replaceable BESMod.Systems.Electrical.Transfer.BaseClasses.PartialTransfer - transfer constrainedby BaseClasses.PartialTransfer(nParallelDem=1) + transfer constrainedby BaseClasses.PartialTransfer annotation (Placement(transformation(extent={{-44,-32},{48,52}})), choicesAllMatching=true); - Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperature[1](each T= - 293.15) annotation (Placement(transformation(extent={{88,-18},{68,2}}))); + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperatureRad[transfer.nParallelDem] + (each T=293.15) + annotation (Placement(transformation(extent={{100,-20},{80,0}}))); + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperatureCon[transfer.nParallelDem] + (each T=293.15) + annotation (Placement(transformation(extent={{100,20},{80,40}}))); equation - connect(fixedTemperature.port, transfer.heatPortRad) annotation ( - Line(points={{68,-8},{60,-8},{60,6.64},{48,6.64}}, color={191,0,0})); - connect(fixedTemperature.port, transfer.heatPortCon) annotation (Line(points= - {{68,-8},{60,-8},{60,26.8},{48,26.8}}, color={191,0,0})); + connect(fixedTemperatureRad.port, transfer.heatPortRad) annotation (Line( + points={{80,-10},{58,-10},{58,6.64},{48,6.64}}, color={191,0,0})); + connect(fixedTemperatureCon.port, transfer.heatPortCon) annotation (Line( + points={{80,30},{58,30},{58,26.8},{48,26.8}}, color={191,0,0})); annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false)), experiment(StopTime=3600, __Dymola_Algorithm="Dassl"), __Dymola_experimentSetupOutput, diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestCombiStorage.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestCombiStorage.mo index 27a3c72d..a1017e78 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestCombiStorage.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestCombiStorage.mo @@ -9,6 +9,8 @@ model TestCombiStorage dTLoadingHC1=5, use_HC2=true, dTLoadingHC2=5))); + extends Modelica.Icons.Example; + Modelica.Blocks.Sources.BooleanPulse booleanPulse(period=100) annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo index 26a090a4..ac3b6ecc 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo @@ -20,6 +20,8 @@ model TestDirectLoading redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR heatingRodAftBufParameters)); + extends Modelica.Icons.Example; + Modelica.Blocks.Sources.BooleanPulse booleanPulse(period=100) annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo index d0f4c3e6..e1d70819 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo @@ -20,6 +20,8 @@ model TestIndirectLoading redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR heatingRodAftBufParameters)); + extends Modelica.Icons.Example; + Modelica.Blocks.Sources.BooleanPulse booleanPulse(period=100) annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestOnlyBuilding.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestOnlyBuilding.mo index 031366ed..9947a356 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestOnlyBuilding.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestOnlyBuilding.mo @@ -3,4 +3,6 @@ model TestOnlyBuilding extends PartialTest(redeclare BESMod.Systems.Hydraulical.Distribution.BuildingOnly distribution(nParallelDem=1)); + extends Modelica.Icons.Example; + end TestOnlyBuilding; diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestOnlyDHW.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestOnlyDHW.mo index f10a32a6..a43ef031 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestOnlyDHW.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestOnlyDHW.mo @@ -3,6 +3,8 @@ model TestOnlyDHW extends PartialTest(redeclare BESMod.Systems.Hydraulical.Distribution.DHWOnly distribution(nParallelDem=1)); + extends Modelica.Icons.Example; + Modelica.Blocks.Sources.BooleanPulse booleanPulse(period=100) annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestSimpleStorages.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestSimpleStorages.mo index 44cb36d9..7fa1d791 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestSimpleStorages.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestSimpleStorages.mo @@ -7,6 +7,8 @@ model TestSimpleStorages bufParameters(dTLoadingHC1=5), redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage dhwParameters(dTLoadingHC1=5))); + extends Modelica.Icons.Example; + Modelica.Blocks.Sources.BooleanPulse booleanPulse(period=100) annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo b/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo index ca80533b..cf9556fb 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo @@ -8,6 +8,8 @@ model ElectricalHeater heatingRodParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)); + extends Modelica.Icons.Example; + Modelica.Blocks.Sources.Constant const1(k=1) annotation (Placement(transformation(extent={{-52,64},{-32,84}}))); equation diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo index 9e023006..5a9edc57 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Generation.Tests; model GasBoiler - extends PartialTest(redeclare + extends Generation.Tests.PartialTest(redeclare BESMod.Systems.Hydraulical.Generation.GasBoiler generation( dTTra_nominal={10}, redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW @@ -8,9 +8,9 @@ model GasBoiler redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor temperatureSensorData, - redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData)); + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)); + extends Modelica.Icons.Example; + Modelica.Blocks.Sources.Pulse pulse(period=1800) annotation (Placement(transformation(extent={{-42,68},{-22,88}}))); equation diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo index e7e006c6..20271fe5 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo @@ -18,6 +18,8 @@ model HeatPumpAndHeatingRod BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, redeclare package Medium_eva = IBPSA.Media.Air)); + extends Modelica.Icons.Example; + Modelica.Blocks.Sources.Constant const1(k=0) annotation (Placement(transformation(extent={{-140,40},{-120,60}}))); Modelica.Blocks.Sources.BooleanConstant diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo index d95eb33c..7c45975e 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo @@ -21,6 +21,8 @@ model SolarThermalAndHeatPumpAndHeatingRod redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpSTData)); + extends Modelica.Icons.Example; + Modelica.Blocks.Sources.Constant const1(k=0) annotation (Placement(transformation(extent={{-140,40},{-120,60}}))); Modelica.Blocks.Sources.BooleanConstant diff --git a/BESMod/Systems/Hydraulical/Generation/package.order b/BESMod/Systems/Hydraulical/Generation/package.order index 6e12ab2a..b3a894d2 100644 --- a/BESMod/Systems/Hydraulical/Generation/package.order +++ b/BESMod/Systems/Hydraulical/Generation/package.order @@ -5,6 +5,6 @@ NoGeneration SolarThermalBivHP SolarThermalBivHPBuiLib Tests -BaseClasses RecordsCollection Types +BaseClasses diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTest.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTest.mo index 426d5ec5..0a34145f 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTest.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTest.mo @@ -7,13 +7,13 @@ partial model PartialTest redeclare package Medium = IBPSA.Media.Water, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, nParallelDem=1, - TSup_nominal=systemParameters.THydSup_nominal, dTTra_nominal={10}, m_flow_nominal={0.317}, Q_flow_nominal=systemParameters.QBui_flow_nominal, TOda_nominal=systemParameters.TOda_nominal, TDem_nominal=systemParameters.TSetZone_nominal, TAmb=systemParameters.TAmbHyd, + TTra_nominal=systemParameters.THydSup_nominal, dpSup_nominal=fill(0, transfer.nParallelDem), AZone={100}, hZone={2.6}, diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo index 2813ae31..62c4a732 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo @@ -8,5 +8,6 @@ model TestIdealValveRadiatorSystem radParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)); + extends Modelica.Icons.Example; end TestIdealValveRadiatorSystem; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo index f4e58227..1e916d61 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo @@ -13,5 +13,6 @@ model TestPressureBasedSystem redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters)); + extends Modelica.Icons.Example; end TestPressureBasedSystem; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestUnderfloorHeating.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestUnderfloorHeating.mo index 5dc6b413..b963a88c 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestUnderfloorHeating.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestUnderfloorHeating.mo @@ -8,5 +8,6 @@ model TestUnderfloorHeating UFHParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)); + extends Modelica.Icons.Example; end TestUnderfloorHeating; diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index 28a14297..1d456286 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -30,8 +30,8 @@ model UFHTransferSystem Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperature - [nParallelDem](final T= - UFHParameters.T_floor) + [nParallelDem](each final + T=UFHParameters.T_floor) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -42,14 +42,15 @@ model UFHTransferSystem extent={{-10,-10},{10,10}}, rotation=0, origin={-46,-6}))); - Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow fixedHeatFlow[nParallelDem](final - Q_flow=0) + Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow fixedHeatFlow[nParallelDem](each final + Q_flow=0) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-92,-20}))); Modelica.Thermal.HeatTransfer.Components.HeatCapacitor - heatCapacitor[nParallelDem](C=100) + heatCapacitor[nParallelDem](each final + C=100) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -62,20 +63,20 @@ model UFHTransferSystem Utilities.KPIs.InputKPICalculator inputKPICalculatorOpening[nParallelDem]( unit=fill("", nParallelDem), integralUnit=fill("s", nParallelDem), - calc_singleOnTime=false, - calc_integral=false, - calc_totalOnTime=false, - calc_numSwi=false, - calc_movAve=false) + each calc_singleOnTime=false, + each calc_integral=false, + each calc_totalOnTime=false, + each calc_numSwi=false, + each calc_movAve=false) annotation (Placement(transformation(extent={{-46,-94},{-26,-58}}))); Utilities.KPIs.InputKPICalculator inputKPICalculatorLossUFH[nParallelDem]( unit=fill("W", nParallelDem), integralUnit=fill("J", nParallelDem), - calc_singleOnTime=false, - calc_integral=false, - calc_totalOnTime=false, - calc_numSwi=false, - calc_movAve=false) + each calc_singleOnTime=false, + each calc_integral=false, + each calc_totalOnTime=false, + each calc_numSwi=false, + each calc_movAve=false) annotation (Placement(transformation(extent={{-46,-120},{-26,-84}}))); IBPSA.Fluid.Sources.Boundary_pT bouPumpHP[nParallelDem]( redeclare package Medium = Medium, diff --git a/BESMod/Systems/UserProfiles/Tests/Case600Profiles.mo b/BESMod/Systems/UserProfiles/Tests/Case600Profiles.mo index 8d3265b1..9fd96e02 100644 --- a/BESMod/Systems/UserProfiles/Tests/Case600Profiles.mo +++ b/BESMod/Systems/UserProfiles/Tests/Case600Profiles.mo @@ -2,4 +2,6 @@ within BESMod.Systems.UserProfiles.Tests; model Case600Profiles extends PartialTest(redeclare BESMod.Systems.UserProfiles.Case600Profiles userProfiles); + extends Modelica.Icons.Example; + end Case600Profiles; diff --git a/BESMod/Systems/UserProfiles/Tests/NoUserTest.mo b/BESMod/Systems/UserProfiles/Tests/NoUserTest.mo index 0228e097..b0c6eff0 100644 --- a/BESMod/Systems/UserProfiles/Tests/NoUserTest.mo +++ b/BESMod/Systems/UserProfiles/Tests/NoUserTest.mo @@ -1,4 +1,6 @@ within BESMod.Systems.UserProfiles.Tests; model NoUserTest extends PartialTest(redeclare BESMod.Systems.UserProfiles.NoUser userProfiles); + extends Modelica.Icons.Example; + end NoUserTest; diff --git a/BESMod/Systems/UserProfiles/Tests/PartialTest.mo b/BESMod/Systems/UserProfiles/Tests/PartialTest.mo index 89ba72d6..40bb211d 100644 --- a/BESMod/Systems/UserProfiles/Tests/PartialTest.mo +++ b/BESMod/Systems/UserProfiles/Tests/PartialTest.mo @@ -1,6 +1,5 @@ within BESMod.Systems.UserProfiles.Tests; partial model PartialTest "Partial Test model" - extends Modelica.Icons.Example; replaceable BaseClasses.PartialUserProfiles userProfiles constrainedby BaseClasses.PartialUserProfiles annotation (Placement(transformation(extent= {{-50,-54},{48,44}})), choicesAllMatching=true); diff --git a/BESMod/Systems/UserProfiles/Tests/TEASERProfileTest.mo b/BESMod/Systems/UserProfiles/Tests/TEASERProfileTest.mo index af937e6c..3b7d7cf4 100644 --- a/BESMod/Systems/UserProfiles/Tests/TEASERProfileTest.mo +++ b/BESMod/Systems/UserProfiles/Tests/TEASERProfileTest.mo @@ -2,4 +2,6 @@ within BESMod.Systems.UserProfiles.Tests; model TEASERProfileTest extends PartialTest(redeclare BESMod.Systems.UserProfiles.TEASERProfiles userProfiles); + extends Modelica.Icons.Example; + end TEASERProfileTest; diff --git a/BESMod/Systems/Ventilation/Generation/Tests/ControlledDomesticVentilation.mo b/BESMod/Systems/Ventilation/Generation/Tests/ControlledDomesticVentilation.mo index 8d580005..f850e943 100644 --- a/BESMod/Systems/Ventilation/Generation/Tests/ControlledDomesticVentilation.mo +++ b/BESMod/Systems/Ventilation/Generation/Tests/ControlledDomesticVentilation.mo @@ -19,6 +19,9 @@ model ControlledDomesticVentilation redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor tempSensorData)); + extends Modelica.Icons.Example; + + Interfaces.GenerationControlBus sigBusGen annotation (Placement(transformation(extent={{-4,54},{16,74}}))); equation diff --git a/bin/templates/03_ci_templates/02_UnitTests/simulate_model.gitlab-ci.yml b/bin/templates/03_ci_templates/02_UnitTests/simulate_model.gitlab-ci.yml index a5ab0c07..e5a0dedd 100644 --- a/bin/templates/03_ci_templates/02_UnitTests/simulate_model.gitlab-ci.yml +++ b/bin/templates/03_ci_templates/02_UnitTests/simulate_model.gitlab-ci.yml @@ -33,6 +33,16 @@ CI_simulate_BESMod_Examples: extends: .CI_simulate_model_job +CI_simulate_BESMod_Utitilies: + variables: + lib_package: Utitilies + extends: .CI_simulate_model_job + +CI_simulate_BESMod_Systems: + variables: + lib_package: Systems + extends: .CI_simulate_model_job + .simulate_model_job: stage: simulate @@ -78,6 +88,16 @@ simulate_BESMod_Examples: lib_package: Examples extends: .simulate_model_job +simulate_BESMod_Utitilies: + variables: + lib_package: Utitilies + extends: .simulate_model_job + +simulate_BESMod_Systems: + variables: + lib_package: Systems + extends: .simulate_model_job + .simulate_changed_models_job: stage: simulate @@ -127,3 +147,18 @@ simulate_BESMod_Examples_changed_models: - BESMod/Examples/**/* extends: .simulate_changed_models_job +simulate_BESMod_Examples_changed_models: + variables: + lib_package: Systems + only: + changes: + - BESMod/Systems/**/* + extends: .simulate_changed_models_job + +simulate_BESMod_Examples_changed_models: + variables: + lib_package: Utilities + only: + changes: + - BESMod/Utilities/**/* + extends: .simulate_changed_models_job From b1a12a780e73b403e8ca3c9e6115039f46a5ba4e Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 19 Aug 2022 22:37:24 +0200 Subject: [PATCH 012/131] Update parameter errors --- .../BaseClasses/PartialHydraulicSystem.mo | 17 ++++++++--------- .../Transfer/BaseClasses/PartialTransfer.mo | 14 +++++++++++--- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo index ee895d5f..689c874c 100644 --- a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo +++ b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo @@ -107,14 +107,14 @@ partial model PartialHydraulicSystem final C_nominal=C_nominal, final mSenFac=mSenFac, final TAmb=hydraulicSystemParameters.TAmb, - final Q_flow_nominal=transfer.Q_flow_nominal .*transfer.f_design, + final Q_flow_nominal=transfer.QSup_flow_nominal, final TDem_nominal=transfer.TSup_nominal, final allowFlowReversal=allowFlowReversal, final show_T=show_T, final rho=rho, final cp=cp, final TOda_nominal=hydraulicSystemParameters.TOda_nominal, - final mDem_flow_nominal=transfer.m_flow_nominal, + final mDem_flow_nominal=transfer.mSup_flow_nominal, final mSup_flow_nominal=generation.m_flow_nominal, final mDHW_flow_nominal=hydraulicSystemParameters.dhwParas.mDHW_flow_nominal, final QDHW_flow_nominal=hydraulicSystemParameters.dhwParas.QDHW_flow_nominal, @@ -124,9 +124,8 @@ partial model PartialHydraulicSystem Placement(transformation(extent={{-12,-104},{90,28}}))); replaceable BESMod.Systems.Hydraulical.Transfer.BaseClasses.PartialTransfer transfer( - dp_nominal=fill(0, transfer.nParallelDem), TTra_nominal= - hydraulicSystemParameters.TSup_nominal) constrainedby - BESMod.Systems.Hydraulical.Transfer.BaseClasses.PartialTransfer( + dp_nominal=fill(0, transfer.nParallelDem)) constrainedby + Transfer.BaseClasses.PartialTransfer( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final massDynamics=massDynamics, @@ -134,6 +133,7 @@ partial model PartialHydraulicSystem final T_start=T_start, final X_start=X_start, final C_start=C_start, + TTra_nominal=hydraulicSystemParameters.TSup_nominal, final AZone=hydraulicSystemParameters.AZone, final hZone=hydraulicSystemParameters.hZone, final ABui=hydraulicSystemParameters.ABui, @@ -146,7 +146,6 @@ partial model PartialHydraulicSystem final TAmb=hydraulicSystemParameters.TAmb, final Q_flow_nominal=hydraulicSystemParameters.Q_flow_nominal, final TDem_nominal=hydraulicSystemParameters.TZone_nominal, - final TSup_nominal=hydraulicSystemParameters.TSup_nominal, final allowFlowReversal=allowFlowReversal, final show_T=show_T, final rho=rho, @@ -309,8 +308,8 @@ equation thickness=1)); connect(transfer.internalElectricalPin, multiSumElec.internalElectricalPinIn[ 1]) annotation (Line( - points={{170.48,-43.28},{170.48,-106},{110,-106},{110,-124.467},{122.2, - -124.467}}, + points={{170.48,-43.28},{170.48,-106},{110,-106},{110,-124.133},{122.2, + -124.133}}, color={0,0,0}, thickness=1)); connect(distribution.internalElectricalPin, multiSumElec.internalElectricalPinIn[ @@ -320,7 +319,7 @@ equation thickness=1)); connect(generation.internalElectricalPin, multiSumElec.internalElectricalPinIn[ 3]) annotation (Line( - points={{-40.24,-104},{-40.24,-123.133},{122.2,-123.133}}, + points={{-40.24,-104},{-40.24,-123.467},{122.2,-123.467}}, color={0,0,0}, thickness=1)); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-180,-140}, diff --git a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo index 702845c2..22282d69 100644 --- a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo +++ b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo @@ -4,12 +4,20 @@ partial model PartialTransfer "Partial transfer model for BES" extends BESMod.Systems.BaseClasses.PartialFluidSubsystemWithParameters( TSup_nominal=fill(max(TTra_nominal),nParallelSup), - dTTra_nominal={if TSup_nominal[i] > 64.9 + 273.15 then 15 elseif - TSup_nominal[i] > 44.9 + 273.15 then 10 else 7 for i in 1:nParallelDem}, + dTTra_nominal={if TTra_nominal[i] > 64.9 + 273.15 then 15 elseif + TTra_nominal[i] > 44.9 + 273.15 then 10 else 7 for i in 1:nParallelDem}, m_flow_nominal=Q_flow_nominal ./ (dTTra_nominal .* 4184)); + parameter Modelica.Units.SI.HeatFlowRate QSup_flow_nominal[nParallelSup]=fill(sum( + Q_flow_nominal .* f_design), nParallelSup) + "Nominal heat flow rate at supply ports to transfer system" annotation (Dialog(group= + "Design - Bottom Up: Parameters are defined by the subsystem")); parameter Modelica.Units.SI.Temperature TTra_nominal[nParallelDem] "Nominal supply temperature to transfer systems" - annotation(Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem")); + annotation(Dialog(group="Design - Top Down: Parameters are given by the parent system")); + parameter Modelica.Units.SI.MassFlowRate mSup_flow_nominal[nParallelSup]=fill(sum( + m_flow_nominal), nParallelSup) + "Nominal mass flow rate of the supply ports to the transfer system" annotation (Dialog( + group="Design - Bottom Up: Parameters are defined by the subsystem")); parameter Modelica.Units.SI.PressureDifference dpSup_nominal[nParallelSup] "Nominal pressure loss of resistances in the supply system of the distribution" From ffecafae60c32879c489b155b108d4a1a93d1aaf Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 19 Aug 2022 22:53:44 +0200 Subject: [PATCH 013/131] Update reference --- .../BAUSimStudy/Buildings/Case_1_retrofit.mo | 4 +- .../BAUSimStudy/Buildings/Case_1_standard.mo | 4 +- .../BAUSimStudy/Buildings/Case_2_retrofit.mo | 4 +- .../BAUSimStudy/Buildings/Case_2_standard.mo | 4 +- BESMod/Examples/BAUSimStudy/Case1Standard.mo | 3 +- BESMod/Examples/BAUSimStudy/PartialCase.mo | 2 +- .../BESModel.mo | 2 +- .../SolarThermalSystem/SolarThermalHPS.mo | 2 +- .../SolarThermalHPSBuildingsLib.mo | 2 +- BESMod/Examples/UseCaseAachen/BES.mo | 2 +- BESMod/Examples/UseCaseAachenTimeBased/BES.mo | 2 +- .../PartialModelicaConferenceUseCase.mo | 63 ++++------ .../TEASERBuilding.mo | 3 +- .../PartialBuildingEnergySystem.mo | 9 +- .../Demand/Building/BuildingsRoomCase600FF.mo | 12 +- .../Building/HeatDemand/CalcHeaDemROM.mo | 2 +- .../Building/RecordsCollection/RefAachen.mo | 4 +- .../Demand/Building/TEASERThermalZone.mo | 119 +++++++++++------- BESMod/Systems/Demand/DHW/DHW.mo | 6 +- .../BaseClasses/PartialElectricalSystem.mo | 3 +- .../Distribution/BatterySystemSimple.mo | 23 ++-- .../Electrical/Distribution/DirectlyToGrid.mo | 5 +- .../Distribution/Tests/BatterySystemSimple.mo | 13 +- .../Electrical/Generation/NoGeneration.mo | 3 +- .../Electrical/Generation/PVSystemMultiSub.mo | 6 +- .../Generation/Tests/PartialTest.mo | 3 +- .../Electrical/Tests/ElectricalSystem.mo | 8 +- .../Transfer/NoElectricalTransfer.mo | 3 +- .../BaseClasses/PartialHydraulicSystem.mo | 3 +- .../PartialTwoPoint_HPS_Controller.mo | 12 +- ...lDistributionTwoStorageParallelDetailed.mo | 18 ++- .../Hydraulical/Distribution/BuildingOnly.mo | 3 +- .../Hydraulical/Distribution/CombiStorage.mo | 6 +- .../Hydraulical/Distribution/DHWOnly.mo | 3 +- .../DistributionTwoStorageParallel.mo | 9 +- .../Generation/ElectricalHeater.mo | 8 +- .../Hydraulical/Generation/GasBoiler.mo | 8 +- .../Generation/HeatPumpAndHeatingRod.mo | 41 +++--- .../Hydraulical/Generation/NoGeneration.mo | 3 +- .../Generation/SolarThermalBivHP.mo | 4 +- .../Generation/SolarThermalBivHPBuiLib.mo | 3 +- .../Hydraulical/Transfer/NoHeatTransfer.mo | 3 +- .../Transfer/RadiatorPressureBased.mo | 3 +- .../Transfer/RadiatorTransferSystem.mo | 9 +- .../Hydraulical/Transfer/UFHTransferSystem.mo | 11 +- .../Systems/UserProfiles/Tests/package.order | 2 +- .../BaseClasses/PartialVentilationSystem.mo | 3 +- .../Distribution/SimpleDistribution.mo | 3 +- .../ControlledDomesticVentilation.mo | 3 +- .../Ventilation/Generation/NoVentilation.mo | 3 +- .../KPIs/BaseClasses/PartialKPICalculator.mo | 2 - .../SupervisoryControl/SupervisoryControl.mo | 19 ++- BESMod/package.mo | 6 +- dependencies.json | 2 +- 54 files changed, 302 insertions(+), 204 deletions(-) diff --git a/BESMod/Examples/BAUSimStudy/Buildings/Case_1_retrofit.mo b/BESMod/Examples/BAUSimStudy/Buildings/Case_1_retrofit.mo index 3356c2b4..82647c76 100644 --- a/BESMod/Examples/BAUSimStudy/Buildings/Case_1_retrofit.mo +++ b/BESMod/Examples/BAUSimStudy/Buildings/Case_1_retrofit.mo @@ -87,5 +87,7 @@ record Case_1_retrofit "Case_1_retrofit_SingleDwelling" CoolerOn = false, withIdealThresholds = false, TThresholdHeater = 288.15, - TThresholdCooler = 295.15); + TThresholdCooler = 295.15, + heaLoadFacGrd=0, + heaLoadFacOut=0); end Case_1_retrofit; diff --git a/BESMod/Examples/BAUSimStudy/Buildings/Case_1_standard.mo b/BESMod/Examples/BAUSimStudy/Buildings/Case_1_standard.mo index 85dec31f..95e241cd 100644 --- a/BESMod/Examples/BAUSimStudy/Buildings/Case_1_standard.mo +++ b/BESMod/Examples/BAUSimStudy/Buildings/Case_1_standard.mo @@ -87,5 +87,7 @@ record Case_1_standard "Case_1_standard_SingleDwelling" CoolerOn = false, withIdealThresholds = false, TThresholdHeater = 288.15, - TThresholdCooler = 295.15); + TThresholdCooler = 295.15, + heaLoadFacGrd=0, + heaLoadFacOut=0); end Case_1_standard; diff --git a/BESMod/Examples/BAUSimStudy/Buildings/Case_2_retrofit.mo b/BESMod/Examples/BAUSimStudy/Buildings/Case_2_retrofit.mo index e8bc7b5a..e642eeb8 100644 --- a/BESMod/Examples/BAUSimStudy/Buildings/Case_2_retrofit.mo +++ b/BESMod/Examples/BAUSimStudy/Buildings/Case_2_retrofit.mo @@ -87,5 +87,7 @@ record Case_2_retrofit "Case_2_retrofit_SingleDwelling" CoolerOn = false, withIdealThresholds = false, TThresholdHeater = 288.15, - TThresholdCooler = 295.15); + TThresholdCooler = 295.15, + heaLoadFacGrd=0, + heaLoadFacOut=0); end Case_2_retrofit; diff --git a/BESMod/Examples/BAUSimStudy/Buildings/Case_2_standard.mo b/BESMod/Examples/BAUSimStudy/Buildings/Case_2_standard.mo index f3ae73d6..c2ab0f17 100644 --- a/BESMod/Examples/BAUSimStudy/Buildings/Case_2_standard.mo +++ b/BESMod/Examples/BAUSimStudy/Buildings/Case_2_standard.mo @@ -87,5 +87,7 @@ record Case_2_standard "Case_2_standard_SingleDwelling" CoolerOn = false, withIdealThresholds = false, TThresholdHeater = 288.15, - TThresholdCooler = 295.15); + TThresholdCooler = 295.15, + heaLoadFacGrd=0, + heaLoadFacOut=0); end Case_2_standard; diff --git a/BESMod/Examples/BAUSimStudy/Case1Standard.mo b/BESMod/Examples/BAUSimStudy/Case1Standard.mo index fc7689e8..12c071a6 100644 --- a/BESMod/Examples/BAUSimStudy/Case1Standard.mo +++ b/BESMod/Examples/BAUSimStudy/Case1Standard.mo @@ -1,6 +1,7 @@ within BESMod.Examples.BAUSimStudy; model Case1Standard - extends PartialCase(building(redeclare Buildings.Case_1_standard oneZoneParam), + extends PartialCase(building(redeclare Buildings.Case_1_standard oneZoneParam( + heaLoadFacGrd=0, heaLoadFacOut=0)), systemParameters(QBui_flow_nominal={16308.1}, TOda_nominal=263.15, THydSup_nominal={328.15})); extends Modelica.Icons.Example; diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index 03a6df66..b8c4d9e3 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -4,7 +4,7 @@ partial model PartialCase redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen - oneZoneParam), + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( diff --git a/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BESModel.mo b/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BESModel.mo index 8353efbd..aa608a1f 100644 --- a/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BESModel.mo +++ b/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BESModel.mo @@ -5,7 +5,7 @@ model BESModel redeclare BESMod.Systems.Demand.Building.TEASERThermalZone building(redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen - oneZoneParam), + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Ventilation.NoVentilation ventilation, diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo index 6fa814dd..da5a76ff 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo @@ -4,7 +4,7 @@ model SolarThermalHPS "HPS which is supported by a solar thermal collector" redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen - oneZoneParam), + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalHPSBuildingsLib.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalHPSBuildingsLib.mo index e125a739..3970e419 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalHPSBuildingsLib.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalHPSBuildingsLib.mo @@ -5,7 +5,7 @@ model SolarThermalHPSBuildingsLib redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen - oneZoneParam), + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( diff --git a/BESMod/Examples/UseCaseAachen/BES.mo b/BESMod/Examples/UseCaseAachen/BES.mo index dade08ee..36dcab8a 100644 --- a/BESMod/Examples/UseCaseAachen/BES.mo +++ b/BESMod/Examples/UseCaseAachen/BES.mo @@ -4,7 +4,7 @@ model BES redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen - oneZoneParam), + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( diff --git a/BESMod/Examples/UseCaseAachenTimeBased/BES.mo b/BESMod/Examples/UseCaseAachenTimeBased/BES.mo index cf790fe4..f690ba00 100644 --- a/BESMod/Examples/UseCaseAachenTimeBased/BES.mo +++ b/BESMod/Examples/UseCaseAachenTimeBased/BES.mo @@ -6,7 +6,7 @@ model BES redeclare BESMod.Systems.Demand.Building.TEASERThermalZone building(redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen - oneZoneParam), + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Ventilation.NoVentilation ventilation, diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 4d5719e5..8e1da6d4 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -11,7 +11,9 @@ partial model PartialModelicaConferenceUseCase generation( redeclare model CellTemperature = AixLib.Electrical.PVSystem.BaseClasses.CellTemperatureMountingContactToGround, + redeclare AixLib.DataBase.SolarElectric.SchuecoSPV170SME1 pVParameters, + lat=weaDat.lat, lon=weaDat.lon, alt=weaDat.alt, @@ -20,22 +22,21 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.Electrical.Transfer.NoElectricalTransfer transfer, redeclare BESMod.Systems.Electrical.Control.NoControl control), - redeclare BESMod.Systems.Control.DHWSuperheating control( - TSetDHW=systemParameters.TSetDHW), - redeclare BESMod.Systems.Hydraulical.HydraulicSystem - hydraulic( + redeclare BESMod.Systems.Control.DHWSuperheating control(TSetDHW= + systemParameters.TSetDHW), + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( dTTra_nominal={10}, - redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare package Medium_eva = AixLib.Media.Air, use_pressure=false, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP heatPumpParameters( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=271.15, scalingFactor=scalingFactorHP, useAirSource=true, @@ -68,47 +69,41 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW TSet_DHW, supCtrlTypeDHWSet=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal), + redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution(redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - bufParameters(dTLoadingHC1=0), - redeclare + bufParameters(dTLoadingHC1=0), redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage dhwParameters(dTLoadingHC1=10)), redeclare Systems.Hydraulical.Transfer.RadiatorTransferSystem transfer( - dTTra_nominal=fill(10,hydraulic.transfer.nParallelDem), + dTTra_nominal=fill(10, hydraulic.transfer.nParallelDem), f_design=fill(1.2, hydraulic.transfer.nParallelDem), redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, - redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData)), + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + redeclare Systems.Demand.DHW.DHW DHW( energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, use_pressure=false, - redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData, - redeclare - BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), - redeclare - BESMod.Examples.UseCaseModelicaConferencePaper.BESModSystemParas + redeclare BESMod.Examples.UseCaseModelicaConferencePaper.BESModSystemParas systemParameters(use_elecHeating=false), - redeclare - BESMod.Systems.RecordsCollection.ParameterStudy.NoStudy + redeclare BESMod.Systems.RecordsCollection.ParameterStudy.NoStudy parameterStudy, redeclare final package MediumDHW = IBPSA.Media.Water, redeclare final package MediumZone = IBPSA.Media.Air, redeclare final package MediumHyd = IBPSA.Media.Water, - redeclare BESMod.Systems.Ventilation.VentilationSystem - ventilation( + redeclare BESMod.Systems.Ventilation.VentilationSystem ventilation( energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare BESMod.Systems.Ventilation.Generation.ControlledDomesticVentilation generation( - m_flow_nominal={sum(building.AZone .*building.hZone .* 0.5 ./ 3600 .* 1.225)}, + m_flow_nominal={sum(building.AZone .* building.hZone .* 0.5 ./ 3600 .* + 1.225)}, redeclare BESMod.Systems.Ventilation.Generation.RecordsCollection.DummyHeatExchangerRecovery parameters, @@ -116,22 +111,18 @@ partial model PartialModelicaConferenceUseCase threeWayValve_b, redeclare IBPSA.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear threeWayValve_a, - redeclare - BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParas, - redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover - fanData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover fanData, + redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor tempSensorData), - redeclare - BESMod.Systems.Ventilation.Distribution.SimpleDistribution - distribution(m_flow_nominal=building.AZone .*building.hZone .* 0.5 ./ + redeclare BESMod.Systems.Ventilation.Distribution.SimpleDistribution + distribution(m_flow_nominal=building.AZone .* building.hZone .* 0.5 ./ 3600 .* 1.225), - redeclare - BESMod.Systems.Ventilation.Control.SummerPIDByPass - control(use_bypass=false))); + redeclare BESMod.Systems.Ventilation.Control.SummerPIDByPass control( + use_bypass=false))); parameter Real scalingFactorHP=hydraulic.generation.heatPumpParameters.QPri_flow_nominal /13000 "May be overwritten to avoid warnings and thus a fail in the CI"; diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mo index 4620037e..ec126933 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mo @@ -5,7 +5,8 @@ model TEASERBuilding AZone={185.9548}, hZone={483.48248/185.9548}, redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen - oneZoneParam, use_verboseEnergyBalance=false, + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0), + use_verboseEnergyBalance=false, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial), redeclare BESMod.Systems.UserProfiles.TEASERProfiles userProfiles(redeclare diff --git a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo index 8e4d1e23..54cf5f72 100644 --- a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo +++ b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo @@ -144,9 +144,12 @@ partial model PartialBuildingEnergySystem "Partial BES" Placement(transformation(extent={{270,40},{300,76}}), iconTransformation( extent={{270,40},{300,76}}))); protected - BESMod.Utilities.Electrical.ZeroLoad hydraulicZeroElecLoad if not systemParameters.use_hydraulic "Internal helper"; - BESMod.Utilities.Electrical.ZeroLoad ventilationZeroElecLoad if not systemParameters.use_ventilation "Internal helper"; - BESMod.Utilities.Electrical.ZeroLoad dhwZeroElecLoad if not systemParameters.use_dhw "Internal helper"; + BESMod.Utilities.Electrical.ZeroLoad hydraulicZeroElecLoad + if not systemParameters.use_hydraulic "Internal helper"; + BESMod.Utilities.Electrical.ZeroLoad ventilationZeroElecLoad + if not systemParameters.use_ventilation "Internal helper"; + BESMod.Utilities.Electrical.ZeroLoad dhwZeroElecLoad + if not systemParameters.use_dhw "Internal helper"; equation connect(building.weaBus, weaDat.weaBus) annotation (Line( diff --git a/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo b/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo index dc5d19e4..5c7306a8 100644 --- a/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo +++ b/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo @@ -1,6 +1,9 @@ within BESMod.Systems.Demand.Building; model BuildingsRoomCase600FF "Detailed room model from the buildings library according to BESTEST Case600FF" + import BESMod; + import BESMod; + import BESMod; extends BaseClasses.PartialDemand( ARoo=roo.AFlo*sqrt(2), hBui=roo.hRoo, @@ -202,15 +205,16 @@ model BuildingsRoomCase600FF use_C_in=false, nPorts=1) "Sink model for air infiltration" annotation (Placement(transformation(extent={{-22,-56},{-10,-44}}))); - Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation( + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement( + transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={108,-92}))); - Utilities.KPIs.ComfortCalculator comfortCalculatorHea[nZones](TComBou= + BESMod.Utilities.KPIs.ComfortCalculator comfortCalculatorHea[nZones](TComBou= TSetZone_nominal .- dTComfort, each for_heating=true) annotation (Placement(transformation(extent={{66,0},{80,14}}))); - Utilities.KPIs.ComfortCalculator comfortCalculatorCool[nZones](TComBou= - TSetZone_nominal .+ dTComfort, each for_heating=false) + BESMod.Utilities.KPIs.ComfortCalculator comfortCalculatorCool[nZones](TComBou + =TSetZone_nominal .+ dTComfort, each for_heating=false) annotation (Placement(transformation(extent={{66,-18},{80,-4}}))); equation connect(roo.uSha, replicator.y) annotation (Line( diff --git a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemROM.mo b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemROM.mo index 8942871c..b7141ad5 100644 --- a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemROM.mo +++ b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemROM.mo @@ -14,7 +14,7 @@ model CalcHeaDemROM building( nZones=1, redeclare BESMod.Examples.BAUSimStudy.Buildings.Case_1_standard - oneZoneParam, + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0), final ventRate=0.5 .- building.zoneParam.baseACH)); extends Modelica.Icons.Example; diff --git a/BESMod/Systems/Demand/Building/RecordsCollection/RefAachen.mo b/BESMod/Systems/Demand/Building/RecordsCollection/RefAachen.mo index 292d6f7c..1eb975ae 100644 --- a/BESMod/Systems/Demand/Building/RecordsCollection/RefAachen.mo +++ b/BESMod/Systems/Demand/Building/RecordsCollection/RefAachen.mo @@ -88,5 +88,7 @@ record RefAachen "Reference Building for Aachen" CoolerOn = false, withIdealThresholds = false, TThresholdHeater=288.15, - TThresholdCooler=295.15); + TThresholdCooler=295.15, + heaLoadFacGrd=0, + heaLoadFacOut=0); end RefAachen; diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index ad6c0e74..1bb0d364 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -1,16 +1,38 @@ within BESMod.Systems.Demand.Building; model TEASERThermalZone "Reduced order building model, coupled with TEASER" + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; extends BaseClasses.PartialDemand( ARoo=sum(zoneParam.ARoof)/nZones, hBui=sum(zoneParam.VAir)^(1/3), ABui=2*sum(zoneParam.VAir)^(1/3), hZone=zoneParam.VAir ./ zoneParam.AZone, AZone=zoneParam.AZone); - replaceable parameter AixLib.DataBase.ThermalZones.ZoneBaseRecord oneZoneParam constrainedby - AixLib.DataBase.ThermalZones.ZoneBaseRecord + replaceable parameter AixLib.DataBase.ThermalZones.ZoneBaseRecord oneZoneParam( + heaLoadFacGrd=0, heaLoadFacOut=0) constrainedby + AixLib.DataBase.ThermalZones.ZoneBaseRecord(heaLoadFacGrd=0, heaLoadFacOut= + 0) "Default zone if only one is chosen" annotation(choicesAllMatching=true); - parameter AixLib.DataBase.ThermalZones.ZoneBaseRecord zoneParam[nZones]=fill(oneZoneParam, nZones) + parameter AixLib.DataBase.ThermalZones.ZoneBaseRecord zoneParam[nZones]( + heaLoadFacGrd=0, + heaLoadFacOut=0) = fill(oneZoneParam, nZones) "Choose an array of multiple zones" annotation(choicesAllMatching=true); parameter Real ventRate[nZones]=fill(0, nZones) "Constant mechanical ventilation rate"; @@ -46,7 +68,7 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=180, origin={74,30}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorTraGain[nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorTraGain[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, @@ -54,11 +76,11 @@ model TEASERThermalZone each calc_numSwi=false, each calc_movAve=false, each calc_intBelThres=false) if use_hydraulic and use_verboseEnergyBalance - annotation (Placement(transformation( + annotation (Placement(transformation( extent={{-7,-11},{7,11}}, rotation=0, origin={-7,-63}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorTraLoss[nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorTraLoss[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, @@ -66,7 +88,7 @@ model TEASERThermalZone each calc_numSwi=false, each calc_movAve=false, each calc_intBelThres=false) if use_hydraulic and use_verboseEnergyBalance - annotation (Placement(transformation( + annotation (Placement(transformation( extent={{-7,-12},{7,12}}, rotation=0, origin={-7,-80}))); @@ -76,27 +98,27 @@ model TEASERThermalZone 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={{-30,-82},{-24,-76}}))); - Utilities.KPIs.InputKPICalculator inputKPICalculator [nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculator[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, each calc_totalOnTime=false, each calc_numSwi=false, each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance - annotation (Placement(transformation( + each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( + Placement(transformation( extent={{-7,-13},{7,13}}, rotation=180, origin={25,-81}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorVentGain[nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorVentGain[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, each calc_totalOnTime=false, each calc_numSwi=false, each calc_movAve=false, - each calc_intBelThres=false) if use_ventilation and use_verboseEnergyBalance - annotation (Placement(transformation( + each calc_intBelThres=false) if use_ventilation and + use_verboseEnergyBalance annotation (Placement(transformation( extent={{-7,-11},{7,11}}, rotation=180, origin={25,-97}))); @@ -108,15 +130,15 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=180, origin={62,-106}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorVentLoss[nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorVentLoss[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, each calc_totalOnTime=false, each calc_numSwi=false, each calc_movAve=false, - each calc_intBelThres=false) if use_ventilation and use_verboseEnergyBalance - annotation (Placement(transformation( + each calc_intBelThres=false) if use_ventilation and + use_verboseEnergyBalance annotation (Placement(transformation( extent={{-7,-12},{7,12}}, rotation=180, origin={25,-114}))); @@ -132,14 +154,15 @@ model TEASERThermalZone annotation (Placement(transformation(extent={{-3,-3},{3,3}}, rotation=180, origin={41,-115}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorTraGain2[nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorTraGain2[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, each calc_totalOnTime=false, each calc_numSwi=false, each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation (Placement(transformation( + each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( + Placement(transformation( extent={{-7,-11},{7,11}}, rotation=0, origin={-7,-97}))); @@ -149,14 +172,15 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=0, origin={-48,-106}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorTraLoss2[nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorTraLoss2[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, each calc_totalOnTime=false, each calc_numSwi=false, each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation (Placement(transformation( + each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( + Placement(transformation( extent={{-7,-12},{7,12}}, rotation=0, origin={-7,-114}))); @@ -178,20 +202,21 @@ model TEASERThermalZone [nZones] if use_hydraulic and use_verboseEnergyBalance annotation (Placement(transformation(extent={{-52,-80},{-42,-70}}))); - Utilities.KPIs.ComfortCalculator comfortCalculatorCool[nZones](TComBou= - TSetZone_nominal .+ dTComfort, each for_heating=false) + BESMod.Utilities.KPIs.ComfortCalculator comfortCalculatorCool[nZones](TComBou + =TSetZone_nominal .+ dTComfort, each for_heating=false) annotation (Placement(transformation(extent={{-24,-52},{-4,-32}}))); - Utilities.KPIs.ComfortCalculator comfortCalculatorHea[nZones](TComBou= + BESMod.Utilities.KPIs.ComfortCalculator comfortCalculatorHea[nZones](TComBou= TSetZone_nominal .- dTComfort, each for_heating=true) annotation (Placement(transformation(extent={{-24,-30},{-4,-10}}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorOwaGain[nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorOwaGain[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, each calc_totalOnTime=false, each calc_numSwi=false, each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation (Placement(transformation( + each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( + Placement(transformation( extent={{-7,-11},{7,11}}, rotation=0, origin={-7,-137}))); @@ -201,14 +226,15 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=0, origin={-48,-146}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorOwaLoss[nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorOwaLoss[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, each calc_totalOnTime=false, each calc_numSwi=false, each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation (Placement(transformation( + each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( + Placement(transformation( extent={{-7,-12},{7,12}}, rotation=0, origin={-7,-154}))); @@ -220,16 +246,16 @@ model TEASERThermalZone [nZones](each final uMax=0, each final uMin=-Modelica.Constants.inf) if use_verboseEnergyBalance annotation (Placement(transformation(extent={{-30,-156},{-24,-150}}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorFloorGain[ - nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorFloorGain[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, each calc_totalOnTime=false, each calc_numSwi=false, each calc_movAve=false, - each calc_intBelThres=false) if oneZoneParam.AFloor > 0 and use_verboseEnergyBalance - annotation (Placement(transformation( + each calc_intBelThres=false) + if oneZoneParam.AFloor > 0 and use_verboseEnergyBalance annotation ( + Placement(transformation( extent={{-7,-11},{7,11}}, rotation=0, origin={-7,-173}))); @@ -240,16 +266,16 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=0, origin={-48,-182}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorFloorLoss[ - nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorFloorLoss[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, each calc_totalOnTime=false, each calc_numSwi=false, each calc_movAve=false, - each calc_intBelThres=false) if oneZoneParam.AFloor > 0 and use_verboseEnergyBalance - annotation (Placement(transformation( + each calc_intBelThres=false) + if oneZoneParam.AFloor > 0 and use_verboseEnergyBalance annotation ( + Placement(transformation( extent={{-7,-12},{7,12}}, rotation=0, origin={-7,-190}))); @@ -263,14 +289,15 @@ model TEASERThermalZone uMax=0, each final uMin=-Modelica.Constants.inf) if oneZoneParam.AFloor > 0 and use_verboseEnergyBalance annotation (Placement(transformation(extent={{-30,-192},{-24,-186}}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorRoofGain[nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorRoofGain[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, each calc_totalOnTime=false, each calc_numSwi=false, each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation (Placement(transformation( + each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( + Placement(transformation( extent={{-7,-11},{7,11}}, rotation=0, origin={-75,-137}))); @@ -280,14 +307,15 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=0, origin={-116,-146}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorRoofLoss[nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorRoofLoss[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, each calc_totalOnTime=false, each calc_numSwi=false, each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation (Placement(transformation( + each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( + Placement(transformation( extent={{-7,-12},{7,12}}, rotation=0, origin={-75,-154}))); @@ -299,14 +327,15 @@ model TEASERThermalZone [nZones](each final uMax=0, each final uMin=-Modelica.Constants.inf) if use_verboseEnergyBalance annotation (Placement(transformation(extent={{-98,-156},{-92,-150}}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorWinGain[nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorWinGain[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, each calc_totalOnTime=false, each calc_numSwi=false, each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation (Placement(transformation( + each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( + Placement(transformation( extent={{-7,-11},{7,11}}, rotation=0, origin={-75,-173}))); @@ -316,14 +345,15 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=0, origin={-116,-182}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorWinLoss[nZones]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorWinLoss[nZones]( unit=fill("W", nZones), integralUnit=fill("J", nZones), each calc_singleOnTime=false, each calc_totalOnTime=false, each calc_numSwi=false, each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation (Placement(transformation( + each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( + Placement(transformation( extent={{-7,-12},{7,12}}, rotation=0, origin={-75,-190}))); @@ -339,7 +369,8 @@ model TEASERThermalZone rotation=180, origin={53,-81}))); - Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation( + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement( + transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={94,-96}))); diff --git a/BESMod/Systems/Demand/DHW/DHW.mo b/BESMod/Systems/Demand/DHW/DHW.mo index f1bc3188..a3d5b764 100644 --- a/BESMod/Systems/Demand/DHW/DHW.mo +++ b/BESMod/Systems/Demand/DHW/DHW.mo @@ -1,5 +1,7 @@ within BESMod.Systems.Demand.DHW; model DHW "Standard DHW subsystem" + import BESMod; + import BESMod; extends BaseClasses.PartialDHW; @@ -40,7 +42,7 @@ Modelica.Blocks.Math.UnitConversions.From_degC fromDegC extent={{7,-7},{-7,7}}, rotation=0, origin={41,63}))); - Utilities.KPIs.InternalKPICalculator internalKPICalculator( + BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculator( unit="W", integralUnit="J", final calc_singleOnTime=false, @@ -90,7 +92,7 @@ Modelica.Blocks.Math.UnitConversions.From_degC fromDegC redeclare final package Medium = Medium, final p=p_start) if use_pressure annotation (Placement(transformation(extent={{-16,-86},{-36,-66}}))); - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{32,-94},{52,-74}}))); equation connect(port_a, senT.port_a) annotation (Line(points={{-100,60},{-60,60},{-60, diff --git a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo index 8aee786b..cac0a579 100644 --- a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo +++ b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo @@ -55,7 +55,8 @@ partial model PartialElectricalSystem "Partial model for electrical system" transformation(extent={{-26,122},{20,160}}), iconTransformation(extent={ {-26,122},{20,160}}))); protected - BESMod.Utilities.Electrical.ZeroLoad zeroTraLoad if not use_elecHeating "Internal helper"; + BESMod.Utilities.Electrical.ZeroLoad zeroTraLoad if not use_elecHeating + "Internal helper"; equation connect(generation.weaBus, weaBus) annotation (Line( points={{-148,19.44},{-162,19.44},{-162,42},{-180,42},{-180,45}}, diff --git a/BESMod/Systems/Electrical/Distribution/BatterySystemSimple.mo b/BESMod/Systems/Electrical/Distribution/BatterySystemSimple.mo index ec752263..1c8ab529 100644 --- a/BESMod/Systems/Electrical/Distribution/BatterySystemSimple.mo +++ b/BESMod/Systems/Electrical/Distribution/BatterySystemSimple.mo @@ -1,5 +1,8 @@ within BESMod.Systems.Electrical.Distribution; model BatterySystemSimple "Simple Battery model" + import BESMod; + import BESMod; + import BESMod; extends BESMod.Systems.Electrical.Distribution.BaseClasses.PartialDistribution; @@ -10,22 +13,18 @@ model BatterySystemSimple "Simple Battery model" nBat=nBat, final SOC_start=SOC_start_bat) annotation (Placement(transformation(extent={{-46,-42},{46,42}}))); - Utilities.Electrical.ElecConToReal elecConToReal(reverse=true) - annotation (Placement( - transformation( + BESMod.Utilities.Electrical.ElecConToReal elecConToReal(reverse=true) + annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={-70,34}))); - Utilities.Electrical.RealToElecConSplit - realToElecConSplit - annotation (Placement( - transformation( + BESMod.Utilities.Electrical.RealToElecConSplit realToElecConSplit annotation + (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={50,-30}))); - Utilities.Electrical.ElecConToReal elecConToReal2[nSubSys](each final reverse= - true) - annotation (Placement(transformation( + BESMod.Utilities.Electrical.ElecConToReal elecConToReal2[nSubSys](each final + reverse=true) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={72,24}))); @@ -66,8 +65,8 @@ equation thickness=1)); connect(elecConToReal.PElecGen, batterySimple.PCharge) annotation (Line(points={{-74,22},{-74,0},{-23,0}}, color={0,0,127})); - connect(realToElecConSplit.PEle, batterySimple.PGrid) annotation (Line(points - ={{50,-18},{50,16.8},{24.84,16.8}}, color={0,0,127})); + connect(realToElecConSplit.PEle, batterySimple.PGrid) annotation (Line(points= + {{50,-18},{50,16.8},{24.84,16.8}}, color={0,0,127})); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Systems/Electrical/Distribution/DirectlyToGrid.mo b/BESMod/Systems/Electrical/Distribution/DirectlyToGrid.mo index f80f7b1b..a12525a5 100644 --- a/BESMod/Systems/Electrical/Distribution/DirectlyToGrid.mo +++ b/BESMod/Systems/Electrical/Distribution/DirectlyToGrid.mo @@ -1,10 +1,11 @@ within BESMod.Systems.Electrical.Distribution; model DirectlyToGrid "Direct grid connection" + import BESMod; extends BESMod.Systems.Electrical.Distribution.BaseClasses.PartialDistribution; - Utilities.Electrical.MultiSumElec multiSumElec(nPorts=nSubSys) annotation ( - Placement(transformation( + BESMod.Utilities.Electrical.MultiSumElec multiSumElec(nPorts=nSubSys) + annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, origin={50,-2}))); diff --git a/BESMod/Systems/Electrical/Distribution/Tests/BatterySystemSimple.mo b/BESMod/Systems/Electrical/Distribution/Tests/BatterySystemSimple.mo index 59f7b8a0..4b0b7afb 100644 --- a/BESMod/Systems/Electrical/Distribution/Tests/BatterySystemSimple.mo +++ b/BESMod/Systems/Electrical/Distribution/Tests/BatterySystemSimple.mo @@ -1,5 +1,8 @@ within BESMod.Systems.Electrical.Distribution.Tests; model BatterySystemSimple + import BESMod; + import BESMod; + import BESMod; extends Modelica.Icons.Example; BESMod.Systems.Electrical.Distribution.BatterySystemSimple batterySystemSimple(nSubSys=2, @@ -7,11 +10,11 @@ model BatterySystemSimple BuildingSystems.Technologies.ElectricalStorages.Data.LithiumIon.LithiumIonTeslaPowerwall1 batteryParameters) annotation (Placement(transformation(extent={{-32,-36},{40,38}}))); - Utilities.Electrical.RealToElecCon realToElecCon(use_souLoa=false) + BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souLoa=false) annotation (Placement(transformation(extent={{-44,50},{-24,70}}))); - Utilities.Electrical.RealToElecCon realToElecCon1(use_souGen=false) + BESMod.Utilities.Electrical.RealToElecCon realToElecCon1(use_souGen=false) annotation (Placement(transformation(extent={{58,50},{38,70}}))); - Utilities.Electrical.ElecConToReal elecConToReal + BESMod.Utilities.Electrical.ElecConToReal elecConToReal annotation (Placement(transformation(extent={{44,-76},{74,-46}}))); Modelica.Blocks.Sources.Sine ElectricalLoad( amplitude=3000, @@ -54,12 +57,12 @@ equation annotation (Line(points={{77,-55},{98,-55},{98,-62}}, color={0,0,127})); connect(realToElecCon1.internalElectricalPin, batterySystemSimple.internalElectricalPin[ 1]) annotation (Line( - points={{37.8,60.2},{22,60.2},{22,36.15}}, + points={{37.8,60.2},{22,60.2},{22,37.075}}, color={0,0,0}, thickness=1)); connect(realToElecCon.internalElectricalPin, batterySystemSimple.internalElectricalPin[ 2]) annotation (Line( - points={{-23.8,60.2},{22,60.2},{22,39.85}}, + points={{-23.8,60.2},{22,60.2},{22,38.925}}, color={0,0,0}, thickness=1)); connect(PGeneration.y, realToElecCon.PEleGen) annotation (Line(points={{-60.8, diff --git a/BESMod/Systems/Electrical/Generation/NoGeneration.mo b/BESMod/Systems/Electrical/Generation/NoGeneration.mo index 81ff9aa2..bc5a5987 100644 --- a/BESMod/Systems/Electrical/Generation/NoGeneration.mo +++ b/BESMod/Systems/Electrical/Generation/NoGeneration.mo @@ -1,8 +1,9 @@ within BESMod.Systems.Electrical.Generation; model NoGeneration "Don't generation electricity" + import BESMod; extends BaseClasses.PartialGeneration(final f_design=fill(0.8, numGenUnits), final numGenUnits=1); - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{10,60},{30,80}}))); equation connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( diff --git a/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo b/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo index 5b85492b..d06ed7c0 100644 --- a/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo +++ b/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo @@ -1,6 +1,8 @@ within BESMod.Systems.Electrical.Generation; model PVSystemMultiSub "PV system with subsystems of different orientation and module type" + import BESMod; + import BESMod; extends BESMod.Systems.Electrical.Generation.BaseClasses.PartialGeneration( numGenUnits=1); @@ -28,7 +30,7 @@ model PVSystemMultiSub replaceable model CellTemperature = AixLib.Electrical.PVSystem.BaseClasses.PartialCellTemperature annotation ( __Dymola_choicesAllMatching=true); - Utilities.Electrical.RealToElecCon realToElecCon(use_souLoa=false) + BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souLoa=false) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, @@ -54,7 +56,7 @@ model PVSystemMultiSub parameter Modelica.Units.SI.Angle azi[numGenUnits]=fill(0*Modelica.Constants.pi/180,numGenUnits) "Surface's azimut angle (0:South)"; parameter Modelica.Units.SI.Area ARoof(min=0) "Roof area of building" annotation(Dialog(group="Design - Top Down: Parameters are given by the parent system")); - Utilities.KPIs.InputKPICalculator inputKPICalculator( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculator( unit="W", integralUnit="J", calc_singleOnTime=false, diff --git a/BESMod/Systems/Electrical/Generation/Tests/PartialTest.mo b/BESMod/Systems/Electrical/Generation/Tests/PartialTest.mo index 921cf9af..b2d60935 100644 --- a/BESMod/Systems/Electrical/Generation/Tests/PartialTest.mo +++ b/BESMod/Systems/Electrical/Generation/Tests/PartialTest.mo @@ -1,5 +1,6 @@ within BESMod.Systems.Electrical.Generation.Tests; partial model PartialTest + import BESMod; replaceable BESMod.Systems.Electrical.Generation.BaseClasses.PartialGeneration generation constrainedby BaseClasses.PartialGeneration @@ -9,7 +10,7 @@ partial model PartialTest ModelicaServices.ExternalReferences.loadResource( "modelica://BESMod/Resources/TRY2015_522361130393_Jahr_City_Potsdam.mos")) annotation (Placement(transformation(extent={{-100,58},{-62,100}}))); - Utilities.Electrical.ElecConToReal elecConToReal + BESMod.Utilities.Electrical.ElecConToReal elecConToReal annotation (Placement(transformation(extent={{56,54},{92,98}}))); equation connect(weaDat.weaBus, generation.weaBus) annotation (Line( diff --git a/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo b/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo index 13cca6e1..75a2a659 100644 --- a/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo +++ b/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo @@ -1,5 +1,7 @@ within BESMod.Systems.Electrical.Tests; model ElectricalSystem + import BESMod; + import BESMod; extends Modelica.Icons.Example; BESMod.Systems.Electrical.ElectricalSystem pVBatterySystemNoTransfer( @@ -26,13 +28,13 @@ model ElectricalSystem f=1/86400, offset=3000) annotation (Placement(transformation(extent={{-98,24},{-78,44}}))); - Utilities.Electrical.RealToElecCon realToElecCon + BESMod.Utilities.Electrical.RealToElecCon realToElecCon annotation (Placement(transformation(extent={{-70,24},{-50,44}}))); IBPSA.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam= ModelicaServices.ExternalReferences.loadResource( "modelica://BESMod/Resources/TRY2015_522361130393_Jahr_City_Potsdam.mos")) annotation (Placement(transformation(extent={{-100,68},{-72,96}}))); - Utilities.Electrical.ElecConToReal elecConToReal(reverse=true) + BESMod.Utilities.Electrical.ElecConToReal elecConToReal(reverse=true) annotation (Placement(transformation(extent={{-30,-80},{-6,-54}}))); Modelica.Blocks.Interfaces.RealOutput PElecFromGrid "Electrical power" annotation (Placement(transformation(extent={{20,-76},{40,-56}}))); @@ -47,7 +49,7 @@ equation connect(pVBatterySystemNoTransfer.externalElectricalPin1, elecConToReal.internalElectricalPin) annotation (Line( - points={{-35.8353,-32.9143},{-35.8353,-66.74},{-29.76,-66.74}}, + points={{54.5412,28.4286},{54.5412,-66.74},{-29.76,-66.74}}, color={0,0,0}, thickness=1)); connect(elecConToReal.PElecLoa, PElecFromGrid) diff --git a/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo b/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo index 82f578ff..95ef204f 100644 --- a/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo +++ b/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo @@ -1,7 +1,8 @@ within BESMod.Systems.Electrical.Transfer; model NoElectricalTransfer "No transfer system" + import BESMod; extends BESMod.Systems.Electrical.Transfer.BaseClasses.PartialTransfer; - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{16,64},{36,84}}))); Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow fixedHeatFlow[ nParallelDem](each final Q_flow=0) diff --git a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo index 689c874c..d9db09f1 100644 --- a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo +++ b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo @@ -1,6 +1,7 @@ within BESMod.Systems.Hydraulical.BaseClasses; partial model PartialHydraulicSystem "Complete hydraulic system model" + import BESMod; extends BESMod.Systems.BaseClasses.PartialFluidSubsystem; parameter Boolean subsystemDisabled "To enable the icon if the subsystem is disabled" annotation (Dialog(tab="Graphics")); @@ -185,7 +186,7 @@ partial model PartialHydraulicSystem Interfaces.SystemControlBus sigBusHyd annotation (Placement(transformation( extent={{12,120},{58,160}}), iconTransformation(extent={{12,120},{ 58,160}}))); - Utilities.Electrical.MultiSumElec multiSumElec(nPorts=3) annotation ( + BESMod.Utilities.Electrical.MultiSumElec multiSumElec(nPorts=3) annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo index 78f31c21..ad5674bf 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo @@ -1,6 +1,9 @@ within BESMod.Systems.Hydraulical.Control.BaseClasses; partial model PartialTwoPoint_HPS_Controller "Partial model with replaceable blocks for rule based control of HPS using on off heating rods" + import BESMod; + import BESMod; + import BESMod; extends BESMod.Systems.Hydraulical.Control.BaseClasses.SystemWithThermostaticValveControl; replaceable @@ -139,11 +142,12 @@ partial model PartialTwoPoint_HPS_Controller extent={{-5,-5},{5,5}}, rotation=270, origin={-37,-17}))); - Utilities.SupervisoryControl.SupervisoryControl supervisoryControlDHW(ctrlType= - supCtrlTypeDHWSet) + BESMod.Utilities.SupervisoryControl.SupervisoryControl supervisoryControlDHW( + ctrlType=supCtrlTypeDHWSet) annotation (Placement(transformation(extent={{-182,72},{-170,84}}))); - parameter Utilities.SupervisoryControl.Types.SupervisoryControlType - supCtrlTypeDHWSet = Utilities.SupervisoryControl.Types.SupervisoryControlType.Local "Type of supervisory control for DHW Setpoint"; + parameter BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType + supCtrlTypeDHWSet=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local + "Type of supervisory control for DHW Setpoint"; equation connect(BufferOnOffController.T_Top, sigBusDistr.TStoBufTopMea) annotation ( Line(points={{-128.8,45.9},{-316,45.9},{-316,-166},{4,-166},{4,-100},{1,-100}}, diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo index 97202322..a8ec7e15 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo @@ -1,6 +1,12 @@ within BESMod.Systems.Hydraulical.Distribution.BaseClasses; partial model PartialDistributionTwoStorageParallelDetailed "Partial model to later extent" + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; extends BaseClasses.PartialDistribution( final dpDem_nominal={0}, final dpSup_nominal={2*(threeWayValveParameters.dpValve_nominal + max( @@ -280,7 +286,7 @@ partial model PartialDistributionTwoStorageParallelDetailed redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parameters=threeWayValveParameters) annotation (Placement(transformation(extent={{-84,54},{-64,74}}))); - Utilities.KPIs.InternalKPICalculator internalKPICalculatorBufLoss( + BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculatorBufLoss( unit="W", integralUnit="J", calc_singleOnTime=false, @@ -291,7 +297,7 @@ partial model PartialDistributionTwoStorageParallelDetailed calc_intBelThres=false, y=fixedTemperatureBuf.port.Q_flow) annotation (Placement(transformation(extent={{-52,-134},{-32,-96}}))); - Utilities.KPIs.InternalKPICalculator internalKPICalculatorDHWLoss( + BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculatorDHWLoss( unit="W", integralUnit="J", calc_singleOnTime=false, @@ -317,9 +323,9 @@ partial model PartialDistributionTwoStorageParallelDetailed rotation=180, origin={87,80}))); - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{30,-108},{50,-88}}))); - Utilities.KPIs.InternalKPICalculator internalKPICalculatorDHWHR( + BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculatorDHWHR( unit="W", integralUnit="J", calc_singleOnTime=false, @@ -330,7 +336,7 @@ partial model PartialDistributionTwoStorageParallelDetailed calc_intBelThres=false, y=QHRStoDHWPre_flow.Q_flow) if dhwParameters.use_hr annotation (Placement(transformation(extent={{-84,-134},{-64,-96}}))); - Utilities.KPIs.InputKPICalculator inputKPICalculator( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculator( unit="W", integralUnit="J", calc_singleOnTime=false, @@ -340,7 +346,7 @@ partial model PartialDistributionTwoStorageParallelDetailed calc_movAve=false, calc_intBelThres=false) if use_heatingRodAfterBuffer annotation (Placement(transformation(extent={{-84,-156},{-64,-118}}))); - Utilities.KPIs.InternalKPICalculator internalKPICalculatorDHWHR1( + BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculatorDHWHR1( unit="W", integralUnit="J", calc_singleOnTime=false, diff --git a/BESMod/Systems/Hydraulical/Distribution/BuildingOnly.mo b/BESMod/Systems/Hydraulical/Distribution/BuildingOnly.mo index 02bc46ec..2300b5b6 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BuildingOnly.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BuildingOnly.mo @@ -1,5 +1,6 @@ within BESMod.Systems.Hydraulical.Distribution; model BuildingOnly "Only loads building" + import BESMod; extends BaseClasses.PartialDistribution( final dpDem_nominal=fill(0, nParallelDem), final dpSup_nominal=fill(0, nParallelSup), @@ -13,7 +14,7 @@ model BuildingOnly "Only loads building" redeclare package MediumGen = Medium, redeclare package MediumDHW = Medium, final dTTra_nominal=fill(0, nParallelDem)); - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{30,-108},{50,-88}}))); equation connect(portDHW_out, portDHW_in) annotation (Line(points={{100,-22},{88,-22},{ diff --git a/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo b/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo index 5b8600d4..334f7f80 100644 --- a/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo +++ b/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo @@ -1,6 +1,8 @@ within BESMod.Systems.Hydraulical.Distribution; model CombiStorage "Combi Storage for heating, dhw and solar assitance" + import BESMod; + import BESMod; extends BaseClasses.PartialDistribution( dpSup_nominal={0,sum(bufferStorage.heatingCoil2.pipe.res.dp_nominal)}, final dpDem_nominal={0}, @@ -105,7 +107,7 @@ model CombiStorage bufferStorage.layer.T) annotation (Placement(transformation(extent={{-42,-122},{-22,-102}}))); - Utilities.KPIs.InternalKPICalculator internalKPICalculatorBufLoss( + BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculatorBufLoss( unit="W", integralUnit="J", thresholdOn=Modelica.Constants.eps, @@ -117,7 +119,7 @@ model CombiStorage calc_intBelThres=false, y=fixedTemperatureBuf.port.Q_flow) annotation (Placement(transformation(extent={{-76,-124},{-56,-86}}))); - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{30,-108},{50,-88}}))); equation connect(fixedTemperatureBuf.port, bufferStorage.heatportOutside) annotation ( diff --git a/BESMod/Systems/Hydraulical/Distribution/DHWOnly.mo b/BESMod/Systems/Hydraulical/Distribution/DHWOnly.mo index 9fbfac84..20f70fd6 100644 --- a/BESMod/Systems/Hydraulical/Distribution/DHWOnly.mo +++ b/BESMod/Systems/Hydraulical/Distribution/DHWOnly.mo @@ -1,5 +1,6 @@ within BESMod.Systems.Hydraulical.Distribution; model DHWOnly "only loads DHW" + import BESMod; extends BaseClasses.PartialDistribution( nParallelDem=1, final dpDem_nominal=fill(0, nParallelDem), @@ -14,7 +15,7 @@ model DHWOnly "only loads DHW" redeclare package MediumDHW = Medium, final dTTra_nominal=fill(0, nParallelDem), final nParallelSup=1); - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{24,-108},{44,-88}}))); equation connect(portDHW_out, portGen_in[1]) annotation (Line(points={{100,-22},{2,-22}, diff --git a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo index da1d6bf0..d7cdfd0d 100644 --- a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo @@ -1,6 +1,9 @@ within BESMod.Systems.Hydraulical.Distribution; model DistributionTwoStorageParallel "Buffer storage and DHW storage" + import BESMod; + import BESMod; + import BESMod; extends BaseClasses.PartialDistribution( final dpDem_nominal={0}, final dpSup_nominal={0}, @@ -121,7 +124,7 @@ model DistributionTwoStorageParallel rotation=0, origin={30,-90}))); - Utilities.KPIs.InternalKPICalculator internalKPICalculatorBufLoss( + BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculatorBufLoss( unit="W", integralUnit="J", thresholdOn=Modelica.Constants.eps, @@ -133,7 +136,7 @@ model DistributionTwoStorageParallel calc_intBelThres=false, y=fixedTemperatureBuf.port.Q_flow) annotation (Placement(transformation(extent={{-80,-90},{-60,-52}}))); - Utilities.KPIs.InternalKPICalculator internalKPICalculatorDHWLoss( + BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculatorDHWLoss( unit="W", integralUnit="J", thresholdOn=Modelica.Constants.eps, @@ -145,7 +148,7 @@ model DistributionTwoStorageParallel calc_intBelThres=false, y=fixedTemperatureDHW.port.Q_flow) annotation (Placement(transformation(extent={{-80,-110},{-60,-72}}))); - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{34,-110},{54,-90}}))); equation connect(fixedTemperatureBuf.port, storageBuf.heatPort) annotation (Line( diff --git a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo index f9d8913c..05e3cb37 100644 --- a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo @@ -1,5 +1,7 @@ within BESMod.Systems.Hydraulical.Generation; model ElectricalHeater "Only heat using a heating rod" + import BESMod; + import BESMod; extends BaseClasses.PartialGeneration( final dTLoss_nominal=fill(0, nParallelDem), dp_nominal={hea.dp_nominal}, final nParallelDem=1); @@ -82,7 +84,7 @@ model ElectricalHeater "Only heat using a heating rod" rotation=90, origin={62,-74}))); -Utilities.KPIs.InternalKPICalculator KPIQHR( + BESMod.Utilities.KPIs.InternalKPICalculator KPIQHR( unit="W", integralUnit="J", calc_singleOnTime=false, @@ -92,12 +94,12 @@ Utilities.KPIs.InternalKPICalculator KPIQHR( calc_movAve=false, calc_intBelThres=false, y=hea.vol.heatPort.Q_flow) - annotation (Placement(transformation(extent={{-40,-128},{-28,-106}}))); + annotation (Placement(transformation(extent={{-40,-128},{-28,-106}}))); replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition pumpData annotation (choicesAllMatching=true, Placement(transformation(extent={{14,-64}, {28,-52}}))); - Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) + BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) annotation (Placement(transformation(extent={{32,-108},{52,-88}}))); equation connect(dummyZero.y,switch1. u3) diff --git a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo index d9702654..3a137aa6 100644 --- a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo @@ -1,5 +1,7 @@ within BESMod.Systems.Hydraulical.Generation; model GasBoiler "Just a gas boiler" + import BESMod; + import BESMod; extends BaseClasses.PartialGeneration(dp_nominal={boilerNoControl.dp_nominal}, final nParallelDem=1); @@ -25,7 +27,7 @@ model GasBoiler "Just a gas boiler" paramBoiler "Parameters for Boiler" annotation(choicesAllMatching=true); parameter Real etaTempBased[:,2]=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99] "Table matrix for temperature based efficiency"; -Utilities.KPIs.InternalKPICalculator KPIQHR( + BESMod.Utilities.KPIs.InternalKPICalculator KPIQHR( unit="W", integralUnit="J", calc_singleOnTime=false, @@ -35,7 +37,7 @@ Utilities.KPIs.InternalKPICalculator KPIQHR( calc_movAve=false, calc_intBelThres=false, y=boilerNoControl.QflowCalculation.y) - annotation (Placement(transformation(extent={{-46,-106},{-24,-70}}))); + annotation (Placement(transformation(extent={{-46,-106},{-24,-70}}))); replaceable parameter BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition temperatureSensorData @@ -79,7 +81,7 @@ Utilities.KPIs.InternalKPICalculator KPIQHR( extent={{-10,-10},{10,10}}, rotation=270, origin={66,-26}))); - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{26,-108},{46,-88}}))); equation diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index 4d62f035..5e55f0b9 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -1,5 +1,10 @@ within BESMod.Systems.Hydraulical.Generation; model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" + import BESMod; + import BESMod; + import BESMod; + import BESMod; + import BESMod; extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialGeneration( final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, final dTLoss_nominal=fill(0, nParallelDem), @@ -153,14 +158,14 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" rotation=270, origin={40,36}))); - Utilities.KPIs.InputKPICalculator KPIWel( + BESMod.Utilities.KPIs.InputKPICalculator KPIWel( integralUnit="J", calc_singleOnTime=true, calc_integral=true, calc_movAve=false, unit="W") annotation (Placement(transformation(extent={{-78,-106},{-66,-84}}))); - Utilities.KPIs.InputKPICalculator KPIWHRel( + BESMod.Utilities.KPIs.InputKPICalculator KPIWHRel( unit="W", integralUnit="J", calc_singleOnTime=true, @@ -223,23 +228,28 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" rotation=0, origin={-164,32}))); -Utilities.KPIs.InternalKPICalculator KPIQHP( + BESMod.Utilities.KPIs.InternalKPICalculator KPIQHP( unit="W", integralUnit="J", - calc_singleOnTime=false, calc_integral=true, + calc_singleOnTime=false, + calc_integral=true, calc_totalOnTime=false, - calc_numSwi=false, calc_movAve=false, - calc_intBelThres=false, y=heatPump.con.QFlow_in) - annotation (Placement(transformation(extent={{-76,-124},{-64,-102}}))); -Utilities.KPIs.InternalKPICalculator KPIQHR( + calc_numSwi=false, + calc_movAve=false, + calc_intBelThres=false, + y=heatPump.con.QFlow_in) + annotation (Placement(transformation(extent={{-76,-124},{-64,-102}}))); + BESMod.Utilities.KPIs.InternalKPICalculator KPIQHR( unit="W", integralUnit="J", - calc_singleOnTime=false, calc_integral=true, + calc_singleOnTime=false, + calc_integral=true, calc_totalOnTime=false, - calc_numSwi=false, calc_movAve=false, - calc_intBelThres=false, y=hea.vol.heatPort.Q_flow) - if use_heaRod - annotation (Placement(transformation(extent={{-76,-142},{-64,-120}}))); + calc_numSwi=false, + calc_movAve=false, + calc_intBelThres=false, + y=hea.vol.heatPort.Q_flow) if use_heaRod + annotation (Placement(transformation(extent={{-76,-142},{-64,-120}}))); IBPSA.Fluid.Sources.Boundary_pT bouPumpHP( redeclare package Medium = Medium, @@ -264,8 +274,9 @@ Utilities.KPIs.InternalKPICalculator KPIQHR( extent={{5,6},{-5,-6}}, rotation=180, origin={71,80}))); - Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, + BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=180, origin={100,-78}))); Modelica.Blocks.Math.MultiSum multiSum(nu=if (use_pressure and use_heaRod) then 3 elseif use_pressure and not use_heaRod then 2 elseif use_heaRod and not use_pressure then 2 else 1) annotation (Placement( diff --git a/BESMod/Systems/Hydraulical/Generation/NoGeneration.mo b/BESMod/Systems/Hydraulical/Generation/NoGeneration.mo index e3ac1265..71bae25f 100644 --- a/BESMod/Systems/Hydraulical/Generation/NoGeneration.mo +++ b/BESMod/Systems/Hydraulical/Generation/NoGeneration.mo @@ -1,10 +1,11 @@ within BESMod.Systems.Hydraulical.Generation; model NoGeneration "No heat generation at all" + import BESMod; extends BaseClasses.PartialGeneration( dp_nominal={0}, dTTra_nominal={10}, final nParallelDem=1); - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{32,-108},{52,-88}}))); equation connect(portGen_out, portGen_in) annotation (Line(points={{100,80},{78,80},{ diff --git a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo index f2054a99..950530fb 100644 --- a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo +++ b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo @@ -1,6 +1,7 @@ within BESMod.Systems.Hydraulical.Generation; model SolarThermalBivHP "Solar thermal assistet monoenergetic heat pump with heating rod" + import BESMod; extends HeatPumpAndHeatingRod(dTTra_nominal={if TDem_nominal[1] > 273.15 + 55 then 10 elseif TDem_nominal[1] > 44.9 then 8 else 5,solarThermalParas.dTMax}, final nParallelDem=2, @@ -82,8 +83,7 @@ model SolarThermalBivHP rotation=0, origin={14,-126}))); - Utilities.KPIs.InternalKPICalculator - KPIWel1( + BESMod.Utilities.KPIs.InternalKPICalculator KPIWel1( unit="W", integralUnit="J", calc_singleOnTime=true, diff --git a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo index 054246a1..3b584d4e 100644 --- a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo +++ b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo @@ -1,6 +1,7 @@ within BESMod.Systems.Hydraulical.Generation; model SolarThermalBivHPBuiLib "Solar thermal assistet monoenergetic heat pump with heating rod" + import BESMod; extends HeatPumpAndHeatingRod(dTTra_nominal={if TDem_nominal[1] > 273.15 + 55 then 10 elseif TDem_nominal[1] > 44.9 then 8 else 5,solarThermalParas.dTMax}, final nParallelDem=2, @@ -90,7 +91,7 @@ model SolarThermalBivHPBuiLib rotation=0, origin={-56,-150}))); - Utilities.KPIs.InternalKPICalculator KPIWel1( + BESMod.Utilities.KPIs.InternalKPICalculator KPIWel1( unit="W", integralUnit="J", calc_singleOnTime=true, diff --git a/BESMod/Systems/Hydraulical/Transfer/NoHeatTransfer.mo b/BESMod/Systems/Hydraulical/Transfer/NoHeatTransfer.mo index d30febd4..24579c6c 100644 --- a/BESMod/Systems/Hydraulical/Transfer/NoHeatTransfer.mo +++ b/BESMod/Systems/Hydraulical/Transfer/NoHeatTransfer.mo @@ -1,12 +1,13 @@ within BESMod.Systems.Hydraulical.Transfer; model NoHeatTransfer "No heat tranfser to building" + import BESMod; extends BaseClasses.PartialTransfer( dp_nominal=fill(0, nParallelDem), dTTra_nominal=fill(0, nParallelDem)); Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow fixedHeatFlow[ nParallelDem](each final Q_flow=0) annotation (Placement(transformation(extent={{54,-10},{74,10}}))); - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{40,-80},{60,-60}}))); equation connect(portTra_in, portTra_out) annotation (Line(points={{-100,38},{-74,38}, diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index 4a599681..c2e26ce7 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -1,5 +1,6 @@ within BESMod.Systems.Hydraulical.Transfer; model RadiatorPressureBased "Pressure Based transfer system" + import BESMod; extends BaseClasses.PartialTransfer(final dp_nominal=rad.dp_nominal .+ val.dpValve_nominal .+ res.dp_nominal .+ val.dpFixed_nominal, final nParallelSup=1); @@ -112,7 +113,7 @@ model RadiatorPressureBased "Pressure Based transfer system" rotation=180, origin={-48,68}))); - Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) + BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) annotation (Placement(transformation(extent={{34,-94},{54,-74}}))); equation connect(rad.heatPortRad, heatPortRad) annotation (Line(points={{-5.08,-27.2}, diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo index 967871f2..8fdde672 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo @@ -1,6 +1,9 @@ within BESMod.Systems.Hydraulical.Transfer; model RadiatorTransferSystem "Subsystem using a radiator and ideal thermostatic valves" + import BESMod; + import BESMod; + import BESMod; extends BaseClasses.PartialTransfer( final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, final dTLoss_nominal=fill(0, nParallelDem), @@ -46,7 +49,7 @@ model RadiatorTransferSystem replaceable parameter BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters annotation (choicesAllMatching=true, Placement(transformation(extent={{-100,-98},{-80,-78}}))); - Utilities.KPIs.InternalKPICalculator internalKPICalculator( + BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculator( unit="W", integralUnit="J", calc_singleOnTime=false, @@ -55,7 +58,7 @@ model RadiatorTransferSystem calc_movAve=false, y=sum(-heatPortRad.Q_flow) + sum(-heatPortCon.Q_flow)) annotation (Placement(transformation(extent={{-32,-96},{-12,-60}}))); - Utilities.KPIs.InputKPICalculator inputKPICalculator[nParallelDem]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculator[nParallelDem]( unit=fill("", nParallelDem), integralUnit=fill("s", nParallelDem), each calc_singleOnTime=false, @@ -106,7 +109,7 @@ model RadiatorTransferSystem extent={{-10,-10},{10,10}}, rotation=90, origin={-66,10}))); - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{30,-106},{50,-86}}))); equation connect(rad.heatPortRad, heatPortRad) annotation (Line(points={{-5.08,-31.2}, diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index 1d456286..934bbfae 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -1,5 +1,8 @@ within BESMod.Systems.Hydraulical.Transfer; model UFHTransferSystem + import BESMod; + import BESMod; + import BESMod; extends BaseClasses.PartialTransfer(final nParallelSup=1, final dp_nominal=fill(0, nParallelDem)); IBPSA.Fluid.FixedResistances.PressureDrop res1[nParallelDem]( @@ -60,7 +63,8 @@ model UFHTransferSystem constrainedby RecordsCollection.UFHData(nZones=nParallelDem, area=AZone) annotation (choicesAllMatching=true, Placement(transformation(extent={{22,12},{42,32}}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorOpening[nParallelDem]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorOpening[ + nParallelDem]( unit=fill("", nParallelDem), integralUnit=fill("s", nParallelDem), each calc_singleOnTime=false, @@ -69,7 +73,8 @@ model UFHTransferSystem each calc_numSwi=false, each calc_movAve=false) annotation (Placement(transformation(extent={{-46,-94},{-26,-58}}))); - Utilities.KPIs.InputKPICalculator inputKPICalculatorLossUFH[nParallelDem]( + BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorLossUFH[ + nParallelDem]( unit=fill("W", nParallelDem), integralUnit=fill("J", nParallelDem), each calc_singleOnTime=false, @@ -121,7 +126,7 @@ model UFHTransferSystem BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition pumpData annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,78}, {-78,98}}))); - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{32,-108},{52,-88}}))); protected parameter BESMod.Components.UFH.ActiveWallBaseDataDefinition floorHeatingType[nParallelDem]={BESMod.Components.UFH.ActiveWallBaseDataDefinition( diff --git a/BESMod/Systems/UserProfiles/Tests/package.order b/BESMod/Systems/UserProfiles/Tests/package.order index 429d5547..ab03aa99 100644 --- a/BESMod/Systems/UserProfiles/Tests/package.order +++ b/BESMod/Systems/UserProfiles/Tests/package.order @@ -1,4 +1,4 @@ -PartialTest NoUserTest TEASERProfileTest Case600Profiles +PartialTest diff --git a/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo b/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo index 97b8e639..3e3b5fad 100644 --- a/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo +++ b/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo @@ -1,5 +1,6 @@ within BESMod.Systems.Ventilation.BaseClasses; partial model PartialVentilationSystem + import BESMod; extends BESMod.Utilities.Icons.VentilationIcon; extends BESMod.Systems.BaseClasses.PartialFluidSubsystem; parameter Boolean subsystemDisabled "To enable the icon if the subsystem is disabled" annotation (Dialog(tab="Graphics")); @@ -120,7 +121,7 @@ partial model PartialVentilationSystem 114}}))); Electrical.Interfaces.InternalElectricalPinOut internalElectricalPin annotation (Placement(transformation(extent={{60,-108},{80,-88}}))); - Utilities.Electrical.MultiSumElec multiSumElec(nPorts=2) annotation ( + BESMod.Utilities.Electrical.MultiSumElec multiSumElec(nPorts=2) annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, diff --git a/BESMod/Systems/Ventilation/Distribution/SimpleDistribution.mo b/BESMod/Systems/Ventilation/Distribution/SimpleDistribution.mo index 3864e2ea..1fef2b5f 100644 --- a/BESMod/Systems/Ventilation/Distribution/SimpleDistribution.mo +++ b/BESMod/Systems/Ventilation/Distribution/SimpleDistribution.mo @@ -1,5 +1,6 @@ within BESMod.Systems.Ventilation.Distribution; model SimpleDistribution "Most basic distribution model" + import BESMod; extends BaseClasses.PartialDistribution( final dp_nominal=resSup.dp_nominal, final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, @@ -23,7 +24,7 @@ model SimpleDistribution "Most basic distribution model" extent={{-7.5,-10},{7.5,10}}, rotation=0, origin={0.5,-60}))); - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{20,-100},{40,-80}}))); equation connect(resExh.port_a, portExh_in) diff --git a/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo b/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo index 12ad8f0f..19725436 100644 --- a/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo +++ b/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo @@ -1,5 +1,6 @@ within BESMod.Systems.Ventilation.Generation; model ControlledDomesticVentilation + import BESMod; extends BESMod.Systems.Ventilation.Generation.BaseClasses.PartialGeneration( dp_nominal={hex.dp1_nominal}, dTTra_nominal={0}, @@ -182,7 +183,7 @@ model ControlledDomesticVentilation tempSensorData annotation (Placement(transformation(extent={{76,78},{96,98}})), choicesAllMatching=true); - Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) + BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) annotation (Placement(transformation(extent={{36,-118},{56,-98}}))); Modelica.Blocks.Math.Add add annotation (Placement(transformation(extent={{2,-114},{22,-94}}))); diff --git a/BESMod/Systems/Ventilation/Generation/NoVentilation.mo b/BESMod/Systems/Ventilation/Generation/NoVentilation.mo index f51bc8a2..1b9df2bf 100644 --- a/BESMod/Systems/Ventilation/Generation/NoVentilation.mo +++ b/BESMod/Systems/Ventilation/Generation/NoVentilation.mo @@ -1,5 +1,6 @@ within BESMod.Systems.Ventilation.Generation; model NoVentilation "Model without any ventilation" + import BESMod; extends BaseClasses.PartialGeneration( final QLoss_flow_nominal={0}, final f_design={1}, @@ -10,7 +11,7 @@ model NoVentilation "Model without any ventilation" final dTTra_nominal={0}, final nParallelSup=1, final nParallelDem=1); - Utilities.Electrical.ZeroLoad zeroLoad + BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{20,-100},{40,-80}}))); equation connect(portVent_in, portVent_out) annotation (Line(points={{-100,42},{-80,42}, diff --git a/BESMod/Utilities/KPIs/BaseClasses/PartialKPICalculator.mo b/BESMod/Utilities/KPIs/BaseClasses/PartialKPICalculator.mo index fc35b992..848decc9 100644 --- a/BESMod/Utilities/KPIs/BaseClasses/PartialKPICalculator.mo +++ b/BESMod/Utilities/KPIs/BaseClasses/PartialKPICalculator.mo @@ -1,7 +1,5 @@ within BESMod.Utilities.KPIs.BaseClasses; partial model PartialKPICalculator "Partial KPI Calculator" - - parameter String unit "Unit of signal"; parameter String integralUnit "Unit of integral of signal"; parameter Real thresholdOn=Modelica.Constants.eps * 100 diff --git a/BESMod/Utilities/SupervisoryControl/SupervisoryControl.mo b/BESMod/Utilities/SupervisoryControl/SupervisoryControl.mo index 27b90661..489e72c9 100644 --- a/BESMod/Utilities/SupervisoryControl/SupervisoryControl.mo +++ b/BESMod/Utilities/SupervisoryControl/SupervisoryControl.mo @@ -1,18 +1,17 @@ within BESMod.Utilities.SupervisoryControl; model SupervisoryControl - parameter BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType ctrlType "Type of supervisory control"; + parameter BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType ctrlType + "Type of supervisory control"; - Modelica.Blocks.Interfaces.RealInput uSup if ctrlType == - BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal + Modelica.Blocks.Interfaces.RealInput uSup if ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal "Input from supervisory control" annotation (Placement(transformation(extent={{-140,60},{-100,100}}), iconTransformation(extent={{-140,60},{-100,100}}))); Modelica.Blocks.Interfaces.RealInput uLoc "Local control input" annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}), iconTransformation(extent={{-140,-100},{-100,-60}}))); - Modelica.Blocks.Interfaces.BooleanInput activateInt if ctrlType == - BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal + Modelica.Blocks.Interfaces.BooleanInput activateInt if ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); Modelica.Blocks.Interfaces.RealOutput y "Control output" @@ -20,16 +19,14 @@ model SupervisoryControl Modelica.Blocks.Logical.Switch swi "Switch between external signal and direct feedthrough signal" annotation (Placement(transformation(extent={{0,-16},{32,16}}))); - Modelica.Blocks.Sources.BooleanExpression activateExt if ctrlType == - BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.External + Modelica.Blocks.Sources.BooleanExpression activateExt if ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.External "Block to activate use of external signal" annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); - Modelica.Blocks.Sources.RealExpression uExt if ctrlType == - BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.External + Modelica.Blocks.Sources.RealExpression uExt if ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.External "External input signal" annotation (Placement(transformation(extent={{-60,10},{-40,30}}))); - Modelica.Blocks.Sources.BooleanConstant deactivateAlways(final k=false) - if ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local + Modelica.Blocks.Sources.BooleanConstant deactivateAlways(final k=false) if + ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local "Block to activate use of external signal" annotation (Placement(transformation(extent={{-60,-40},{-40,-20}}))); Modelica.Blocks.Sources.Constant uSupDeacticate(final k=0) if ctrlType == diff --git a/BESMod/package.mo b/BESMod/package.mo index 02b1f93c..cc7ea686 100644 --- a/BESMod/package.mo +++ b/BESMod/package.mo @@ -5,12 +5,12 @@ package BESMod annotation ( version="0.2.0", uses( - SDF(version="0.4.1"), BuildingSystems(version="2.0.0-beta"), Modelica(version="4.0.0"), + ModelicaServices(version="4.0.0"), + SDF(version="0.4.2"), IBPSA(version="3.0.0"), - AixLib(version="1.2.0"), - ModelicaServices(version="4.0.0")), + AixLib(version="1.3.1")), conversion(from( version="0.1.1", script="modelica://BESMod/Resources/Scripts/ConvertBESMod_from_0.1.1_to_0.2.0.mos")), diff --git a/dependencies.json b/dependencies.json index 840e76aa..c0c189f9 100644 --- a/dependencies.json +++ b/dependencies.json @@ -9,7 +9,7 @@ "optional": { "AixLib": { "url": "https://github.com/RWTH-EBC/AixLib", - "commit": "b21102ec1245c8d407681aaf6b847aa9f9ceacff", + "commit": "b341e6903b36fe032e0aff256496cef456c8ceca", "mo": "AixLib//package.mo" }, "Buildings": { From 1fc90b481e26d20c7e5dcdf4fa4f7bda06782f87 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 19 Aug 2022 23:04:17 +0200 Subject: [PATCH 014/131] rm unwanted imports --- .../Demand/Building/BuildingsRoomCase600FF.mo | 3 --- .../Demand/Building/TEASERThermalZone.mo | 18 ------------------ BESMod/Systems/Demand/DHW/DHW.mo | 2 -- .../Distribution/BatterySystemSimple.mo | 3 --- .../Electrical/Distribution/DirectlyToGrid.mo | 1 - .../Distribution/Tests/BatterySystemSimple.mo | 3 --- .../Electrical/Generation/NoGeneration.mo | 1 - .../Electrical/Generation/PVSystemMultiSub.mo | 2 -- .../Electrical/Generation/Tests/PartialTest.mo | 1 - .../Electrical/Tests/ElectricalSystem.mo | 2 -- .../Transfer/NoElectricalTransfer.mo | 1 - .../BaseClasses/PartialHydraulicSystem.mo | 1 - .../PartialTwoPoint_HPS_Controller.mo | 3 --- ...alDistributionTwoStorageParallelDetailed.mo | 6 ------ .../Hydraulical/Distribution/BuildingOnly.mo | 1 - .../Hydraulical/Distribution/CombiStorage.mo | 2 -- .../Hydraulical/Distribution/DHWOnly.mo | 1 - .../DistributionTwoStorageParallel.mo | 3 --- .../Hydraulical/Generation/ElectricalHeater.mo | 2 -- .../Hydraulical/Generation/GasBoiler.mo | 2 -- .../Generation/HeatPumpAndHeatingRod.mo | 5 ----- .../Hydraulical/Generation/NoGeneration.mo | 1 - .../Generation/SolarThermalBivHP.mo | 1 - .../Generation/SolarThermalBivHPBuiLib.mo | 1 - .../Hydraulical/Transfer/NoHeatTransfer.mo | 1 - .../Transfer/RadiatorPressureBased.mo | 1 - .../Transfer/RadiatorTransferSystem.mo | 3 --- .../Hydraulical/Transfer/UFHTransferSystem.mo | 3 --- .../BaseClasses/PartialVentilationSystem.mo | 1 - .../Distribution/SimpleDistribution.mo | 1 - .../ControlledDomesticVentilation.mo | 1 - .../Ventilation/Generation/NoVentilation.mo | 1 - 32 files changed, 78 deletions(-) diff --git a/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo b/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo index 5c7306a8..729166fa 100644 --- a/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo +++ b/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo @@ -1,9 +1,6 @@ within BESMod.Systems.Demand.Building; model BuildingsRoomCase600FF "Detailed room model from the buildings library according to BESTEST Case600FF" - import BESMod; - import BESMod; - import BESMod; extends BaseClasses.PartialDemand( ARoo=roo.AFlo*sqrt(2), hBui=roo.hRoo, diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index 1bb0d364..f97b5ed7 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -1,24 +1,6 @@ within BESMod.Systems.Demand.Building; model TEASERThermalZone "Reduced order building model, coupled with TEASER" - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; extends BaseClasses.PartialDemand( ARoo=sum(zoneParam.ARoof)/nZones, hBui=sum(zoneParam.VAir)^(1/3), diff --git a/BESMod/Systems/Demand/DHW/DHW.mo b/BESMod/Systems/Demand/DHW/DHW.mo index a3d5b764..d5ff5380 100644 --- a/BESMod/Systems/Demand/DHW/DHW.mo +++ b/BESMod/Systems/Demand/DHW/DHW.mo @@ -1,7 +1,5 @@ within BESMod.Systems.Demand.DHW; model DHW "Standard DHW subsystem" - import BESMod; - import BESMod; extends BaseClasses.PartialDHW; diff --git a/BESMod/Systems/Electrical/Distribution/BatterySystemSimple.mo b/BESMod/Systems/Electrical/Distribution/BatterySystemSimple.mo index 1c8ab529..ac7c12e9 100644 --- a/BESMod/Systems/Electrical/Distribution/BatterySystemSimple.mo +++ b/BESMod/Systems/Electrical/Distribution/BatterySystemSimple.mo @@ -1,8 +1,5 @@ within BESMod.Systems.Electrical.Distribution; model BatterySystemSimple "Simple Battery model" - import BESMod; - import BESMod; - import BESMod; extends BESMod.Systems.Electrical.Distribution.BaseClasses.PartialDistribution; diff --git a/BESMod/Systems/Electrical/Distribution/DirectlyToGrid.mo b/BESMod/Systems/Electrical/Distribution/DirectlyToGrid.mo index a12525a5..83ec0a98 100644 --- a/BESMod/Systems/Electrical/Distribution/DirectlyToGrid.mo +++ b/BESMod/Systems/Electrical/Distribution/DirectlyToGrid.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Electrical.Distribution; model DirectlyToGrid "Direct grid connection" - import BESMod; extends BESMod.Systems.Electrical.Distribution.BaseClasses.PartialDistribution; diff --git a/BESMod/Systems/Electrical/Distribution/Tests/BatterySystemSimple.mo b/BESMod/Systems/Electrical/Distribution/Tests/BatterySystemSimple.mo index 4b0b7afb..3767e502 100644 --- a/BESMod/Systems/Electrical/Distribution/Tests/BatterySystemSimple.mo +++ b/BESMod/Systems/Electrical/Distribution/Tests/BatterySystemSimple.mo @@ -1,8 +1,5 @@ within BESMod.Systems.Electrical.Distribution.Tests; model BatterySystemSimple - import BESMod; - import BESMod; - import BESMod; extends Modelica.Icons.Example; BESMod.Systems.Electrical.Distribution.BatterySystemSimple batterySystemSimple(nSubSys=2, diff --git a/BESMod/Systems/Electrical/Generation/NoGeneration.mo b/BESMod/Systems/Electrical/Generation/NoGeneration.mo index bc5a5987..5189850f 100644 --- a/BESMod/Systems/Electrical/Generation/NoGeneration.mo +++ b/BESMod/Systems/Electrical/Generation/NoGeneration.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Electrical.Generation; model NoGeneration "Don't generation electricity" - import BESMod; extends BaseClasses.PartialGeneration(final f_design=fill(0.8, numGenUnits), final numGenUnits=1); BESMod.Utilities.Electrical.ZeroLoad zeroLoad diff --git a/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo b/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo index d06ed7c0..171ce153 100644 --- a/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo +++ b/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo @@ -1,8 +1,6 @@ within BESMod.Systems.Electrical.Generation; model PVSystemMultiSub "PV system with subsystems of different orientation and module type" - import BESMod; - import BESMod; extends BESMod.Systems.Electrical.Generation.BaseClasses.PartialGeneration( numGenUnits=1); diff --git a/BESMod/Systems/Electrical/Generation/Tests/PartialTest.mo b/BESMod/Systems/Electrical/Generation/Tests/PartialTest.mo index b2d60935..1e78a416 100644 --- a/BESMod/Systems/Electrical/Generation/Tests/PartialTest.mo +++ b/BESMod/Systems/Electrical/Generation/Tests/PartialTest.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Electrical.Generation.Tests; partial model PartialTest - import BESMod; replaceable BESMod.Systems.Electrical.Generation.BaseClasses.PartialGeneration generation constrainedby BaseClasses.PartialGeneration diff --git a/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo b/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo index 75a2a659..8f830e76 100644 --- a/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo +++ b/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo @@ -1,7 +1,5 @@ within BESMod.Systems.Electrical.Tests; model ElectricalSystem - import BESMod; - import BESMod; extends Modelica.Icons.Example; BESMod.Systems.Electrical.ElectricalSystem pVBatterySystemNoTransfer( diff --git a/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo b/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo index 95ef204f..70cdf1a8 100644 --- a/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo +++ b/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Electrical.Transfer; model NoElectricalTransfer "No transfer system" - import BESMod; extends BESMod.Systems.Electrical.Transfer.BaseClasses.PartialTransfer; BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{16,64},{36,84}}))); diff --git a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo index d9db09f1..aaf2ae63 100644 --- a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo +++ b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo @@ -1,7 +1,6 @@ within BESMod.Systems.Hydraulical.BaseClasses; partial model PartialHydraulicSystem "Complete hydraulic system model" - import BESMod; extends BESMod.Systems.BaseClasses.PartialFluidSubsystem; parameter Boolean subsystemDisabled "To enable the icon if the subsystem is disabled" annotation (Dialog(tab="Graphics")); diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo index ad5674bf..704da289 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo @@ -1,9 +1,6 @@ within BESMod.Systems.Hydraulical.Control.BaseClasses; partial model PartialTwoPoint_HPS_Controller "Partial model with replaceable blocks for rule based control of HPS using on off heating rods" - import BESMod; - import BESMod; - import BESMod; extends BESMod.Systems.Hydraulical.Control.BaseClasses.SystemWithThermostaticValveControl; replaceable diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo index a8ec7e15..1469e1dc 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo @@ -1,12 +1,6 @@ within BESMod.Systems.Hydraulical.Distribution.BaseClasses; partial model PartialDistributionTwoStorageParallelDetailed "Partial model to later extent" - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; extends BaseClasses.PartialDistribution( final dpDem_nominal={0}, final dpSup_nominal={2*(threeWayValveParameters.dpValve_nominal + max( diff --git a/BESMod/Systems/Hydraulical/Distribution/BuildingOnly.mo b/BESMod/Systems/Hydraulical/Distribution/BuildingOnly.mo index 2300b5b6..531e6282 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BuildingOnly.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BuildingOnly.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Hydraulical.Distribution; model BuildingOnly "Only loads building" - import BESMod; extends BaseClasses.PartialDistribution( final dpDem_nominal=fill(0, nParallelDem), final dpSup_nominal=fill(0, nParallelSup), diff --git a/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo b/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo index 334f7f80..49adce0b 100644 --- a/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo +++ b/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo @@ -1,8 +1,6 @@ within BESMod.Systems.Hydraulical.Distribution; model CombiStorage "Combi Storage for heating, dhw and solar assitance" - import BESMod; - import BESMod; extends BaseClasses.PartialDistribution( dpSup_nominal={0,sum(bufferStorage.heatingCoil2.pipe.res.dp_nominal)}, final dpDem_nominal={0}, diff --git a/BESMod/Systems/Hydraulical/Distribution/DHWOnly.mo b/BESMod/Systems/Hydraulical/Distribution/DHWOnly.mo index 20f70fd6..6623c9c3 100644 --- a/BESMod/Systems/Hydraulical/Distribution/DHWOnly.mo +++ b/BESMod/Systems/Hydraulical/Distribution/DHWOnly.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Hydraulical.Distribution; model DHWOnly "only loads DHW" - import BESMod; extends BaseClasses.PartialDistribution( nParallelDem=1, final dpDem_nominal=fill(0, nParallelDem), diff --git a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo index d7cdfd0d..4ade85aa 100644 --- a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo @@ -1,9 +1,6 @@ within BESMod.Systems.Hydraulical.Distribution; model DistributionTwoStorageParallel "Buffer storage and DHW storage" - import BESMod; - import BESMod; - import BESMod; extends BaseClasses.PartialDistribution( final dpDem_nominal={0}, final dpSup_nominal={0}, diff --git a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo index 05e3cb37..b23aebe6 100644 --- a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo @@ -1,7 +1,5 @@ within BESMod.Systems.Hydraulical.Generation; model ElectricalHeater "Only heat using a heating rod" - import BESMod; - import BESMod; extends BaseClasses.PartialGeneration( final dTLoss_nominal=fill(0, nParallelDem), dp_nominal={hea.dp_nominal}, final nParallelDem=1); diff --git a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo index 3a137aa6..d31cd492 100644 --- a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo @@ -1,7 +1,5 @@ within BESMod.Systems.Hydraulical.Generation; model GasBoiler "Just a gas boiler" - import BESMod; - import BESMod; extends BaseClasses.PartialGeneration(dp_nominal={boilerNoControl.dp_nominal}, final nParallelDem=1); diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index 5e55f0b9..34cd82af 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -1,10 +1,5 @@ within BESMod.Systems.Hydraulical.Generation; model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" - import BESMod; - import BESMod; - import BESMod; - import BESMod; - import BESMod; extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialGeneration( final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, final dTLoss_nominal=fill(0, nParallelDem), diff --git a/BESMod/Systems/Hydraulical/Generation/NoGeneration.mo b/BESMod/Systems/Hydraulical/Generation/NoGeneration.mo index 71bae25f..b5480411 100644 --- a/BESMod/Systems/Hydraulical/Generation/NoGeneration.mo +++ b/BESMod/Systems/Hydraulical/Generation/NoGeneration.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Hydraulical.Generation; model NoGeneration "No heat generation at all" - import BESMod; extends BaseClasses.PartialGeneration( dp_nominal={0}, dTTra_nominal={10}, diff --git a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo index 950530fb..5ceb0fb7 100644 --- a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo +++ b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo @@ -1,7 +1,6 @@ within BESMod.Systems.Hydraulical.Generation; model SolarThermalBivHP "Solar thermal assistet monoenergetic heat pump with heating rod" - import BESMod; extends HeatPumpAndHeatingRod(dTTra_nominal={if TDem_nominal[1] > 273.15 + 55 then 10 elseif TDem_nominal[1] > 44.9 then 8 else 5,solarThermalParas.dTMax}, final nParallelDem=2, diff --git a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo index 3b584d4e..1dc32013 100644 --- a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo +++ b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo @@ -1,7 +1,6 @@ within BESMod.Systems.Hydraulical.Generation; model SolarThermalBivHPBuiLib "Solar thermal assistet monoenergetic heat pump with heating rod" - import BESMod; extends HeatPumpAndHeatingRod(dTTra_nominal={if TDem_nominal[1] > 273.15 + 55 then 10 elseif TDem_nominal[1] > 44.9 then 8 else 5,solarThermalParas.dTMax}, final nParallelDem=2, diff --git a/BESMod/Systems/Hydraulical/Transfer/NoHeatTransfer.mo b/BESMod/Systems/Hydraulical/Transfer/NoHeatTransfer.mo index 24579c6c..8712ec9f 100644 --- a/BESMod/Systems/Hydraulical/Transfer/NoHeatTransfer.mo +++ b/BESMod/Systems/Hydraulical/Transfer/NoHeatTransfer.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Hydraulical.Transfer; model NoHeatTransfer "No heat tranfser to building" - import BESMod; extends BaseClasses.PartialTransfer( dp_nominal=fill(0, nParallelDem), dTTra_nominal=fill(0, nParallelDem)); diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index c2e26ce7..30c17f3e 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Hydraulical.Transfer; model RadiatorPressureBased "Pressure Based transfer system" - import BESMod; extends BaseClasses.PartialTransfer(final dp_nominal=rad.dp_nominal .+ val.dpValve_nominal .+ res.dp_nominal .+ val.dpFixed_nominal, final nParallelSup=1); diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo index 8fdde672..14d54987 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo @@ -1,9 +1,6 @@ within BESMod.Systems.Hydraulical.Transfer; model RadiatorTransferSystem "Subsystem using a radiator and ideal thermostatic valves" - import BESMod; - import BESMod; - import BESMod; extends BaseClasses.PartialTransfer( final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, final dTLoss_nominal=fill(0, nParallelDem), diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index 934bbfae..c31d14db 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -1,8 +1,5 @@ within BESMod.Systems.Hydraulical.Transfer; model UFHTransferSystem - import BESMod; - import BESMod; - import BESMod; extends BaseClasses.PartialTransfer(final nParallelSup=1, final dp_nominal=fill(0, nParallelDem)); IBPSA.Fluid.FixedResistances.PressureDrop res1[nParallelDem]( diff --git a/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo b/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo index 3e3b5fad..f4848e11 100644 --- a/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo +++ b/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Ventilation.BaseClasses; partial model PartialVentilationSystem - import BESMod; extends BESMod.Utilities.Icons.VentilationIcon; extends BESMod.Systems.BaseClasses.PartialFluidSubsystem; parameter Boolean subsystemDisabled "To enable the icon if the subsystem is disabled" annotation (Dialog(tab="Graphics")); diff --git a/BESMod/Systems/Ventilation/Distribution/SimpleDistribution.mo b/BESMod/Systems/Ventilation/Distribution/SimpleDistribution.mo index 1fef2b5f..bc85f39d 100644 --- a/BESMod/Systems/Ventilation/Distribution/SimpleDistribution.mo +++ b/BESMod/Systems/Ventilation/Distribution/SimpleDistribution.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Ventilation.Distribution; model SimpleDistribution "Most basic distribution model" - import BESMod; extends BaseClasses.PartialDistribution( final dp_nominal=resSup.dp_nominal, final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, diff --git a/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo b/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo index 19725436..2b582c69 100644 --- a/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo +++ b/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Ventilation.Generation; model ControlledDomesticVentilation - import BESMod; extends BESMod.Systems.Ventilation.Generation.BaseClasses.PartialGeneration( dp_nominal={hex.dp1_nominal}, dTTra_nominal={0}, diff --git a/BESMod/Systems/Ventilation/Generation/NoVentilation.mo b/BESMod/Systems/Ventilation/Generation/NoVentilation.mo index 1b9df2bf..6dbeaaf6 100644 --- a/BESMod/Systems/Ventilation/Generation/NoVentilation.mo +++ b/BESMod/Systems/Ventilation/Generation/NoVentilation.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Ventilation.Generation; model NoVentilation "Model without any ventilation" - import BESMod; extends BaseClasses.PartialGeneration( final QLoss_flow_nominal={0}, final f_design={1}, From 040ead261d423df71117e8d2787c7deff29f91b7 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sat, 20 Aug 2022 10:02:18 +0200 Subject: [PATCH 015/131] Fix thermalZone --- .../Demand/Building/TEASERThermalZone.mo | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index f97b5ed7..f11eb7c2 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -7,14 +7,10 @@ model TEASERThermalZone ABui=2*sum(zoneParam.VAir)^(1/3), hZone=zoneParam.VAir ./ zoneParam.AZone, AZone=zoneParam.AZone); - replaceable parameter AixLib.DataBase.ThermalZones.ZoneBaseRecord oneZoneParam( - heaLoadFacGrd=0, heaLoadFacOut=0) constrainedby - AixLib.DataBase.ThermalZones.ZoneBaseRecord(heaLoadFacGrd=0, heaLoadFacOut= - 0) + replaceable parameter AixLib.DataBase.ThermalZones.ZoneBaseRecord oneZoneParam constrainedby + AixLib.DataBase.ThermalZones.ZoneBaseRecord "Default zone if only one is chosen" annotation(choicesAllMatching=true); - parameter AixLib.DataBase.ThermalZones.ZoneBaseRecord zoneParam[nZones]( - heaLoadFacGrd=0, - heaLoadFacOut=0) = fill(oneZoneParam, nZones) + parameter AixLib.DataBase.ThermalZones.ZoneBaseRecord zoneParam[nZones] = fill(oneZoneParam, nZones) "Choose an array of multiple zones" annotation(choicesAllMatching=true); parameter Real ventRate[nZones]=fill(0, nZones) "Constant mechanical ventilation rate"; @@ -33,7 +29,8 @@ model TEASERThermalZone each final energyDynamics=energyDynamics, each final T_start=T_start, final zoneParam=zoneParam, - each final use_AirExchange=true, + each final use_MechanicalAirExchange=true, + each final use_NaturalAirExchange=true, each final nPorts=if use_ventilation then 2 else 0) annotation (Placement( transformation(extent={{35,12},{-39,84}}, rotation=0))); @@ -184,8 +181,8 @@ model TEASERThermalZone [nZones] if use_hydraulic and use_verboseEnergyBalance annotation (Placement(transformation(extent={{-52,-80},{-42,-70}}))); - BESMod.Utilities.KPIs.ComfortCalculator comfortCalculatorCool[nZones](TComBou - =TSetZone_nominal .+ dTComfort, each for_heating=false) + BESMod.Utilities.KPIs.ComfortCalculator comfortCalculatorCool[nZones](TComBou= + TSetZone_nominal .+ dTComfort, each for_heating=false) annotation (Placement(transformation(extent={{-24,-52},{-4,-32}}))); BESMod.Utilities.KPIs.ComfortCalculator comfortCalculatorHea[nZones](TComBou= TSetZone_nominal .- dTComfort, each for_heating=true) @@ -356,19 +353,26 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=180, origin={94,-96}))); + Modelica.Blocks.Routing.RealPassThrough realPassThroughIntGains[nZones,3] + annotation (Placement(transformation(extent={{-100,0},{-80,20}}))); + Modelica.Blocks.Routing.RealPassThrough realPassThroughTDry[nZones] + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={114,62}))); equation for i in 1:nZones loop - connect(weaBus.TDryBul, thermalZone[i].ventTemp) annotation (Line( - points={{-47,98},{126,98},{126,42.24},{33.52,42.24}}, + connect(weaBus.TDryBul, realPassThroughTDry[i].u) annotation (Line( + points={{-47,98},{-47,96},{134,96},{134,62},{126,62}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(useProBus.intGains, thermalZone[i].intGains) annotation (Line( - points={{51,101},{-62,101},{-62,8},{-31.6,8},{-31.6,17.76}}, + connect(useProBus.intGains, realPassThroughIntGains[i, :].u) annotation (Line( + points={{51,101},{-120,101},{-120,10},{-102,10}}, color={255,204,51}, thickness=0.5), Text( string="%first", @@ -658,7 +662,12 @@ equation points={{84,-96},{70,-96}}, color={0,0,0}, thickness=1)); - annotation (Diagram(graphics, - coordinateSystem(extent={{-100,-100},{100,100}})), Icon(graphics, + 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})); + annotation (Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon(graphics, coordinateSystem(extent={{-100,-120},{100,100}}))); end TEASERThermalZone; From 193a9972839bef6a73d1ec7ed2990767b576e8bb Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 23 Aug 2022 12:11:23 +0200 Subject: [PATCH 016/131] Increase Version number due to AixLib changes --- BESMod/package.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BESMod/package.mo b/BESMod/package.mo index cc7ea686..32b4d4d0 100644 --- a/BESMod/package.mo +++ b/BESMod/package.mo @@ -3,7 +3,7 @@ package BESMod extends Modelica.Icons.Package; annotation ( - version="0.2.0", + version="0.2.1", uses( BuildingSystems(version="2.0.0-beta"), Modelica(version="4.0.0"), From cb19dce331a483fa8c33639b90bcec24009d53e9 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 23 Aug 2022 13:48:42 +0200 Subject: [PATCH 017/131] print dependencies.json --- .../03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml b/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml index d0f0957b..5c0e4f33 100644 --- a/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml +++ b/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml @@ -1 +1 @@ -stages: - check - create_whitelist .check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: - external_pull_requests retry: max: 2 when: runner_system_failure except: variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ Check_BESMod_Examples: variables: lib_package: Examples extends: .check_model_job .check_changed_models_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - git diff --raw --diff-filter=AMT HEAD^1 > bin/Configfiles/ci_changed_model_list.txt - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 -CM artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day except: refs: - external_pull_requests variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ retry: max: 2 when: runner_system_failure Check_BESMod_Examples_changed_models: variables: lib_package: Examples only: changes: - BESMod/Examples/**/* extends: .check_changed_models_job .CI_check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_check/ except: refs: - external_pull_requests retry: max: 2 when: runner_system_failure CI_Check_BESMod_Examples: variables: lib_package: Examples extends: .CI_check_model_job whitelist_job: stage: create_whitelist before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - eval $(ssh-agent -s) - mkdir -p ~/.ssh - ssh-keyscan github.com >> ~/.ssh/known_hosts - ssh-agent -a /tmp/ssh_agent.sock > /dev/null - echo "${GITHUB_PRIVATE_KEY}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - git config --global user.name "${GITLAB_USER_NAME}" - git config --global user.email "${GITLAB_USER_EMAIL}" script: - mkdir whitelist && cd whitelist - git clone --single-branch --branch $CI_COMMIT_REF_NAME git@github.com:${Github_Repository}.git - cd ${CI_PROJECT_NAME} - echo "FAIL" > bin/Configfiles/exit.sh - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py -DS 2022 --repo-dir BESMod --library BESMod --wh-library BESMod --whitelist after_script: - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cd whitelist && cd ${CI_PROJECT_NAME} - if cat bin/Configfiles/exit.sh | grep "FAIL"; then message="Automatic push of CI - Update model_whitelist. Please pull the new files before push again. [skip ci]" ; git add bin/ci_whitelist/model_whitelist.txt ; git commit -m "$message" ; git push git@github.com:${Github_Repository}.git ; GREEN='\033[0;32m' ; NC='\033[0m' ; echo -e "$GREEN New html whitelist files were pushed to this branch.$NC" ; exit 0; else echo 'successful' > bin/Configfiles/exit.sh ; echo -e "$GREEN Whitelist is already up to date. Please delete the version number in file bin/ci_whitelist/model_whitelist.txt, if you want to recreate the whitelist.$NC" ; exit 0 ; fi artifacts: paths: - whitelist/${CI_PROJECT_NAME}/bin/ci_whitelist/model_whitelist.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ except: refs: - external_pull_requests \ No newline at end of file +stages: - check - create_whitelist .check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cat dependencies.json - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: - external_pull_requests retry: max: 2 when: runner_system_failure except: variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ Check_BESMod_Examples: variables: lib_package: Examples extends: .check_model_job .check_changed_models_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - git diff --raw --diff-filter=AMT HEAD^1 > bin/Configfiles/ci_changed_model_list.txt - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 -CM artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day except: refs: - external_pull_requests variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ retry: max: 2 when: runner_system_failure Check_BESMod_Examples_changed_models: variables: lib_package: Examples only: changes: - BESMod/Examples/**/* extends: .check_changed_models_job .CI_check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_check/ except: refs: - external_pull_requests retry: max: 2 when: runner_system_failure CI_Check_BESMod_Examples: variables: lib_package: Examples extends: .CI_check_model_job whitelist_job: stage: create_whitelist before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - eval $(ssh-agent -s) - mkdir -p ~/.ssh - ssh-keyscan github.com >> ~/.ssh/known_hosts - ssh-agent -a /tmp/ssh_agent.sock > /dev/null - echo "${GITHUB_PRIVATE_KEY}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - git config --global user.name "${GITLAB_USER_NAME}" - git config --global user.email "${GITLAB_USER_EMAIL}" script: - mkdir whitelist && cd whitelist - git clone --single-branch --branch $CI_COMMIT_REF_NAME git@github.com:${Github_Repository}.git - cd ${CI_PROJECT_NAME} - echo "FAIL" > bin/Configfiles/exit.sh - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py -DS 2022 --repo-dir BESMod --library BESMod --wh-library BESMod --whitelist after_script: - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cd whitelist && cd ${CI_PROJECT_NAME} - if cat bin/Configfiles/exit.sh | grep "FAIL"; then message="Automatic push of CI - Update model_whitelist. Please pull the new files before push again. [skip ci]" ; git add bin/ci_whitelist/model_whitelist.txt ; git commit -m "$message" ; git push git@github.com:${Github_Repository}.git ; GREEN='\033[0;32m' ; NC='\033[0m' ; echo -e "$GREEN New html whitelist files were pushed to this branch.$NC" ; exit 0; else echo 'successful' > bin/Configfiles/exit.sh ; echo -e "$GREEN Whitelist is already up to date. Please delete the version number in file bin/ci_whitelist/model_whitelist.txt, if you want to recreate the whitelist.$NC" ; exit 0 ; fi artifacts: paths: - whitelist/${CI_PROJECT_NAME}/bin/ci_whitelist/model_whitelist.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ except: refs: - external_pull_requests \ No newline at end of file From 375a9487833d8c8004178cb2cfeb8391b5002ad0 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 23 Aug 2022 14:01:47 +0200 Subject: [PATCH 018/131] fix install script --- install_dependencies.py | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/install_dependencies.py b/install_dependencies.py index 3aeec29d..c2ed6ec3 100644 --- a/install_dependencies.py +++ b/install_dependencies.py @@ -1,6 +1,7 @@ import os import sys import pathlib +import json class LibraryInstaller: @@ -23,27 +24,15 @@ def __init__(self, url: str, commit: str, mo: str = None): self.mo: str = mo -required_dependencies_config: dict = { - "IBPSA": LibraryInstaller( - url="https://github.com/ibpsa/modelica-ibpsa", - commit="d5b02ab5aac01c4d07583d73afff6b14c5f58bd2" - ) -} - -optional_dependencies_config: dict = { - "AixLib": LibraryInstaller( - url="https://github.com/RWTH-EBC/AixLib", - commit="0cef0cefc199dcb0d642d2b0c6eb0a3438d8a9a6" - ), - "Buildings": LibraryInstaller( - url="https://github.com/lbl-srg/modelica-buildings", - commit="fba63b60c75bb0285ede2081ae17dbdc9f38d9e7" - ), - "BuildingSystems": LibraryInstaller( - url="https://github.com/UdK-VPT/BuildingSystems", - commit="64adca47eae19d2744d86aa8d1624cbf7ad6326b" - ) -} +required_dependencies_config: dict = {} +optional_dependencies_config: dict = {} + +with open("dependencies.json", "r") as file: + data = json.load(file) + for key, value in data["required"].items(): + required_dependencies_config[key] = LibraryInstaller(**value) + for key, value in data["optional"].items(): + optional_dependencies_config[key] = LibraryInstaller(**value) def install_dependencies( From f355c9ddc1114eee1db7aad6fc705b6821269666 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 23 Aug 2022 16:24:51 +0200 Subject: [PATCH 019/131] Fix dependencies.json and add update version --- dependencies.json | 10 +++++++--- install_dependencies.py | 31 +++++++++++++++++++++++++------ 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/dependencies.json b/dependencies.json index c0c189f9..fe182212 100644 --- a/dependencies.json +++ b/dependencies.json @@ -2,7 +2,8 @@ "required": { "IBPSA": { "url": "https://github.com/ibpsa/modelica-ibpsa", - "commit": "2200c0169f2468fbb42fa28c23ad06d3ddf5a8c3", + "commit": "4466fbb309e7ffb3a7763e2872ac43f80522e84e", + "default_branch": "master", "mo": "IBPSA//package.mo" } }, @@ -10,16 +11,19 @@ "AixLib": { "url": "https://github.com/RWTH-EBC/AixLib", "commit": "b341e6903b36fe032e0aff256496cef456c8ceca", + "default_branch": "development", "mo": "AixLib//package.mo" }, "Buildings": { "url": "https://github.com/lbl-srg/modelica-buildings", - "commit": "8a5db0ce3a7c54803e0abc2c01b28f7c18e81b09", + "commit": "fba63b60c75bb0285ede2081ae17dbdc9f38d9e7", + "default_branch": "master", "mo": "Buildings//package.mo" }, "BuildingSystems": { "url": "https://github.com/UdK-VPT/BuildingSystems", - "commit": "d6020ce8006af7f1bcfa59e712efd8a2134e03b6", + "commit": "64adca47eae19d2744d86aa8d1624cbf7ad6326b", + "default_branch": "master", "mo": "BuildingSystems//package.mo" } } diff --git a/install_dependencies.py b/install_dependencies.py index c2ed6ec3..27276691 100644 --- a/install_dependencies.py +++ b/install_dependencies.py @@ -12,16 +12,20 @@ class LibraryInstaller: Url to repo to install :param str commit: The commit hash + :param str default_branch: + Default branch. Used to update installed + dependencies :param str mo: Default None. If the mo to load is not the name\\package.mo in the setup-config dicts. """ - def __init__(self, url: str, commit: str, mo: str = None): + def __init__(self, url: str, commit: str, default_branch: str, mo: str = None): self.url: str = url self.commit: str = commit self.mo: str = mo + self.default_branch: str = default_branch required_dependencies_config: dict = {} @@ -39,7 +43,9 @@ def install_dependencies( optional_dependencies: list, install_directory: str, working_directory: str, - besmod_directory: pathlib.Path): + besmod_directory: pathlib.Path, + update: bool +): working_directory = pathlib.Path(working_directory) install_directory = pathlib.Path(install_directory) @@ -56,9 +62,18 @@ def install_dependencies( for lib, lib_installer in install_libraries.items(): os.chdir(install_directory) lib_dir = install_directory.joinpath(lib) - os.system(f'git clone "{lib_installer.url}" "{str(lib_dir)}"') - os.chdir(lib_dir) - os.system(f"git checkout -b commit_{lib_installer.commit[:8]} {lib_installer.commit} --") + if update: + os.chdir(lib_dir) + os.system(f'git checkout "{lib_installer.default_branch}"') + os.system('git pull') + # Try to create new branch + ret = os.system(f"git checkout -b commit_{lib_installer.commit[:8]} {lib_installer.commit} --") + if ret != 0: + os.system(f"git checkout commit_{lib_installer.commit[:8]}") + else: + os.system(f'git clone "{lib_installer.url}" "{str(lib_dir)}"') + os.chdir(lib_dir) + os.system(f"git checkout -b commit_{lib_installer.commit[:8]} {lib_installer.commit} --") if lib_installer.mo is None: package_mo = f"{lib}//package.mo" else: @@ -84,6 +99,7 @@ def install_dependencies( WORKING_DIR = BESMOD_DIR.joinpath("working_dir") OPTIONAL_DEPENDENCIES = [] INSTALL_FULL = False + UPDATE = False for _v in argv: if _v.startswith("--install_dir="): INSTALL_DIR = _v.replace("--install_dir=", "") @@ -91,6 +107,8 @@ def install_dependencies( WORKING_DIR = _v.replace("--working_dir=", "") elif _v == "full": INSTALL_FULL = True + elif _v == "--update": + UPDATE = True else: OPTIONAL_DEPENDENCIES.append(_v) if INSTALL_FULL: @@ -99,5 +117,6 @@ def install_dependencies( optional_dependencies=OPTIONAL_DEPENDENCIES, install_directory=INSTALL_DIR, working_directory=WORKING_DIR, - besmod_directory=BESMOD_DIR + besmod_directory=BESMOD_DIR, + update=UPDATE ) From 4ad6ae166a2217fe3c67836bba5336bfaa1d875a Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 23 Aug 2022 16:27:07 +0200 Subject: [PATCH 020/131] Update readme --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index e6b305c9..27154f4b 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,14 @@ python install_dependencies.py AixLib Buildings --install_dir=D:\BESMod_install After installing all libraries, a script `startup.mos` will be created in your BESMod repo. Execute this script to load all dependencies and start modelling. +### Updating dependencies + +If you have BESMod already installed, run + +``` +python install_dependencies.py full --update +``` +to update the existing repos and avoid a second download. # How to contribute to the development of BESMod From 9d7bf81d36e1a056d074fbaef6a8185de3e87d09 Mon Sep 17 00:00:00 2001 From: David Jansen Date: Tue, 23 Aug 2022 16:52:58 +0200 Subject: [PATCH 021/131] Update validatetest.py --- bin/CITests/02_UnitTests/CheckPackages/validatetest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py index 32b56b14..16c89bac 100644 --- a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py +++ b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py @@ -188,7 +188,7 @@ def _get_examples(self): # list all examples in package ex_file = open(filepath, "r", encoding='utf8', errors='ignore') lines = ex_file.readlines() for line in lines: - # if line.find("extends") > -1 and line.find("Modelica.Icons.Example") > -1: + if line.find("extends") > -1 and line.find("Modelica.Icons.Example") > -1: example = filepath.replace(os.sep, ".") example = example[example.rfind(self.mo_library):example.rfind(".mo")] example_list.append(example) From d50ad7c1851b7652b9d78985b6ad3bbf69459896 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 24 Aug 2022 09:02:40 +0200 Subject: [PATCH 022/131] fix indent --- bin/CITests/02_UnitTests/CheckPackages/validatetest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py index 16c89bac..d8903393 100644 --- a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py +++ b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py @@ -189,9 +189,9 @@ def _get_examples(self): # list all examples in package lines = ex_file.readlines() for line in lines: if line.find("extends") > -1 and line.find("Modelica.Icons.Example") > -1: - example = filepath.replace(os.sep, ".") - example = example[example.rfind(self.mo_library):example.rfind(".mo")] - example_list.append(example) + example = filepath.replace(os.sep, ".") + example = example[example.rfind(self.mo_library):example.rfind(".mo")] + example_list.append(example) break ex_file.close() return example_list From 737c80fb4fc3d5078eede08152fe8952b105764c Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 24 Aug 2022 09:23:48 +0200 Subject: [PATCH 023/131] fix break --- bin/CITests/02_UnitTests/CheckPackages/validatetest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py index d8903393..a96db3d0 100644 --- a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py +++ b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py @@ -192,7 +192,7 @@ def _get_examples(self): # list all examples in package example = filepath.replace(os.sep, ".") example = example[example.rfind(self.mo_library):example.rfind(".mo")] example_list.append(example) - break + break ex_file.close() return example_list From 3d361838639afd09a38e4cbe25294ce7f7fc443d Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 24 Aug 2022 09:32:31 +0200 Subject: [PATCH 024/131] debug --- bin/CITests/02_UnitTests/CheckPackages/validatetest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py index a96db3d0..9f1b77a3 100644 --- a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py +++ b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py @@ -194,6 +194,7 @@ def _get_examples(self): # list all examples in package example_list.append(example) break ex_file.close() + print(example_list) return example_list def _get_ch_examples(self): # list all changed examples in package @@ -480,6 +481,7 @@ def sim_example_workflow(): example_list = CheckModelTest._filter_wh_models(models, wh_list) else: example_list = CheckModelTest._get_examples() + print(example_list) if len(example_list) == 0: print(f'No models in package {args.single_package}') exit(1) From b030f49fac589948d1f1be6bc7bd3d60255462dc Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 24 Aug 2022 10:00:18 +0200 Subject: [PATCH 025/131] fix tests --- .../Electrical/Tests/ElectricalSystem.mo | 31 ++++++++++++++----- .../Transfer/NoElectricalTransfer.mo | 15 +++++---- .../Examples/ParallelBivalentControl.mo | 2 ++ .../Examples/PartialOnOffController.mo | 1 - .../OnOffController/Examples/package.order | 2 +- .../UserProfiles/Tests/Case600Profiles.mo | 3 +- .../UserProfiles/Tests/TEASERProfileTest.mo | 3 +- .../CheckPackages/validatetest.py | 2 -- .../02_UnitTests/check_model.gitlab-ci.yml | 2 +- .../02_UnitTests/simulate_model.gitlab-ci.yml | 8 ++--- 10 files changed, 44 insertions(+), 25 deletions(-) diff --git a/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo b/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo index 8f830e76..4526f7f5 100644 --- a/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo +++ b/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo @@ -4,6 +4,20 @@ model ElectricalSystem BESMod.Systems.Electrical.ElectricalSystem pVBatterySystemNoTransfer( use_elecHeating=false, + redeclare + BESMod.Systems.Electrical.RecordsCollection.ElectricalSystemBaseDataDefinition + electricalSystemParameters( + nZones=1, + Q_flow_nominal={0}, + TOda_nominal=261.15, + TSup_nominal={293.15}, + TZone_nominal={293.15}, + TAmb=293.15, + AZone={0}, + hZone={0}, + ABui=0, + hBui=0, + ARoo=0), redeclare Transfer.NoElectricalTransfer transfer, redeclare Distribution.BatterySystemSimple distribution(redeclare BuildingSystems.Technologies.ElectricalStorages.Data.LithiumIon.LithiumIonTeslaPowerwall1 @@ -19,43 +33,44 @@ model ElectricalSystem ARoof=50), nLoadsExtSubSys=1, redeclare Control.NoControl control) - annotation (Placement(transformation(extent={{-38,-34},{54,42}}))); + annotation (Placement(transformation(extent={{-40,-34},{52,42}}))); Modelica.Blocks.Sources.Sine LoadFromResidualBES( amplitude=3000, f=1/86400, offset=3000) annotation (Placement(transformation(extent={{-98,24},{-78,44}}))); - BESMod.Utilities.Electrical.RealToElecCon realToElecCon + BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) annotation (Placement(transformation(extent={{-70,24},{-50,44}}))); IBPSA.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam= ModelicaServices.ExternalReferences.loadResource( "modelica://BESMod/Resources/TRY2015_522361130393_Jahr_City_Potsdam.mos")) annotation (Placement(transformation(extent={{-100,68},{-72,96}}))); BESMod.Utilities.Electrical.ElecConToReal elecConToReal(reverse=true) - annotation (Placement(transformation(extent={{-30,-80},{-6,-54}}))); + annotation (Placement(transformation(extent={{64,-12},{88,14}}))); Modelica.Blocks.Interfaces.RealOutput PElecFromGrid "Electrical power" - annotation (Placement(transformation(extent={{20,-76},{40,-56}}))); + annotation (Placement(transformation(extent={{100,-8},{120,12}}))); equation connect(LoadFromResidualBES.y, realToElecCon.PEleLoa) annotation (Line(points={{-77,34},{-74,34},{-74,38},{-72,38}}, color={0,0,127})); connect(weaDat.weaBus, pVBatterySystemNoTransfer.weaBus) annotation (Line( - points={{-72,82},{-64,82},{-64,84},{-56,84},{-56,16.2143},{-38,16.2143}}, + points={{-72,82},{-64,82},{-64,84},{-56,84},{-56,16.2143},{-40,16.2143}}, color={255,204,51}, thickness=0.5)); connect(pVBatterySystemNoTransfer.externalElectricalPin1, elecConToReal.internalElectricalPin) annotation (Line( - points={{54.5412,28.4286},{54.5412,-66.74},{-29.76,-66.74}}, + points={{52.5412,28.4286},{60,28.4286},{60,6},{58,6},{58,1.26},{64.24, + 1.26}}, color={0,0,0}, thickness=1)); connect(elecConToReal.PElecLoa, PElecFromGrid) - annotation (Line(points={{-3.6,-61.8},{30,-61.8},{30,-66}}, + annotation (Line(points={{90.4,6.2},{96,6.2},{96,2},{110,2}}, color={0,0,127})); connect(realToElecCon.internalElectricalPin, pVBatterySystemNoTransfer.internalElectricalPin[ 1]) annotation (Line( - points={{-49.8,34.2},{-43.9,34.2},{-43.9,27.8857},{-38,27.8857}}, + points={{-49.8,34.2},{-43.9,34.2},{-43.9,27.8857},{-40,27.8857}}, color={0,0,0}, thickness=1)); annotation (Icon(graphics, diff --git a/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo b/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo index 70cdf1a8..0914362a 100644 --- a/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo +++ b/BESMod/Systems/Electrical/Transfer/NoElectricalTransfer.mo @@ -3,19 +3,22 @@ model NoElectricalTransfer "No transfer system" extends BESMod.Systems.Electrical.Transfer.BaseClasses.PartialTransfer; BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{16,64},{36,84}}))); - Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow fixedHeatFlow[ + Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow fixedHeatFlowCon[ nParallelDem](each final Q_flow=0) - annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + annotation (Placement(transformation(extent={{52,28},{72,48}}))); + Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow fixedHeatFlowRad[ + nParallelDem](each final Q_flow=0) + annotation (Placement(transformation(extent={{42,-48},{62,-28}}))); equation connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( Line( points={{36,74},{48,74},{48,100}}, color={0,0,0}, thickness=1)); - connect(fixedHeatFlow.port, heatPortCon) annotation (Line(points={{60,0},{86, - 0},{86,38},{100,38}}, color={191,0,0})); - connect(fixedHeatFlow.port, heatPortRad) annotation (Line(points={{60,0},{86, - 0},{86,-38},{100,-38}}, color={191,0,0})); + connect(fixedHeatFlowCon.port, heatPortCon) + annotation (Line(points={{72,38},{100,38}}, color={191,0,0})); + connect(fixedHeatFlowRad.port, heatPortRad) + annotation (Line(points={{62,-38},{100,-38}}, color={191,0,0})); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/ParallelBivalentControl.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/ParallelBivalentControl.mo index 2ba82679..bd45f5d7 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/ParallelBivalentControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/ParallelBivalentControl.mo @@ -12,4 +12,6 @@ model ParallelBivalentControl TRoom=293.15, QDem_flow_nominal=12000, QHP_flow_cutOff=3000)); + + extends Modelica.Icons.Example; end ParallelBivalentControl; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/PartialOnOffController.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/PartialOnOffController.mo index 73b9bf43..6cfe7842 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/PartialOnOffController.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/PartialOnOffController.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Hydraulical.Control.Components.OnOffController.Examples; partial model PartialOnOffController - extends Modelica.Icons.Example; parameter Real TSetDef=273.15 + 50 "Constant output value"; parameter Real dTHys "Hysterisis value"; replaceable BaseClasses.PartialOnOffController onOffController annotation ( diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/package.order b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/package.order index 4a19ad2c..b81378e4 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/package.order @@ -1,2 +1,2 @@ -PartialOnOffController ParallelBivalentControl +PartialOnOffController diff --git a/BESMod/Systems/UserProfiles/Tests/Case600Profiles.mo b/BESMod/Systems/UserProfiles/Tests/Case600Profiles.mo index 9fd96e02..6d9a7f77 100644 --- a/BESMod/Systems/UserProfiles/Tests/Case600Profiles.mo +++ b/BESMod/Systems/UserProfiles/Tests/Case600Profiles.mo @@ -1,7 +1,8 @@ within BESMod.Systems.UserProfiles.Tests; model Case600Profiles extends PartialTest(redeclare BESMod.Systems.UserProfiles.Case600Profiles - userProfiles); + userProfiles(redeclare + BESMod.Systems.Demand.DHW.RecordsCollection.ProfileS DHWProfile)); extends Modelica.Icons.Example; end Case600Profiles; diff --git a/BESMod/Systems/UserProfiles/Tests/TEASERProfileTest.mo b/BESMod/Systems/UserProfiles/Tests/TEASERProfileTest.mo index 3b7d7cf4..a27db67f 100644 --- a/BESMod/Systems/UserProfiles/Tests/TEASERProfileTest.mo +++ b/BESMod/Systems/UserProfiles/Tests/TEASERProfileTest.mo @@ -1,7 +1,8 @@ within BESMod.Systems.UserProfiles.Tests; model TEASERProfileTest extends PartialTest(redeclare BESMod.Systems.UserProfiles.TEASERProfiles - userProfiles); + userProfiles(redeclare + BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile)); extends Modelica.Icons.Example; end TEASERProfileTest; diff --git a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py index 9f1b77a3..a96db3d0 100644 --- a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py +++ b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py @@ -194,7 +194,6 @@ def _get_examples(self): # list all examples in package example_list.append(example) break ex_file.close() - print(example_list) return example_list def _get_ch_examples(self): # list all changed examples in package @@ -481,7 +480,6 @@ def sim_example_workflow(): example_list = CheckModelTest._filter_wh_models(models, wh_list) else: example_list = CheckModelTest._get_examples() - print(example_list) if len(example_list) == 0: print(f'No models in package {args.single_package}') exit(1) diff --git a/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml b/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml index 5c0e4f33..eb4e5a9c 100644 --- a/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml +++ b/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml @@ -1 +1 @@ -stages: - check - create_whitelist .check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cat dependencies.json - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: - external_pull_requests retry: max: 2 when: runner_system_failure except: variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ Check_BESMod_Examples: variables: lib_package: Examples extends: .check_model_job .check_changed_models_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - git diff --raw --diff-filter=AMT HEAD^1 > bin/Configfiles/ci_changed_model_list.txt - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 -CM artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day except: refs: - external_pull_requests variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ retry: max: 2 when: runner_system_failure Check_BESMod_Examples_changed_models: variables: lib_package: Examples only: changes: - BESMod/Examples/**/* extends: .check_changed_models_job .CI_check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_check/ except: refs: - external_pull_requests retry: max: 2 when: runner_system_failure CI_Check_BESMod_Examples: variables: lib_package: Examples extends: .CI_check_model_job whitelist_job: stage: create_whitelist before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - eval $(ssh-agent -s) - mkdir -p ~/.ssh - ssh-keyscan github.com >> ~/.ssh/known_hosts - ssh-agent -a /tmp/ssh_agent.sock > /dev/null - echo "${GITHUB_PRIVATE_KEY}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - git config --global user.name "${GITLAB_USER_NAME}" - git config --global user.email "${GITLAB_USER_EMAIL}" script: - mkdir whitelist && cd whitelist - git clone --single-branch --branch $CI_COMMIT_REF_NAME git@github.com:${Github_Repository}.git - cd ${CI_PROJECT_NAME} - echo "FAIL" > bin/Configfiles/exit.sh - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py -DS 2022 --repo-dir BESMod --library BESMod --wh-library BESMod --whitelist after_script: - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cd whitelist && cd ${CI_PROJECT_NAME} - if cat bin/Configfiles/exit.sh | grep "FAIL"; then message="Automatic push of CI - Update model_whitelist. Please pull the new files before push again. [skip ci]" ; git add bin/ci_whitelist/model_whitelist.txt ; git commit -m "$message" ; git push git@github.com:${Github_Repository}.git ; GREEN='\033[0;32m' ; NC='\033[0m' ; echo -e "$GREEN New html whitelist files were pushed to this branch.$NC" ; exit 0; else echo 'successful' > bin/Configfiles/exit.sh ; echo -e "$GREEN Whitelist is already up to date. Please delete the version number in file bin/ci_whitelist/model_whitelist.txt, if you want to recreate the whitelist.$NC" ; exit 0 ; fi artifacts: paths: - whitelist/${CI_PROJECT_NAME}/bin/ci_whitelist/model_whitelist.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ except: refs: - external_pull_requests \ No newline at end of file +stages: - check - create_whitelist .check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cat dependencies.json - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: - external_pull_requests retry: max: 2 when: runner_system_failure except: variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ Check_BESMod_Examples: variables: lib_package: Examples extends: .check_model_job Check_BESMod_Utilities: variables: lib_package: Utilities extends: .check_model_job Check_BESMod_Systems: variables: lib_package: Systems extends: .check_model_job Check_BESMod_Tutorial: variables: lib_package: Tutorial extends: .check_model_job Check_BESMod_Components: variables: lib_package: Components extends: .check_model_job .check_changed_models_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - git diff --raw --diff-filter=AMT HEAD^1 > bin/Configfiles/ci_changed_model_list.txt - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 -CM artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day except: refs: - external_pull_requests variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ retry: max: 2 when: runner_system_failure Check_BESMod_Examples_changed_models: variables: lib_package: Examples only: changes: - BESMod/Examples/**/* extends: .check_changed_models_job Check_BESMod_Utilities_changed_models: variables: lib_package: Utilities only: changes: - BESMod/Utilities/**/* extends: .check_changed_models_job Check_BESMod_Tutorial_changed_models: variables: lib_package: Tutorial only: changes: - BESMod/Tutorial/**/* extends: .check_changed_models_job Check_BESMod_Systems_changed_models: variables: lib_package: Systems only: changes: - BESMod/Systems/**/* extends: .check_changed_models_job Check_BESMod_Components_changed_models: variables: lib_package: Components only: changes: - BESMod/Components/**/* extends: .check_changed_models_job .CI_check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_check/ except: refs: - external_pull_requests retry: max: 2 when: runner_system_failure CI_Check_BESMod_Examples: variables: lib_package: Examples extends: .CI_check_model_job CI_Check_BESMod_Utilities: variables: lib_package: Utilities extends: .CI_check_model_job CI_Check_BESMod_Tutorial: variables: lib_package: Tutorial extends: .CI_check_model_job CI_Check_BESMod_Systems: variables: lib_package: Systems extends: .CI_check_model_job CI_Check_BESMod_Components: variables: lib_package: Components extends: .CI_check_model_job whitelist_job: stage: create_whitelist before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - eval $(ssh-agent -s) - mkdir -p ~/.ssh - ssh-keyscan github.com >> ~/.ssh/known_hosts - ssh-agent -a /tmp/ssh_agent.sock > /dev/null - echo "${GITHUB_PRIVATE_KEY}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - git config --global user.name "${GITLAB_USER_NAME}" - git config --global user.email "${GITLAB_USER_EMAIL}" script: - mkdir whitelist && cd whitelist - git clone --single-branch --branch $CI_COMMIT_REF_NAME git@github.com:${Github_Repository}.git - cd ${CI_PROJECT_NAME} - echo "FAIL" > bin/Configfiles/exit.sh - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py -DS 2022 --repo-dir BESMod --library BESMod --wh-library BESMod --whitelist after_script: - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cd whitelist && cd ${CI_PROJECT_NAME} - if cat bin/Configfiles/exit.sh | grep "FAIL"; then message="Automatic push of CI - Update model_whitelist. Please pull the new files before push again. [skip ci]" ; git add bin/ci_whitelist/model_whitelist.txt ; git commit -m "$message" ; git push git@github.com:${Github_Repository}.git ; GREEN='\033[0;32m' ; NC='\033[0m' ; echo -e "$GREEN New html whitelist files were pushed to this branch.$NC" ; exit 0; else echo 'successful' > bin/Configfiles/exit.sh ; echo -e "$GREEN Whitelist is already up to date. Please delete the version number in file bin/ci_whitelist/model_whitelist.txt, if you want to recreate the whitelist.$NC" ; exit 0 ; fi artifacts: paths: - whitelist/${CI_PROJECT_NAME}/bin/ci_whitelist/model_whitelist.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ except: refs: - external_pull_requests \ No newline at end of file diff --git a/bin/templates/03_ci_templates/02_UnitTests/simulate_model.gitlab-ci.yml b/bin/templates/03_ci_templates/02_UnitTests/simulate_model.gitlab-ci.yml index e5a0dedd..62b020d9 100644 --- a/bin/templates/03_ci_templates/02_UnitTests/simulate_model.gitlab-ci.yml +++ b/bin/templates/03_ci_templates/02_UnitTests/simulate_model.gitlab-ci.yml @@ -33,9 +33,9 @@ CI_simulate_BESMod_Examples: extends: .CI_simulate_model_job -CI_simulate_BESMod_Utitilies: +CI_simulate_BESMod_Utilities: variables: - lib_package: Utitilies + lib_package: Utilities extends: .CI_simulate_model_job CI_simulate_BESMod_Systems: @@ -88,9 +88,9 @@ simulate_BESMod_Examples: lib_package: Examples extends: .simulate_model_job -simulate_BESMod_Utitilies: +simulate_BESMod_Utilities: variables: - lib_package: Utitilies + lib_package: Utilities extends: .simulate_model_job simulate_BESMod_Systems: From 47889febf884a639455e85a80f995888438e0e23 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 24 Aug 2022 10:31:07 +0200 Subject: [PATCH 026/131] Rm old files --- BESMod/Utilities/HeatDemand/CalcHeaDemROM.mo | 20 --- .../HeatDemand/PartialCalcHeatingDemand.mo | 130 ------------------ BESMod/Utilities/HeatDemand/package.order | 2 - 3 files changed, 152 deletions(-) delete mode 100644 BESMod/Utilities/HeatDemand/CalcHeaDemROM.mo delete mode 100644 BESMod/Utilities/HeatDemand/PartialCalcHeatingDemand.mo delete mode 100644 BESMod/Utilities/HeatDemand/package.order diff --git a/BESMod/Utilities/HeatDemand/CalcHeaDemROM.mo b/BESMod/Utilities/HeatDemand/CalcHeaDemROM.mo deleted file mode 100644 index 89f18756..00000000 --- a/BESMod/Utilities/HeatDemand/CalcHeaDemROM.mo +++ /dev/null @@ -1,20 +0,0 @@ -within BESMod.Utilities.HeatDemand; -model CalcHeaDemROM - "Calculate the heat demand for a given reduced order model from TEASER" - extends PartialCalcHeatingDemand( - TN_heater=building.zoneParam[1].TNHeat, - KR_heater=building.zoneParam[1].KRHeat, - h_heater=building.zoneParam.hHeat*10, - redeclare BESMod.Examples.BAUSimStudy.BESParameters - systemParameters(TOda_nominal=259.75), - redeclare BESMod.Systems.Demand.Building.TEASERThermalZone - building( - nZones=1, - redeclare - BESMod.Systems.Demand.Building.RecordsCollection.RefAachen - oneZoneParam, - final ventRate=0.5 .- building.zoneParam.baseACH)); - annotation (Documentation(info=" -

In order to use this model, choose a number of zones and pass a zoneParam from TEASER for every zone. Further specify the nominal heat outdoor air temperature in the system parameters or pass your custom systemParameters record.

-")); -end CalcHeaDemROM; diff --git a/BESMod/Utilities/HeatDemand/PartialCalcHeatingDemand.mo b/BESMod/Utilities/HeatDemand/PartialCalcHeatingDemand.mo deleted file mode 100644 index 9c1b0bea..00000000 --- a/BESMod/Utilities/HeatDemand/PartialCalcHeatingDemand.mo +++ /dev/null @@ -1,130 +0,0 @@ -within BESMod.Utilities.HeatDemand; -partial model PartialCalcHeatingDemand - "Model to calculate the heating demand for a given building record" - extends Modelica.Icons.Example; - parameter Real h_heater[building.nZones] "Upper limit controller output of the heater"; - parameter Real KR_heater=1000 "Gain of the heating controller"; - parameter Modelica.SIunits.Time TN_heater=1 "Time constant of the heating controller"; - replaceable parameter BESMod.Systems.RecordsCollection.SystemParametersBaseDataDefinition - systemParameters constrainedby - BESMod.Systems.RecordsCollection.SystemParametersBaseDataDefinition - "Parameters relevant for the whole energy system" annotation ( - choicesAllMatching=true, Placement(transformation(extent={{76,-96},{96,-76}}))); - Systems.UserProfiles.NoUser heatDemandScenario(final systemParameters= - systemParameters, final T_const=systemParameters.TOda_nominal) - annotation (Placement(transformation(extent={{-100,18},{-50,80}}))); - replaceable BESMod.Systems.Demand.Building.BaseClasses.PartialDemand building - constrainedby - BESMod.Systems.Demand.Building.BaseClasses.PartialDemand( final TSetZone_nominal=systemParameters.TSetZone_nominal, - final use_hydraulic=true, - final use_ventilation=false, - redeclare package MediumZone = AixLib.Media.Air) - annotation (choicesAllMatching=true, Placement(transformation(extent={{24,-34},{72,24}}))); - Modelica.Blocks.Interfaces.RealOutput QDemBuiSum_flow(final unit="W") - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={110,0}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={110,-80}))); - Modelica.Blocks.Sources.RealExpression - realExpression(y=sum(heaterCooler.heatingPower)) - annotation (Placement(transformation(extent={{10,52},{32,74}}))); - Modelica.Blocks.Interfaces.RealOutput QBui_flow_nominal[building.nZones]( - each final unit="W") "Indoor air temperature" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={110,40}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={110,-80}))); - AixLib.Utilities.Sources.HeaterCooler.HeaterCoolerPI heaterCooler[ - building.nZones]( - h_heater=h_heater, - each final l_heater=0, - each final KR_heater=KR_heater, - each final TN_heater=TN_heater, - each final zoneParam=AixLib.DataBase.ThermalZones.ZoneRecordDummy(), - each recOrSep=false, - each Heater_on=true, - each Cooler_on=false, - each final staOrDyn=false) "Heater Cooler with PI control" - annotation (Placement(transformation(extent={{-38,0},{-4,38}}))); - Modelica.Blocks.Sources.Constant const[building.nZones](final k= - systemParameters.TSetZone_nominal) - annotation (Placement(transformation(extent={{-74,-28},{-52,-6}}))); - Modelica.Blocks.Sources.BooleanConstant - booleanConstant - [building.nZones](each final k=true) - annotation (Placement(transformation(extent={{-112,-46},{-90,-24}}))); - Modelica.Blocks.Sources.BooleanConstant - booleanConstant1 - [building.nZones](each final k=false) - annotation (Placement(transformation(extent={{-112,-12},{-90,10}}))); - AixLib.BoundaryConditions.WeatherData.ReaderTMY3 weaDat( - final filNam=systemParameters.filNamWea, - TDryBulSou=AixLib.BoundaryConditions.Types.DataSource.Parameter, - TDryBul=systemParameters.TOda_nominal, - TDewPoiSou=AixLib.BoundaryConditions.Types.DataSource.Parameter, - TDewPoi=systemParameters.TOda_nominal, - TBlaSkySou=AixLib.BoundaryConditions.Types.DataSource.Parameter, - TBlaSky=systemParameters.TOda_nominal, - relHumSou=AixLib.BoundaryConditions.Types.DataSource.Parameter, - relHum=0, - HInfHorSou=AixLib.BoundaryConditions.Types.DataSource.Parameter, - HInfHor=0, - HSou=AixLib.BoundaryConditions.Types.RadiationDataSource.Input_HGloHor_HDifHor) - "Weather data reader" - annotation (Placement(transformation(extent={{-100,86},{-42,152}}))); - Modelica.Blocks.Sources.Constant constIrr(each final k=0) - annotation (Placement(transformation(extent={{-162,66},{-140,88}}))); - -equation - connect(heatDemandScenario.useProBus, building.useProBus) annotation (Line( - points={{-51.0417,48.7417},{6,48.7417},{6,48},{62,48},{62,28},{61.2,28},{ - 61.2,24}}, - color={0,127,0}, - thickness=0.5)); - - connect(QDemBuiSum_flow, realExpression.y) annotation (Line(points={{110,0}, - {80,0},{80,63},{33.1,63}}, color={0,0,127})); - connect(building.heatPortCon, heaterCooler.heatCoolRoom) annotation (Line( - points={{24,12.4},{16,12.4},{16,12},{6,12},{6,11.4},{-5.7,11.4}}, color= - {191,0,0})); - connect(const.y, heaterCooler.setPointHeat) annotation (Line(points={{-50.9, - -17},{-17.26,-17},{-17.26,5.32}}, - color={0,0,127})); - connect(heaterCooler.heatingPower, QBui_flow_nominal) annotation (Line(points= - {{-4,26.6},{14,26.6},{14,40},{110,40}}, color={0,0,127})); - connect(heaterCooler.heaterActive, booleanConstant.y) annotation (Line(points={{-9.44, - 5.32},{-9.44,-35},{-88.9,-35}}, color={255,0,255})); - connect(booleanConstant1.y, heaterCooler.coolerActive) annotation (Line( - points={{-88.9,-1},{-59.45,-1},{-59.45,5.32},{-32.9,5.32}}, color={255,0, - 255})); - connect(weaDat.weaBus, building.weaBus) annotation (Line( - points={{-42,119},{-8,119},{-8,50},{34.08,50},{34.08,24.58}}, - color={255,204,51}, - thickness=0.5)); - connect(constIrr.y, weaDat.HDifHor_in) annotation (Line(points={{-138.9,77},{ - -122.45,77},{-122.45,87.65},{-102.9,87.65}}, color={0,0,127})); - connect(constIrr.y, weaDat.HGloHor_in) annotation (Line(points={{-138.9,77},{ - -122.45,77},{-122.45,76.1},{-102.9,76.1}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false), graphics={Text( - extent={{-130,-24},{56,-118}}, - lineColor={28,108,200}, - textString="Right click -> Parameters -> -Select your system parameters -> -Simulate and extract QDemand and -array based demand for your systemParameters")}), experiment(StopTime=31536000, Interval=3600), - Documentation(info=" -

The heat demand is one of the most important paramters to quantify in order to correctly size the components in a BES. Hence, we add this partial heat demand calculator to enable a heat demand calculation according to EN 12831 for all possible Demand-Subsystems.

-

Note:

-
    -
  1. Depending on your subsystem, you have to ensure a nominal air exchange rate of 0.5 1/h is met.
  2. -
  3. You have to specify the maximal heat load to give the ideal heater (a PI Control) an upper limit. If your demand is equal to the upper limit, be sure to check if the required room temperature is supplied.
  4. -
-")); -end PartialCalcHeatingDemand; diff --git a/BESMod/Utilities/HeatDemand/package.order b/BESMod/Utilities/HeatDemand/package.order deleted file mode 100644 index 86dad9e9..00000000 --- a/BESMod/Utilities/HeatDemand/package.order +++ /dev/null @@ -1,2 +0,0 @@ -PartialCalcHeatingDemand -CalcHeaDemROM From 305eeff8bee9e21868358c058a0466379d083fcc Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 24 Aug 2022 10:57:28 +0200 Subject: [PATCH 027/131] Start check fixes --- .../BaseClasses/PartialSubsystemParameters.mo | 2 +- .../Hydraulical/Generation/ElectricalHeater.mo | 4 ++-- .../Hydraulical/Transfer/RadiatorTransferSystem.mo | 2 +- .../TransferDataBaseDefinition.mo | 14 +++++++------- .../Hydraulical/Transfer/UFHTransferSystem.mo | 2 +- .../Movers/AutomaticConfigurationData.mo | 4 ++-- .../RecordsCollection/Movers/DefaultMover.mo | 4 ++-- .../Movers/MoverBaseDataDefinition.mo | 6 ++++-- 8 files changed, 20 insertions(+), 18 deletions(-) diff --git a/BESMod/Systems/BaseClasses/PartialSubsystemParameters.mo b/BESMod/Systems/BaseClasses/PartialSubsystemParameters.mo index 1365525f..48b6a9db 100644 --- a/BESMod/Systems/BaseClasses/PartialSubsystemParameters.mo +++ b/BESMod/Systems/BaseClasses/PartialSubsystemParameters.mo @@ -31,7 +31,7 @@ model PartialSubsystemParameters "Model for a partial subsystem" "Nominal heat flow rate due to heat losses" annotation (Dialog(group= "Design - Bottom Up: Parameters are defined by the subsystem")); - parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal[nParallelDem] + parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal[nParallelDem](each min=Modelica.Constants.eps) "Nominal heat flow rate" annotation (Dialog(group= "Design - Top Down: Parameters are given by the parent system")); parameter Modelica.Units.SI.Temperature TOda_nominal diff --git a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo index b23aebe6..e0c9b2f8 100644 --- a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo @@ -35,7 +35,7 @@ model ElectricalHeater "Only heat using a heating rod" annotation (Placement(transformation(extent={{-16,-16},{16,16}}, rotation=90, origin={-32,10}))); - replaceable BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatingRodBaseDataDefinition + replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatingRodBaseDataDefinition heatingRodParameters annotation (choicesAllMatching=true, Placement(transformation(extent={{-62,-42}, {-50,-30}}))); @@ -146,7 +146,7 @@ equation horizontalAlignment=TextAlignment.Left)); connect(realToElecCon.internalElectricalPin, internalElectricalPin) annotation (Line( - points={{52.2,-97.8},{52.2,-96},{58,-96},{58,-86},{72,-86},{72,-98}}, + points={{52.2,-97.8},{52.2,-96},{58,-96},{58,-86},{72,-86},{72,-100}}, color={0,0,0}, thickness=1)); connect(realToElecCon.PEleLoa, hea.Pel) annotation (Line(points={{30,-94},{ diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo index 14d54987..6f6c8c28 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo @@ -95,7 +95,7 @@ model RadiatorTransferSystem extent={{-11,-11},{11,11}}, rotation=270, origin={-15,9}))); - replaceable + replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition pumpData annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,78},{-78,98}}))); IBPSA.Fluid.Sources.Boundary_pT bouPumpHP[nParallelDem]( diff --git a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferDataBaseDefinition.mo b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferDataBaseDefinition.mo index 71f533b4..43388e5e 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferDataBaseDefinition.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferDataBaseDefinition.mo @@ -21,35 +21,35 @@ partial record TransferDataBaseDefinition "Data record for hydraulic heat transf "Volume of water in whole heat distribution and transfer system" annotation (Dialog(group="Volume")); // Pressure - parameter BESMod.Systems.Hydraulical.Transfer.Types.PressureDropPerLength pressureDropPerLen + parameter BESMod.Systems.Hydraulical.Transfer.Types.PressureDropPerLength pressureDropPerLen(min=Modelica.Constants.eps) "Pressure drop per m that is allowed maximal within whole heat distribution system (typical value: 100 Pa/m). TODO: Calculate based on Figure 2.6.3-12 in Taschenbuch für HEIZUNG + KLIMATECHNIK 2019" annotation(Dialog(group="Pressure")); parameter BESMod.Systems.Hydraulical.Transfer.Types.HydraulicResistanceType typeOfHydRes "Type of the hydraulic restistances to be considered for parameter zf" annotation(Dialog(group="Pressure"), choicesAllMatching=true, Dialog(descriptionLabel=true)); parameter Real zf(min=1.0, max=10.0, unit="1") = BESMod.Systems.Hydraulical.Transfer.Functions.GetSurchargeFactorForHydraulicResistances(typeOfHydRes) "Factor for additional pressure resistances in piping network such as bows. Acc. to [Babusch, 2009]" annotation(Dialog(group="Pressure")); - parameter Modelica.Units.SI.PressureDifference dpHeaDistr_nominal= + parameter Modelica.Units.SI.PressureDifference dpHeaDistr_nominal(min=Modelica.Constants.eps)= pressureDropPerLen*zf*2*(2*sqrt(AFloor) + heiBui) "Pressure difference of heat distribuition system including piping plus pressure resistances but excluding UFH piping / heating circuit distributor. Actually L * W * H (factor 2 for flow and return)." annotation (Dialog(group="Pressure")); // Radiator - parameter Real perPreLosRad "Percentage of pressure loss in radiator relative to overall pressure loss" annotation(Dialog(group="Radiator")); - parameter Modelica.Units.SI.PressureDifference dpRad_nominal[nZones]=fill( + parameter Real perPreLosRad(min=Modelica.Constants.eps) "Percentage of pressure loss in radiator relative to overall pressure loss" annotation(Dialog(group="Radiator")); + parameter Modelica.Units.SI.PressureDifference dpRad_nominal[nZones](each min=Modelica.Constants.eps)=fill( perPreLosRad*dpHeaDistr_nominal, nZones) "Pressure drop at nominal mass flow rate in radiator" annotation (Dialog(group="Radiator")); // Valves parameter Real valveAutho[nZones](each min=0.2, each max=0.8, each unit="1") "Assumed valve authority (typical value: 0.5)" annotation(Dialog(group="Thermostatic Valve")); - parameter Modelica.Units.SI.PressureDifference dpHeaSysValve_nominal[nZones]= + parameter Modelica.Units.SI.PressureDifference dpHeaSysValve_nominal[nZones](each min=Modelica.Constants.eps)= (dpRad_nominal .+ dpHeaSysPreValve_nominal) ./ (1 .- valveAutho) "Nominal pressure drop over valve when fully opened at m_flowValve_nominal" annotation (Dialog(group="Thermostatic Valve")); parameter Boolean use_hydrBalAutom = true "Use automatic hydraluic balancing to set dpHeaSysPreValve_nominal" annotation(Dialog(group="Thermostatic Valve")); parameter Modelica.Units.SI.PressureDifference dpHeaSysPreValve_nominal[ - nZones]=if use_hydrBalAutom then max(dpRad_nominal) .- (dpRad_nominal) - else fill(0, nZones) + nZones](each min=Modelica.Constants.eps)=if use_hydrBalAutom then max(dpRad_nominal) .- (dpRad_nominal) + else fill(Modelica.Constants.eps, nZones) "Pressure difference of each branch in heat distribution system as pre set value for valves (hydraulic balance)" annotation (Dialog(group="Thermostatic Valve", enable=use_hydrBalAutom)); parameter Real leakageOpening = 0.0001 diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index c31d14db..2a644c8f 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -119,7 +119,7 @@ model UFHTransferSystem extent={{-11,-11},{11,11}}, rotation=0, origin={-23,37}))); - replaceable + replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition pumpData annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,78}, {-78,98}}))); diff --git a/BESMod/Systems/RecordsCollection/Movers/AutomaticConfigurationData.mo b/BESMod/Systems/RecordsCollection/Movers/AutomaticConfigurationData.mo index 5e342488..064b020c 100644 --- a/BESMod/Systems/RecordsCollection/Movers/AutomaticConfigurationData.mo +++ b/BESMod/Systems/RecordsCollection/Movers/AutomaticConfigurationData.mo @@ -18,6 +18,6 @@ record AutomaticConfigurationData parameter Modelica.Units.SI.PressureDifference dp_nominal "Nominal pressure difference"; parameter Modelica.Units.SI.Density rho "Density of fluid in use"; - parameter Real V_flowCurve[:]={0,0.99,1.1,1.01} "Relative V_flow curve to be used"; - parameter Real dpCurve[:]={1.01,1,0.99,0} "Relative dp curve to be used"; + parameter Real V_flowCurve[:]={0,0.99,1,1.01,1.02} "Relative V_flow curve to be used"; + parameter Real dpCurve[:]={1.02,1.01,1,0.99,0} "Relative dp curve to be used"; end AutomaticConfigurationData; diff --git a/BESMod/Systems/RecordsCollection/Movers/DefaultMover.mo b/BESMod/Systems/RecordsCollection/Movers/DefaultMover.mo index 3cef71a9..50d1f974 100644 --- a/BESMod/Systems/RecordsCollection/Movers/DefaultMover.mo +++ b/BESMod/Systems/RecordsCollection/Movers/DefaultMover.mo @@ -6,6 +6,6 @@ record DefaultMover use_inputFilter=false, addPowerToMedium=false, speed_rpm_nominal=1500, - dpCurve={1.01,1,0.99,0}, - V_flowCurve={0,0.99,1,1.01}); + dpCurve={1.02,1.01,1,0.99,0}, + V_flowCurve={0,0.99,1,1.01,1.02}); end DefaultMover; diff --git a/BESMod/Systems/RecordsCollection/Movers/MoverBaseDataDefinition.mo b/BESMod/Systems/RecordsCollection/Movers/MoverBaseDataDefinition.mo index bfba1d7d..aa5c7d20 100644 --- a/BESMod/Systems/RecordsCollection/Movers/MoverBaseDataDefinition.mo +++ b/BESMod/Systems/RecordsCollection/Movers/MoverBaseDataDefinition.mo @@ -1,8 +1,10 @@ within BESMod.Systems.RecordsCollection.Movers; partial record MoverBaseDataDefinition extends Modelica.Icons.Record; - parameter Real V_flowCurve[:] "Relative V_flow curve to be used"; - parameter Real dpCurve[:] "Relative dp curve to be used"; + parameter Real V_flowCurve[:]={0,0.99,1,1.01,1.02} + "Relative V_flow curve to be used"; + parameter Real dpCurve[:]={1.02,1.01,1,0.99,0} + "Relative dp curve to be used"; parameter Modelica.Units.NonSI.AngularVelocity_rpm speed_rpm_nominal "Nominal rotational speed for flow characteristic"; parameter Boolean addPowerToMedium From ebd2b61b317532c497e46913a4b6743477d88194 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 24 Aug 2022 11:41:39 +0200 Subject: [PATCH 028/131] further fix checks --- .../PartialModelicaConferenceUseCase.mo | 12 ++---------- BESMod/Systems/Demand/Building/TEASERThermalZone.mo | 4 ++-- .../PartialDistributionTwoStorageParallelDetailed.mo | 4 ++-- .../Hydraulical/Transfer/RadiatorPressureBased.mo | 5 ++++- .../Generation/ControlledDomesticVentilation.mo | 8 ++++---- 5 files changed, 14 insertions(+), 19 deletions(-) diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 8e1da6d4..18a1c932 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -11,9 +11,7 @@ partial model PartialModelicaConferenceUseCase generation( redeclare model CellTemperature = AixLib.Electrical.PVSystem.BaseClasses.CellTemperatureMountingContactToGround, - redeclare AixLib.DataBase.SolarElectric.SchuecoSPV170SME1 pVParameters, - lat=weaDat.lat, lon=weaDat.lon, alt=weaDat.alt, @@ -29,14 +27,12 @@ partial model PartialModelicaConferenceUseCase redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( dTTra_nominal={10}, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - redeclare package Medium_eva = AixLib.Media.Air, use_pressure=false, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP heatPumpParameters( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=271.15, scalingFactor=scalingFactorHP, useAirSource=true, @@ -69,7 +65,6 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW TSet_DHW, supCtrlTypeDHWSet=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal), - redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution(redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage @@ -83,7 +78,6 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), - redeclare Systems.Demand.DHW.DHW DHW( energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, use_pressure=false, @@ -107,10 +101,8 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.Ventilation.Generation.RecordsCollection.DummyHeatExchangerRecovery parameters, - redeclare IBPSA.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear - threeWayValve_b, - redeclare IBPSA.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear - threeWayValve_a, + redeclare IBPSA.Fluid.Actuators.Valves.ThreeWayLinear threeWayValve_b, + redeclare IBPSA.Fluid.Actuators.Valves.ThreeWayLinear threeWayValve_a, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParas, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover fanData, diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index f11eb7c2..c33c1925 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -7,14 +7,14 @@ model TEASERThermalZone ABui=2*sum(zoneParam.VAir)^(1/3), hZone=zoneParam.VAir ./ zoneParam.AZone, AZone=zoneParam.AZone); - replaceable parameter AixLib.DataBase.ThermalZones.ZoneBaseRecord oneZoneParam constrainedby + replaceable parameter AixLib.DataBase.ThermalZones.ZoneRecordDummy oneZoneParam constrainedby AixLib.DataBase.ThermalZones.ZoneBaseRecord "Default zone if only one is chosen" annotation(choicesAllMatching=true); parameter AixLib.DataBase.ThermalZones.ZoneBaseRecord zoneParam[nZones] = fill(oneZoneParam, nZones) "Choose an array of multiple zones" annotation(choicesAllMatching=true); parameter Real ventRate[nZones]=fill(0, nZones) "Constant mechanical ventilation rate"; - parameter Boolean use_verboseEnergyBalance = true "=false to disable the integration of the verbose energy balance"; + parameter Boolean use_verboseEnergyBalance=true "=false to disable the integration of the verbose energy balance"; parameter Modelica.Units.SI.TemperatureDifference dTComfort=2 "Temperature difference to room set temperature at which the comfort is still acceptable. 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."; diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo index 1469e1dc..da20e7f9 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo @@ -39,7 +39,7 @@ partial model PartialDistributionTwoStorageParallelDetailed use_inputFilter=false) annotation (choicesAllMatching= true, Placement(transformation(extent={{-84,84},{-64,104}}))); - replaceable + replaceable parameter RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition bufParameters constrainedby RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( @@ -62,7 +62,7 @@ partial model PartialDistributionTwoStorageParallelDetailed annotation ( choicesAllMatching=true, Placement(transformation(extent={{18,26},{32,40}}))); - replaceable + replaceable parameter RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition dhwParameters constrainedby RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index 30c17f3e..e56febf0 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -1,6 +1,9 @@ within BESMod.Systems.Hydraulical.Transfer; model RadiatorPressureBased "Pressure Based transfer system" - extends BaseClasses.PartialTransfer(final dp_nominal=rad.dp_nominal .+ val.dpValve_nominal .+ res.dp_nominal .+ val.dpFixed_nominal, + // Abui =1 and hBui =1 to avaoid warnings, will be overwritten anyway + extends BaseClasses.PartialTransfer( + ABui=1, + hBui=1, final dp_nominal=rad.dp_nominal .+ val.dpValve_nominal .+ res.dp_nominal .+ val.dpFixed_nominal, final nParallelSup=1); replaceable parameter RecordsCollection.TransferDataBaseDefinition diff --git a/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo b/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo index 2b582c69..0d5491f7 100644 --- a/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo +++ b/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo @@ -125,7 +125,7 @@ model ControlledDomesticVentilation rotation=180, origin={-53,42}))); - replaceable IBPSA.Fluid.Actuators.BaseClasses.PartialThreeWayValve threeWayValve_b constrainedby + replaceable IBPSA.Fluid.Actuators.Valves.ThreeWayLinear threeWayValve_b constrainedby IBPSA.Fluid.Actuators.BaseClasses.PartialThreeWayValve( final energyDynamics=energyDynamics, final p_start=p_start, @@ -144,7 +144,7 @@ model ControlledDomesticVentilation final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, final m_flow_nominal=m_flow_nominal[1]) annotation (choicesAllMatching=true, Placement(transformation(extent={{22,-64},{38,-80}}))); - replaceable IBPSA.Fluid.Actuators.BaseClasses.PartialThreeWayValve threeWayValve_a constrainedby + replaceable IBPSA.Fluid.Actuators.Valves.ThreeWayLinear threeWayValve_a constrainedby IBPSA.Fluid.Actuators.BaseClasses.PartialThreeWayValve( final energyDynamics=energyDynamics, final p_start=p_start, @@ -173,11 +173,11 @@ model ControlledDomesticVentilation dp_nominal={dpDem_nominal[1], dpDem_nominal[1] + parameters.dpHex_nominal}) annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,-98}, {-76,-74}}))); - replaceable + replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition fanData annotation (Placement(transformation(extent={{-82,-8},{-62,12}})), choicesAllMatching=true); - replaceable + replaceable parameter BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition tempSensorData annotation (Placement(transformation(extent={{76,78},{96,98}})), From 5f722f1aef3bb8d895e327c2eb55266741bad74b Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 24 Aug 2022 13:59:31 +0200 Subject: [PATCH 029/131] fix tests --- .../BaseClasses/PartialDHWParameters.mo | 6 +++--- .../BaseClasses/PartialDistribution.mo | 4 ++-- ...lDistributionTwoStorageParallelDetailed.mo | 20 +++++++++++++------ .../BufferStorageBaseDataDefinition.mo | 2 +- .../PartialStorageBaseDataDefinition.mo | 2 +- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDHWParameters.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDHWParameters.mo index c69d590f..b46b5fbc 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDHWParameters.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDHWParameters.mo @@ -1,9 +1,9 @@ within BESMod.Systems.Hydraulical.Distribution.BaseClasses; model PartialDHWParameters - parameter Modelica.Units.SI.MassFlowRate mDHW_flow_nominal + parameter Modelica.Units.SI.MassFlowRate mDHW_flow_nominal(min=Modelica.Constants.eps) "Nominal mass flow rate" annotation (Dialog(group= "Design - Top Down: Parameters are given by the parent system")); - parameter Modelica.Units.SI.HeatFlowRate QDHW_flow_nominal + parameter Modelica.Units.SI.HeatFlowRate QDHW_flow_nominal(min=Modelica.Constants.eps) "Nominal heat flow rate to DHW" annotation (Dialog(group= "Design - Top Down: Parameters are given by the parent system")); parameter Modelica.Units.SI.Temperature TDHW_nominal @@ -12,7 +12,7 @@ model PartialDHWParameters parameter Modelica.Units.SI.TemperatureDifference dTTraDHW_nominal "Nominal temperature difference to transfer heat to DHW" annotation (Dialog( group="Design - Bottom Up: Parameters are defined by the subsystem")); - parameter Modelica.Units.SI.Volume VDHWDay "Daily volume of DHW tapping" + parameter Modelica.Units.SI.Volume VDHWDay(min=Modelica.Constants.eps) "Daily volume of DHW tapping" annotation (Dialog(group= "Design - Top Down: Parameters are given by the parent system")); parameter Modelica.Units.SI.Temperature TDHWCold_nominal diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistribution.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistribution.mo index 71215e1d..51dd8c5b 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistribution.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistribution.mo @@ -14,11 +14,11 @@ partial model PartialDistribution replaceable package MediumGen = Modelica.Media.Interfaces.PartialMedium annotation (choicesAllMatching=true); - parameter Modelica.Units.SI.MassFlowRate mSup_flow_nominal[nParallelSup] + parameter Modelica.Units.SI.MassFlowRate mSup_flow_nominal[nParallelSup](each min=Modelica.Constants.eps) "Nominal mass flow rate of system supplying the distribution" annotation ( Dialog(group= "Design - Top Down: Parameters are given by the parent system")); - parameter Modelica.Units.SI.MassFlowRate mDem_flow_nominal[nParallelDem] + parameter Modelica.Units.SI.MassFlowRate mDem_flow_nominal[nParallelDem](each min=Modelica.Constants.eps) "Nominal mass flow rate of demand system of the distribution" annotation ( Dialog(group= "Design - Top Down: Parameters are given by the parent system")); diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo index da20e7f9..acd37e47 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo @@ -62,22 +62,30 @@ partial model PartialDistributionTwoStorageParallelDetailed annotation ( choicesAllMatching=true, Placement(transformation(extent={{18,26},{32,40}}))); + /* + ( + final V=VDHWDay, + final Q_flow_nominal=QDHW_flow_nominal, + final VPerQ_flow=0, + T_m=TDHW_nominal) + */ + replaceable parameter RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition dhwParameters constrainedby RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( + final Q_flow_nominal=QDHW_flow_nominal, + final VPerQ_flow=0, final rho=rho, final c_p=cp, - final TAmb=TAmb, - final use_HC1=storageDHW.useHeatingCoil1, - final QHC1_flow_nominal=Q_flow_nominal[1]*f_design[1], final V=VDHWDay, - final Q_flow_nominal=QDHW_flow_nominal, - final VPerQ_flow=0, + final TAmb=TAmb, T_m=TDHW_nominal, + final QHC1_flow_nominal=Q_flow_nominal[1]*f_design[1], final mHC1_flow_nominal=mSup_flow_nominal[1], redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, - final use_HC2=storageDHW.useHeatingCoil2, + final use_HC2=storageBuf.useHeatingCoil2, + final use_HC1=storageBuf.useHeatingCoil1, final dTLoadingHC2=9999999, final fHeiHC2=1, final fDiaHC2=1, diff --git a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/BufferStorageBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/BufferStorageBaseDataDefinition.mo index 58773a02..00e92484 100644 --- a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/BufferStorageBaseDataDefinition.mo +++ b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/BufferStorageBaseDataDefinition.mo @@ -28,7 +28,7 @@ record BufferStorageBaseDataDefinition parameter Modelica.Units.SI.MassFlowRate mHC2_flow_nominal "Nominal mass flow rate of HC fluid" annotation (Dialog(group="Loading", enable=use_HC2)); - replaceable parameter AixLib.DataBase.Pipes.PipeBaseDataDefinition pipeHC2 constrainedby + replaceable parameter AixLib.DataBase.Pipes.Copper.Copper_12x0_6 pipeHC2 constrainedby AixLib.DataBase.Pipes.PipeBaseDataDefinition "Type of Pipe for HC2" annotation (choicesAllMatching=true, Dialog(group="Loading", enable=use_HC2)); parameter Modelica.Units.SI.CoefficientOfHeatTransfer hConHC2=(2/pipeHC2.d_i + 2/pipeHC2.d_o)/(((max(dTLoadingHC2, dTLoaMin)*2*Modelica.Constants.pi* diff --git a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/PartialStorageBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/PartialStorageBaseDataDefinition.mo index aab49bdc..56d096d8 100644 --- a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/PartialStorageBaseDataDefinition.mo +++ b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/PartialStorageBaseDataDefinition.mo @@ -43,7 +43,7 @@ partial record PartialStorageBaseDataDefinition parameter Modelica.Units.SI.MassFlowRate mHC1_flow_nominal "Nominal mass flow rate of HC fluid" annotation (Dialog(group="Loading", enable=use_HC1)); - replaceable parameter AixLib.DataBase.Pipes.PipeBaseDataDefinition pipeHC1 constrainedby + replaceable parameter AixLib.DataBase.Pipes.Copper.Copper_12x0_6 pipeHC1 constrainedby AixLib.DataBase.Pipes.PipeBaseDataDefinition "Type of Pipe for HC1" annotation (choicesAllMatching=true, Dialog(group="Loading", enable=use_HC1)); parameter Modelica.Units.SI.CoefficientOfHeatTransfer hConHC1=(2/pipeHC1.d_o) /(((max(dTLoadingHC1, dTLoaMin)*2*Modelica.Constants.pi*lengthHC1)/ From 4ebfcaed6c8cfb2ed8a7d429740be1ccffa615b2 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 24 Aug 2022 14:37:35 +0200 Subject: [PATCH 030/131] update whitelist --- bin/ci_whitelist/html_whitelist.txt | 2804 +-------------------------- 1 file changed, 1 insertion(+), 2803 deletions(-) diff --git a/bin/ci_whitelist/html_whitelist.txt b/bin/ci_whitelist/html_whitelist.txt index 41a70b45..13846ef0 100644 --- a/bin/ci_whitelist/html_whitelist.txt +++ b/bin/ci_whitelist/html_whitelist.txt @@ -1,2804 +1,2 @@ -IBPSA.package.mo - -IBPSA.ThermalZones.package.mo - -IBPSA.ThermalZones.ReducedOrder.package.mo - -IBPSA.ThermalZones.ReducedOrder.SolarGain.package.mo - -IBPSA.ThermalZones.ReducedOrder.SolarGain.CorrectionGDoublePane.mo - -IBPSA.ThermalZones.ReducedOrder.SolarGain.BaseClasses.package.mo - -IBPSA.ThermalZones.ReducedOrder.SolarGain.BaseClasses.PartialCorrectionG.mo - -IBPSA.ThermalZones.ReducedOrder.Examples.SimpleRoomFourElementsTraceSubstance.mo - -IBPSA.ThermalZones.ReducedOrder.Examples.package.mo - -IBPSA.ThermalZones.ReducedOrder.Examples.SimpleRoomOneElement.mo - -IBPSA.ThermalZones.ReducedOrder.Examples.SimpleRoomFourElements.mo - -IBPSA.ThermalZones.ReducedOrder.Examples.SimpleRoomThreeElements.mo - -IBPSA.ThermalZones.ReducedOrder.Examples.SimpleRoomTwoElements.mo - -IBPSA.ThermalZones.ReducedOrder.RC.package.mo - -IBPSA.ThermalZones.ReducedOrder.RC.ThreeElements.mo - -IBPSA.ThermalZones.ReducedOrder.RC.FourElements.mo - -IBPSA.ThermalZones.ReducedOrder.RC.TwoElements.mo - -IBPSA.ThermalZones.ReducedOrder.RC.OneElement.mo - -IBPSA.ThermalZones.ReducedOrder.RC.BaseClasses.package.mo - -IBPSA.ThermalZones.ReducedOrder.RC.BaseClasses.ExteriorWall.mo - -IBPSA.ThermalZones.ReducedOrder.RC.BaseClasses.splitFacVal.mo - -IBPSA.ThermalZones.ReducedOrder.RC.BaseClasses.ThermSplitter.mo - -IBPSA.ThermalZones.ReducedOrder.RC.BaseClasses.InteriorWall.mo - -IBPSA.ThermalZones.ReducedOrder.EquivalentAirTemperature.package.mo - -IBPSA.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007.mo - -IBPSA.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007WithWindow.mo - -IBPSA.ThermalZones.ReducedOrder.EquivalentAirTemperature.BaseClasses.package.mo - -IBPSA.ThermalZones.ReducedOrder.EquivalentAirTemperature.BaseClasses.PartialVDI6007.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.package.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.RoomWithoutLatentGain.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.RoomSteadyState.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.RoomWithLatentGain.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.package.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.TestCase1.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.TestCase2.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.TestCase11.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.TestCase12.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.TestCase7.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.TestCase9.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.TestCase10.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.TestCase6.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.TestCase4.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.TestCase8.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.TestCase5.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.TestCase3.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.BaseClasses.package.mo - -IBPSA.ThermalZones.ReducedOrder.Validation.VDI6007.BaseClasses.VerifyDifferenceThreePeriods.mo - -IBPSA.Resources.src.fluid.heatpumps.calibration.Examples.SomeManufacturer_ABC060_70kW_4_0COP_R410A.mo - -IBPSA.Utilities.package.mo - -IBPSA.Utilities.IO.package.mo - -IBPSA.Utilities.IO.Files.JSONWriter.mo - -IBPSA.Utilities.IO.Files.package.mo - -IBPSA.Utilities.IO.Files.CSVWriter.mo - -IBPSA.Utilities.IO.Files.CombiTimeTableWriter.mo - -IBPSA.Utilities.IO.Files.BaseClasses.package.mo - -IBPSA.Utilities.IO.Files.BaseClasses.writeJSON.mo - -IBPSA.Utilities.IO.Files.BaseClasses.cacheVals.mo - -IBPSA.Utilities.IO.Files.BaseClasses.FileWriter.mo - -IBPSA.Utilities.IO.Files.BaseClasses.JSONWriterObject.mo - -IBPSA.Utilities.IO.Files.BaseClasses.FileWriterObject.mo - -IBPSA.Utilities.IO.Files.BaseClasses.OutputTime.mo - -IBPSA.Utilities.IO.Files.Examples.JSONWriter.mo - -IBPSA.Utilities.IO.Files.Examples.package.mo - -IBPSA.Utilities.IO.Files.Examples.CSVReader.mo - -IBPSA.Utilities.IO.Files.Examples.CSVWriter.mo - -IBPSA.Utilities.IO.Files.Examples.BaseClasses.package.mo - -IBPSA.Utilities.IO.Files.Examples.BaseClasses.PartialCSV.mo - -IBPSA.Utilities.IO.SignalExchange.package.mo - -IBPSA.Utilities.IO.SignalExchange.WeatherStation.mo - -IBPSA.Utilities.IO.SignalExchange.Read.mo - -IBPSA.Utilities.IO.SignalExchange.Overwrite.mo - -IBPSA.Utilities.IO.SignalExchange.SignalTypes.package.mo - -IBPSA.Utilities.IO.SignalExchange.SignalTypes.SignalsForKPIs.mo - -IBPSA.Utilities.IO.SignalExchange.Examples.package.mo - -IBPSA.Utilities.IO.SignalExchange.Examples.FirstOrder.mo - -IBPSA.Utilities.IO.SignalExchange.Examples.WeatherStation.mo - -IBPSA.Utilities.IO.SignalExchange.Examples.BaseClasses.package.mo - -IBPSA.Utilities.IO.SignalExchange.Examples.BaseClasses.ExportedModel.mo - -IBPSA.Utilities.IO.SignalExchange.Examples.BaseClasses.OriginalModel.mo - -IBPSA.Utilities.Cryptographics.package.mo - -IBPSA.Utilities.Cryptographics.sha.mo - -IBPSA.Utilities.Cryptographics.Validation.package.mo - -IBPSA.Utilities.Cryptographics.Validation.SHA1.mo - -IBPSA.Utilities.Math.Polynomial.mo - -IBPSA.Utilities.Math.package.mo - -IBPSA.Utilities.Math.FallingFactorial.mo - -IBPSA.Utilities.Math.Bicubic.mo - -IBPSA.Utilities.Math.RegNonZeroPower.mo - -IBPSA.Utilities.Math.BesselJ1.mo - -IBPSA.Utilities.Math.Factorial.mo - -IBPSA.Utilities.Math.SmoothExponential.mo - -IBPSA.Utilities.Math.SmoothMax.mo - -IBPSA.Utilities.Math.PowerLinearized.mo - -IBPSA.Utilities.Math.Binomial.mo - -IBPSA.Utilities.Math.QuadraticLinear.mo - -IBPSA.Utilities.Math.BesselY1.mo - -IBPSA.Utilities.Math.Min.mo - -IBPSA.Utilities.Math.Max.mo - -IBPSA.Utilities.Math.Biquadratic.mo - -IBPSA.Utilities.Math.BooleanReplicator.mo - -IBPSA.Utilities.Math.ExponentialIntegralE1.mo - -IBPSA.Utilities.Math.InverseXRegularized.mo - -IBPSA.Utilities.Math.TrapezoidalIntegration.mo - -IBPSA.Utilities.Math.BesselJ0.mo - -IBPSA.Utilities.Math.IntegerReplicator.mo - -IBPSA.Utilities.Math.BesselY0.mo - -IBPSA.Utilities.Math.SmoothHeaviside.mo - -IBPSA.Utilities.Math.SmoothMin.mo - -IBPSA.Utilities.Math.IntegratorWithReset.mo - -IBPSA.Utilities.Math.SmoothLimit.mo - -IBPSA.Utilities.Math.Average.mo - -IBPSA.Utilities.Math.Splice.mo - -IBPSA.Utilities.Math.Examples.Polynomial.mo - -IBPSA.Utilities.Math.Examples.package.mo - -IBPSA.Utilities.Math.Examples.FallingFactorial.mo - -IBPSA.Utilities.Math.Examples.Bicubic.mo - -IBPSA.Utilities.Math.Examples.RegNonZeroPower.mo - -IBPSA.Utilities.Math.Examples.BesselJ1.mo - -IBPSA.Utilities.Math.Examples.Factorial.mo - -IBPSA.Utilities.Math.Examples.SmoothBlocks.mo - -IBPSA.Utilities.Math.Examples.SmoothExponential.mo - -IBPSA.Utilities.Math.Examples.PowerLinearized.mo - -IBPSA.Utilities.Math.Examples.VectorFunctions.mo - -IBPSA.Utilities.Math.Examples.Binomial.mo - -IBPSA.Utilities.Math.Examples.QuadraticLinear.mo - -IBPSA.Utilities.Math.Examples.BesselY1.mo - -IBPSA.Utilities.Math.Examples.Biquadratic.mo - -IBPSA.Utilities.Math.Examples.BooleanReplicator.mo - -IBPSA.Utilities.Math.Examples.ExponentialIntegralE1.mo - -IBPSA.Utilities.Math.Examples.InverseXRegularized.mo - -IBPSA.Utilities.Math.Examples.BesselJ0.mo - -IBPSA.Utilities.Math.Examples.IntegerReplicator.mo - -IBPSA.Utilities.Math.Examples.BesselY0.mo - -IBPSA.Utilities.Math.Examples.SmoothHeaviside.mo - -IBPSA.Utilities.Math.Examples.SmoothMin.mo - -IBPSA.Utilities.Math.Examples.IntegratorWithReset.mo - -IBPSA.Utilities.Math.Examples.SmoothLimit.mo - -IBPSA.Utilities.Math.Examples.Average.mo - -IBPSA.Utilities.Math.Examples.Splice.mo - -IBPSA.Utilities.Math.Functions.spliceFunction.mo - -IBPSA.Utilities.Math.Functions.isMonotonic.mo - -IBPSA.Utilities.Math.Functions.booleanReplicator.mo - -IBPSA.Utilities.Math.Functions.besselY0.mo - -IBPSA.Utilities.Math.Functions.smoothHeaviside.mo - -IBPSA.Utilities.Math.Functions.inverseXRegularized.mo - -IBPSA.Utilities.Math.Functions.package.mo - -IBPSA.Utilities.Math.Functions.average.mo - -IBPSA.Utilities.Math.Functions.regNonZeroPower.mo - -IBPSA.Utilities.Math.Functions.cubicHermiteLinearExtrapolation.mo - -IBPSA.Utilities.Math.Functions.quadraticLinear.mo - -IBPSA.Utilities.Math.Functions.powerLinearized.mo - -IBPSA.Utilities.Math.Functions.biquadratic.mo - -IBPSA.Utilities.Math.Functions.regStep.mo - -IBPSA.Utilities.Math.Functions.besselY1.mo - -IBPSA.Utilities.Math.Functions.factorial.mo - -IBPSA.Utilities.Math.Functions.exponentialIntegralE1.mo - -IBPSA.Utilities.Math.Functions.besselJ1.mo - -IBPSA.Utilities.Math.Functions.besselJ0.mo - -IBPSA.Utilities.Math.Functions.trapezoidalIntegration.mo - -IBPSA.Utilities.Math.Functions.integerReplicator.mo - -IBPSA.Utilities.Math.Functions.binomial.mo - -IBPSA.Utilities.Math.Functions.fallingFactorial.mo - -IBPSA.Utilities.Math.Functions.quinticHermite.mo - -IBPSA.Utilities.Math.Functions.smoothLimit.mo - -IBPSA.Utilities.Math.Functions.splineDerivatives.mo - -IBPSA.Utilities.Math.Functions.smoothExponential.mo - -IBPSA.Utilities.Math.Functions.smoothMax.mo - -IBPSA.Utilities.Math.Functions.smoothMin.mo - -IBPSA.Utilities.Math.Functions.bicubic.mo - -IBPSA.Utilities.Math.Functions.polynomial.mo - -IBPSA.Utilities.Math.Functions.BaseClasses.package.mo - -IBPSA.Utilities.Math.Functions.BaseClasses.smoothTransition.mo - -IBPSA.Utilities.Math.Functions.BaseClasses.der_2_regNonZeroPower.mo - -IBPSA.Utilities.Math.Functions.BaseClasses.der_spliceFunction.mo - -IBPSA.Utilities.Math.Functions.BaseClasses.der_2_smoothTransition.mo - -IBPSA.Utilities.Math.Functions.BaseClasses.der_inverseXRegularized.mo - -IBPSA.Utilities.Math.Functions.BaseClasses.der_regNonZeroPower.mo - -IBPSA.Utilities.Math.Functions.BaseClasses.der_smoothTransition.mo - -IBPSA.Utilities.Math.Functions.Examples.QuinticHermite.mo - -IBPSA.Utilities.Math.Functions.Examples.Polynomial.mo - -IBPSA.Utilities.Math.Functions.Examples.package.mo - -IBPSA.Utilities.Math.Functions.Examples.SmoothExponentialDerivativeCheck.mo - -IBPSA.Utilities.Math.Functions.Examples.FallingFactorial.mo - -IBPSA.Utilities.Math.Functions.Examples.RegNonZeroPower.mo - -IBPSA.Utilities.Math.Functions.Examples.RegNonZeroPowerDerivative_2_Check.mo - -IBPSA.Utilities.Math.Functions.Examples.BesselJ1.mo - -IBPSA.Utilities.Math.Functions.Examples.SpliceFunctionDerivativeCheck.mo - -IBPSA.Utilities.Math.Functions.Examples.Factorial.mo - -IBPSA.Utilities.Math.Functions.Examples.IsMonotonic.mo - -IBPSA.Utilities.Math.Functions.Examples.RegNonZeroPowerDerivativeCheck.mo - -IBPSA.Utilities.Math.Functions.Examples.SmoothHeavisideDerivatives.mo - -IBPSA.Utilities.Math.Functions.Examples.PowerLinearized.mo - -IBPSA.Utilities.Math.Functions.Examples.Binomial.mo - -IBPSA.Utilities.Math.Functions.Examples.BesselY1.mo - -IBPSA.Utilities.Math.Functions.Examples.RegStep.mo - -IBPSA.Utilities.Math.Functions.Examples.ExponentialIntegralE1.mo - -IBPSA.Utilities.Math.Functions.Examples.InverseXRegularized.mo - -IBPSA.Utilities.Math.Functions.Examples.TrapezoidalIntegration.mo - -IBPSA.Utilities.Math.Functions.Examples.CubicHermite.mo - -IBPSA.Utilities.Math.Functions.Examples.BesselJ0.mo - -IBPSA.Utilities.Math.Functions.Examples.BesselY0.mo - -IBPSA.Utilities.Math.Functions.Examples.InverseXDerivativeCheck.mo - -IBPSA.Utilities.Math.Functions.Examples.InverseXDerivative_2_Check.mo - -IBPSA.Utilities.Math.Functions.Examples.SpliceFunction.mo - -IBPSA.Utilities.Psychrometrics.package.mo - -IBPSA.Utilities.Psychrometrics.Density_pTX.mo - -IBPSA.Utilities.Psychrometrics.TDewPoi_pW.mo - -IBPSA.Utilities.Psychrometrics.SaturationPressureLiquid.mo - -IBPSA.Utilities.Psychrometrics.Constants.mo - -IBPSA.Utilities.Psychrometrics.TWetBul_TDryBulXi.mo - -IBPSA.Utilities.Psychrometrics.ToTotalAir.mo - -IBPSA.Utilities.Psychrometrics.pW_TDewPoi.mo - -IBPSA.Utilities.Psychrometrics.X_pTphi.mo - -IBPSA.Utilities.Psychrometrics.X_pW.mo - -IBPSA.Utilities.Psychrometrics.TWetBul_TDryBulPhi.mo - -IBPSA.Utilities.Psychrometrics.SaturationPressure.mo - -IBPSA.Utilities.Psychrometrics.SublimationPressureIce.mo - -IBPSA.Utilities.Psychrometrics.Phi_pTX.mo - -IBPSA.Utilities.Psychrometrics.ToDryAir.mo - -IBPSA.Utilities.Psychrometrics.pW_X.mo - -IBPSA.Utilities.Psychrometrics.BaseClasses.package.mo - -IBPSA.Utilities.Psychrometrics.BaseClasses.HumidityRatioVaporPressure.mo - -IBPSA.Utilities.Psychrometrics.Examples.package.mo - -IBPSA.Utilities.Psychrometrics.Examples.Density_pTX.mo - -IBPSA.Utilities.Psychrometrics.Examples.HumidityRatioPressure.mo - -IBPSA.Utilities.Psychrometrics.Examples.SaturationPressureLiquid.mo - -IBPSA.Utilities.Psychrometrics.Examples.MassFraction_pTphi.mo - -IBPSA.Utilities.Psychrometrics.Examples.TWetBul_TDryBulXi.mo - -IBPSA.Utilities.Psychrometrics.Examples.TotalAirDryAir.mo - -IBPSA.Utilities.Psychrometrics.Examples.DewPointTemperature.mo - -IBPSA.Utilities.Psychrometrics.Examples.TWetBul_TDryBulPhi.mo - -IBPSA.Utilities.Psychrometrics.Examples.SaturationPressure.mo - -IBPSA.Utilities.Psychrometrics.Examples.SublimationPressureIce.mo - -IBPSA.Utilities.Psychrometrics.Examples.Phi_pTX.mo - -IBPSA.Utilities.Psychrometrics.Functions.package.mo - -IBPSA.Utilities.Psychrometrics.Functions.saturationPressureLiquid.mo - -IBPSA.Utilities.Psychrometrics.Functions.phi_pTX.mo - -IBPSA.Utilities.Psychrometrics.Functions.density_pTX.mo - -IBPSA.Utilities.Psychrometrics.Functions.TDewPoi_pW.mo - -IBPSA.Utilities.Psychrometrics.Functions.sublimationPressureIce.mo - -IBPSA.Utilities.Psychrometrics.Functions.saturationPressure.mo - -IBPSA.Utilities.Psychrometrics.Functions.TDewPoi_pW_amb.mo - -IBPSA.Utilities.Psychrometrics.Functions.pW_TDewPoi_amb.mo - -IBPSA.Utilities.Psychrometrics.Functions.pW_TDewPoi.mo - -IBPSA.Utilities.Psychrometrics.Functions.X_pTphi.mo - -IBPSA.Utilities.Psychrometrics.Functions.X_pW.mo - -IBPSA.Utilities.Psychrometrics.Functions.X_pSatpphi.mo - -IBPSA.Utilities.Psychrometrics.Functions.pW_X.mo - -IBPSA.Utilities.Psychrometrics.Functions.BaseClasses.der_pW_X.mo - -IBPSA.Utilities.Psychrometrics.Functions.BaseClasses.package.mo - -IBPSA.Utilities.Psychrometrics.Functions.BaseClasses.der_pW_TDewPoi_amb.mo - -IBPSA.Utilities.Psychrometrics.Functions.BaseClasses.der_TDewPoi_pW_amb.mo - -IBPSA.Utilities.Psychrometrics.Functions.BaseClasses.der_sublimationPressureIce.mo - -IBPSA.Utilities.Psychrometrics.Functions.BaseClasses.der_pW_TDewPoi.mo - -IBPSA.Utilities.Psychrometrics.Functions.BaseClasses.der_saturationPressureLiquid.mo - -IBPSA.Utilities.Psychrometrics.Functions.BaseClasses.Examples.package.mo - -IBPSA.Utilities.Psychrometrics.Functions.BaseClasses.Examples.InverseDewPointTemperatureDerivativeCheck_amb.mo - -IBPSA.Utilities.Psychrometrics.Functions.BaseClasses.Examples.DewPointTemperatureDerivativeCheck.mo - -IBPSA.Utilities.Psychrometrics.Functions.BaseClasses.Examples.SaturationPressureDerivativeCheck.mo - -IBPSA.Utilities.Psychrometrics.Functions.BaseClasses.Examples.WaterVaporPressureDerivativeCheck.mo - -IBPSA.Utilities.Psychrometrics.Functions.BaseClasses.Examples.DewPointTemperatureDerivativeCheck_amb.mo - -IBPSA.Utilities.Psychrometrics.Functions.Examples.package.mo - -IBPSA.Utilities.Psychrometrics.Functions.Examples.phi_pTX.mo - -IBPSA.Utilities.Psychrometrics.Functions.Examples.Density_pTX.mo - -IBPSA.Utilities.Psychrometrics.Functions.Examples.pW_TDewPoi.mo - -IBPSA.Utilities.Psychrometrics.Functions.Examples.SaturationPressure.mo - -IBPSA.Utilities.Psychrometrics.Functions.Examples.pW_TDewPoi_comparison.mo - -IBPSA.Utilities.Psychrometrics.Functions.Examples.X_pSatpphi.mo - -IBPSA.Utilities.Psychrometrics.Functions.Examples.pW_X.mo - -IBPSA.Utilities.Diagnostics.package.mo - -IBPSA.Utilities.Diagnostics.AssertInequality.mo - -IBPSA.Utilities.Diagnostics.AssertEquality.mo - -IBPSA.Utilities.Diagnostics.CheckEquality.mo - -IBPSA.Utilities.Diagnostics.BaseClasses.package.mo - -IBPSA.Utilities.Diagnostics.BaseClasses.PartialInputCheck.mo - -IBPSA.Utilities.Diagnostics.Validation.package.mo - -IBPSA.Utilities.Diagnostics.Validation.CheckEquality.mo - -IBPSA.Utilities.Time.package.mo - -IBPSA.Utilities.Time.ModelTime.mo - -IBPSA.Utilities.Time.CalendarTime.mo - -IBPSA.Utilities.Time.Examples.package.mo - -IBPSA.Utilities.Time.Examples.ModelTime.mo - -IBPSA.Utilities.Time.Examples.CalendarTime.mo - -IBPSA.Utilities.Time.Types.package.mo - -IBPSA.Utilities.Time.Types.ZeroTime.mo - -IBPSA.Utilities.Time.Validation.package.mo - -IBPSA.Utilities.Time.Validation.CalendarTimeMonthsPlus.mo - -IBPSA.Utilities.Time.Validation.CalendarTimeMonths.mo - -IBPSA.Utilities.Time.Validation.CalendarTimeMonthsMinus.mo - -IBPSA.Controls.package.mo - -IBPSA.Controls.Continuous.OffTimer.mo - -IBPSA.Controls.Continuous.NumberOfRequests.mo - -IBPSA.Controls.Continuous.package.mo - -IBPSA.Controls.Continuous.SignalRanker.mo - -IBPSA.Controls.Continuous.LimPID.mo - -IBPSA.Controls.Continuous.Examples.OffTimer.mo - -IBPSA.Controls.Continuous.Examples.NumberOfRequests.mo - -IBPSA.Controls.Continuous.Examples.package.mo - -IBPSA.Controls.Continuous.Examples.SignalRanker.mo - -IBPSA.Controls.Continuous.Examples.LimPID.mo - -IBPSA.Controls.Continuous.Examples.LimPIDWithReset.mo - -IBPSA.Controls.Continuous.Validation.package.mo - -IBPSA.Controls.Continuous.Validation.OffTimerNonZeroStart.mo - -IBPSA.Controls.Continuous.Validation.LimPIDReset.mo - -IBPSA.Controls.SetPoints.package.mo - -IBPSA.Controls.SetPoints.OccupancySchedule.mo - -IBPSA.Controls.SetPoints.SupplyReturnTemperatureReset.mo - -IBPSA.Controls.SetPoints.Table.mo - -IBPSA.Controls.SetPoints.Examples.package.mo - -IBPSA.Controls.SetPoints.Examples.OccupancySchedule.mo - -IBPSA.Controls.SetPoints.Examples.SupplyReturnTemperatureReset.mo - -IBPSA.Controls.SetPoints.Examples.Table.mo - -IBPSA.Controls.SetPoints.Validation.package.mo - -IBPSA.Controls.SetPoints.Validation.OccupancySchedulePositiveStartTime.mo - -IBPSA.Controls.SetPoints.Validation.OccupancyScheduleNegativeStartTime.mo - -IBPSA.Controls.Discrete.package.mo - -IBPSA.Controls.Discrete.BooleanDelay.mo - -IBPSA.Controls.Discrete.Examples.package.mo - -IBPSA.Controls.Discrete.Examples.BooleanDelay.mo - -IBPSA.BoundaryConditions.package.mo - -IBPSA.BoundaryConditions.Types.mo - -IBPSA.BoundaryConditions.UsersGuide.mo - -IBPSA.BoundaryConditions.SolarIrradiation.package.mo - -IBPSA.BoundaryConditions.SolarIrradiation.DiffusePerez.mo - -IBPSA.BoundaryConditions.SolarIrradiation.DiffuseIsotropic.mo - -IBPSA.BoundaryConditions.SolarIrradiation.DirectTiltedSurface.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.package.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.DiffusePerez.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.BrighteningCoefficient.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.SkyClearness.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.SkyBrightness.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.DiffuseIsotropic.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.PartialSolarIrradiation.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.RelativeAirMass.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.DirectTiltedSurface.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.Examples.package.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.Examples.BrighteningCoefficient.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.Examples.SkyClearness.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.Examples.SkyBrightness.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.Examples.DiffuseIsotropic.mo - -IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses.Examples.RelativeAirMass.mo - -IBPSA.BoundaryConditions.SolarIrradiation.Examples.package.mo - -IBPSA.BoundaryConditions.SolarIrradiation.Examples.DiffusePerez.mo - -IBPSA.BoundaryConditions.SolarIrradiation.Examples.DiffuseIsotropic.mo - -IBPSA.BoundaryConditions.SolarIrradiation.Examples.DirectTiltedSurface.mo - -IBPSA.BoundaryConditions.WeatherData.package.mo - -IBPSA.BoundaryConditions.WeatherData.ReaderTMY3.mo - -IBPSA.BoundaryConditions.WeatherData.Bus.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.EquationOfTime.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.getAltitudeLocationTMY3.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.package.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.getLastHeaderElementTMY3.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.SourceSelectorRadiation.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.PartialLimiterMin.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.CheckBlackBodySkyTemperature.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.SolarTime.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.getLatitudeTMY3.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.getAbsolutePath.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.LimiterHorizontalInfraredIrradiation.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.CheckDryBulbTemperature.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.getTimeZoneTMY3.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.LocalCivilTime.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.ConvertTime.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.CheckPressure.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.getTimeSpanTMY3.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.getHeaderElementTMY3.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.LimiterTotalSkyCover.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.LimiterWindSpeed.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.LimiterOpaqueSkyCover.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.getLongitudeTMY3.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.LimiterRelativeHumidity.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.LimiterCeilingHeight.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.CheckDewPointTemperature.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.SourceSelector.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.LimiterWindDirection.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.PartialLimiter.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.GetAbsolutePath.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.EquationOfTime.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.package.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.LimitMin.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertTimePositiveStart.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.GetAltitudeTMY3.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckBlackBodySkyTemperature.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.SolarTime.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.LocalCivilTime.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.GetTimeSpanTMY3.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertTime.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckPressure.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.GetTimeSpanTMY3LongHeader.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertTimeNegativeStart.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.GetHeaderElement.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckTemperature.mo - -IBPSA.BoundaryConditions.WeatherData.BaseClasses.Examples.GetTimeSpanTMY3_NonzeroStart.mo - -IBPSA.BoundaryConditions.WeatherData.Examples.package.mo - -IBPSA.BoundaryConditions.WeatherData.Examples.ReaderTMY3.mo - -IBPSA.BoundaryConditions.WeatherData.Validation.package.mo - -IBPSA.BoundaryConditions.WeatherData.Validation.ReaderTMY3HDirNor.mo - -IBPSA.BoundaryConditions.WeatherData.Validation.DecemberToJanuary.mo - -IBPSA.BoundaryConditions.WeatherData.Validation.OverAYear_usingOneYearData.mo - -IBPSA.BoundaryConditions.WeatherData.Validation.ThreeYears_usingTwoYearDataNegativeStart.mo - -IBPSA.BoundaryConditions.WeatherData.Validation.ThreeYears_usingTwoYearData.mo - -IBPSA.BoundaryConditions.WeatherData.Validation.ThreeYears_usingTwoYearDataPositiveStart.mo - -IBPSA.BoundaryConditions.SkyTemperature.package.mo - -IBPSA.BoundaryConditions.SkyTemperature.BlackBody.mo - -IBPSA.BoundaryConditions.SkyTemperature.Examples.package.mo - -IBPSA.BoundaryConditions.SkyTemperature.Examples.BlackBody.mo - -IBPSA.BoundaryConditions.Validation.IsotropicAndPerezDiffuseRadiation.mo - -IBPSA.BoundaryConditions.Validation.package.mo - -IBPSA.BoundaryConditions.Validation.UsersGuide.mo - -IBPSA.BoundaryConditions.Validation.BESTEST.package.mo - -IBPSA.BoundaryConditions.Validation.BESTEST.WD500.mo - -IBPSA.BoundaryConditions.Validation.BESTEST.WD400.mo - -IBPSA.BoundaryConditions.Validation.BESTEST.WD300.mo - -IBPSA.BoundaryConditions.Validation.BESTEST.WD100.mo - -IBPSA.BoundaryConditions.Validation.BESTEST.WD200.mo - -IBPSA.BoundaryConditions.Validation.BESTEST.WD600.mo - -IBPSA.BoundaryConditions.SolarGeometry.package.mo - -IBPSA.BoundaryConditions.SolarGeometry.IncidenceAngle.mo - -IBPSA.BoundaryConditions.SolarGeometry.ZenithAngle.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.package.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.IncidenceAngle.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.Declination.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.AltitudeAngle.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.solarAzimuthNoEvent.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.solarAzimuthWithEvent.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.WallSolarAzimuth.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.SolarAzimuth.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.ZenithAngle.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.SolarHourAngle.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.Examples.package.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.Examples.IncidenceAngle.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.Examples.Declination.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.Examples.AltitudeAngle.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.Examples.WallSolarAzimuth.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.Examples.SolarAzimuth.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.Examples.ZenithAngle.mo - -IBPSA.BoundaryConditions.SolarGeometry.BaseClasses.Examples.SolarHourAngle.mo - -IBPSA.BoundaryConditions.SolarGeometry.Examples.package.mo - -IBPSA.BoundaryConditions.SolarGeometry.Examples.IncidenceAngle.mo - -IBPSA.BoundaryConditions.SolarGeometry.Examples.ZenithAngle.mo - -IBPSA.Obsolete.package.mo - -IBPSA.Obsolete.BaseClasses.package.mo - -IBPSA.Obsolete.BaseClasses.ObsoleteModel.mo - -IBPSA.Obsolete.Controls.package.mo - -IBPSA.Obsolete.Controls.Continuous.package.mo - -IBPSA.Obsolete.Controls.Continuous.PIDHysteresisTimer.mo - -IBPSA.Obsolete.Controls.Continuous.PIDHysteresis.mo - -IBPSA.Obsolete.Controls.Continuous.Examples.package.mo - -IBPSA.Obsolete.Controls.Continuous.Examples.PIDHysteresisTimer.mo - -IBPSA.Obsolete.Controls.Continuous.Examples.PIDHysteresis.mo - -IBPSA.Obsolete.Fluid.package.mo - -IBPSA.Obsolete.Fluid.Sources.package.mo - -IBPSA.Obsolete.Fluid.Sources.FixedBoundary.mo - -IBPSA.Obsolete.Fluid.FixedResistances.package.mo - -IBPSA.Obsolete.Fluid.FixedResistances.PlugFlowPipe.mo - -IBPSA.Obsolete.Fluid.FixedResistances.BaseClasses.package.mo - -IBPSA.Obsolete.Fluid.FixedResistances.BaseClasses.PlugFlowCore.mo - -IBPSA.Obsolete.Fluid.FixedResistances.BaseClasses.Validation.package.mo - -IBPSA.Obsolete.Fluid.FixedResistances.BaseClasses.Validation.PlugFlowCore.mo - -IBPSA.Media.package.mo - -IBPSA.Media.Water.mo - -IBPSA.Media.Air.mo - -IBPSA.Media.Steam.mo - -IBPSA.Media.Specialized.package.mo - -IBPSA.Media.Specialized.Air.package.mo - -IBPSA.Media.Specialized.Air.PerfectGas.mo - -IBPSA.Media.Specialized.Air.Examples.package.mo - -IBPSA.Media.Specialized.Air.Examples.PerfectGasTemperatureEnthalpyInversion.mo - -IBPSA.Media.Specialized.Air.Examples.PerfectGasDerivativeCheck.mo - -IBPSA.Media.Specialized.Water.package.mo - -IBPSA.Media.Specialized.Water.TemperatureDependentDensity.mo - -IBPSA.Media.Specialized.Water.Examples.package.mo - -IBPSA.Media.Specialized.Water.Examples.TemperatureDependentDensityProperties.mo - -IBPSA.Media.Specialized.Water.Examples.TemperatureDependentDensityDerivativeCheck.mo - -IBPSA.Media.Specialized.Water.Examples.WaterProperties_pT.mo - -IBPSA.Media.Specialized.Water.Examples.TemperatureDependentDensityTemperatureEnthalpyInversion.mo - -IBPSA.Media.Specialized.Water.ConstantProperties_pT.package.mo - -IBPSA.Media.Refrigerants.package.mo - -IBPSA.Media.Refrigerants.Validation.package.mo - -IBPSA.Media.Refrigerants.Validation.R410A_dSpecificVolumeVap_pT.mo - -IBPSA.Media.Refrigerants.R410A.package.mo - -IBPSA.Media.Refrigerants.R410A.enthalpySatVap_T.mo - -IBPSA.Media.Refrigerants.R410A.dPressureVap_dSpecificVolume_Tv.mo - -IBPSA.Media.Refrigerants.R410A.pressureSatVap_T.mo - -IBPSA.Media.Refrigerants.R410A.isentropicExponentVap_Tv.mo - -IBPSA.Media.Refrigerants.R410A.enthalpySatLiq_T.mo - -IBPSA.Media.Refrigerants.R410A.specificIsobaricHeatCapacityVap_Tv.mo - -IBPSA.Media.Refrigerants.R410A.specificVolumeVap_pT.mo - -IBPSA.Media.Refrigerants.R410A.dSpecificVolumeVap_pT.mo - -IBPSA.Media.Refrigerants.R410A.pressureVap_Tv.mo - -IBPSA.Media.Refrigerants.R410A.specificIsochoricHeatCapacityVap_Tv.mo - -IBPSA.Media.Refrigerants.R410A.dPressureVap_dTemperature_Tv.mo - -IBPSA.Media.Examples.SteamDerivativeCheck.mo - -IBPSA.Media.Examples.package.mo - -IBPSA.Media.Examples.SteamSaturationConsistencyCheck.mo - -IBPSA.Media.Examples.WaterTemperatureEnthalpyInversion.mo - -IBPSA.Media.Examples.PropyleneGlycolWaterDerivativeCheck.mo - -IBPSA.Media.Examples.SteamTemperatureEnthalpyInversion.mo - -IBPSA.Media.Examples.WaterProperties.mo - -IBPSA.Media.Examples.WaterDerivativeCheck.mo - -IBPSA.Media.Examples.SteamProperties.mo - -IBPSA.Media.Examples.AirDerivativeCheck.mo - -IBPSA.Media.Examples.PropyleneGlycolWaterTemperatureEnthalpyInversion.mo - -IBPSA.Media.Examples.PropyleneGlycolWaterProperties.mo - -IBPSA.Media.Examples.AirTemperatureEnthalpyInversion.mo - -IBPSA.Media.Examples.AirProperties.mo - -IBPSA.Media.Examples.BaseClasses.package.mo - -IBPSA.Media.Examples.BaseClasses.TestTemperatureEnthalpyInversion.mo - -IBPSA.Media.Examples.BaseClasses.PartialProperties.mo - -IBPSA.Media.Examples.BaseClasses.FluidProperties.mo - -IBPSA.Media.Antifreeze.PropyleneGlycolWater.mo - -IBPSA.Media.Antifreeze.package.mo - -IBPSA.Media.Antifreeze.EthyleneGlycolWater.mo - -IBPSA.Media.Antifreeze.BaseClasses.package.mo - -IBPSA.Media.Antifreeze.BaseClasses.PropertyCoefficients.mo - -IBPSA.Media.Antifreeze.Validation.PropyleneGlycolWater.mo - -IBPSA.Media.Antifreeze.Validation.package.mo - -IBPSA.Media.Antifreeze.Validation.EthyleneGlycolWater.mo - -IBPSA.Media.Antifreeze.Validation.BaseClasses.PropyleneGlycolWater.mo - -IBPSA.Media.Antifreeze.Validation.BaseClasses.package.mo - -IBPSA.Media.Antifreeze.Validation.BaseClasses.FluidProperties.mo - -IBPSA.Media.Antifreeze.Validation.BaseClasses.EthyleneGlycolWater.mo - -IBPSA.Experimental.package.mo - -IBPSA.Experimental.Benchmarks.package.mo - -IBPSA.Experimental.Benchmarks.AirFlow.package.mo - -IBPSA.Experimental.Benchmarks.AirFlow.Examples.package.mo - -IBPSA.Experimental.Benchmarks.AirFlow.Examples.ZoneStepResponse.mo - -IBPSA.Experimental.Benchmarks.AirFlow.Examples.TwoFloors.mo - -IBPSA.Experimental.Benchmarks.AirFlow.Examples.MultipleFloorsVectors.mo - -IBPSA.Experimental.Benchmarks.AirFlow.Components.Staircase.mo - -IBPSA.Experimental.Benchmarks.AirFlow.Components.package.mo - -IBPSA.Experimental.Benchmarks.AirFlow.Components.OutsideEnvironment.mo - -IBPSA.Experimental.Benchmarks.AirFlow.Components.ZoneHallway.mo - -IBPSA.Experimental.Benchmarks.AirFlow.Components.SimpleZone.mo - -IBPSA.Experimental.Benchmarks.AirFlow.Components.Floor.mo - -IBPSA.Airflow.package.mo - -IBPSA.Airflow.Multizone.package.mo - -IBPSA.Airflow.Multizone.DoorOpen.mo - -IBPSA.Airflow.Multizone.DoorDiscretizedOperable.mo - -IBPSA.Airflow.Multizone.Orifice.mo - -IBPSA.Airflow.Multizone.MediumColumn.mo - -IBPSA.Airflow.Multizone.DoorDiscretizedOpen.mo - -IBPSA.Airflow.Multizone.DoorOperable.mo - -IBPSA.Airflow.Multizone.ZonalFlow_ACS.mo - -IBPSA.Airflow.Multizone.EffectiveAirLeakageArea.mo - -IBPSA.Airflow.Multizone.MediumColumnDynamic.mo - -IBPSA.Airflow.Multizone.UsersGuide.mo - -IBPSA.Airflow.Multizone.ZonalFlow_m_flow.mo - -IBPSA.Airflow.Multizone.BaseClasses.package.mo - -IBPSA.Airflow.Multizone.BaseClasses.ZonalFlow.mo - -IBPSA.Airflow.Multizone.BaseClasses.TwoWayFlowElementBuoyancy.mo - -IBPSA.Airflow.Multizone.BaseClasses.ErrorControl.mo - -IBPSA.Airflow.Multizone.BaseClasses.PowerLawResistance.mo - -IBPSA.Airflow.Multizone.BaseClasses.powerLawFixedM.mo - -IBPSA.Airflow.Multizone.BaseClasses.TwoWayFlowElement.mo - -IBPSA.Airflow.Multizone.BaseClasses.Door.mo - -IBPSA.Airflow.Multizone.BaseClasses.DoorDiscretized.mo - -IBPSA.Airflow.Multizone.BaseClasses.windPressureLowRise.mo - -IBPSA.Airflow.Multizone.BaseClasses.powerLaw.mo - -IBPSA.Airflow.Multizone.BaseClasses.Examples.package.mo - -IBPSA.Airflow.Multizone.BaseClasses.Examples.PowerLaw.mo - -IBPSA.Airflow.Multizone.BaseClasses.Examples.WindPressureLowRise.mo - -IBPSA.Airflow.Multizone.BaseClasses.Examples.PowerLawFixedM.mo - -IBPSA.Airflow.Multizone.Examples.ReverseBuoyancy.mo - -IBPSA.Airflow.Multizone.Examples.NaturalVentilation.mo - -IBPSA.Airflow.Multizone.Examples.package.mo - -IBPSA.Airflow.Multizone.Examples.ChimneyShaftWithVolume.mo - -IBPSA.Airflow.Multizone.Examples.ZonalFlow.mo - -IBPSA.Airflow.Multizone.Examples.ChimneyShaftNoVolume.mo - -IBPSA.Airflow.Multizone.Examples.ClosedDoors.mo - -IBPSA.Airflow.Multizone.Examples.Orifice.mo - -IBPSA.Airflow.Multizone.Examples.OneOpenDoor.mo - -IBPSA.Airflow.Multizone.Examples.ReverseBuoyancy3Zones.mo - -IBPSA.Airflow.Multizone.Examples.OneRoom.mo - -IBPSA.Airflow.Multizone.Examples.CO2TransportStep.mo - -IBPSA.Airflow.Multizone.Examples.OneEffectiveAirLeakageArea.mo - -IBPSA.Airflow.Multizone.Types.package.mo - -IBPSA.Airflow.Multizone.Types.densitySelection.mo - -IBPSA.Airflow.Multizone.Validation.DoorOpenClosed.mo - -IBPSA.Airflow.Multizone.Validation.package.mo - -IBPSA.Airflow.Multizone.Validation.ThreeRoomsContam.mo - -IBPSA.Airflow.Multizone.Validation.ThreeRoomsContamDiscretizedDoor.mo - -IBPSA.Airflow.Multizone.Validation.OpenDoorBuoyancyDynamic.mo - -IBPSA.Airflow.Multizone.Validation.OpenDoorTemperature.mo - -IBPSA.Airflow.Multizone.Validation.OpenDoorBuoyancyPressureDynamic.mo - -IBPSA.Airflow.Multizone.Validation.OpenDoorPressure.mo - -IBPSA.Types.package.mo - -IBPSA.Types.Azimuth.package.mo - -IBPSA.Types.Tilt.package.mo - -IBPSA.Fluid.package.mo - -IBPSA.Fluid.Types.mo - -IBPSA.Fluid.BaseClasses.package.mo - -IBPSA.Fluid.BaseClasses.PartialResistance.mo - -IBPSA.Fluid.BaseClasses.MassFlowRateMultiplier.mo - -IBPSA.Fluid.BaseClasses.ActuatorFilter.mo - -IBPSA.Fluid.BaseClasses.PartialThreeWayResistance.mo - -IBPSA.Fluid.BaseClasses.IndexMassFraction.mo - -IBPSA.Fluid.BaseClasses.Validation.package.mo - -IBPSA.Fluid.BaseClasses.Validation.MassFlowRateMultiplier.mo - -IBPSA.Fluid.BaseClasses.Validation.ActuatorFilter.mo - -IBPSA.Fluid.BaseClasses.FlowModels.package.mo - -IBPSA.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp_der2.mo - -IBPSA.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp_der.mo - -IBPSA.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow_der.mo - -IBPSA.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow.mo - -IBPSA.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow_der2.mo - -IBPSA.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp.mo - -IBPSA.Fluid.BaseClasses.FlowModels.Validation.BasicFlowFunction_m_flow_DerivativeCheck.mo - -IBPSA.Fluid.BaseClasses.FlowModels.Validation.BasicFlowFunction_dp_DerivativeCheck2.mo - -IBPSA.Fluid.BaseClasses.FlowModels.Validation.package.mo - -IBPSA.Fluid.BaseClasses.FlowModels.Validation.InverseFlowFunctions.mo - -IBPSA.Fluid.BaseClasses.FlowModels.Validation.InvertingBasicFlowFunction_dp.mo - -IBPSA.Fluid.BaseClasses.FlowModels.Validation.BasicFlowFunction_m_flow_DerivativeCheck2.mo - -IBPSA.Fluid.BaseClasses.FlowModels.Validation.InvertingBasicFlowFunction_m_flow.mo - -IBPSA.Fluid.BaseClasses.FlowModels.Validation.BasicFlowFunction_dp_DerivativeCheck.mo - -IBPSA.Fluid.Geothermal.package.mo - -IBPSA.Fluid.Geothermal.Borefields.package.mo - -IBPSA.Fluid.Geothermal.Borefields.Types.mo - -IBPSA.Fluid.Geothermal.Borefields.TwoUTubes.mo - -IBPSA.Fluid.Geothermal.Borefields.UsersGuide.mo - -IBPSA.Fluid.Geothermal.Borefields.OneUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.PartialBorefield.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.Cylindrical.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.GroundTemperatureResponse.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.LoadAggregation.shiftAggregationCells.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.LoadAggregation.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.LoadAggregation.countAggregationCells.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.LoadAggregation.aggregationWeightingFactors.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.LoadAggregation.temperatureResponseMatrix.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.LoadAggregation.temporalSuperposition.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.LoadAggregation.aggregationCellTimes.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.LoadAggregation.Validation.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.LoadAggregation.Validation.AggregationCellTimes.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.LoadAggregation.Validation.TemporalSuperposition.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.LoadAggregation.Validation.CountAggregationCells.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.LoadAggregation.Validation.ShiftAggregationCells.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.LoadAggregation.Validation.AggregationWeightingFactors.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.LoadAggregation.Validation.TemperatureResponseMatrix.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.cylindricalHeatSource_Integrand.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.finiteLineSource_Integrand.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.infiniteLineSource.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.timeGeometric.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.finiteLineSource_Erfint.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.finiteLineSource.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.gFunction.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.shaGFunction.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.cylindricalHeatSource.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.Validation.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.Validation.CylindricalHeatSource.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.Validation.FiniteLineSource_Integrand_Length.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.Validation.GFunction_100boreholes.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.Validation.TimeGeometric.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.Validation.ShaGFunction.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.Validation.InfiniteLineSource.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.Validation.FiniteLineSource.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.Validation.GFunction_1borehole_5meters.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.Validation.FiniteLineSource_Erfint.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.Validation.FiniteLineSource_Integrand.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.Validation.GFunction_SmallScaleValidation.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.ThermalResponseFactors.Validation.CylindricalHeatSource_Integrand.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.Validation.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.Validation.Analytic_20Years.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.Validation.Cylindrical.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.Validation.FiniteDifference_1Week.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.Validation.Measured_SmallScale.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.Validation.BaseClasses.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.Validation.BaseClasses.SmallScale_Filling.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.Validation.BaseClasses.SmallScale_Configuration.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.Validation.BaseClasses.SmallScale_Borefield.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.HeatTransfer.Validation.BaseClasses.SmallScale_Soil.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.OneUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.TwoUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.PartialInternalResistances.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.PartialBorehole.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.InternalHEXOneUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.InternalResistancesTwoUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.InternalHEXTwoUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.InternalResistancesOneUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.PartialInternalHEX.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalHEXOneUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalResistancesTwoUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalHEXTwoUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Examples.InternalResistancesOneUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.multipoleFluidTemperature.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.multipoleFmk.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.partialInternalResistances.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.internalResistancesOneUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.convectionResistanceCircularPipe.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.multipoleThermalResistances.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.internalResistancesTwoUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.Validation.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.Validation.ConvectionResistanceCircularPipe.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.Validation.MultipoleThermalResistances_OneUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.Validation.MultipoleThermalResistances_TwoUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.Validation.InternalResistancesOneUTubeNegative.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.Validation.InternalResistancesTwoUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.Validation.InternalResistancesTwoUTubeNegative.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.BaseClasses.Functions.Validation.InternalResistancesOneUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.Examples.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.Examples.BoreholeTwoUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.Examples.BoreholeDynamics.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.Examples.BoreholeOneUTube.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.Examples.BaseClasses.package.mo - -IBPSA.Fluid.Geothermal.Borefields.BaseClasses.Boreholes.Examples.BaseClasses.PartialBorehole.mo - -IBPSA.Fluid.Geothermal.Borefields.Examples.package.mo - -IBPSA.Fluid.Geothermal.Borefields.Examples.RectangularBorefield.mo - -IBPSA.Fluid.Geothermal.Borefields.Examples.Borefields.mo - -IBPSA.Fluid.Geothermal.Borefields.Data.package.mo - -IBPSA.Fluid.Geothermal.Borefields.Data.Filling.package.mo - -IBPSA.Fluid.Geothermal.Borefields.Data.Filling.Template.mo - -IBPSA.Fluid.Geothermal.Borefields.Data.Filling.Bentonite.mo - -IBPSA.Fluid.Geothermal.Borefields.Data.Configuration.package.mo - -IBPSA.Fluid.Geothermal.Borefields.Data.Configuration.Template.mo - -IBPSA.Fluid.Geothermal.Borefields.Data.Configuration.Example.mo - -IBPSA.Fluid.Geothermal.Borefields.Data.Borefield.package.mo - -IBPSA.Fluid.Geothermal.Borefields.Data.Borefield.Template.mo - -IBPSA.Fluid.Geothermal.Borefields.Data.Borefield.Example.mo - -IBPSA.Fluid.Geothermal.Borefields.Data.Soil.package.mo - -IBPSA.Fluid.Geothermal.Borefields.Data.Soil.SandStone.mo - -IBPSA.Fluid.Geothermal.Borefields.Data.Soil.Template.mo - -IBPSA.Fluid.Geothermal.Borefields.Validation.package.mo - -IBPSA.Fluid.Geothermal.Borefields.Validation.Sandbox.mo - -IBPSA.Fluid.Geothermal.Borefields.Validation.ConstantHeatInjection_100Boreholes.mo - -IBPSA.Fluid.Geothermal.Borefields.Validation.BaseClasses.package.mo - -IBPSA.Fluid.Geothermal.Borefields.Validation.BaseClasses.SandBox_Soil.mo - -IBPSA.Fluid.Geothermal.Borefields.Validation.BaseClasses.SandBox_Borefield.mo - -IBPSA.Fluid.Geothermal.Borefields.Validation.BaseClasses.SandBox_Filling.mo - -IBPSA.Fluid.Geothermal.Borefields.Validation.BaseClasses.ConstantHeatInjection_100Boreholes_Filling.mo - -IBPSA.Fluid.Geothermal.Borefields.Validation.BaseClasses.ConstantHeatInjection_100Boreholes_Soil.mo - -IBPSA.Fluid.Geothermal.Borefields.Validation.BaseClasses.ConstantHeatInjection_100Boreholes_Configuration.mo - -IBPSA.Fluid.Geothermal.Borefields.Validation.BaseClasses.ConstantHeatInjection_100Boreholes_Borefield.mo - -IBPSA.Fluid.Geothermal.Borefields.Validation.BaseClasses.SandBox_Configuration.mo - -IBPSA.Fluid.Actuators.package.mo - -IBPSA.Fluid.Actuators.BaseClasses.PartialTwoWayValveKv.mo - -IBPSA.Fluid.Actuators.BaseClasses.package.mo - -IBPSA.Fluid.Actuators.BaseClasses.PartialDamperExponential.mo - -IBPSA.Fluid.Actuators.BaseClasses.PartialTwoWayValve.mo - -IBPSA.Fluid.Actuators.BaseClasses.der_equalPercentage.mo - -IBPSA.Fluid.Actuators.BaseClasses.exponentialDamper.mo - -IBPSA.Fluid.Actuators.BaseClasses.PartialThreeWayValve.mo - -IBPSA.Fluid.Actuators.BaseClasses.equalPercentage.mo - -IBPSA.Fluid.Actuators.BaseClasses.ValveParameters.mo - -IBPSA.Fluid.Actuators.BaseClasses.ActuatorSignal.mo - -IBPSA.Fluid.Actuators.BaseClasses.Examples.package.mo - -IBPSA.Fluid.Actuators.BaseClasses.Examples.EqualPercentageDerivativeCheck.mo - -IBPSA.Fluid.Actuators.Valves.TwoWayEqualPercentage.mo - -IBPSA.Fluid.Actuators.Valves.TwoWayTable.mo - -IBPSA.Fluid.Actuators.Valves.package.mo - -IBPSA.Fluid.Actuators.Valves.TwoWayPressureIndependent.mo - -IBPSA.Fluid.Actuators.Valves.TwoWayQuickOpening.mo - -IBPSA.Fluid.Actuators.Valves.ThreeWayTable.mo - -IBPSA.Fluid.Actuators.Valves.TwoWayButterfly.mo - -IBPSA.Fluid.Actuators.Valves.TwoWayPolynomial.mo - -IBPSA.Fluid.Actuators.Valves.TwoWayLinear.mo - -IBPSA.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear.mo - -IBPSA.Fluid.Actuators.Valves.ThreeWayLinear.mo - -IBPSA.Fluid.Actuators.Valves.Examples.TwoWayValvesMotor.mo - -IBPSA.Fluid.Actuators.Valves.Examples.TwoWayValvePressureIndependent.mo - -IBPSA.Fluid.Actuators.Valves.Examples.TwoWayValveTable.mo - -IBPSA.Fluid.Actuators.Valves.Examples.package.mo - -IBPSA.Fluid.Actuators.Valves.Examples.TwoWayValves.mo - -IBPSA.Fluid.Actuators.Valves.Examples.ThreeWayValves.mo - -IBPSA.Fluid.Actuators.Valves.Examples.TwoWayValvesTable.mo - -IBPSA.Fluid.Actuators.Valves.Data.package.mo - -IBPSA.Fluid.Actuators.Valves.Data.Linear.mo - -IBPSA.Fluid.Actuators.Valves.Data.Generic.mo - -IBPSA.Fluid.Actuators.Valves.Validation.package.mo - -IBPSA.Fluid.Actuators.Valves.Validation.TwoWayValveParameterization.mo - -IBPSA.Fluid.Actuators.Valves.Validation.ThreeWayValveParameterization.mo - -IBPSA.Fluid.Actuators.Dampers.Exponential.mo - -IBPSA.Fluid.Actuators.Dampers.package.mo - -IBPSA.Fluid.Actuators.Dampers.MixingBox.mo - -IBPSA.Fluid.Actuators.Dampers.PressureIndependent.mo - -IBPSA.Fluid.Actuators.Dampers.Examples.package.mo - -IBPSA.Fluid.Actuators.Dampers.Examples.Damper.mo - -IBPSA.Fluid.Actuators.Dampers.Examples.MixingBox.mo - -IBPSA.Fluid.Actuators.Dampers.Examples.VAVBoxExponential.mo - -IBPSA.Fluid.Actuators.Dampers.Validation.package.mo - -IBPSA.Fluid.Actuators.Dampers.Validation.PressureIndependent.mo - -IBPSA.Fluid.Actuators.Motors.package.mo - -IBPSA.Fluid.Actuators.Motors.IdealMotor.mo - -IBPSA.Fluid.Actuators.Motors.Examples.package.mo - -IBPSA.Fluid.Actuators.Motors.Examples.IdealMotor.mo - -IBPSA.Fluid.Sensors.SensibleEnthalpyFlowRate.mo - -IBPSA.Fluid.Sensors.RelativeHumidity.mo - -IBPSA.Fluid.Sensors.VolumeFlowRate.mo - -IBPSA.Fluid.Sensors.MassFraction.mo - -IBPSA.Fluid.Sensors.package.mo - -IBPSA.Fluid.Sensors.SpecificEntropyTwoPort.mo - -IBPSA.Fluid.Sensors.DensityTwoPort.mo - -IBPSA.Fluid.Sensors.SpecificEnthalpyTwoPort.mo - -IBPSA.Fluid.Sensors.TemperatureWetBulbTwoPort.mo - -IBPSA.Fluid.Sensors.EnthalpyFlowRate.mo - -IBPSA.Fluid.Sensors.MassFlowRate.mo - -IBPSA.Fluid.Sensors.SpecificEntropy.mo - -IBPSA.Fluid.Sensors.PPM.mo - -IBPSA.Fluid.Sensors.TraceSubstances.mo - -IBPSA.Fluid.Sensors.Density.mo - -IBPSA.Fluid.Sensors.Pressure.mo - -IBPSA.Fluid.Sensors.Temperature.mo - -IBPSA.Fluid.Sensors.Velocity.mo - -IBPSA.Fluid.Sensors.MassFractionTwoPort.mo - -IBPSA.Fluid.Sensors.PPMTwoPort.mo - -IBPSA.Fluid.Sensors.RelativeTemperature.mo - -IBPSA.Fluid.Sensors.UsersGuide.mo - -IBPSA.Fluid.Sensors.TraceSubstancesTwoPort.mo - -IBPSA.Fluid.Sensors.RelativeHumidityTwoPort.mo - -IBPSA.Fluid.Sensors.SpecificEnthalpy.mo - -IBPSA.Fluid.Sensors.EntropyFlowRate.mo - -IBPSA.Fluid.Sensors.RelativePressure.mo - -IBPSA.Fluid.Sensors.TemperatureTwoPort.mo - -IBPSA.Fluid.Sensors.LatentEnthalpyFlowRate.mo - -IBPSA.Fluid.Sensors.BaseClasses.package.mo - -IBPSA.Fluid.Sensors.BaseClasses.PartialDynamicFlowSensor.mo - -IBPSA.Fluid.Sensors.BaseClasses.PartialAbsoluteSensor.mo - -IBPSA.Fluid.Sensors.BaseClasses.PartialFlowSensor.mo - -IBPSA.Fluid.Sensors.Examples.RelativeHumidity.mo - -IBPSA.Fluid.Sensors.Examples.VolumeFlowRate.mo - -IBPSA.Fluid.Sensors.Examples.MassFraction.mo - -IBPSA.Fluid.Sensors.Examples.MoistAirEnthalpyFlowRate.mo - -IBPSA.Fluid.Sensors.Examples.package.mo - -IBPSA.Fluid.Sensors.Examples.EnthalpyFlowRate.mo - -IBPSA.Fluid.Sensors.Examples.SpecificEntropy.mo - -IBPSA.Fluid.Sensors.Examples.PPM.mo - -IBPSA.Fluid.Sensors.Examples.TraceSubstances.mo - -IBPSA.Fluid.Sensors.Examples.Density.mo - -IBPSA.Fluid.Sensors.Examples.TemperatureWetBulb.mo - -IBPSA.Fluid.Sensors.Examples.Pressure.mo - -IBPSA.Fluid.Sensors.Examples.TemperatureDryBulb.mo - -IBPSA.Fluid.Sensors.Examples.Velocity.mo - -IBPSA.Fluid.Sensors.Examples.SpecificEnthalpy.mo - -IBPSA.Fluid.Sensors.Examples.EntropyFlowRate.mo - -IBPSA.Fluid.Sensors.Conversions.package.mo - -IBPSA.Fluid.Sensors.Conversions.To_VolumeFraction.mo - -IBPSA.Fluid.Sensors.Conversions.Examples.package.mo - -IBPSA.Fluid.Sensors.Conversions.Examples.To_VolumeFraction.mo - -IBPSA.Fluid.Chillers.package.mo - -IBPSA.Fluid.Chillers.Carnot_TEva.mo - -IBPSA.Fluid.Chillers.Carnot_y.mo - -IBPSA.Fluid.Chillers.BaseClasses.package.mo - -IBPSA.Fluid.Chillers.BaseClasses.PartialCarnot_y.mo - -IBPSA.Fluid.Chillers.BaseClasses.Carnot.mo - -IBPSA.Fluid.Chillers.BaseClasses.PartialCarnot_T.mo - -IBPSA.Fluid.Chillers.Examples.package.mo - -IBPSA.Fluid.Chillers.Examples.Carnot_TEva.mo - -IBPSA.Fluid.Chillers.Examples.Carnot_y.mo - -IBPSA.Fluid.Chillers.Validation.Carnot_y_etaPL.mo - -IBPSA.Fluid.Chillers.Validation.Carnot_TEva_reverseFlow.mo - -IBPSA.Fluid.Chillers.Validation.package.mo - -IBPSA.Fluid.Chillers.Validation.Carnot_TEva_HighTemperature.mo - -IBPSA.Fluid.Chillers.Validation.Carnot_TEva_etaPL.mo - -IBPSA.Fluid.Chillers.Validation.CarnotVerifyEtaCarnot.mo - -IBPSA.Fluid.Chillers.Validation.Carnot_TEva_LimitedCapacity.mo - -IBPSA.Fluid.Chillers.Validation.Carnot_TEva_2ndLaw.mo - -IBPSA.Fluid.Chillers.Validation.CarnotVerifyCOP.mo - -IBPSA.Fluid.Interfaces.package.mo - -IBPSA.Fluid.Interfaces.PartialTwoPortInterface.mo - -IBPSA.Fluid.Interfaces.StaticFourPortHeatMassExchanger.mo - -IBPSA.Fluid.Interfaces.FourPortFlowResistanceParameters.mo - -IBPSA.Fluid.Interfaces.PartialEightPortInterface.mo - -IBPSA.Fluid.Interfaces.FourPortHeatMassExchanger.mo - -IBPSA.Fluid.Interfaces.EightPortHeatMassExchanger.mo - -IBPSA.Fluid.Interfaces.EightPort.mo - -IBPSA.Fluid.Interfaces.StaticTwoPortConservationEquation.mo - -IBPSA.Fluid.Interfaces.PrescribedOutlet.mo - -IBPSA.Fluid.Interfaces.TwoPortHeatMassExchanger.mo - -IBPSA.Fluid.Interfaces.PartialFourPort.mo - -IBPSA.Fluid.Interfaces.TwoPortFlowResistanceParameters.mo - -IBPSA.Fluid.Interfaces.PartialTwoPortTransport.mo - -IBPSA.Fluid.Interfaces.EightPortFlowResistanceParameters.mo - -IBPSA.Fluid.Interfaces.PartialTwoPortVector.mo - -IBPSA.Fluid.Interfaces.LumpedVolumeDeclarations.mo - -IBPSA.Fluid.Interfaces.PartialFourPortParallel.mo - -IBPSA.Fluid.Interfaces.ConservationEquation.mo - -IBPSA.Fluid.Interfaces.PartialFourPortInterface.mo - -IBPSA.Fluid.Interfaces.PartialTwoPort.mo - -IBPSA.Fluid.Interfaces.StaticTwoPortHeatMassExchanger.mo - -IBPSA.Fluid.Interfaces.Examples.package.mo - -IBPSA.Fluid.Interfaces.Examples.PrescribedOutlet_X_wSetOnly.mo - -IBPSA.Fluid.Interfaces.Examples.FourPortHeatMassExchanger.mo - -IBPSA.Fluid.Interfaces.Examples.EightPortHeatMassExchanger.mo - -IBPSA.Fluid.Interfaces.Examples.StaticTwoPortConservationEquation.mo - -IBPSA.Fluid.Interfaces.Examples.PrescribedOutlet.mo - -IBPSA.Fluid.Interfaces.Examples.PrescribedOutlet_TSetOnly.mo - -IBPSA.Fluid.Interfaces.Examples.HeaterCooler_u.mo - -IBPSA.Fluid.Interfaces.Examples.ReverseFlowHumidifier.mo - -IBPSA.Fluid.Interfaces.Examples.Humidifier_u.mo - -IBPSA.Fluid.Interfaces.Examples.PrescribedOutlet_Water.mo - -IBPSA.Fluid.Interfaces.Examples.ConservationEquation.mo - -IBPSA.Fluid.Interfaces.Examples.ReverseFlowMassExchanger.mo - -IBPSA.Fluid.Interfaces.Examples.BaseClasses.package.mo - -IBPSA.Fluid.Interfaces.Examples.BaseClasses.PrescribedOutletState.mo - -IBPSA.Fluid.Examples.package.mo - -IBPSA.Fluid.Examples.SimpleHouse.mo - -IBPSA.Fluid.Examples.ResistanceVolumeFlowReversal.mo - -IBPSA.Fluid.Examples.Performance.package.mo - -IBPSA.Fluid.Examples.Performance.Example5.mo - -IBPSA.Fluid.Examples.Performance.Example7.mo - -IBPSA.Fluid.Examples.Performance.Example4.mo - -IBPSA.Fluid.Examples.Performance.Example6.mo - -IBPSA.Fluid.Examples.Performance.Example8.mo - -IBPSA.Fluid.Examples.Performance.Example2.mo - -IBPSA.Fluid.Examples.Performance.Example3.mo - -IBPSA.Fluid.Examples.Performance.Example1v2.mo - -IBPSA.Fluid.Examples.Performance.Example1v1.mo - -IBPSA.Fluid.Examples.Performance.BaseClasses.package.mo - -IBPSA.Fluid.Examples.Performance.BaseClasses.Example1.mo - -IBPSA.Fluid.Examples.Performance.PressureDrop.package.mo - -IBPSA.Fluid.Examples.Performance.PressureDrop.SeriesParallelDp.mo - -IBPSA.Fluid.Examples.Performance.PressureDrop.ParallelDp.mo - -IBPSA.Fluid.Examples.Performance.PressureDrop.SeriesDpOptimised.mo - -IBPSA.Fluid.Examples.Performance.PressureDrop.SeriesParallelFlowOptimised.mo - -IBPSA.Fluid.Examples.Performance.PressureDrop.SeriesDp.mo - -IBPSA.Fluid.Examples.Performance.PressureDrop.SeriesParallelDpOptimised.mo - -IBPSA.Fluid.Examples.Performance.PressureDrop.ParallelFlow.mo - -IBPSA.Fluid.Examples.Performance.PressureDrop.ParallelDpOptimised.mo - -IBPSA.Fluid.Examples.Performance.PressureDrop.ParallelFlowOptimised.mo - -IBPSA.Fluid.Examples.Performance.PressureDrop.SeriesFlowOptimised.mo - -IBPSA.Fluid.Examples.Performance.PressureDrop.SeriesParallelFlow.mo - -IBPSA.Fluid.Examples.Performance.PressureDrop.SeriesFlow.mo - -IBPSA.Fluid.Examples.FlowSystem.package.mo - -IBPSA.Fluid.Examples.FlowSystem.Simplified3.mo - -IBPSA.Fluid.Examples.FlowSystem.Simplified6.mo - -IBPSA.Fluid.Examples.FlowSystem.Basic.mo - -IBPSA.Fluid.Examples.FlowSystem.Simplified5.mo - -IBPSA.Fluid.Examples.FlowSystem.Simplified2.mo - -IBPSA.Fluid.Examples.FlowSystem.Simplified1.mo - -IBPSA.Fluid.Examples.FlowSystem.Simplified4.mo - -IBPSA.Fluid.Movers.SpeedControlled_y.mo - -IBPSA.Fluid.Movers.package.mo - -IBPSA.Fluid.Movers.UsersGuide.mo - -IBPSA.Fluid.Movers.FlowControlled_m_flow.mo - -IBPSA.Fluid.Movers.FlowControlled_dp.mo - -IBPSA.Fluid.Movers.SpeedControlled_Nrpm.mo - -IBPSA.Fluid.Movers.BaseClasses.package.mo - -IBPSA.Fluid.Movers.BaseClasses.Types.mo - -IBPSA.Fluid.Movers.BaseClasses.FlowMachineInterface.mo - -IBPSA.Fluid.Movers.BaseClasses.IdealSource.mo - -IBPSA.Fluid.Movers.BaseClasses.PartialFlowMachine.mo - -IBPSA.Fluid.Movers.BaseClasses.PowerInterface.mo - -IBPSA.Fluid.Movers.BaseClasses.Validation.package.mo - -IBPSA.Fluid.Movers.BaseClasses.Validation.FlowMachineInterface.mo - -IBPSA.Fluid.Movers.BaseClasses.Validation.PowerInterface.mo - -IBPSA.Fluid.Movers.BaseClasses.Characteristics.package.mo - -IBPSA.Fluid.Movers.BaseClasses.Characteristics.powerParameters.mo - -IBPSA.Fluid.Movers.BaseClasses.Characteristics.efficiency.mo - -IBPSA.Fluid.Movers.BaseClasses.Characteristics.efficiencyParameters.mo - -IBPSA.Fluid.Movers.BaseClasses.Characteristics.flowParametersInternal.mo - -IBPSA.Fluid.Movers.BaseClasses.Characteristics.pressure.mo - -IBPSA.Fluid.Movers.BaseClasses.Characteristics.power.mo - -IBPSA.Fluid.Movers.BaseClasses.Characteristics.flowParameters.mo - -IBPSA.Fluid.Movers.Examples.SpeedControlled_y_pumpCurves.mo - -IBPSA.Fluid.Movers.Examples.package.mo - -IBPSA.Fluid.Movers.Examples.PumpsParallel.mo - -IBPSA.Fluid.Movers.Examples.MoverStages.mo - -IBPSA.Fluid.Movers.Examples.MoverParameter.mo - -IBPSA.Fluid.Movers.Examples.MoverContinuous.mo - -IBPSA.Fluid.Movers.Examples.ClosedLoop_y.mo - -IBPSA.Fluid.Movers.Examples.PumpsSeries.mo - -IBPSA.Fluid.Movers.Data.package.mo - -IBPSA.Fluid.Movers.Data.Generic.mo - -IBPSA.Fluid.Movers.Data.Pumps.package.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.package.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.Stratos25slash1to8.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.VeroLine80slash115dash2comma2slash2.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.TopS30slash5.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.TopS40slash10.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.CronolineIL80slash220dash4slash4.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.TopS40slash7.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.Stratos32slash1to12.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.VeroLine50slash150dash4slash2.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.Stratos40slash1to8.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.TopS25slash10.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.Stratos80slash1to12.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.Stratos30slash1to8.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.Stratos25slash1to6.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.TopS30slash10.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.Stratos30slash1to4.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.Stratos40slash1to12.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.Stratos50slash1to12.mo - -IBPSA.Fluid.Movers.Data.Pumps.Wilo.Stratos25slash1to4.mo - -IBPSA.Fluid.Movers.Validation.SpeedControlled_y.mo - -IBPSA.Fluid.Movers.Validation.package.mo - -IBPSA.Fluid.Movers.Validation.Pump_Nrpm_stratos.mo - -IBPSA.Fluid.Movers.Validation.PumpCurveConstruction.mo - -IBPSA.Fluid.Movers.Validation.ControlledFlowMachine.mo - -IBPSA.Fluid.Movers.Validation.ControlledFlowMachineDynamic.mo - -IBPSA.Fluid.Movers.Validation.FlowControlled_dpSystem.mo - -IBPSA.Fluid.Movers.Validation.PowerExact.mo - -IBPSA.Fluid.Movers.Validation.Pump_stratos.mo - -IBPSA.Fluid.Movers.Validation.SpeedControlled_y_linear.mo - -IBPSA.Fluid.Movers.Validation.PowerSimplified.mo - -IBPSA.Fluid.Movers.Validation.PumpCurveDerivatives.mo - -IBPSA.Fluid.Movers.Validation.FlowControlled_m_flow.mo - -IBPSA.Fluid.Movers.Validation.FlowControlled_dp.mo - -IBPSA.Fluid.Movers.Validation.SpeedControlled_Nrpm.mo - -IBPSA.Fluid.Movers.Validation.BaseClasses.package.mo - -IBPSA.Fluid.Movers.Validation.BaseClasses.ControlledFlowMachine.mo - -IBPSA.Fluid.Movers.Validation.BaseClasses.FlowMachine_ZeroFlow.mo - -IBPSA.Fluid.Sources.package.mo - -IBPSA.Fluid.Sources.MassFlowSource_h.mo - -IBPSA.Fluid.Sources.Outside.mo - -IBPSA.Fluid.Sources.Boundary_ph.mo - -IBPSA.Fluid.Sources.Boundary_pT.mo - -IBPSA.Fluid.Sources.MassFlowSource_T.mo - -IBPSA.Fluid.Sources.PropertySource_h.mo - -IBPSA.Fluid.Sources.TraceSubstancesFlowSource.mo - -IBPSA.Fluid.Sources.MassFlowSource_WeatherData.mo - -IBPSA.Fluid.Sources.Outside_CpLowRise.mo - -IBPSA.Fluid.Sources.PropertySource_T.mo - -IBPSA.Fluid.Sources.BaseClasses.package.mo - -IBPSA.Fluid.Sources.BaseClasses.Outside.mo - -IBPSA.Fluid.Sources.BaseClasses.PartialPropertySource.mo - -IBPSA.Fluid.Sources.BaseClasses.PartialSource_Xi_C.mo - -IBPSA.Fluid.Sources.BaseClasses.PartialSource.mo - -IBPSA.Fluid.Sources.Examples.package.mo - -IBPSA.Fluid.Sources.Examples.Outside.mo - -IBPSA.Fluid.Sources.Examples.PropertySource_h.mo - -IBPSA.Fluid.Sources.Examples.TraceSubstancesFlowSource.mo - -IBPSA.Fluid.Sources.Examples.MassFlowSource_WeatherData.mo - -IBPSA.Fluid.Sources.Examples.Outside_CpLowRise.mo - -IBPSA.Fluid.Sources.Examples.PropertySource_T.mo - -IBPSA.Fluid.Sources.Validation.package.mo - -IBPSA.Fluid.Sources.Validation.Boundary.mo - -IBPSA.Fluid.Sources.Validation.BoundaryWithXi_in.mo - -IBPSA.Fluid.Sources.Validation.BoundaryWithX_in.mo - -IBPSA.Fluid.Sources.Validation.BaseClasses.package.mo - -IBPSA.Fluid.Sources.Validation.BaseClasses.BoundarySystemWithXi_in.mo - -IBPSA.Fluid.Sources.Validation.BaseClasses.BoundarySystem.mo - -IBPSA.Fluid.Sources.Validation.BaseClasses.BoundarySystemWithX_in.mo - -IBPSA.Fluid.Storage.package.mo - -IBPSA.Fluid.Storage.StratifiedEnhanced.mo - -IBPSA.Fluid.Storage.ExpansionVessel.mo - -IBPSA.Fluid.Storage.Stratified.mo - -IBPSA.Fluid.Storage.StratifiedEnhancedInternalHex.mo - -IBPSA.Fluid.Storage.UsersGuide.mo - -IBPSA.Fluid.Storage.BaseClasses.package.mo - -IBPSA.Fluid.Storage.BaseClasses.PartialStratified.mo - -IBPSA.Fluid.Storage.BaseClasses.ThirdOrderStratifier.mo - -IBPSA.Fluid.Storage.BaseClasses.Buoyancy.mo - -IBPSA.Fluid.Storage.BaseClasses.IndirectTankHeatExchanger.mo - -IBPSA.Fluid.Storage.BaseClasses.Examples.package.mo - -IBPSA.Fluid.Storage.BaseClasses.Examples.IndirectTankHeatExchanger.mo - -IBPSA.Fluid.Storage.Examples.package.mo - -IBPSA.Fluid.Storage.Examples.ExpansionVessel.mo - -IBPSA.Fluid.Storage.Examples.StratifiedUnloadAtMinimumTemperature.mo - -IBPSA.Fluid.Storage.Examples.Stratified.mo - -IBPSA.Fluid.Storage.Examples.StratifiedEnhancedInternalHex.mo - -IBPSA.Fluid.Storage.Validation.StratifiedNonUniformInitial.mo - -IBPSA.Fluid.Storage.Validation.package.mo - -IBPSA.Fluid.Storage.Validation.HeatExchangerDynamics.mo - -IBPSA.Fluid.Storage.Validation.StratifiedLoadingUnloading.mo - -IBPSA.Fluid.Storage.Validation.HeatExchangerLocation.mo - -IBPSA.Fluid.Humidifiers.package.mo - -IBPSA.Fluid.Humidifiers.SteamHumidifier_X.mo - -IBPSA.Fluid.Humidifiers.SprayAirWasher_X.mo - -IBPSA.Fluid.Humidifiers.Humidifier_u.mo - -IBPSA.Fluid.Humidifiers.Examples.package.mo - -IBPSA.Fluid.Humidifiers.Examples.Humidifier_u.mo - -IBPSA.Fluid.Humidifiers.Validation.package.mo - -IBPSA.Fluid.Humidifiers.Validation.SteamHumidifier_X_dynamic.mo - -IBPSA.Fluid.Humidifiers.Validation.SprayAirWasher_X_dynamic.mo - -IBPSA.Fluid.Humidifiers.Validation.SteamHumidifier_X.mo - -IBPSA.Fluid.Humidifiers.Validation.SprayAirWasher_X.mo - -IBPSA.Fluid.HeatPumps.package.mo - -IBPSA.Fluid.HeatPumps.Carnot_TCon.mo - -IBPSA.Fluid.HeatPumps.ReciprocatingWaterToWater.mo - -IBPSA.Fluid.HeatPumps.Carnot_y.mo - -IBPSA.Fluid.HeatPumps.ScrollWaterToWater.mo - -IBPSA.Fluid.HeatPumps.BaseClasses.package.mo - -IBPSA.Fluid.HeatPumps.BaseClasses.PartialWaterToWater.mo - -IBPSA.Fluid.HeatPumps.Calibration.package.mo - -IBPSA.Fluid.HeatPumps.Calibration.ScrollWaterToWater.mo - -IBPSA.Fluid.HeatPumps.Calibration.BaseClasses.package.mo - -IBPSA.Fluid.HeatPumps.Calibration.BaseClasses.PartialWaterToWater.mo - -IBPSA.Fluid.HeatPumps.Examples.package.mo - -IBPSA.Fluid.HeatPumps.Examples.Carnot_TCon.mo - -IBPSA.Fluid.HeatPumps.Examples.ScrollWaterToWater_OneRoomRadiator.mo - -IBPSA.Fluid.HeatPumps.Examples.Carnot_y.mo - -IBPSA.Fluid.HeatPumps.Compressors.package.mo - -IBPSA.Fluid.HeatPumps.Compressors.ReciprocatingCompressor.mo - -IBPSA.Fluid.HeatPumps.Compressors.ScrollCompressor.mo - -IBPSA.Fluid.HeatPumps.Compressors.BaseClasses.package.mo - -IBPSA.Fluid.HeatPumps.Compressors.BaseClasses.PartialCompressor.mo - -IBPSA.Fluid.HeatPumps.Compressors.BaseClasses.TemperatureProtection.mo - -IBPSA.Fluid.HeatPumps.Compressors.BaseClasses.Validation.package.mo - -IBPSA.Fluid.HeatPumps.Compressors.BaseClasses.Validation.TemperatureProtection.mo - -IBPSA.Fluid.HeatPumps.Compressors.Validation.package.mo - -IBPSA.Fluid.HeatPumps.Compressors.Validation.ReciprocatingCompressor_ZeroInput.mo - -IBPSA.Fluid.HeatPumps.Compressors.Validation.ReciprocatingCompressor.mo - -IBPSA.Fluid.HeatPumps.Compressors.Validation.ScrollCompressor.mo - -IBPSA.Fluid.HeatPumps.Compressors.Validation.ScrollCompressor_ZeroInput.mo - -IBPSA.Fluid.HeatPumps.Data.package.mo - -IBPSA.Fluid.HeatPumps.Data.BaseClasses.package.mo - -IBPSA.Fluid.HeatPumps.Data.BaseClasses.HeatPumps.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.package.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Generic.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Viessmann_BW301A45_58kW_5_50COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.package.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Carrier_50PSW122_38kW_4_29COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Carrier_50PSW240_93kW_4_40COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Daikin_WRA150_49kW_4_70COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Carrier_50PSW420_140kW_4_40COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Daikin_WRA072_24kW_4_30COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Trane_EXW240_76kW_4_10COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Carrier_50PSW180_52kW_4_50COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Trane_EXW060_21kW_4_30COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Viessmann_BW301A29_37kW_6_0COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Daikin_WRA036_13kW_4_50COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.ClimateMaster_TMW170_48kW_4_30COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Daikin_WRA180_63kW_4_50COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Trane_EXW120_40kW_3_90COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Carrier_50PSW360_105kW_4_50COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Daikin_WRA240_79kW_4_40COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.ClimateMaster_TMW340_98kW_4_40COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Daikin_WRA120_37kW_4_40COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Daikin_WRA060_19kW_4_50COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Daikin_WRA300_93kW_4_60COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Carrier_50PSW210_70kW_4_40COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.ClimateMaster_TMW060_21kW_4_60COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Daikin_WRA360_116kW_4_60COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.ClimateMaster_TMW036_12kW_4_90COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Daikin_WRA420_137kW_4_50COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Daikin_WRA048_16kW_4_60COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.ClimateMaster_TMW120_42kW_4_50COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ScrollWaterToWater.Heating.Viessmann_BW301A21_28kW_5_94COP_R410A.mo - -IBPSA.Fluid.HeatPumps.Data.ReciprocatingWaterToWater.package.mo - -IBPSA.Fluid.HeatPumps.Data.ReciprocatingWaterToWater.Generic.mo - -IBPSA.Fluid.HeatPumps.Validation.ReciprocatingWaterToWater_ScalingFactor.mo - -IBPSA.Fluid.HeatPumps.Validation.Carnot_y_etaPL.mo - -IBPSA.Fluid.HeatPumps.Validation.Carnot_TCon_reverseFlow.mo - -IBPSA.Fluid.HeatPumps.Validation.package.mo - -IBPSA.Fluid.HeatPumps.Validation.ScrollWaterToWater_VariableSpeed.mo - -IBPSA.Fluid.HeatPumps.Validation.Carnot_TCon_etaPL.mo - -IBPSA.Fluid.HeatPumps.Validation.ReciprocatingWaterToWater_Static.mo - -IBPSA.Fluid.HeatPumps.Validation.ScrollWaterToWater_ScalingFactor.mo - -IBPSA.Fluid.HeatPumps.Validation.Carnot_TCon_LowTemperature.mo - -IBPSA.Fluid.HeatPumps.Validation.Carnot_TCon_LimitedCapacity.mo - -IBPSA.Fluid.HeatPumps.Validation.ScrollWaterToWater_Static.mo - -IBPSA.Fluid.HeatPumps.Validation.ReciprocatingWaterToWater_VariableSpeed.mo - -IBPSA.Fluid.HeatPumps.Validation.ScrollWaterToWater_Dynamic.mo - -IBPSA.Fluid.HeatPumps.Validation.ReciprocatingWaterToWater_Dynamic.mo - -IBPSA.Fluid.HeatPumps.Validation.Carnot_y_etaCar.mo - -IBPSA.Fluid.HeatPumps.Validation.ScrollWaterToWater_TemperatureProtection.mo - -IBPSA.Fluid.Delays.package.mo - -IBPSA.Fluid.Delays.DelayFirstOrder.mo - -IBPSA.Fluid.Delays.Examples.package.mo - -IBPSA.Fluid.Delays.Examples.Delay.mo - -IBPSA.Fluid.HeatExchangers.package.mo - -IBPSA.Fluid.HeatExchangers.ConstantEffectiveness.mo - -IBPSA.Fluid.HeatExchangers.EvaporatorCondenser.mo - -IBPSA.Fluid.HeatExchangers.PrescribedOutlet.mo - -IBPSA.Fluid.HeatExchangers.HeaterCooler_u.mo - -IBPSA.Fluid.HeatExchangers.DryCoilEffectivenessNTU.mo - -IBPSA.Fluid.HeatExchangers.SensibleCooler_T.mo - -IBPSA.Fluid.HeatExchangers.Heater_T.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.package.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.PartialEffectiveness.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.HACoilInside.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.dynamicViscosityWater.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.epsilon_C.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.HANaturalCylinder.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.PartialEffectivenessNTU.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.epsilon_ntuZ.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.isobaricExpansionCoefficientWater.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.ntu_epsilonZ.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.PartialPrescribedOutlet.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.HADryCoil.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.prandtlNumberWater.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.Examples.package.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.Examples.HACoilInside.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.Examples.HANaturalCylinder.mo - -IBPSA.Fluid.HeatExchangers.BaseClasses.Examples.HADryCoil.mo - -IBPSA.Fluid.HeatExchangers.Radiators.package.mo - -IBPSA.Fluid.HeatExchangers.Radiators.RadiatorEN442_2.mo - -IBPSA.Fluid.HeatExchangers.Radiators.Examples.package.mo - -IBPSA.Fluid.HeatExchangers.Radiators.Examples.RadiatorEN442_2.mo - -IBPSA.Fluid.HeatExchangers.Examples.WaterHeater_T.mo - -IBPSA.Fluid.HeatExchangers.Examples.package.mo - -IBPSA.Fluid.HeatExchangers.Examples.WaterHeater_u.mo - -IBPSA.Fluid.HeatExchangers.Examples.DryCoilEffectivenessNTUPControl.mo - -IBPSA.Fluid.HeatExchangers.Examples.AirHeater_T.mo - -IBPSA.Fluid.HeatExchangers.Examples.DryCoilEffectivenessNTUMassFlow.mo - -IBPSA.Fluid.HeatExchangers.Examples.AirHeater_u.mo - -IBPSA.Fluid.HeatExchangers.Examples.WaterCooler_T.mo - -IBPSA.Fluid.HeatExchangers.Examples.BaseClasses.package.mo - -IBPSA.Fluid.HeatExchangers.Examples.BaseClasses.Heater.mo - -IBPSA.Fluid.HeatExchangers.Examples.BaseClasses.EffectivenessNTUMassFlow.mo - -IBPSA.Fluid.HeatExchangers.Validation.package.mo - -IBPSA.Fluid.HeatExchangers.Validation.ConstantEffectiveness.mo - -IBPSA.Fluid.HeatExchangers.Validation.EvaporatorCondenser.mo - -IBPSA.Fluid.HeatExchangers.Validation.PrescribedOutlet.mo - -IBPSA.Fluid.HeatExchangers.Validation.HeaterCooler_u.mo - -IBPSA.Fluid.HeatExchangers.Validation.DryCoilEffectivenessNTU.mo - -IBPSA.Fluid.HeatExchangers.Validation.PrescribedOutlet_dynamic.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.package.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.CoolingAndHeating.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Cooling.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.UsersGuide.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.BaseClasses.package.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.BaseClasses.DerivativesCubicSpline.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.BaseClasses.ModificationFactor.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.BaseClasses.Convector.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.BaseClasses.Examples.package.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.BaseClasses.Examples.DerivateCubicSpline.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.BaseClasses.Examples.ModificationFactor.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.BaseClasses.Examples.Convector.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Examples.package.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Examples.CoolingAndHeating.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Examples.CoolingOnly.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Examples.HeatingOnly.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Data.package.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Data.Trox.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Data.Generic.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Data.BaseClasses.package.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Data.BaseClasses.WaterFlow.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Data.BaseClasses.TemperatureDifference.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Data.BaseClasses.AirFlow.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Validation.package.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Validation.NumberOfBeamsDynamics.mo - -IBPSA.Fluid.HeatExchangers.ActiveBeams.Validation.NumberOfBeams.mo - -IBPSA.Fluid.MixingVolumes.package.mo - -IBPSA.Fluid.MixingVolumes.MixingVolume.mo - -IBPSA.Fluid.MixingVolumes.MixingVolumeMoistAir.mo - -IBPSA.Fluid.MixingVolumes.BaseClasses.package.mo - -IBPSA.Fluid.MixingVolumes.BaseClasses.PartialMixingVolume.mo - -IBPSA.Fluid.MixingVolumes.BaseClasses.MixingVolumeHeatPort.mo - -IBPSA.Fluid.MixingVolumes.BaseClasses.MixingVolumeHeatMoisturePort.mo - -IBPSA.Fluid.MixingVolumes.BaseClasses.Validation.package.mo - -IBPSA.Fluid.MixingVolumes.BaseClasses.Validation.MixingVolumeHeatMoisturePort.mo - -IBPSA.Fluid.MixingVolumes.BaseClasses.Validation.MixingVolumeHeatPortAir.mo - -IBPSA.Fluid.MixingVolumes.BaseClasses.Validation.MixingVolumeHeatPortWater.mo - -IBPSA.Fluid.MixingVolumes.Examples.package.mo - -IBPSA.Fluid.MixingVolumes.Examples.MixingVolumeHeatConduction.mo - -IBPSA.Fluid.MixingVolumes.Examples.MixingVolumeMoistAir.mo - -IBPSA.Fluid.MixingVolumes.Examples.MixingVolumePrescribedHeatFlowRate.mo - -IBPSA.Fluid.MixingVolumes.Validation.MixingVolumeAdiabaticCooling.mo - -IBPSA.Fluid.MixingVolumes.Validation.CoupledVolumesGlycol47.mo - -IBPSA.Fluid.MixingVolumes.Validation.package.mo - -IBPSA.Fluid.MixingVolumes.Validation.CoupledVolumesWater.mo - -IBPSA.Fluid.MixingVolumes.Validation.MixingVolumeHeatReverseFlowPrescribedHeatFlowRate.mo - -IBPSA.Fluid.MixingVolumes.Validation.MoistureMixingConservationDynamicBalance.mo - -IBPSA.Fluid.MixingVolumes.Validation.CoupledVolumesSpecializedWaterTemperatureDependentDensity.mo - -IBPSA.Fluid.MixingVolumes.Validation.MixingVolumeSteadyStateMass.mo - -IBPSA.Fluid.MixingVolumes.Validation.MixingVolumeHeatReverseFlow.mo - -IBPSA.Fluid.MixingVolumes.Validation.MixingVolumeTraceSubstanceReverseFlowPrescribedHeatFlowRate.mo - -IBPSA.Fluid.MixingVolumes.Validation.MixingVolumeMoistureReverseFlow.mo - -IBPSA.Fluid.MixingVolumes.Validation.CoupledVolumesSpecializedAirPerfectGas.mo - -IBPSA.Fluid.MixingVolumes.Validation.MixingVolume.mo - -IBPSA.Fluid.MixingVolumes.Validation.MixingVolumeMassFlow.mo - -IBPSA.Fluid.MixingVolumes.Validation.MixingVolumeTraceSubstanceReverseFlow.mo - -IBPSA.Fluid.MixingVolumes.Validation.CoupledVolumesAir.mo - -IBPSA.Fluid.MixingVolumes.Validation.CoupledVolumesSpecializedWaterConstantProperties_pT.mo - -IBPSA.Fluid.MixingVolumes.Validation.MixingVolumeMoistureReverseFlowPrescribedHeatFlowRate.mo - -IBPSA.Fluid.MixingVolumes.Validation.MixingVolumeInitialization.mo - -IBPSA.Fluid.MixingVolumes.Validation.TraceSubstanceConservationDynamicBalance.mo - -IBPSA.Fluid.MixingVolumes.Validation.TraceSubstanceConservationSteadyState.mo - -IBPSA.Fluid.MixingVolumes.Validation.MixingVolumeTraceSubstance.mo - -IBPSA.Fluid.MixingVolumes.Validation.MixingVolumeMFactor.mo - -IBPSA.Fluid.MixingVolumes.Validation.MoistureMixingConservationSteadyState.mo - -IBPSA.Fluid.MixingVolumes.Validation.MixingVolumeZeroFlow.mo - -IBPSA.Fluid.MixingVolumes.Validation.BaseClasses.MixingVolumeReverseFlow.mo - -IBPSA.Fluid.MixingVolumes.Validation.BaseClasses.package.mo - -IBPSA.Fluid.MixingVolumes.Validation.BaseClasses.MoistureMixingConservation.mo - -IBPSA.Fluid.MixingVolumes.Validation.BaseClasses.TraceSubstanceConservation.mo - -IBPSA.Fluid.MassExchangers.package.mo - -IBPSA.Fluid.MassExchangers.ConstantEffectiveness.mo - -IBPSA.Fluid.MassExchangers.Examples.package.mo - -IBPSA.Fluid.MassExchangers.Examples.ConstantEffectiveness.mo - -IBPSA.Fluid.MassExchangers.Validation.package.mo - -IBPSA.Fluid.MassExchangers.Validation.ConstantEffectivenessZeroFlowBothStreams.mo - -IBPSA.Fluid.MassExchangers.Validation.ConstantEffectivenessZeroFlow.mo - -IBPSA.Fluid.FMI.package.mo - -IBPSA.Fluid.FMI.FlowSplitter_u.mo - -IBPSA.Fluid.FMI.Source_T.mo - -IBPSA.Fluid.FMI.UsersGuide.mo - -IBPSA.Fluid.FMI.Sink_T.mo - -IBPSA.Fluid.FMI.BaseClasses.package.mo - -IBPSA.Fluid.FMI.BaseClasses.X_w_toX.mo - -IBPSA.Fluid.FMI.BaseClasses.hOut_toT.mo - -IBPSA.Fluid.FMI.Interfaces.package.mo - -IBPSA.Fluid.FMI.Interfaces.Inlet.mo - -IBPSA.Fluid.FMI.Interfaces.PressureOutput.mo - -IBPSA.Fluid.FMI.Interfaces.FluidProperties.mo - -IBPSA.Fluid.FMI.Interfaces.MassFractionConnector.mo - -IBPSA.Fluid.FMI.Interfaces.Outlet.mo - -IBPSA.Fluid.FMI.Interfaces.PressureInput.mo - -IBPSA.Fluid.FMI.Adaptors.package.mo - -IBPSA.Fluid.FMI.Adaptors.Inlet.mo - -IBPSA.Fluid.FMI.Adaptors.ThermalZone.mo - -IBPSA.Fluid.FMI.Adaptors.HVAC.mo - -IBPSA.Fluid.FMI.Adaptors.Outlet.mo - -IBPSA.Fluid.FMI.Adaptors.Examples.package.mo - -IBPSA.Fluid.FMI.Adaptors.Examples.ThermalZoneHVACWithExhaust.mo - -IBPSA.Fluid.FMI.Adaptors.Examples.ThermalZoneHVACNoExhaust.mo - -IBPSA.Fluid.FMI.Conversion.AirToOutlet.mo - -IBPSA.Fluid.FMI.Conversion.package.mo - -IBPSA.Fluid.FMI.Conversion.InletToAir.mo - -IBPSA.Fluid.FMI.Conversion.Validation.AirToOutlet.mo - -IBPSA.Fluid.FMI.Conversion.Validation.package.mo - -IBPSA.Fluid.FMI.Conversion.Validation.AirToOutletFlowReversal.mo - -IBPSA.Fluid.FMI.Conversion.Validation.InletToAirMoistAirCO2.mo - -IBPSA.Fluid.FMI.Conversion.Validation.InletToAirDryAirCO2.mo - -IBPSA.Fluid.FMI.Conversion.Validation.InletToAirDryAir.mo - -IBPSA.Fluid.FMI.Conversion.Validation.InletToAirMoistAir.mo - -IBPSA.Fluid.FMI.Validation.HeaterFan_noReverseFlow.mo - -IBPSA.Fluid.FMI.Validation.package.mo - -IBPSA.Fluid.FMI.Validation.HeaterFan.mo - -IBPSA.Fluid.FMI.Validation.HeaterFanPressureDriven.mo - -IBPSA.Fluid.FMI.Validation.FlowSplitter_u.mo - -IBPSA.Fluid.FMI.ExportContainers.package.mo - -IBPSA.Fluid.FMI.ExportContainers.HVACZone.mo - -IBPSA.Fluid.FMI.ExportContainers.ReplaceableTwoPort.mo - -IBPSA.Fluid.FMI.ExportContainers.ThermalZone.mo - -IBPSA.Fluid.FMI.ExportContainers.ThermalZones.mo - -IBPSA.Fluid.FMI.ExportContainers.HVACZones.mo - -IBPSA.Fluid.FMI.ExportContainers.PartialTwoPort.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.package.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.package.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.HVACZone.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.TwoPortPassThrough.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.MixingVolume.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.HeaterCooler_u.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.ThermalZone.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.Fan.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.ResistanceVolume.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.ThermalZones.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.FlowSplitter_u.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.Humidifier_u.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.PressureDrop.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.HVACZones.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.Heater_T.mo - -IBPSA.Fluid.FMI.ExportContainers.Examples.FMUs.IdealSource_m_flow.mo - -IBPSA.Fluid.FMI.ExportContainers.Validation.package.mo - -IBPSA.Fluid.FMI.ExportContainers.Validation.FMUs.HVACThermalZoneAir3.mo - -IBPSA.Fluid.FMI.ExportContainers.Validation.FMUs.package.mo - -IBPSA.Fluid.FMI.ExportContainers.Validation.FMUs.HVACThermalZoneSimpleAir3.mo - -IBPSA.Fluid.FMI.ExportContainers.Validation.FMUs.ThermalZoneSimpleAir1.mo - -IBPSA.Fluid.FMI.ExportContainers.Validation.FMUs.ThermalZoneSimpleAir3.mo - -IBPSA.Fluid.FMI.ExportContainers.Validation.FMUs.HVACThermalZoneAir2.mo - -IBPSA.Fluid.FMI.ExportContainers.Validation.FMUs.HVACThermalZoneSimpleAir2.mo - -IBPSA.Fluid.FMI.ExportContainers.Validation.FMUs.HVACThermalZoneAir1.mo - -IBPSA.Fluid.FMI.ExportContainers.Validation.FMUs.ThermalZoneSimpleAir2.mo - -IBPSA.Fluid.FMI.ExportContainers.Validation.FMUs.ThermalZoneAir2.mo - -IBPSA.Fluid.FMI.ExportContainers.Validation.FMUs.ThermalZoneAir1.mo - -IBPSA.Fluid.FMI.ExportContainers.Validation.FMUs.HVACThermalZoneSimpleAir1.mo - -IBPSA.Fluid.FMI.ExportContainers.Validation.FMUs.ThermalZoneAir3.mo - -IBPSA.Fluid.FixedResistances.package.mo - -IBPSA.Fluid.FixedResistances.LosslessPipe.mo - -IBPSA.Fluid.FixedResistances.PlugFlowPipeDiscretized.mo - -IBPSA.Fluid.FixedResistances.Junction.mo - -IBPSA.Fluid.FixedResistances.PlugFlowPipe.mo - -IBPSA.Fluid.FixedResistances.CheckValve.mo - -IBPSA.Fluid.FixedResistances.HydraulicDiameter.mo - -IBPSA.Fluid.FixedResistances.PressureDrop.mo - -IBPSA.Fluid.FixedResistances.BaseClasses.package.mo - -IBPSA.Fluid.FixedResistances.BaseClasses.PlugFlowHeatLoss.mo - -IBPSA.Fluid.FixedResistances.BaseClasses.PlugFlowPipe.mo - -IBPSA.Fluid.FixedResistances.BaseClasses.PlugFlow.mo - -IBPSA.Fluid.FixedResistances.BaseClasses.PlugFlowTransportDelay.mo - -IBPSA.Fluid.FixedResistances.Examples.package.mo - -IBPSA.Fluid.FixedResistances.Examples.PlugFlowPipeDiscretized.mo - -IBPSA.Fluid.FixedResistances.Examples.PlugFlowPipe.mo - -IBPSA.Fluid.FixedResistances.Examples.CheckValve.mo - -IBPSA.Fluid.FixedResistances.Examples.FlowJunction.mo - -IBPSA.Fluid.FixedResistances.Examples.HydraulicDiameter.mo - -IBPSA.Fluid.FixedResistances.Examples.PressureDrop.mo - -IBPSA.Fluid.FixedResistances.Validation.package.mo - -IBPSA.Fluid.FixedResistances.Validation.LosslessPipe.mo - -IBPSA.Fluid.FixedResistances.Validation.PressureDropsSeries.mo - -IBPSA.Fluid.FixedResistances.Validation.PressureDropsParallel.mo - -IBPSA.Fluid.FixedResistances.Validation.PressureDropsExplicit.mo - -IBPSA.Fluid.FixedResistances.Validation.FlowJunctionSteadyState.mo - -IBPSA.Fluid.FixedResistances.Validation.FlowJunctionSteadyStateNoPressureDrop.mo - -IBPSA.Fluid.FixedResistances.Validation.PressureDropsExplicitLinearized.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.TransportWaterAir.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.package.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.PlugFlowAIT.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.MSLAIT2Nodes.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.FlowReversal.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.PlugFlowULg.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.MSLAIT.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.Data.package.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.Data.PipeDataULg151202.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.Data.TestData.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.Data.PipeDataAIT151218.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.Data.PipeDataULg151204_1.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.Data.PipeDataULg160118_1.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.Data.PipeDataULg160104_2.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.Data.PipeDataULg151204_4.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.Data.PipeDataULg151204_2.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.Data.PipeDataULg150801.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.Data.BaseClasses.package.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.Data.BaseClasses.PipeDataBaseDefinition.mo - -IBPSA.Fluid.FixedResistances.Validation.PlugFlowPipes.Data.BaseClasses.PipeDataULg.mo +BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib From 3e8497598922b67beb311cc756c9137145f0beb1 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 24 Aug 2022 17:50:06 +0200 Subject: [PATCH 031/131] use filterwhitelist --- .../PartialDistributionTwoStorageParallelDetailed.mo | 8 -------- .../02_UnitTests/check_model.gitlab-ci.yml | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo index acd37e47..369b0970 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo @@ -62,14 +62,6 @@ partial model PartialDistributionTwoStorageParallelDetailed annotation ( choicesAllMatching=true, Placement(transformation(extent={{18,26},{32,40}}))); - /* - ( - final V=VDHWDay, - final Q_flow_nominal=QDHW_flow_nominal, - final VPerQ_flow=0, - T_m=TDHW_nominal) - */ - replaceable parameter RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition dhwParameters constrainedby diff --git a/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml b/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml index eb4e5a9c..c3967e84 100644 --- a/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml +++ b/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml @@ -1 +1 @@ -stages: - check - create_whitelist .check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cat dependencies.json - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: - external_pull_requests retry: max: 2 when: runner_system_failure except: variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ Check_BESMod_Examples: variables: lib_package: Examples extends: .check_model_job Check_BESMod_Utilities: variables: lib_package: Utilities extends: .check_model_job Check_BESMod_Systems: variables: lib_package: Systems extends: .check_model_job Check_BESMod_Tutorial: variables: lib_package: Tutorial extends: .check_model_job Check_BESMod_Components: variables: lib_package: Components extends: .check_model_job .check_changed_models_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - git diff --raw --diff-filter=AMT HEAD^1 > bin/Configfiles/ci_changed_model_list.txt - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 -CM artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day except: refs: - external_pull_requests variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ retry: max: 2 when: runner_system_failure Check_BESMod_Examples_changed_models: variables: lib_package: Examples only: changes: - BESMod/Examples/**/* extends: .check_changed_models_job Check_BESMod_Utilities_changed_models: variables: lib_package: Utilities only: changes: - BESMod/Utilities/**/* extends: .check_changed_models_job Check_BESMod_Tutorial_changed_models: variables: lib_package: Tutorial only: changes: - BESMod/Tutorial/**/* extends: .check_changed_models_job Check_BESMod_Systems_changed_models: variables: lib_package: Systems only: changes: - BESMod/Systems/**/* extends: .check_changed_models_job Check_BESMod_Components_changed_models: variables: lib_package: Components only: changes: - BESMod/Components/**/* extends: .check_changed_models_job .CI_check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_check/ except: refs: - external_pull_requests retry: max: 2 when: runner_system_failure CI_Check_BESMod_Examples: variables: lib_package: Examples extends: .CI_check_model_job CI_Check_BESMod_Utilities: variables: lib_package: Utilities extends: .CI_check_model_job CI_Check_BESMod_Tutorial: variables: lib_package: Tutorial extends: .CI_check_model_job CI_Check_BESMod_Systems: variables: lib_package: Systems extends: .CI_check_model_job CI_Check_BESMod_Components: variables: lib_package: Components extends: .CI_check_model_job whitelist_job: stage: create_whitelist before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - eval $(ssh-agent -s) - mkdir -p ~/.ssh - ssh-keyscan github.com >> ~/.ssh/known_hosts - ssh-agent -a /tmp/ssh_agent.sock > /dev/null - echo "${GITHUB_PRIVATE_KEY}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - git config --global user.name "${GITLAB_USER_NAME}" - git config --global user.email "${GITLAB_USER_EMAIL}" script: - mkdir whitelist && cd whitelist - git clone --single-branch --branch $CI_COMMIT_REF_NAME git@github.com:${Github_Repository}.git - cd ${CI_PROJECT_NAME} - echo "FAIL" > bin/Configfiles/exit.sh - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py -DS 2022 --repo-dir BESMod --library BESMod --wh-library BESMod --whitelist after_script: - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cd whitelist && cd ${CI_PROJECT_NAME} - if cat bin/Configfiles/exit.sh | grep "FAIL"; then message="Automatic push of CI - Update model_whitelist. Please pull the new files before push again. [skip ci]" ; git add bin/ci_whitelist/model_whitelist.txt ; git commit -m "$message" ; git push git@github.com:${Github_Repository}.git ; GREEN='\033[0;32m' ; NC='\033[0m' ; echo -e "$GREEN New html whitelist files were pushed to this branch.$NC" ; exit 0; else echo 'successful' > bin/Configfiles/exit.sh ; echo -e "$GREEN Whitelist is already up to date. Please delete the version number in file bin/ci_whitelist/model_whitelist.txt, if you want to recreate the whitelist.$NC" ; exit 0 ; fi artifacts: paths: - whitelist/${CI_PROJECT_NAME}/bin/ci_whitelist/model_whitelist.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ except: refs: - external_pull_requests \ No newline at end of file +stages: - check - create_whitelist .check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cat dependencies.json - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: - external_pull_requests retry: max: 2 when: runner_system_failure except: variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ Check_BESMod_Examples: variables: lib_package: Examples extends: .check_model_job Check_BESMod_Utilities: variables: lib_package: Utilities extends: .check_model_job Check_BESMod_Systems: variables: lib_package: Systems extends: .check_model_job Check_BESMod_Tutorial: variables: lib_package: Tutorial extends: .check_model_job Check_BESMod_Components: variables: lib_package: Components extends: .check_model_job .check_changed_models_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - git diff --raw --diff-filter=AMT HEAD^1 > bin/Configfiles/ci_changed_model_list.txt - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 -CM artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day except: refs: - external_pull_requests variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ retry: max: 2 when: runner_system_failure Check_BESMod_Examples_changed_models: variables: lib_package: Examples only: changes: - BESMod/Examples/**/* extends: .check_changed_models_job Check_BESMod_Utilities_changed_models: variables: lib_package: Utilities only: changes: - BESMod/Utilities/**/* extends: .check_changed_models_job Check_BESMod_Tutorial_changed_models: variables: lib_package: Tutorial only: changes: - BESMod/Tutorial/**/* extends: .check_changed_models_job Check_BESMod_Systems_changed_models: variables: lib_package: Systems only: changes: - BESMod/Systems/**/* extends: .check_changed_models_job Check_BESMod_Components_changed_models: variables: lib_package: Components only: changes: - BESMod/Components/**/* extends: .check_changed_models_job .CI_check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 --filterwhitelist artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_check/ except: refs: - external_pull_requests retry: max: 2 when: runner_system_failure CI_Check_BESMod_Examples: variables: lib_package: Examples extends: .CI_check_model_job CI_Check_BESMod_Utilities: variables: lib_package: Utilities extends: .CI_check_model_job CI_Check_BESMod_Tutorial: variables: lib_package: Tutorial extends: .CI_check_model_job CI_Check_BESMod_Systems: variables: lib_package: Systems extends: .CI_check_model_job CI_Check_BESMod_Components: variables: lib_package: Components extends: .CI_check_model_job whitelist_job: stage: create_whitelist before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - eval $(ssh-agent -s) - mkdir -p ~/.ssh - ssh-keyscan github.com >> ~/.ssh/known_hosts - ssh-agent -a /tmp/ssh_agent.sock > /dev/null - echo "${GITHUB_PRIVATE_KEY}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - git config --global user.name "${GITLAB_USER_NAME}" - git config --global user.email "${GITLAB_USER_EMAIL}" script: - mkdir whitelist && cd whitelist - git clone --single-branch --branch $CI_COMMIT_REF_NAME git@github.com:${Github_Repository}.git - cd ${CI_PROJECT_NAME} - echo "FAIL" > bin/Configfiles/exit.sh - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py -DS 2022 --repo-dir BESMod --library BESMod --wh-library BESMod --whitelist after_script: - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cd whitelist && cd ${CI_PROJECT_NAME} - if cat bin/Configfiles/exit.sh | grep "FAIL"; then message="Automatic push of CI - Update model_whitelist. Please pull the new files before push again. [skip ci]" ; git add bin/ci_whitelist/model_whitelist.txt ; git commit -m "$message" ; git push git@github.com:${Github_Repository}.git ; GREEN='\033[0;32m' ; NC='\033[0m' ; echo -e "$GREEN New html whitelist files were pushed to this branch.$NC" ; exit 0; else echo 'successful' > bin/Configfiles/exit.sh ; echo -e "$GREEN Whitelist is already up to date. Please delete the version number in file bin/ci_whitelist/model_whitelist.txt, if you want to recreate the whitelist.$NC" ; exit 0 ; fi artifacts: paths: - whitelist/${CI_PROJECT_NAME}/bin/ci_whitelist/model_whitelist.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ except: refs: - external_pull_requests \ No newline at end of file From c282dc9dcc67b284cd2f7648cc00dcba8640a2ad Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 24 Aug 2022 19:01:53 +0200 Subject: [PATCH 032/131] Manual removal --- bin/CITests/02_UnitTests/CheckPackages/validatetest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py index a96db3d0..395ae18a 100644 --- a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py +++ b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py @@ -443,6 +443,11 @@ def check_model_workflow(): model_list = CheckModelTest._filter_wh_models(models, wh_list) else: # Check all models in package model_list = CheckModelTest._get_model() + with open("bin/ci_whitelist/html_whitelist.txt", "r") as file: + whitelists = file.readlines() + for white_model in whitelists: + if white_model in model_list: + model_list.remove(white_model) if len(model_list) == 0: print(f'No models in package {args.single_package}') exit(1) From d0aa2253e1cef743d8a402c5739ba18c8480b80c Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 24 Aug 2022 19:04:34 +0200 Subject: [PATCH 033/131] Fix medium to avoid error --- .../Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo index 1dc32013..5b6734db 100644 --- a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo +++ b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo @@ -1,7 +1,9 @@ within BESMod.Systems.Hydraulical.Generation; model SolarThermalBivHPBuiLib "Solar thermal assistet monoenergetic heat pump with heating rod" - extends HeatPumpAndHeatingRod(dTTra_nominal={if TDem_nominal[1] > 273.15 + 55 + extends HeatPumpAndHeatingRod( + redeclare package Medium = IBPSA.Media.Water, + dTTra_nominal={if TDem_nominal[1] > 273.15 + 55 then 10 elseif TDem_nominal[1] > 44.9 then 8 else 5,solarThermalParas.dTMax}, final nParallelDem=2, final dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal, dpST_nominal}); From 79439de8de46bdab3753e9f2d65af15785eb6f42 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sat, 27 Aug 2022 15:03:47 +0200 Subject: [PATCH 034/131] debug --- bin/CITests/02_UnitTests/CheckPackages/validatetest.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py index 395ae18a..24e6f26e 100644 --- a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py +++ b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py @@ -443,11 +443,6 @@ def check_model_workflow(): model_list = CheckModelTest._filter_wh_models(models, wh_list) else: # Check all models in package model_list = CheckModelTest._get_model() - with open("bin/ci_whitelist/html_whitelist.txt", "r") as file: - whitelists = file.readlines() - for white_model in whitelists: - if white_model in model_list: - model_list.remove(white_model) if len(model_list) == 0: print(f'No models in package {args.single_package}') exit(1) @@ -488,6 +483,7 @@ def sim_example_workflow(): if len(example_list) == 0: print(f'No models in package {args.single_package}') exit(1) + print(example_list) result = CheckModelTest._sim_examples(example_list) error_model = result[0] error_message = result[1] From 1c40839906b09eabc090c4f3854e283d8bfacb88 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sat, 27 Aug 2022 15:37:48 +0200 Subject: [PATCH 035/131] debug --- bin/CITests/02_UnitTests/CheckPackages/validatetest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py index 24e6f26e..6c5291c8 100644 --- a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py +++ b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py @@ -190,7 +190,9 @@ def _get_examples(self): # list all examples in package for line in lines: if line.find("extends") > -1 and line.find("Modelica.Icons.Example") > -1: example = filepath.replace(os.sep, ".") + print(example) example = example[example.rfind(self.mo_library):example.rfind(".mo")] + print(example, self.mo_library) example_list.append(example) break ex_file.close() From 4b39eda1478733e8ac8b991049f84ab1e85da19a Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sat, 27 Aug 2022 15:40:40 +0200 Subject: [PATCH 036/131] Rename to avoid rfind issue --- .../MyOwnHeatingRodEfficiencyStudy/{BESModel.mo => BES.mo} | 4 ++-- BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/package.order | 2 +- bin/CITests/02_UnitTests/CheckPackages/validatetest.py | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) rename BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/{BESModel.mo => BES.mo} (99%) diff --git a/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BESModel.mo b/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BES.mo similarity index 99% rename from BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BESModel.mo rename to BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BES.mo index aa608a1f..a934ce0f 100644 --- a/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BESModel.mo +++ b/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BES.mo @@ -1,5 +1,5 @@ within BESMod.Examples.MyOwnHeatingRodEfficiencyStudy; -model BESModel +model BES extends Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare BESMod.Systems.Demand.Building.TEASERThermalZone @@ -79,4 +79,4 @@ model BESModel StopTime=86400, Interval=600, __Dymola_Algorithm="Dassl")); -end BESModel; +end BES; diff --git a/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/package.order b/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/package.order index ab33752d..d15b34a5 100644 --- a/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/package.order +++ b/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/package.order @@ -1,2 +1,2 @@ -BESModel +BES SimpleStudyOfHeatingRodEfficiency diff --git a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py index 6c5291c8..24e6f26e 100644 --- a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py +++ b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py @@ -190,9 +190,7 @@ def _get_examples(self): # list all examples in package for line in lines: if line.find("extends") > -1 and line.find("Modelica.Icons.Example") > -1: example = filepath.replace(os.sep, ".") - print(example) example = example[example.rfind(self.mo_library):example.rfind(".mo")] - print(example, self.mo_library) example_list.append(example) break ex_file.close() From e8bd94aba6469e14c880a1b99f84893d7af819ac Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 29 Aug 2022 10:31:47 +0200 Subject: [PATCH 037/131] revert print --- bin/CITests/02_UnitTests/CheckPackages/validatetest.py | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py index 24e6f26e..a96db3d0 100644 --- a/bin/CITests/02_UnitTests/CheckPackages/validatetest.py +++ b/bin/CITests/02_UnitTests/CheckPackages/validatetest.py @@ -483,7 +483,6 @@ def sim_example_workflow(): if len(example_list) == 0: print(f'No models in package {args.single_package}') exit(1) - print(example_list) result = CheckModelTest._sim_examples(example_list) error_model = result[0] error_message = result[1] From fb5984ed77f9bdd3006503f1fd8d493afbe85a0d Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 30 Aug 2022 12:45:28 +0200 Subject: [PATCH 038/131] move Components package to hydraulics --- BESMod/Components/Electrical/package.mo | 3 - BESMod/Components/package.order | 2 - .../PartialModelicaConferenceUseCase.mo | 1 - .../Demand/Building/BuildingsRoomCase600FF.mo | 4 +- .../Distribution/BatterySystemSimple.mo | 4 +- .../Electrical/Transfer/Tests/PartialTest.mo | 8 +- .../HeatingRodWithSecurityControl.mo | 276 ++++++++++++++ .../Components/Pumps/ArtificalPumpFixedT.mo | 11 + .../Pumps/ArtificalPumpIsotermhal.mo | 19 + .../Components/Pumps/ArtificalPump_h_in.mo | 19 + .../Pumps/BaseClasses/PartialArtificalPump.mo | 29 ++ .../BaseClasses/PartialArtificalPumpT.mo | 13 + .../BaseClasses/PartialArtificalPump_h.mo | 12 + .../Components/Pumps/BaseClasses/package.mo | 3 + .../Pumps/BaseClasses/package.order | 3 + .../Hydraulical/Components/Pumps/package.mo | 5 + .../Components/Pumps/package.order | 4 + .../UFH/ActiveWallBaseDataDefinition.mo | 54 +++ .../Components/UFH/PanelHeating.mo | 338 ++++++++++++++++++ .../Components/UFH/PanelHeatingSegment.mo | 235 ++++++++++++ .../Hydraulical/Components/UFH/package.mo | 9 + .../Hydraulical/Components/UFH/package.order | 3 + .../Systems/Hydraulical/Components/package.mo | 23 ++ .../Hydraulical/Components/package.order | 3 + ...lDistributionTwoStorageParallelDetailed.mo | 17 +- .../Components/DiscretizeContSignal.mo | 2 +- .../Valves/ArtificialThreeWayValve.mo | 17 +- .../Distribution/Components/package.order | 1 + .../Generation/HeatPumpAndHeatingRod.mo | 7 +- .../Hydraulical/Transfer/UFHTransferSystem.mo | 33 +- BESMod/Systems/Hydraulical/package.order | 3 +- .../SupervisoryControl/SupervisoryControl.mo | 4 +- 32 files changed, 1112 insertions(+), 53 deletions(-) delete mode 100644 BESMod/Components/Electrical/package.mo create mode 100644 BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpFixedT.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpIsotermhal.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPump_h_in.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPumpT.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump_h.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.order create mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/package.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/package.order create mode 100644 BESMod/Systems/Hydraulical/Components/UFH/ActiveWallBaseDataDefinition.mo create mode 100644 BESMod/Systems/Hydraulical/Components/UFH/PanelHeating.mo create mode 100644 BESMod/Systems/Hydraulical/Components/UFH/PanelHeatingSegment.mo create mode 100644 BESMod/Systems/Hydraulical/Components/UFH/package.mo create mode 100644 BESMod/Systems/Hydraulical/Components/UFH/package.order create mode 100644 BESMod/Systems/Hydraulical/Components/package.mo create mode 100644 BESMod/Systems/Hydraulical/Components/package.order rename BESMod/{ => Systems/Hydraulical/Distribution}/Components/DiscretizeContSignal.mo (90%) diff --git a/BESMod/Components/Electrical/package.mo b/BESMod/Components/Electrical/package.mo deleted file mode 100644 index 834130d4..00000000 --- a/BESMod/Components/Electrical/package.mo +++ /dev/null @@ -1,3 +0,0 @@ -within BESMod.Components; -package Electrical "Additional electrical components which are not part of any libraries yet" -end Electrical; diff --git a/BESMod/Components/package.order b/BESMod/Components/package.order index 253d11cb..a5b41f99 100644 --- a/BESMod/Components/package.order +++ b/BESMod/Components/package.order @@ -1,5 +1,3 @@ Pumps UFH HeatingRodWithSecurityControl -DiscretizeContSignal -Electrical diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 18a1c932..a51daa3b 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -106,7 +106,6 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParas, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover fanData, - redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor tempSensorData), diff --git a/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo b/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo index 729166fa..8a326473 100644 --- a/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo +++ b/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo @@ -210,8 +210,8 @@ model BuildingsRoomCase600FF BESMod.Utilities.KPIs.ComfortCalculator comfortCalculatorHea[nZones](TComBou= TSetZone_nominal .- dTComfort, each for_heating=true) annotation (Placement(transformation(extent={{66,0},{80,14}}))); - BESMod.Utilities.KPIs.ComfortCalculator comfortCalculatorCool[nZones](TComBou - =TSetZone_nominal .+ dTComfort, each for_heating=false) + BESMod.Utilities.KPIs.ComfortCalculator comfortCalculatorCool[nZones](TComBou= + TSetZone_nominal .+ dTComfort, each for_heating=false) annotation (Placement(transformation(extent={{66,-18},{80,-4}}))); equation connect(roo.uSha, replicator.y) annotation (Line( diff --git a/BESMod/Systems/Electrical/Distribution/BatterySystemSimple.mo b/BESMod/Systems/Electrical/Distribution/BatterySystemSimple.mo index ac7c12e9..6642be11 100644 --- a/BESMod/Systems/Electrical/Distribution/BatterySystemSimple.mo +++ b/BESMod/Systems/Electrical/Distribution/BatterySystemSimple.mo @@ -15,8 +15,8 @@ model BatterySystemSimple "Simple Battery model" extent={{-10,-10},{10,10}}, rotation=-90, origin={-70,34}))); - BESMod.Utilities.Electrical.RealToElecConSplit realToElecConSplit annotation - (Placement(transformation( + BESMod.Utilities.Electrical.RealToElecConSplit realToElecConSplit annotation ( + Placement(transformation( extent={{-10,-10},{10,10}}, rotation=-90, origin={50,-30}))); diff --git a/BESMod/Systems/Electrical/Transfer/Tests/PartialTest.mo b/BESMod/Systems/Electrical/Transfer/Tests/PartialTest.mo index 7580d4c9..ac9adba9 100644 --- a/BESMod/Systems/Electrical/Transfer/Tests/PartialTest.mo +++ b/BESMod/Systems/Electrical/Transfer/Tests/PartialTest.mo @@ -5,11 +5,11 @@ partial model PartialTest transfer constrainedby BaseClasses.PartialTransfer annotation (Placement(transformation(extent={{-44,-32},{48,52}})), choicesAllMatching=true); - Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperatureRad[transfer.nParallelDem] - (each T=293.15) + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperatureRad[transfer.nParallelDem]( + each T=293.15) annotation (Placement(transformation(extent={{100,-20},{80,0}}))); - Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperatureCon[transfer.nParallelDem] - (each T=293.15) + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperatureCon[transfer.nParallelDem]( + each T=293.15) annotation (Placement(transformation(extent={{100,20},{80,40}}))); equation connect(fixedTemperatureRad.port, transfer.heatPortRad) annotation (Line( diff --git a/BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo b/BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo new file mode 100644 index 00000000..981ed532 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo @@ -0,0 +1,276 @@ +within BESMod.Systems.Hydraulical.Components; +model HeatingRodWithSecurityControl + "Heating rod which converts electrical energy into heat with a given efficiency" + extends IBPSA.Fluid.Interfaces.TwoPortHeatMassExchanger( + redeclare final IBPSA.Fluid.MixingVolumes.MixingVolume vol( + final m_flow_small=m_flow_small, + final V=V, + final prescribedHeatFlowRate=true)); + + parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal + "Heat flow rate at u=1, positive for heating"; + parameter Modelica.Units.SI.Volume V=m_flow_nominal*tau/rho_default + "Volume of heat exchanger"; + parameter Real eta "Efficiency of the heating rod"; + + // Count switches + parameter Boolean use_countNumSwi=true + "Turn the counting of the number of heating rod uses on or off." + annotation (Dialog(tab="Advanced", group="Diagnostics"), choices(checkBox=true)); + Modelica.Blocks.Interfaces.RealInput u(unit="1", + min=0, + max=1) "Control input" + annotation (Placement(transformation( + extent={{-140,40},{-100,80}}))); + Modelica.Blocks.Interfaces.RealOutput Pel(unit="W") + "Electrical power used to provide current heat flow" + annotation (Placement(transformation(extent={{100,50},{120,70}}))); + Modelica.Blocks.Math.Gain gai_eta(final k=1/eta) "Divide efficiency" + annotation (Placement(transformation(extent={{40,62},{60,82}}))); + + Modelica.Blocks.MathInteger.TriggeredAdd triggeredAdd(final use_reset=false, + final y_start=0) if use_countNumSwi + "To count on-off cycles" + annotation (Placement(transformation(extent={{68,-68},{86,-52}}))); + Modelica.Blocks.Sources.IntegerConstant integerConstant(final k=1) + if use_countNumSwi + annotation (Placement(transformation(extent={{38,-68},{54,-52}}))); + Modelica.Blocks.Interfaces.IntegerOutput numSwi if use_countNumSwi + "Number of on switches " + annotation (Placement(transformation(extent={{100,-70},{120,-50}}), + iconTransformation(extent={{96,-62},{116,-42}}))); + Modelica.Blocks.Logical.GreaterThreshold greaterThreshold(final threshold= + Modelica.Constants.eps) if use_countNumSwi + annotation (Placement(transformation(extent={{38,-94},{54,-78}}))); + parameter Real m_flowTurnOff=m_flow_small + "if m_flow smaller than this value, HR won't turn on"; + parameter Real m_flowTurnOn=m_flow_nominal*0.1 + "If m_flow is bigger than this value, HR may turn on"; +protected + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHea( + final alpha=0) + "Prescribed heat flow" + annotation (Placement(transformation(extent={{-36,50},{-16,70}}))); + Modelica.Blocks.Math.Gain gai(k=Q_flow_nominal) "Gain" + annotation (Placement(transformation(extent={{-60,56},{-52,64}}))); + Modelica.Blocks.Logical.Switch + gai1 "Gain" + annotation (Placement(transformation(extent={{-72,56},{-64,64}}))); + Modelica.Blocks.Logical.Hysteresis mFlowBigEnough( + final uLow=m_flowTurnOff, + final uHigh=m_flowTurnOn, + final pre_y_start=false) "Check if m_flow is big enough" + annotation (Placement(transformation(extent={{-86,56},{-78,64}}))); + Modelica.Blocks.Sources.Constant constZero(final k=0) "Turn device off" + annotation (Placement(transformation(extent={{-86,44},{-78,52}}))); + Modelica.Blocks.Sources.RealExpression internal_mFlow(y=abs(port_a.m_flow)) + "Only used as no mass flow sensor is present" + annotation (Placement(transformation(extent={{-98,50},{-90,58}}))); +equation + connect(gai.y, preHea.Q_flow) annotation (Line( + points={{-51.6,60},{-36,60}}, + color={0,0,127})); + connect(preHea.port, vol.heatPort) annotation (Line( + points={{-16,60},{-9,60},{-9,-10}}, + color={191,0,0})); + connect(gai.y, gai_eta.u) annotation (Line(points={{-51.6,60},{-42,60},{-42, + 72},{38,72}}, + color={0,0,127})); + connect(gai_eta.y, Pel) annotation (Line(points={{61,72},{88,72},{88,60},{110, + 60}}, color={0,0,127})); + connect(triggeredAdd.y,numSwi) + annotation (Line(points={{87.8,-60},{110,-60}}, color={255,127,0}, + pattern=LinePattern.Dash)); + connect(integerConstant.y,triggeredAdd. u) annotation (Line(points={{54.8,-60}, + {64.4,-60}}, color={255,127,0}, + pattern=LinePattern.Dash)); + connect(greaterThreshold.y, triggeredAdd.trigger) annotation (Line( + points={{54.8,-86},{71.6,-86},{71.6,-69.6}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + connect(gai.u, gai1.y) + annotation (Line(points={{-60.8,60},{-63.6,60}}, color={0,0,127})); + connect(gai1.u2, mFlowBigEnough.y) + annotation (Line(points={{-72.8,60},{-77.6,60}}, color={255,0,255})); + connect(u, gai1.u1) annotation (Line(points={{-120,60},{-92,60},{-92,76},{-76, + 76},{-76,63.2},{-72.8,63.2}}, color={0,0,127})); + connect(gai1.u3, constZero.y) annotation (Line(points={{-72.8,56.8},{-72.8,48}, + {-77.6,48}}, color={0,0,127})); + connect(internal_mFlow.y, mFlowBigEnough.u) annotation (Line(points={{-89.6, + 54},{-89.6,56},{-86.8,56},{-86.8,60}}, color={0,0,127})); + connect(gai1.y, greaterThreshold.u) annotation (Line( + points={{-63.6,60},{-62,60},{-62,14},{-68,14},{-68,-86},{36.4,-86}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={ + Rectangle( + extent={{-100,8},{101,-5}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-70,-60},{70,60},{-70,60},{-70,-60}}, + fillColor={127,0,0}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + lineColor={0,0,0}), + Polygon( + points={{-70,-60},{70,60},{70,-60},{-70,-60}}, + fillColor={0,0,127}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Rectangle( + extent={{70,60},{100,58}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,127}, + fillPattern=FillPattern.Solid), + Text( + extent={{-56,-18},{54,-78}}, + lineColor={255,255,255}, + textString="Q=%Q_flow_nominal"), + Rectangle( + extent={{-100,60},{-70,58}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,127}, + fillPattern=FillPattern.Solid), + Text( + extent={{-122,106},{-78,78}}, + lineColor={0,0,127}, + textString="u"), + Text( + extent={{74,102},{118,74}}, + lineColor={0,0,127}, + textString="P_el"), + Line( + points={{-18,80},{-60,80},{-60,2},{-42,2}}, + color={0,0,0}, + thickness=1), + Ellipse( + extent={{-14,86},{-26,74}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{26,86},{14,74}}, + lineColor={0,0,0}, + lineThickness=1, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Line( + points={{22,80},{60,80},{60,0},{46,0}}, + color={0,0,0}, + thickness=1), + Line( + points={{-42,2},{-42,52},{-26,-36}}, + color={238,46,47}, + thickness=0.5), + Line( + points={{-34,52},{-18,-36}}, + color={238,46,47}, + thickness=0.5), + Line( + points={{-26,52},{-10,-36}}, + color={238,46,47}, + thickness=0.5), + Line( + points={{-18,52},{-2,-36}}, + color={238,46,47}, + thickness=0.5), + Line( + points={{-10,52},{6,-36}}, + color={238,46,47}, + thickness=0.5), + Line( + points={{-2,52},{14,-36}}, + color={238,46,47}, + thickness=0.5), + Line( + points={{30,52},{46,-36}}, + color={238,46,47}, + thickness=0.5), + Line( + points={{22,52},{38,-36}}, + color={238,46,47}, + thickness=0.5), + Line( + points={{14,52},{30,-36}}, + color={238,46,47}, + thickness=0.5), + Line( + points={{6,52},{22,-36}}, + color={238,46,47}, + thickness=0.5), + Line( + points={{46,0},{46,-34},{46,-34}}, + color={238,46,47}, + thickness=0.5)}), +defaultComponentName="hea", +Documentation(info="

+ Model for a heating rod. +

+

+ This model adds heat in the amount of Q_flow = u Q_flow_nominal to the + medium. The input signal u and the nominal heat flow rate + Q_flow_nominal can be + positive or negative. A positive value of Q_flow means heating, and negative + means cooling. +

+

+ The outlet conditions at port_a are not affected by this + model, other than for a possible pressure difference due to flow + friction. +

+

+ Optionally, this model can have a flow resistance. Set dp_nominal = 0 to disable the flow + friction calculation. +

+

+ For a model that uses as an input the fluid temperature leaving at + port_b, use IBPSA.Fluid.HeatExchangers.PrescribedOutlet +

+

+ As output, the electrical energy required to supply Q_flow is calculated using the + efficiency which is a parameter of the model. +

+

+ Lastly, the number of times the heating rod switches on may be used + as an output. +

+

+ Limitations +

+

+ This model does not affect the humidity of the air. Therefore, if + used to cool air below the dew point temperature, the water mass + fraction will not change. +

+

+ Validation +

+

+ The model has been validated against the analytical solution in the + example IBPSA.Fluid.HeatExchangers.Validation.HeaterCooler_u. +

+", +revisions="
    +
  • May 5, 2021, by Fabian Wuellhorst:
    + Added model.
    + This is for IBPSA, #1092. +
  • +
+")); +end HeatingRodWithSecurityControl; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpFixedT.mo b/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpFixedT.mo new file mode 100644 index 00000000..6e02d57e --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpFixedT.mo @@ -0,0 +1,11 @@ +within BESMod.Systems.Hydraulical.Components.Pumps; +model ArtificalPumpFixedT + "Temperature of source is a given fixed value" + extends BaseClasses.PartialArtificalPumpT(final bou_sink(nPorts=1), + bou_source(final T=T_fixed)); + parameter Modelica.Media.Interfaces.Types.Temperature T_fixed=Medium.T_default + "Fixed value of temperature for outlet of pump"; +equation + connect(bou_sink.ports[1], port_a) + annotation (Line(points={{-62,0},{-100,0}}, color={0,127,255})); +end ArtificalPumpFixedT; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpIsotermhal.mo b/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpIsotermhal.mo new file mode 100644 index 00000000..67ba2d94 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpIsotermhal.mo @@ -0,0 +1,19 @@ +within BESMod.Systems.Hydraulical.Components.Pumps; +model ArtificalPumpIsotermhal + "Pump without temperature losses" +extends BaseClasses.PartialArtificalPumpT(bou_source(use_T_in=true), final + bou_sink(final nPorts=1)); + IBPSA.Fluid.Sensors.TemperatureTwoPort senTem( + redeclare final package Medium = Medium, + allowFlowReversal=false, m_flow_nominal=m_flow_nominal) + annotation (Placement(transformation(extent={{-90,-10},{-70,10}}))); + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal + "Nominal mass flow rate, used for regularization near zero flow"; +equation + connect(port_a, senTem.port_a) + annotation (Line(points={{-100,0},{-90,0}}, color={0,127,255})); + connect(bou_sink.ports[1], senTem.port_b) + annotation (Line(points={{-62,0},{-70,0}}, color={0,127,255})); +connect(senTem.T, bou_source.T_in) annotation (Line(points={{-80,11},{-78,11}, + {-78,26},{-40,26},{-40,24},{-16,24},{-16,4},{58,4}}, color={0,0,127})); +end ArtificalPumpIsotermhal; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPump_h_in.mo b/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPump_h_in.mo new file mode 100644 index 00000000..e1a6f444 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPump_h_in.mo @@ -0,0 +1,19 @@ +within BESMod.Systems.Hydraulical.Components.Pumps; +model ArtificalPump_h_in "Artifical pump with enthalpy as input" + extends BaseClasses.PartialArtificalPump_h(bou_sink(nPorts=1), bou_source( + use_h_in=true)); + Modelica.Blocks.Interfaces.RealInput h_flow_in(final unit="J/(kg)") + "Prescribed enthaply flow rate" annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=270, + origin={-60,120}), iconTransformation( + extent={{-20,-20},{20,20}}, + rotation=270, + origin={-84,114}))); +equation + connect(port_a, bou_sink.ports[1]) + annotation (Line(points={{-100,0},{-62,0}}, color={0,127,255})); + connect(h_flow_in, bou_source.h_in) annotation (Line(points={{-60,120},{-60, + 42},{-28,42},{-28,4},{50,4}}, + color={0,0,127})); +end ArtificalPump_h_in; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump.mo b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump.mo new file mode 100644 index 00000000..c6578eec --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump.mo @@ -0,0 +1,29 @@ +within BESMod.Systems.Hydraulical.Components.Pumps.BaseClasses; +partial model PartialArtificalPump + "Partial model a sink combined with a source to avoid calculation of pump characteristics (time-consuming)" + extends IBPSA.Fluid.Interfaces.PartialTwoPort; + + parameter Modelica.Media.Interfaces.Types.AbsolutePressure p=Medium.p_default + "Fixed value of pressure"; + + IBPSA.Fluid.Sources.Boundary_ph bou_sink(redeclare package Medium = Medium, + p=p) + annotation (Placement(transformation(extent={{-42,-10},{-62,10}}))); + Modelica.Blocks.Interfaces.RealInput m_flow_in(final unit="kg/s") + "Prescribed mass flow rate" + annotation (Placement(transformation(extent={{-20,-20},{20,20}}, + rotation=270, + origin={0,120}), iconTransformation(extent={{-20,-20}, + {20,20}}, + rotation=270, + origin={0,116}))); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Ellipse(extent = {{-100, 96}, {100, -104}}, + lineColor = {0, 0, 0}, fillColor = {0, 127, 0}, + fillPattern=FillPattern.Solid), + Polygon(points = {{-42, 70}, {78, -4}, {-42, -78}, {-42, 70}}, + lineColor = {0, 0, 0}, fillColor = {175, 175, 175}, + fillPattern=FillPattern.Solid)}), Diagram(graphics, + coordinateSystem(preserveAspectRatio=false))); +end PartialArtificalPump; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPumpT.mo b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPumpT.mo new file mode 100644 index 00000000..3f70210c --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPumpT.mo @@ -0,0 +1,13 @@ +within BESMod.Systems.Hydraulical.Components.Pumps.BaseClasses; +partial model PartialArtificalPumpT "Setting m_flow and temperature possible" + extends PartialArtificalPump; + IBPSA.Fluid.Sources.MassFlowSource_T bou_source( + redeclare package Medium = Medium, final use_m_flow_in=true, + nPorts=1) + annotation (Placement(transformation(extent={{60,-10},{80,10}}))); +equation + connect(bou_source.ports[1], port_b) + annotation (Line(points={{80,0},{100,0}}, color={0,127,255})); + connect(m_flow_in, bou_source.m_flow_in) + annotation (Line(points={{0,120},{0,8},{58,8}}, color={0,0,127})); +end PartialArtificalPumpT; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump_h.mo b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump_h.mo new file mode 100644 index 00000000..47c927bb --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump_h.mo @@ -0,0 +1,12 @@ +within BESMod.Systems.Hydraulical.Components.Pumps.BaseClasses; +partial model PartialArtificalPump_h + extends PartialArtificalPump; + IBPSA.Fluid.Sources.MassFlowSource_h bou_source( + redeclare package Medium = Medium, use_m_flow_in=true, nPorts=1) + annotation (Placement(transformation(extent={{52,-10},{72,10}}))); +equation + connect(bou_source.ports[1], port_b) + annotation (Line(points={{72,0},{100,0}}, color={0,127,255})); + connect(m_flow_in, bou_source.m_flow_in) + annotation (Line(points={{0,120},{0,10},{50,10},{50,8}}, color={0,0,127})); +end PartialArtificalPump_h; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.mo b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.mo new file mode 100644 index 00000000..75b4405b --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.mo @@ -0,0 +1,3 @@ +within BESMod.Systems.Hydraulical.Components.Pumps; +package BaseClasses "Base Classes for pumps" +end BaseClasses; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.order new file mode 100644 index 00000000..a7dd40b9 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.order @@ -0,0 +1,3 @@ +PartialArtificalPump +PartialArtificalPump_h +PartialArtificalPumpT diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/package.mo b/BESMod/Systems/Hydraulical/Components/Pumps/package.mo new file mode 100644 index 00000000..1597e52f --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Pumps/package.mo @@ -0,0 +1,5 @@ +within BESMod.Systems.Hydraulical.Components; +package Pumps "Package for pumps" + extends Modelica.Icons.InternalPackage; + +end Pumps; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/package.order b/BESMod/Systems/Hydraulical/Components/Pumps/package.order new file mode 100644 index 00000000..30dce38f --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Pumps/package.order @@ -0,0 +1,4 @@ +ArtificalPumpIsotermhal +ArtificalPump_h_in +ArtificalPumpFixedT +BaseClasses diff --git a/BESMod/Systems/Hydraulical/Components/UFH/ActiveWallBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Components/UFH/ActiveWallBaseDataDefinition.mo new file mode 100644 index 00000000..6a2704b3 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/UFH/ActiveWallBaseDataDefinition.mo @@ -0,0 +1,54 @@ +within BESMod.Systems.Hydraulical.Components.UFH; +record ActiveWallBaseDataDefinition "Base data definition for active walls" +extends Modelica.Icons.Record; + parameter Modelica.Units.SI.Temperature Temp_nom[3] + "Nominal Temperatures T_flow, T_return, T_room / air "; + parameter Modelica.Units.SI.HeatFlux q_dot_nom + "nominal Power per square meter"; + parameter Modelica.Units.SI.CoefficientOfHeatTransfer k_isolation + "k_isolation of whole FH Layer"; + parameter Modelica.Units.SI.CoefficientOfHeatTransfer k_top + "Heat transfer coefficient for layers above tubes"; + parameter Modelica.Units.SI.CoefficientOfHeatTransfer k_down + "Heat transfer coefficient for layers underneath tubes"; +parameter Real VolumeWaterPerMeter(unit="l/m") "Water volume"; + + parameter Modelica.Units.SI.Emissivity eps "Emissivity of Floor"; +parameter AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatCapacityPerArea C_ActivatedElement = 50000; +parameter Real c_top_ratio; +parameter Real PressureDropExponent; +parameter Real PressureDropCoefficient; +parameter Real diameter; + +annotation (Documentation(revisions="
    +
  • + February 14, 2014  by Ana Constantin:
    + Changed name of heat capacity per are to C_Activated Element, to be + able to use it for both heating and cooling. +
  • +
  • + September 20, 2013  by Mark Wesseling:
    + Implemented. +
  • +
+", + info="

+ Overview +

+

+ Base record for Active Walls (Ceiling and Floor) models. +

+

+ Defines heat exchange properties and storage capacity of the active + part of the wall. +

+

+ References +

+

+ Base data definition for record used with EBC.HVAC.Components.ActiveWalls.Panelheating_1D_Dis +

+")); + +end ActiveWallBaseDataDefinition; diff --git a/BESMod/Systems/Hydraulical/Components/UFH/PanelHeating.mo b/BESMod/Systems/Hydraulical/Components/UFH/PanelHeating.mo new file mode 100644 index 00000000..6d04645e --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/UFH/PanelHeating.mo @@ -0,0 +1,338 @@ +within BESMod.Systems.Hydraulical.Components.UFH; +model PanelHeating + "A panel heating for e.g. floor heating with discretization" + + extends Modelica.Fluid.Interfaces.PartialTwoPort; + + replaceable parameter + BESMod.Systems.Hydraulical.Components.UFH.ActiveWallBaseDataDefinition floorHeatingType + constrainedby + BESMod.Systems.Hydraulical.Components.UFH.ActiveWallBaseDataDefinition + annotation (Dialog(group="Type"), choicesAllMatching=true); + + parameter Boolean isFloor = true "Floor or Ceiling heating" + annotation(Dialog(compact = true, descriptionLabel = true), choices( + choice = true "Floorheating", + choice = false "Ceilingheating", + radioButtons = true)); + parameter Modelica.Units.SI.Length Spacing=Modelica.Constants.pi* + floorHeatingType.k_top*floorHeatingType.diameter* + AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.logDT({ + floorHeatingType.Temp_nom[1],floorHeatingType.Temp_nom[2], + floorHeatingType.Temp_nom[3]})/(floorHeatingType.q_dot_nom*2) + "Spacing of Pipe"; + parameter Integer dis(min=1) = 5 "Number of Discreatisation Layers"; + + parameter Modelica.Units.SI.Area A "Area of floor / heating panel part"; + + parameter Modelica.Units.SI.Temperature T0= + Modelica.Units.Conversions.from_degC(20) + "Initial temperature, in degrees Celsius"; + parameter Integer calcMethod=2 "Calculation method for convective heat transfer coefficient at surface" annotation (Dialog(group="Heat convection", + descriptionLabel=true), choices( + choice=1 "EN ISO 6946 Appendix A >>Flat Surfaces<<", + choice=2 "By Bernd Glueck", + choice=3 "Custom hCon (constant)", + radioButtons=true)); + + parameter Modelica.Units.SI.CoefficientOfHeatTransfer hCon_const=2.5 + "Custom convective heat transfer coefficient" annotation (Dialog( + group="Heat convection", + descriptionLabel=true, + enable=if calcMethod == 3 then true else false)); + + final parameter Modelica.Units.SI.Emissivity eps=floorHeatingType.eps + "Emissivity"; + + final parameter Real cTopRatio(min=0,max=1)= floorHeatingType.c_top_ratio; + + final parameter + AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatCapacityPerArea cFloorHeating= + floorHeatingType.C_ActivatedElement; + + final parameter + AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatCapacityPerArea cTop= + cFloorHeating*cTopRatio; + + final parameter + AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatCapacityPerArea cDown= + cFloorHeating*(1 - cTopRatio); + + final parameter Modelica.Units.SI.Length tubeLength=A/Spacing; + + final parameter Modelica.Units.SI.Volume VWater= + Modelica.Units.Conversions.from_litre(Modelica.Constants.pi* + floorHeatingType.diameter^2*tubeLength/4) "Volume of Water"; + + // ACCORDING TO GLUECK, Bauteilaktivierung 1999 + + // According to equations 7.91 (for heat flow up) and 7.93 (for heat flow down) from page 41 + // final parameter Modelica.SIunits.Temperature T_Floor_nom= if Floor then + // (floorHeatingType.q_dot_nom/8.92)^(1/1.1) + floorHeatingType.Temp_nom[3] + // else floorHeatingType.q_dot_nom/6.7 + floorHeatingType.Temp_nom[3]; + + final parameter Modelica.Units.SI.CoefficientOfHeatTransfer kTop_nominal= + floorHeatingType.k_top; + + final parameter Modelica.Units.SI.CoefficientOfHeatTransfer kDown_nominal= + floorHeatingType.k_down; + + Modelica.Fluid.Sensors.TemperatureTwoPort TFlow(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-70,-40},{-50,-20}}))); + Modelica.Fluid.Sensors.TemperatureTwoPort TReturn(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{60,-36},{80,-16}}))); + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a ThermDown annotation ( + Placement(transformation(extent={{-10,-72},{10,-52}}), + iconTransformation(extent={{-2,-38},{18,-18}}))); + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a thermConv annotation ( + Placement(transformation(extent={{4,48},{24,68}}), iconTransformation( + extent={{4,30},{24,50}}))); + AixLib.Utilities.Interfaces.RadPort starRad annotation (Placement(transformation(extent={{-26,50},{-6,70}}), iconTransformation(extent={{-22,28},{-2,48}}))); + PanelHeatingSegment panelHeatingSegment[dis]( + redeclare package Medium = Medium, + each final A=tubeLength*floorHeatingType.diameter*Modelica.Constants.pi/dis/ + 2, + each final eps=eps, + each final T0=T0, + each final VWater=VWater/dis, + each final kTop=kTop_nominal, + each final kDown=kDown_nominal, + each final cTop=cTop, + each final cDown=cDown, + each final isFloor=isFloor, + each final calcMethod=calcMethod, + each final hCon_const=hCon_const, + each final A_floor=A) annotation (Placement(transformation(extent={{-58,1},{-8,51}}))); + + AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.PressureDropPH pressureDrop( + redeclare package Medium = Medium, + final tubeLength=tubeLength, + final n=floorHeatingType.PressureDropExponent, + final m=floorHeatingType.PressureDropCoefficient) + annotation (Placement(transformation(extent={{8,0},{54,52}}))); +equation + + // HEAT CONNECTIONS + for i in 1:dis loop + connect(panelHeatingSegment[i].thermConvWall, ThermDown); + connect(panelHeatingSegment[i].thermConvRoom, thermConv); + connect(panelHeatingSegment[i].starRad, starRad); + end for; + + // FLOW CONNECTIONS + + //OUTER CONNECTIONS + + connect(TFlow.port_b, panelHeatingSegment[1].port_a); + connect(pressureDrop.port_a, panelHeatingSegment[dis].port_b); + + //INNER CONNECTIONS + + if dis > 1 then + for i in 1:(dis-1) loop + connect(panelHeatingSegment[i].port_b, panelHeatingSegment[i + 1].port_a); + end for; + end if; + + connect(port_a, TFlow.port_a) annotation (Line( + points={{-100,0},{-88,0},{-88,-30},{-70,-30}}, + color={0,127,255}, + smooth=Smooth.None)); + + connect(TReturn.port_b, port_b) annotation (Line( + points={{80,-26},{84,-26},{84,0},{100,0}}, + color={0,127,255}, + smooth=Smooth.None)); + connect(pressureDrop.port_b, TReturn.port_a) annotation (Line( + points={{54,26},{60,26},{60,-26}}, + color={0,127,255}, + smooth=Smooth.None)); + +annotation (Diagram(graphics, + coordinateSystem(preserveAspectRatio=false,extent={{-100, + -60},{100,60}})), Icon(coordinateSystem(preserveAspectRatio=false, + extent={{-100,-25},{100,35}}), + graphics={ + Rectangle( + extent={{-100,14},{100,-26}}, + lineColor={200,200,200}, + fillColor={150,150,150}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,35},{100,14}}, + lineColor={200,200,200}, + fillColor={170,255,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-84,-2},{-76,-10}}, + lineColor={200,200,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-68,-2},{-60,-10}}, + lineColor={200,200,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-52,-2},{-44,-10}}, + lineColor={200,200,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-36,-2},{-28,-10}}, + lineColor={200,200,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-20,-2},{-12,-10}}, + lineColor={200,200,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-4,-2},{4,-10}}, + lineColor={200,200,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{12,-2},{20,-10}}, + lineColor={200,200,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{28,-2},{36,-10}}, + lineColor={200,200,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{44,-2},{52,-10}}, + lineColor={200,200,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{60,-2},{68,-10}}, + lineColor={200,200,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{76,-2},{84,-10}}, + lineColor={200,200,200}, + fillColor={0,128,255}, + fillPattern=FillPattern.Solid), + Line( + points={{-80,8},{-80,0}}, + color={255,0,0}, + smooth=Smooth.None, + arrow={Arrow.Filled,Arrow.None}, + thickness=1), + Line( + points={{-64,8},{-64,0}}, + color={255,0,0}, + smooth=Smooth.None, + arrow={Arrow.Filled,Arrow.None}), + Line( + points={{-48,8},{-48,0}}, + color={255,0,0}, + smooth=Smooth.None, + arrow={Arrow.Filled,Arrow.None}), + Line( + points={{-32,8},{-32,0}}, + color={255,0,0}, + smooth=Smooth.None, + arrow={Arrow.Filled,Arrow.None}), + Line( + points={{-16,8},{-16,0}}, + color={255,0,0}, + smooth=Smooth.None, + arrow={Arrow.Filled,Arrow.None}), + Line( + points={{0,8},{0,0}}, + color={255,0,0}, + smooth=Smooth.None, + arrow={Arrow.Filled,Arrow.None}), + Line( + points={{16,8},{16,0}}, + color={255,0,0}, + smooth=Smooth.None, + arrow={Arrow.Filled,Arrow.None}), + Line( + points={{32,8},{32,0}}, + color={255,0,0}, + smooth=Smooth.None, + arrow={Arrow.Filled,Arrow.None}), + Line( + points={{48,8},{48,0}}, + color={255,0,0}, + smooth=Smooth.None, + arrow={Arrow.Filled,Arrow.None}), + Line( + points={{64,8},{64,0}}, + color={255,0,0}, + smooth=Smooth.None, + arrow={Arrow.Filled,Arrow.None}), + Line( + points={{80,8},{80,0}}, + color={255,0,0}, + smooth=Smooth.None, + arrow={Arrow.Filled,Arrow.None})}), + Documentation(info="

+ Overview +

+

+ Model for floor heating, with one pipe running through the whole + floor. +

+

+ Concept +

+

+ The assumption is made that there is one pipe that runs thorugh the + whole floor. Which means that a discretisation of the floor heating + is done, the discretisation elements will be connected in series: the + flow temperature of one element is the return temperature of the + element before. +

+

+ The pressure drop is calculated at the end for the whole length of + the pipe. +

+

+ Reference +

+

+ Source: +

+
    +
  • Bernd Glueck, Bauteilaktivierung 1999, Page 41 +
  • +
+

+ Example Results +

+

+ AixLib.Fluid.HeatExchangers.Examples.ActiveWalls.ActiveWalls_Test +

+", + revisions="
    +
  • + February 06, 2017  by Philipp Mehrfeld:
    + Use kTop and kDown instead of k_insulation. Naming according to + AixLib standards. +
  • +
  • + June 15, 2017  by Tobias Blacha:
    + Moved into AixLib +
  • +
  • + March 25, 2015  by Ana Constantin:
    + Uses components from MSL +
  • +
  • + November 06, 2014  by Ana Constantin:
    + Added documentation. +
  • +
+")); +end PanelHeating; diff --git a/BESMod/Systems/Hydraulical/Components/UFH/PanelHeatingSegment.mo b/BESMod/Systems/Hydraulical/Components/UFH/PanelHeatingSegment.mo new file mode 100644 index 00000000..1762521a --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/UFH/PanelHeatingSegment.mo @@ -0,0 +1,235 @@ +within BESMod.Systems.Hydraulical.Components.UFH; +model PanelHeatingSegment "One segment of the discretized panel heating" + +extends Modelica.Fluid.Interfaces.PartialTwoPort; + +parameter Boolean isFloor = true; + + parameter Modelica.Units.SI.Area A "Area of Floor part"; + + parameter Modelica.Units.SI.Emissivity eps=0.95 "Emissivity"; + + parameter Modelica.Units.SI.Temperature T0= + Modelica.Units.Conversions.from_degC(20) + "Initial temperature, in degrees Celsius"; + + parameter Modelica.Units.SI.Volume VWater "Volume of Water in m^3"; + + parameter Modelica.Units.SI.CoefficientOfHeatTransfer kTop; + parameter Modelica.Units.SI.CoefficientOfHeatTransfer kDown; + +parameter + AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatCapacityPerArea cTop; +parameter + AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatCapacityPerArea cDown; + + parameter Integer calcMethod=2 "Calculation method for convective heat transfer coefficient at surface" + annotation (Dialog(group="Heat convection", + descriptionLabel=true), choices( + choice=1 "EN ISO 6946 Appendix A >>Flat Surfaces<<", + choice=2 "By Bernd Glueck", + choice=3 "Custom hCon (constant)", + radioButtons=true)); + + parameter Modelica.Units.SI.CoefficientOfHeatTransfer hCon_const=2.5 + "Constant heat transfer coefficient" annotation (Dialog( + group="Heat convection", + descriptionLabel=true, + enable=if calcMethod == 3 then true else false)); + + Modelica.Fluid.Vessels.ClosedVolume vol( + redeclare package Medium = Medium, + energyDynamics=system.energyDynamics, + use_HeatTransfer=true, + T_start=T0, + redeclare model HeatTransfer = + Modelica.Fluid.Vessels.BaseClasses.HeatTransfer.IdealHeatTransfer, + use_portsData=false, + V=VWater, + nPorts=2) annotation (Placement(transformation(extent={{-14,-26},{8,-4}}))); + + Modelica.Fluid.Sensors.TemperatureTwoPort TFlow(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{-70,-36},{-50,-16}}))); + Modelica.Fluid.Sensors.TemperatureTwoPort TReturn(redeclare package Medium = + Medium) + annotation (Placement(transformation(extent={{50,-36},{70,-16}}))); + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a thermConvWall + annotation (Placement(transformation(extent={{-22,-110},{-2,-90}}))); + AixLib.Utilities.HeatTransfer.HeatToRad twoStar_RadEx(A=A_floor, eps=eps) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-30,74}))); + AixLib.Utilities.HeatTransfer.HeatConvInside HeatConv( + final A=A_floor, + final calcMethod=calcMethod, + final hCon_const=hCon_const, + surfaceOrientation=if isFloor then 2 else 1) annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={1.77636e-015,74}))); + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a thermConvRoom + annotation (Placement(transformation(extent={{-12,90},{8,110}}))); + AixLib.Utilities.Interfaces.RadPort starRad annotation (Placement(transformation(extent={{-38,92},{-18,112}}))); + AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatConductionSegment panel_Segment1( + kA=kTop*A, + mc_p=cTop*A, + T0=T0) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-16,30}))); + AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatConductionSegment panel_Segment2( + T0=T0, + kA=kDown*A, + mc_p=cDown*A) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={-12,-56}))); + parameter Modelica.Units.SI.Area A_floor=A "Area of surface of wall / Floor"; +equation + + connect(port_a, TFlow.port_a) annotation (Line( + points={{-100,0},{-88,0},{-88,-26},{-70,-26}}, + color={0,127,255}, + smooth=Smooth.None)); + + connect(TFlow.port_b, vol.ports[1]) annotation (Line( + points={{-50,-26},{-4.1,-26}}, + color={0,127,255}, + smooth=Smooth.None)); + connect(vol.ports[2], TReturn.port_a) annotation (Line( + points={{-1.9,-26},{50,-26}}, + color={0,127,255}, + smooth=Smooth.None)); + connect(TReturn.port_b, port_b) annotation (Line( + points={{70,-26},{84,-26},{84,0},{100,0}}, + color={0,127,255}, + smooth=Smooth.None)); + connect(HeatConv.port_a, thermConvRoom) annotation (Line( + points={{3.60822e-015,84},{3.60822e-015,92.5},{-2,92.5},{-2,100}}, + color={191,0,0}, + smooth=Smooth.None)); + connect(twoStar_RadEx.radPort, starRad) annotation (Line( + points={{-30,84.1},{-30,102},{-28,102}}, + color={95,95,95}, + pattern=LinePattern.None, + smooth=Smooth.None)); + connect(thermConvWall, thermConvWall) annotation (Line( + points={{-12,-100},{-12,-100}}, + color={191,0,0}, + smooth=Smooth.None)); + connect(panel_Segment1.port_b, twoStar_RadEx.convPort) annotation (Line( + points={{-16.9,39.1},{-16.9,51.55},{-30,51.55},{-30,64}}, + color={191,0,0}, + smooth=Smooth.None)); + connect(panel_Segment1.port_b, HeatConv.port_b) annotation (Line( + points={{-16.9,39.1},{-16.9,51.55},{0,51.55},{0,64}}, + color={191,0,0}, + smooth=Smooth.None)); + connect(panel_Segment1.port_a, vol.heatPort) annotation (Line( + points={{-16.9,20.9},{-16.9,2},{-14,2},{-14,-15}}, + color={191,0,0}, + smooth=Smooth.None)); + connect(panel_Segment2.port_b, thermConvWall) annotation (Line( + points={{-11.1,-65.1},{-11.1,-81.55},{-12,-81.55},{-12,-100}}, + color={191,0,0}, + smooth=Smooth.None)); + connect(panel_Segment2.port_a, vol.heatPort) annotation (Line( + points={{-11.1,-46.9},{-11.1,-31.45},{-14,-31.45},{-14,-15}}, + color={191,0,0}, + smooth=Smooth.None)); + annotation (Diagram(graphics, + coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), Icon(graphics={ + Rectangle( + extent={{-100,20},{100,-22}}, + lineColor={0,0,0}, + fillColor={0,0,255}, + fillPattern=FillPattern.HorizontalCylinder), + Rectangle( + extent={{-100,66},{100,40}}, + lineColor={166,166,166}, + pattern=LinePattern.None, + fillColor={190,190,190}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{100,100},{-100,66}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={156,156,156}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{100,40},{-100,20}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={156,156,156}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{100,-22},{-100,-56}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={156,156,156}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-100,-56},{100,-82}}, + lineColor={166,166,166}, + pattern=LinePattern.None, + fillColor={190,190,190}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{100,-82},{-100,-102}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={156,156,156}, + fillPattern=FillPattern.Solid), + Line( + points={{-22,26},{-22,82}}, + color={255,0,0}, + thickness=0.5, + arrow={Arrow.None,Arrow.Filled}), + Text( + extent={{-20,62},{62,40}}, + lineColor={255,0,0}, + textString="Q_flow"), + Text( + extent={{-20,-46},{62,-68}}, + lineColor={255,0,0}, + textString="Q_flow"), + Line( + points={{0,-28},{0,28}}, + color={255,0,0}, + thickness=0.5, + arrow={Arrow.None,Arrow.Filled}, + origin={-22,-54}, + rotation=180)}), + Documentation(revisions="
    +
  • + February 06, 2017  by Philipp Mehrfeld:
    + Naming according to IBPSA standards. +
  • +
  • + June 15, 2017  by Tobias Blacha:
    + Moved into IBPSA +
  • +
  • + March 25, 2015  by Ana Constantin:
    + Uses components from MSL +
  • +
  • + November 06, 2014  by Ana Constantin:
    + Added documentation. +
  • +
+", + info="

+ Overview +

+

+ Model for a panel heating element, consisting of a water volume, heat + conduction upwards and downwards through the wall layers, convection + and radiation exchange at the room facing side. +

+")); +end PanelHeatingSegment; diff --git a/BESMod/Systems/Hydraulical/Components/UFH/package.mo b/BESMod/Systems/Hydraulical/Components/UFH/package.mo new file mode 100644 index 00000000..13e97b40 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/UFH/package.mo @@ -0,0 +1,9 @@ +within BESMod.Systems.Hydraulical.Components; +package UFH + extends Modelica.Icons.InternalPackage; + + +annotation (Documentation(info=" +


Based on the UFH heating model in the AixLib with smaller error fixes. As soon as the new IBPSA-based UFH model is merged into the AixLib development, this package will be fully obsolete.

+")); +end UFH; diff --git a/BESMod/Systems/Hydraulical/Components/UFH/package.order b/BESMod/Systems/Hydraulical/Components/UFH/package.order new file mode 100644 index 00000000..d720493e --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/UFH/package.order @@ -0,0 +1,3 @@ +PanelHeating +PanelHeatingSegment +ActiveWallBaseDataDefinition diff --git a/BESMod/Systems/Hydraulical/Components/package.mo b/BESMod/Systems/Hydraulical/Components/package.mo new file mode 100644 index 00000000..22aaa4a5 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/package.mo @@ -0,0 +1,23 @@ +within BESMod.Systems.Hydraulical; +package Components "Package for all additional compontents developted for this project" + extends Modelica.Icons.Package; + +annotation (Documentation(info=" +

Components used in building energy systems which are not given in an existing model library to the modeling depth required by the simulation.

+

Most of these components shall not stay in this library but rather

+
    +
  • be integrated into the corresponding component library. For instance, we modified the heating rod model in the IBPSA. This will be added to the IBPSA in the near future
  • +
  • be replaced by better fitting models. For instance, the ArtificalPumps were used starting this library but are replaced one after another be the movers from IBPSA
  • +
  • be moved to a matching project library. For instance, we simulated an UFH system in one project. Moving the UFH-subsystem and these models into an own project library is more straightforward.
  • +
+


This is true not only for this package but all packages named "Components".

+"), Icon(graphics={ + Polygon(points={{-72,34},{66,-36},{66,34},{0,-2},{-72,-34},{-72,34}}, + lineColor={0,0,0}), + Line(points={{0,50},{0,-2}}), + Rectangle( + extent={{-20,58},{20,50}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid)})); +end Components; diff --git a/BESMod/Systems/Hydraulical/Components/package.order b/BESMod/Systems/Hydraulical/Components/package.order new file mode 100644 index 00000000..a5b41f99 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/package.order @@ -0,0 +1,3 @@ +Pumps +UFH +HeatingRodWithSecurityControl diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo index 369b0970..6c6f3acd 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo @@ -207,8 +207,7 @@ partial model PartialDistributionTwoStorageParallelDetailed final allowFlowReversal_HC2=allowFlowReversal) annotation (Placement(transformation(extent={{-36,-74},{0,-28}}))); - BESMod.Components.HeatingRodWithSecurityControl - hea( + BESMod.Systems.Hydraulical.Components.HeatingRodWithSecurityControl hea( redeclare package Medium = Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=m_flow_nominal[1], @@ -255,16 +254,16 @@ partial model PartialDistributionTwoStorageParallelDetailed Modelica.Blocks.Math.Gain gainHRBuf(k=bufParameters.QHR_flow_nominal) if bufParameters.use_hr annotation (Placement(transformation(extent={{-80,18},{-64,36}}))); - BESMod.Components.DiscretizeContSignal discretizeHRAftBufSto(final - discretizationSteps=heatingRodAftBufParameters.discretizationSteps) - if use_heatingRodAfterBuffer + BESMod.Systems.Hydraulical.Distribution.Components.DiscretizeContSignal + discretizeHRAftBufSto(final discretizationSteps=heatingRodAftBufParameters.discretizationSteps) + if use_heatingRodAfterBuffer annotation (Placement(transformation(extent={{36,88},{44,96}}))); - BESMod.Components.DiscretizeContSignal discretizeHRInDHWSto(final - discretizationSteps=dhwParameters.discretizationStepsHR) + BESMod.Systems.Hydraulical.Distribution.Components.DiscretizeContSignal + discretizeHRInDHWSto(final discretizationSteps=dhwParameters.discretizationStepsHR) if dhwParameters.use_hr annotation (Placement(transformation(extent={{-120,-54},{-112,-46}}))); - BESMod.Components.DiscretizeContSignal discretizeHRInBufSto(final - discretizationSteps=bufParameters.discretizationStepsHR) + BESMod.Systems.Hydraulical.Distribution.Components.DiscretizeContSignal + discretizeHRInBufSto(final discretizationSteps=bufParameters.discretizationStepsHR) if bufParameters.use_hr annotation (Placement(transformation(extent={{-100,24},{-92,32}}))); diff --git a/BESMod/Components/DiscretizeContSignal.mo b/BESMod/Systems/Hydraulical/Distribution/Components/DiscretizeContSignal.mo similarity index 90% rename from BESMod/Components/DiscretizeContSignal.mo rename to BESMod/Systems/Hydraulical/Distribution/Components/DiscretizeContSignal.mo index fd987103..3d31b0be 100644 --- a/BESMod/Components/DiscretizeContSignal.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Components/DiscretizeContSignal.mo @@ -1,4 +1,4 @@ -within BESMod.Components; +within BESMod.Systems.Hydraulical.Distribution.Components; model DiscretizeContSignal extends Modelica.Blocks.Interfaces.SISO; parameter Integer discretizationSteps(min=0) = 0 "Number of steps to dicretize. =0 modulating, =1 resembels an on-off controller. =2 would sample 0, 0.5 and 1"; diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ArtificialThreeWayValve.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ArtificialThreeWayValve.mo index c632ff28..3df2c040 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ArtificialThreeWayValve.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ArtificialThreeWayValve.mo @@ -70,20 +70,21 @@ model ArtificialThreeWayValve annotation (Placement(transformation(extent={{-8,-80},{-28,-60}}))); Modelica.Blocks.Sources.RealExpression dummyEnthalpyBuf(y=inStream(port_dhw_a.h_outflow)) annotation (Placement(transformation(extent={{-8,-56},{-28,-36}}))); - BESMod.Components.Pumps.ArtificalPump_h_in artificalPump_h_in_gen( - redeclare package Medium = Medium) annotation (Placement(transformation( + BESMod.Systems.Hydraulical.Components.Pumps.ArtificalPump_h_in + artificalPump_h_in_gen(redeclare package Medium = Medium) annotation ( + Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, origin={-78,0}))); - BESMod.Components.Pumps.ArtificalPump_h_in artificalPump_h_in_buf( - redeclare package Medium = Medium, p=p_hydr) annotation (Placement( - transformation( + BESMod.Systems.Hydraulical.Components.Pumps.ArtificalPump_h_in + artificalPump_h_in_buf(redeclare package Medium = Medium, p=p_hydr) + annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={68,-60}))); - BESMod.Components.Pumps.ArtificalPump_h_in artificalPump_h_in_dhw( - redeclare final package Medium = Medium, final p=p_hydr) annotation ( - Placement(transformation( + BESMod.Systems.Hydraulical.Components.Pumps.ArtificalPump_h_in + artificalPump_h_in_dhw(redeclare final package Medium = Medium, final p= + p_hydr) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={66,60}))); diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/package.order b/BESMod/Systems/Hydraulical/Distribution/Components/package.order index c8572576..f044c50b 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/Components/package.order @@ -1 +1,2 @@ +DiscretizeContSignal Valves diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index 34cd82af..75c51807 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -41,11 +41,12 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" if not use_heaRod annotation (Placement(transformation(extent={{32,74},{44,86}}))); - BESMod.Components.Pumps.ArtificalPumpIsotermhal artificalPumpIsotermhal( + BESMod.Systems.Hydraulical.Components.Pumps.ArtificalPumpIsotermhal + artificalPumpIsotermhal( redeclare package Medium = Medium, final p=p_start, - final m_flow_nominal=m_flow_nominal[1]) if not - use_pressure annotation (Placement(transformation( + final m_flow_nominal=m_flow_nominal[1]) if not use_pressure annotation ( + Placement(transformation( extent={{-10,10},{10,-10}}, rotation=180, origin={70,-50}))); diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index 2a644c8f..f7e0d8a6 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -16,7 +16,7 @@ model UFHTransferSystem extent={{-10,-10},{10,10}}, rotation=270, origin={-28,72}))); - BESMod.Components.UFH.PanelHeating panelHeating[ + BESMod.Systems.Hydraulical.Components.UFH.PanelHeating panelHeating[ nParallelDem]( redeclare package Medium = Medium, final floorHeatingType=floorHeatingType, @@ -126,20 +126,23 @@ model UFHTransferSystem BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{32,-108},{52,-88}}))); protected - parameter BESMod.Components.UFH.ActiveWallBaseDataDefinition floorHeatingType[nParallelDem]={BESMod.Components.UFH.ActiveWallBaseDataDefinition( - Temp_nom=Modelica.Units.Conversions.from_degC( {TTra_nominal[i], - TTra_nominal[i]-dTTra_nominal[i],TDem_nominal[i]}), - q_dot_nom=Q_flow_nominal[i] / UFHParameters.area[i], - k_isolation=UFHParameters.k_top[i] + UFHParameters.k_down[i], - k_top=UFHParameters.k_top[i], - k_down=UFHParameters.k_down[i], - VolumeWaterPerMeter=0, - eps=0.9, - C_ActivatedElement=UFHParameters.C_ActivatedElement[i], - c_top_ratio=UFHParameters.c_top_ratio[i], - PressureDropExponent=0, - PressureDropCoefficient=0, - diameter=UFHParameters.diameter) for i in 1:nParallelDem}; + parameter + BESMod.Systems.Hydraulical.Components.UFH.ActiveWallBaseDataDefinition + floorHeatingType[nParallelDem]={ + BESMod.Systems.Hydraulical.Components.UFH.ActiveWallBaseDataDefinition( + Temp_nom=Modelica.Units.Conversions.from_degC({TTra_nominal[i], + TTra_nominal[i] - dTTra_nominal[i],TDem_nominal[i]}), + q_dot_nom=Q_flow_nominal[i]/UFHParameters.area[i], + k_isolation=UFHParameters.k_top[i] + UFHParameters.k_down[i], + k_top=UFHParameters.k_top[i], + k_down=UFHParameters.k_down[i], + VolumeWaterPerMeter=0, + eps=0.9, + C_ActivatedElement=UFHParameters.C_ActivatedElement[i], + c_top_ratio=UFHParameters.c_top_ratio[i], + PressureDropExponent=0, + PressureDropCoefficient=0, + diameter=UFHParameters.diameter) for i in 1:nParallelDem}; equation diff --git a/BESMod/Systems/Hydraulical/package.order b/BESMod/Systems/Hydraulical/package.order index 56bf3121..fcc7ad20 100644 --- a/BESMod/Systems/Hydraulical/package.order +++ b/BESMod/Systems/Hydraulical/package.order @@ -4,5 +4,6 @@ Generation Transfer Interfaces HydraulicSystem -BaseClasses +Components RecordsCollection +BaseClasses diff --git a/BESMod/Utilities/SupervisoryControl/SupervisoryControl.mo b/BESMod/Utilities/SupervisoryControl/SupervisoryControl.mo index 489e72c9..3a6dd012 100644 --- a/BESMod/Utilities/SupervisoryControl/SupervisoryControl.mo +++ b/BESMod/Utilities/SupervisoryControl/SupervisoryControl.mo @@ -25,8 +25,8 @@ model SupervisoryControl Modelica.Blocks.Sources.RealExpression uExt if ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.External "External input signal" annotation (Placement(transformation(extent={{-60,10},{-40,30}}))); - Modelica.Blocks.Sources.BooleanConstant deactivateAlways(final k=false) if - ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local + Modelica.Blocks.Sources.BooleanConstant deactivateAlways(final k=false) + if ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local "Block to activate use of external signal" annotation (Placement(transformation(extent={{-60,-40},{-40,-20}}))); Modelica.Blocks.Sources.Constant uSupDeacticate(final k=0) if ctrlType == From 1ae5813a031e04106d0a7f00fe2da26777b24ec6 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 30 Aug 2022 12:53:55 +0200 Subject: [PATCH 039/131] Update ci and rm files --- BESMod/Components/Electrical/Inverter.mo | 54 --- BESMod/Components/Electrical/package.order | 1 - .../HeatingRodWithSecurityControl.mo | 276 -------------- .../Components/Pumps/ArtificalPumpFixedT.mo | 11 - .../Pumps/ArtificalPumpIsotermhal.mo | 19 - BESMod/Components/Pumps/ArtificalPump_h_in.mo | 19 - .../Pumps/BaseClasses/PartialArtificalPump.mo | 29 -- .../BaseClasses/PartialArtificalPumpT.mo | 13 - .../BaseClasses/PartialArtificalPump_h.mo | 12 - .../Components/Pumps/BaseClasses/package.mo | 3 - .../Pumps/BaseClasses/package.order | 3 - BESMod/Components/Pumps/package.mo | 5 - BESMod/Components/Pumps/package.order | 4 - .../UFH/ActiveWallBaseDataDefinition.mo | 54 --- BESMod/Components/UFH/PanelHeating.mo | 336 ------------------ BESMod/Components/UFH/PanelHeatingSegment.mo | 235 ------------ BESMod/Components/UFH/package.mo | 9 - BESMod/Components/UFH/package.order | 3 - BESMod/Components/package.mo | 23 -- BESMod/Components/package.order | 3 - BESMod/Systems/Demand/DHW/DHW.mo | 6 +- BESMod/package.order | 1 - .../02_UnitTests/check_model.gitlab-ci.yml | 2 +- 23 files changed, 4 insertions(+), 1117 deletions(-) delete mode 100644 BESMod/Components/Electrical/Inverter.mo delete mode 100644 BESMod/Components/Electrical/package.order delete mode 100644 BESMod/Components/HeatingRodWithSecurityControl.mo delete mode 100644 BESMod/Components/Pumps/ArtificalPumpFixedT.mo delete mode 100644 BESMod/Components/Pumps/ArtificalPumpIsotermhal.mo delete mode 100644 BESMod/Components/Pumps/ArtificalPump_h_in.mo delete mode 100644 BESMod/Components/Pumps/BaseClasses/PartialArtificalPump.mo delete mode 100644 BESMod/Components/Pumps/BaseClasses/PartialArtificalPumpT.mo delete mode 100644 BESMod/Components/Pumps/BaseClasses/PartialArtificalPump_h.mo delete mode 100644 BESMod/Components/Pumps/BaseClasses/package.mo delete mode 100644 BESMod/Components/Pumps/BaseClasses/package.order delete mode 100644 BESMod/Components/Pumps/package.mo delete mode 100644 BESMod/Components/Pumps/package.order delete mode 100644 BESMod/Components/UFH/ActiveWallBaseDataDefinition.mo delete mode 100644 BESMod/Components/UFH/PanelHeating.mo delete mode 100644 BESMod/Components/UFH/PanelHeatingSegment.mo delete mode 100644 BESMod/Components/UFH/package.mo delete mode 100644 BESMod/Components/UFH/package.order delete mode 100644 BESMod/Components/package.mo delete mode 100644 BESMod/Components/package.order diff --git a/BESMod/Components/Electrical/Inverter.mo b/BESMod/Components/Electrical/Inverter.mo deleted file mode 100644 index 3602abc8..00000000 --- a/BESMod/Components/Electrical/Inverter.mo +++ /dev/null @@ -1,54 +0,0 @@ -within BESMod.Components.Electrical; -model Inverter "Inverter to convert DC to AC current" - Modelica.Blocks.Sources.RealExpression P_out(y=P_AC_out) - annotation (Placement(transformation(extent={{4,-10},{24,10}}))); - Modelica.Blocks.Nonlinear.Limiter InverterLimits(uMax=P_Max, uMin=P_Min) "Inverter Limits" annotation (Placement(transformation(extent={{48,-10}, - {68,10}}))); - Modelica.Blocks.Interfaces.RealInput P_DC "AC charging signal" annotation ( - Placement(transformation(extent={{-122,-20},{-82,20}}), - iconTransformation(extent={{-122,-20},{-82,20}}))); - Modelica.Blocks.Interfaces.RealOutput P_AC "DC charging signal" annotation ( - Placement(transformation(extent={{96,-10},{116,10}}), iconTransformation( - extent={{72,-14},{100,14}}))); - parameter Real P_Max "Maximum inverter power"; - parameter Real P_Min "Minimum inverter power"; - - parameter Real a1 = 0.002409 "curve parameter" annotation (choicesAllMatching, Dialog(group="Parameter")); - parameter Real a2 = 0.00561 "curve parameter" annotation (choicesAllMatching, Dialog(group="Parameter")); - parameter Real a3 = 0.01228 "curve parameter" annotation (choicesAllMatching, Dialog(group="Parameter")); - - Real eta "Load-dependend inverter efficiency"; - - Real P_AC_out "AC power after inverter"; - Real P_0 "Initial relative power"; - -equation - P_0 = P_DC / P_Max; - eta = max(Modelica.Constants.eps,P_0 / (P_0 + a1 + a2* P_0 + a3 * P_0^2)); - P_AC_out = P_DC * eta; - connect(P_out.y,InverterLimits. u) - annotation (Line(points={{25,0},{46,0}}, color={0,0,127})); - connect(InverterLimits.y,P_AC) - annotation (Line(points={{69,0},{106,0}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - extent={{-100,100},{100,-100}}), - Line(points={{100,100},{-100,-100}}, color={0,0,0}), - Line(points={{-70,64},{-10,64}}, color={0,0,0}), - Line(points={{-70,52},{-10,52}}, color={0,0,0}), - Line( - points={{12,-56},{14,-50},{16,-48},{18,-46},{24,-44},{30,-44},{34,-46}, - {38,-50},{40,-52},{42,-54},{46,-56},{56,-56},{62,-52},{64,-44}}, - color={0,0,0}, - smooth=Smooth.Bezier), - Line( - points={{14,-72},{16,-66},{18,-64},{20,-62},{26,-60},{32,-60},{36,-62}, - {40,-66},{42,-68},{44,-70},{48,-72},{58,-72},{64,-68},{66,-60}}, - color={0,0,0}, - smooth=Smooth.Bezier)}), Diagram(graphics, - coordinateSystem(preserveAspectRatio= - false))); -end Inverter; diff --git a/BESMod/Components/Electrical/package.order b/BESMod/Components/Electrical/package.order deleted file mode 100644 index 596d8818..00000000 --- a/BESMod/Components/Electrical/package.order +++ /dev/null @@ -1 +0,0 @@ -Inverter diff --git a/BESMod/Components/HeatingRodWithSecurityControl.mo b/BESMod/Components/HeatingRodWithSecurityControl.mo deleted file mode 100644 index b7c70e23..00000000 --- a/BESMod/Components/HeatingRodWithSecurityControl.mo +++ /dev/null @@ -1,276 +0,0 @@ -within BESMod.Components; -model HeatingRodWithSecurityControl - "Heating rod which converts electrical energy into heat with a given efficiency" - extends IBPSA.Fluid.Interfaces.TwoPortHeatMassExchanger( - redeclare final IBPSA.Fluid.MixingVolumes.MixingVolume vol( - final m_flow_small=m_flow_small, - final V=V, - final prescribedHeatFlowRate=true)); - - parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal - "Heat flow rate at u=1, positive for heating"; - parameter Modelica.Units.SI.Volume V=m_flow_nominal*tau/rho_default - "Volume of heat exchanger"; - parameter Real eta "Efficiency of the heating rod"; - - // Count switches - parameter Boolean use_countNumSwi=true - "Turn the counting of the number of heating rod uses on or off." - annotation (Dialog(tab="Advanced", group="Diagnostics"), choices(checkBox=true)); - Modelica.Blocks.Interfaces.RealInput u(unit="1", - min=0, - max=1) "Control input" - annotation (Placement(transformation( - extent={{-140,40},{-100,80}}))); - Modelica.Blocks.Interfaces.RealOutput Pel(unit="W") - "Electrical power used to provide current heat flow" - annotation (Placement(transformation(extent={{100,50},{120,70}}))); - Modelica.Blocks.Math.Gain gai_eta(final k=1/eta) "Divide efficiency" - annotation (Placement(transformation(extent={{40,62},{60,82}}))); - - Modelica.Blocks.MathInteger.TriggeredAdd triggeredAdd(final use_reset=false, - final y_start=0) if use_countNumSwi - "To count on-off cycles" - annotation (Placement(transformation(extent={{68,-68},{86,-52}}))); - Modelica.Blocks.Sources.IntegerConstant integerConstant(final k=1) - if use_countNumSwi - annotation (Placement(transformation(extent={{38,-68},{54,-52}}))); - Modelica.Blocks.Interfaces.IntegerOutput numSwi if use_countNumSwi - "Number of on switches " - annotation (Placement(transformation(extent={{100,-70},{120,-50}}), - iconTransformation(extent={{96,-62},{116,-42}}))); - Modelica.Blocks.Logical.GreaterThreshold greaterThreshold(final threshold= - Modelica.Constants.eps) if use_countNumSwi - annotation (Placement(transformation(extent={{38,-94},{54,-78}}))); - parameter Real m_flowTurnOff=m_flow_small - "if m_flow smaller than this value, HR won't turn on"; - parameter Real m_flowTurnOn=m_flow_nominal*0.1 - "If m_flow is bigger than this value, HR may turn on"; -protected - Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preHea( - final alpha=0) - "Prescribed heat flow" - annotation (Placement(transformation(extent={{-36,50},{-16,70}}))); - Modelica.Blocks.Math.Gain gai(k=Q_flow_nominal) "Gain" - annotation (Placement(transformation(extent={{-60,56},{-52,64}}))); - Modelica.Blocks.Logical.Switch - gai1 "Gain" - annotation (Placement(transformation(extent={{-72,56},{-64,64}}))); - Modelica.Blocks.Logical.Hysteresis mFlowBigEnough( - final uLow=m_flowTurnOff, - final uHigh=m_flowTurnOn, - final pre_y_start=false) "Check if m_flow is big enough" - annotation (Placement(transformation(extent={{-86,56},{-78,64}}))); - Modelica.Blocks.Sources.Constant constZero(final k=0) "Turn device off" - annotation (Placement(transformation(extent={{-86,44},{-78,52}}))); - Modelica.Blocks.Sources.RealExpression internal_mFlow(y=abs(port_a.m_flow)) - "Only used as no mass flow sensor is present" - annotation (Placement(transformation(extent={{-98,50},{-90,58}}))); -equation - connect(gai.y, preHea.Q_flow) annotation (Line( - points={{-51.6,60},{-36,60}}, - color={0,0,127})); - connect(preHea.port, vol.heatPort) annotation (Line( - points={{-16,60},{-9,60},{-9,-10}}, - color={191,0,0})); - connect(gai.y, gai_eta.u) annotation (Line(points={{-51.6,60},{-42,60},{-42, - 72},{38,72}}, - color={0,0,127})); - connect(gai_eta.y, Pel) annotation (Line(points={{61,72},{88,72},{88,60},{110, - 60}}, color={0,0,127})); - connect(triggeredAdd.y,numSwi) - annotation (Line(points={{87.8,-60},{110,-60}}, color={255,127,0}, - pattern=LinePattern.Dash)); - connect(integerConstant.y,triggeredAdd. u) annotation (Line(points={{54.8,-60}, - {64.4,-60}}, color={255,127,0}, - pattern=LinePattern.Dash)); - connect(greaterThreshold.y, triggeredAdd.trigger) annotation (Line( - points={{54.8,-86},{71.6,-86},{71.6,-69.6}}, - color={255,0,255}, - pattern=LinePattern.Dash)); - connect(gai.u, gai1.y) - annotation (Line(points={{-60.8,60},{-63.6,60}}, color={0,0,127})); - connect(gai1.u2, mFlowBigEnough.y) - annotation (Line(points={{-72.8,60},{-77.6,60}}, color={255,0,255})); - connect(u, gai1.u1) annotation (Line(points={{-120,60},{-92,60},{-92,76},{-76, - 76},{-76,63.2},{-72.8,63.2}}, color={0,0,127})); - connect(gai1.u3, constZero.y) annotation (Line(points={{-72.8,56.8},{-72.8,48}, - {-77.6,48}}, color={0,0,127})); - connect(internal_mFlow.y, mFlowBigEnough.u) annotation (Line(points={{-89.6, - 54},{-89.6,56},{-86.8,56},{-86.8,60}}, color={0,0,127})); - connect(gai1.y, greaterThreshold.u) annotation (Line( - points={{-63.6,60},{-62,60},{-62,14},{-68,14},{-68,-86},{36.4,-86}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}}), graphics={ - Rectangle( - extent={{-100,8},{101,-5}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,0}, - fillPattern=FillPattern.Solid), - Polygon( - points={{-70,-60},{70,60},{-70,60},{-70,-60}}, - fillColor={127,0,0}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - lineColor={0,0,0}), - Polygon( - points={{-70,-60},{70,60},{70,-60},{-70,-60}}, - fillColor={0,0,127}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None), - Rectangle( - extent={{70,60},{100,58}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,127}, - fillPattern=FillPattern.Solid), - Text( - extent={{-56,-18},{54,-78}}, - lineColor={255,255,255}, - textString="Q=%Q_flow_nominal"), - Rectangle( - extent={{-100,60},{-70,58}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,127}, - fillPattern=FillPattern.Solid), - Text( - extent={{-122,106},{-78,78}}, - lineColor={0,0,127}, - textString="u"), - Text( - extent={{74,102},{118,74}}, - lineColor={0,0,127}, - textString="P_el"), - Line( - points={{-18,80},{-60,80},{-60,2},{-42,2}}, - color={0,0,0}, - thickness=1), - Ellipse( - extent={{-14,86},{-26,74}}, - lineColor={0,0,0}, - lineThickness=1, - fillColor={0,0,0}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{26,86},{14,74}}, - lineColor={0,0,0}, - lineThickness=1, - fillColor={0,0,0}, - fillPattern=FillPattern.Solid), - Line( - points={{22,80},{60,80},{60,0},{46,0}}, - color={0,0,0}, - thickness=1), - Line( - points={{-42,2},{-42,52},{-26,-36}}, - color={238,46,47}, - thickness=0.5), - Line( - points={{-34,52},{-18,-36}}, - color={238,46,47}, - thickness=0.5), - Line( - points={{-26,52},{-10,-36}}, - color={238,46,47}, - thickness=0.5), - Line( - points={{-18,52},{-2,-36}}, - color={238,46,47}, - thickness=0.5), - Line( - points={{-10,52},{6,-36}}, - color={238,46,47}, - thickness=0.5), - Line( - points={{-2,52},{14,-36}}, - color={238,46,47}, - thickness=0.5), - Line( - points={{30,52},{46,-36}}, - color={238,46,47}, - thickness=0.5), - Line( - points={{22,52},{38,-36}}, - color={238,46,47}, - thickness=0.5), - Line( - points={{14,52},{30,-36}}, - color={238,46,47}, - thickness=0.5), - Line( - points={{6,52},{22,-36}}, - color={238,46,47}, - thickness=0.5), - Line( - points={{46,0},{46,-34},{46,-34}}, - color={238,46,47}, - thickness=0.5)}), -defaultComponentName="hea", -Documentation(info="

- Model for a heating rod. -

-

- This model adds heat in the amount of Q_flow = u Q_flow_nominal to the - medium. The input signal u and the nominal heat flow rate - Q_flow_nominal can be - positive or negative. A positive value of Q_flow means heating, and negative - means cooling. -

-

- The outlet conditions at port_a are not affected by this - model, other than for a possible pressure difference due to flow - friction. -

-

- Optionally, this model can have a flow resistance. Set dp_nominal = 0 to disable the flow - friction calculation. -

-

- For a model that uses as an input the fluid temperature leaving at - port_b, use IBPSA.Fluid.HeatExchangers.PrescribedOutlet -

-

- As output, the electrical energy required to supply Q_flow is calculated using the - efficiency which is a parameter of the model. -

-

- Lastly, the number of times the heating rod switches on may be used - as an output. -

-

- Limitations -

-

- This model does not affect the humidity of the air. Therefore, if - used to cool air below the dew point temperature, the water mass - fraction will not change. -

-

- Validation -

-

- The model has been validated against the analytical solution in the - example IBPSA.Fluid.HeatExchangers.Validation.HeaterCooler_u. -

-", -revisions="
    -
  • May 5, 2021, by Fabian Wuellhorst:
    - Added model.
    - This is for IBPSA, #1092. -
  • -
-")); -end HeatingRodWithSecurityControl; diff --git a/BESMod/Components/Pumps/ArtificalPumpFixedT.mo b/BESMod/Components/Pumps/ArtificalPumpFixedT.mo deleted file mode 100644 index ba3d093d..00000000 --- a/BESMod/Components/Pumps/ArtificalPumpFixedT.mo +++ /dev/null @@ -1,11 +0,0 @@ -within BESMod.Components.Pumps; -model ArtificalPumpFixedT - "Temperature of source is a given fixed value" - extends BaseClasses.PartialArtificalPumpT(final bou_sink(nPorts=1), - bou_source(final T=T_fixed)); - parameter Modelica.Media.Interfaces.Types.Temperature T_fixed=Medium.T_default - "Fixed value of temperature for outlet of pump"; -equation - connect(bou_sink.ports[1], port_a) - annotation (Line(points={{-62,0},{-100,0}}, color={0,127,255})); -end ArtificalPumpFixedT; diff --git a/BESMod/Components/Pumps/ArtificalPumpIsotermhal.mo b/BESMod/Components/Pumps/ArtificalPumpIsotermhal.mo deleted file mode 100644 index fd136dc4..00000000 --- a/BESMod/Components/Pumps/ArtificalPumpIsotermhal.mo +++ /dev/null @@ -1,19 +0,0 @@ -within BESMod.Components.Pumps; -model ArtificalPumpIsotermhal - "Pump without temperature losses" -extends BaseClasses.PartialArtificalPumpT(bou_source(use_T_in=true), final - bou_sink(final nPorts=1)); - IBPSA.Fluid.Sensors.TemperatureTwoPort senTem( - redeclare final package Medium = Medium, - allowFlowReversal=false, m_flow_nominal=m_flow_nominal) - annotation (Placement(transformation(extent={{-90,-10},{-70,10}}))); - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal - "Nominal mass flow rate, used for regularization near zero flow"; -equation - connect(port_a, senTem.port_a) - annotation (Line(points={{-100,0},{-90,0}}, color={0,127,255})); - connect(bou_sink.ports[1], senTem.port_b) - annotation (Line(points={{-62,0},{-70,0}}, color={0,127,255})); -connect(senTem.T, bou_source.T_in) annotation (Line(points={{-80,11},{-78,11}, - {-78,26},{-40,26},{-40,24},{-16,24},{-16,4},{58,4}}, color={0,0,127})); -end ArtificalPumpIsotermhal; diff --git a/BESMod/Components/Pumps/ArtificalPump_h_in.mo b/BESMod/Components/Pumps/ArtificalPump_h_in.mo deleted file mode 100644 index 20dda033..00000000 --- a/BESMod/Components/Pumps/ArtificalPump_h_in.mo +++ /dev/null @@ -1,19 +0,0 @@ -within BESMod.Components.Pumps; -model ArtificalPump_h_in "Artifical pump with enthalpy as input" - extends BaseClasses.PartialArtificalPump_h(bou_sink(nPorts=1), bou_source( - use_h_in=true)); - Modelica.Blocks.Interfaces.RealInput h_flow_in(final unit="J/(kg)") - "Prescribed enthaply flow rate" annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=270, - origin={-60,120}), iconTransformation( - extent={{-20,-20},{20,20}}, - rotation=270, - origin={-84,114}))); -equation - connect(port_a, bou_sink.ports[1]) - annotation (Line(points={{-100,0},{-62,0}}, color={0,127,255})); - connect(h_flow_in, bou_source.h_in) annotation (Line(points={{-60,120},{-60, - 42},{-28,42},{-28,4},{50,4}}, - color={0,0,127})); -end ArtificalPump_h_in; diff --git a/BESMod/Components/Pumps/BaseClasses/PartialArtificalPump.mo b/BESMod/Components/Pumps/BaseClasses/PartialArtificalPump.mo deleted file mode 100644 index db4bb806..00000000 --- a/BESMod/Components/Pumps/BaseClasses/PartialArtificalPump.mo +++ /dev/null @@ -1,29 +0,0 @@ -within BESMod.Components.Pumps.BaseClasses; -partial model PartialArtificalPump - "Partial model a sink combined with a source to avoid calculation of pump characteristics (time-consuming)" - extends IBPSA.Fluid.Interfaces.PartialTwoPort; - - parameter Modelica.Media.Interfaces.Types.AbsolutePressure p=Medium.p_default - "Fixed value of pressure"; - - IBPSA.Fluid.Sources.Boundary_ph bou_sink(redeclare package Medium = Medium, - p=p) - annotation (Placement(transformation(extent={{-42,-10},{-62,10}}))); - Modelica.Blocks.Interfaces.RealInput m_flow_in(final unit="kg/s") - "Prescribed mass flow rate" - annotation (Placement(transformation(extent={{-20,-20},{20,20}}, - rotation=270, - origin={0,120}), iconTransformation(extent={{-20,-20}, - {20,20}}, - rotation=270, - origin={0,116}))); - - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Ellipse(extent = {{-100, 96}, {100, -104}}, - lineColor = {0, 0, 0}, fillColor = {0, 127, 0}, - fillPattern=FillPattern.Solid), - Polygon(points = {{-42, 70}, {78, -4}, {-42, -78}, {-42, 70}}, - lineColor = {0, 0, 0}, fillColor = {175, 175, 175}, - fillPattern=FillPattern.Solid)}), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false))); -end PartialArtificalPump; diff --git a/BESMod/Components/Pumps/BaseClasses/PartialArtificalPumpT.mo b/BESMod/Components/Pumps/BaseClasses/PartialArtificalPumpT.mo deleted file mode 100644 index 500c9fc4..00000000 --- a/BESMod/Components/Pumps/BaseClasses/PartialArtificalPumpT.mo +++ /dev/null @@ -1,13 +0,0 @@ -within BESMod.Components.Pumps.BaseClasses; -partial model PartialArtificalPumpT "Setting m_flow and temperature possible" - extends PartialArtificalPump; - IBPSA.Fluid.Sources.MassFlowSource_T bou_source( - redeclare package Medium = Medium, final use_m_flow_in=true, - nPorts=1) - annotation (Placement(transformation(extent={{60,-10},{80,10}}))); -equation - connect(bou_source.ports[1], port_b) - annotation (Line(points={{80,0},{100,0}}, color={0,127,255})); - connect(m_flow_in, bou_source.m_flow_in) - annotation (Line(points={{0,120},{0,8},{58,8}}, color={0,0,127})); -end PartialArtificalPumpT; diff --git a/BESMod/Components/Pumps/BaseClasses/PartialArtificalPump_h.mo b/BESMod/Components/Pumps/BaseClasses/PartialArtificalPump_h.mo deleted file mode 100644 index ae056729..00000000 --- a/BESMod/Components/Pumps/BaseClasses/PartialArtificalPump_h.mo +++ /dev/null @@ -1,12 +0,0 @@ -within BESMod.Components.Pumps.BaseClasses; -partial model PartialArtificalPump_h - extends PartialArtificalPump; - IBPSA.Fluid.Sources.MassFlowSource_h bou_source( - redeclare package Medium = Medium, use_m_flow_in=true, nPorts=1) - annotation (Placement(transformation(extent={{52,-10},{72,10}}))); -equation - connect(bou_source.ports[1], port_b) - annotation (Line(points={{72,0},{100,0}}, color={0,127,255})); - connect(m_flow_in, bou_source.m_flow_in) - annotation (Line(points={{0,120},{0,10},{50,10},{50,8}}, color={0,0,127})); -end PartialArtificalPump_h; diff --git a/BESMod/Components/Pumps/BaseClasses/package.mo b/BESMod/Components/Pumps/BaseClasses/package.mo deleted file mode 100644 index d036a0ea..00000000 --- a/BESMod/Components/Pumps/BaseClasses/package.mo +++ /dev/null @@ -1,3 +0,0 @@ -within BESMod.Components.Pumps; -package BaseClasses "Base Classes for pumps" -end BaseClasses; diff --git a/BESMod/Components/Pumps/BaseClasses/package.order b/BESMod/Components/Pumps/BaseClasses/package.order deleted file mode 100644 index a7dd40b9..00000000 --- a/BESMod/Components/Pumps/BaseClasses/package.order +++ /dev/null @@ -1,3 +0,0 @@ -PartialArtificalPump -PartialArtificalPump_h -PartialArtificalPumpT diff --git a/BESMod/Components/Pumps/package.mo b/BESMod/Components/Pumps/package.mo deleted file mode 100644 index a0b29e5c..00000000 --- a/BESMod/Components/Pumps/package.mo +++ /dev/null @@ -1,5 +0,0 @@ -within BESMod.Components; -package Pumps "Package for pumps" - extends Modelica.Icons.InternalPackage; - -end Pumps; diff --git a/BESMod/Components/Pumps/package.order b/BESMod/Components/Pumps/package.order deleted file mode 100644 index 30dce38f..00000000 --- a/BESMod/Components/Pumps/package.order +++ /dev/null @@ -1,4 +0,0 @@ -ArtificalPumpIsotermhal -ArtificalPump_h_in -ArtificalPumpFixedT -BaseClasses diff --git a/BESMod/Components/UFH/ActiveWallBaseDataDefinition.mo b/BESMod/Components/UFH/ActiveWallBaseDataDefinition.mo deleted file mode 100644 index e139725f..00000000 --- a/BESMod/Components/UFH/ActiveWallBaseDataDefinition.mo +++ /dev/null @@ -1,54 +0,0 @@ -within BESMod.Components.UFH; -record ActiveWallBaseDataDefinition "Base data definition for active walls" -extends Modelica.Icons.Record; - parameter Modelica.Units.SI.Temperature Temp_nom[3] - "Nominal Temperatures T_flow, T_return, T_room / air "; - parameter Modelica.Units.SI.HeatFlux q_dot_nom - "nominal Power per square meter"; - parameter Modelica.Units.SI.CoefficientOfHeatTransfer k_isolation - "k_isolation of whole FH Layer"; - parameter Modelica.Units.SI.CoefficientOfHeatTransfer k_top - "Heat transfer coefficient for layers above tubes"; - parameter Modelica.Units.SI.CoefficientOfHeatTransfer k_down - "Heat transfer coefficient for layers underneath tubes"; -parameter Real VolumeWaterPerMeter(unit="l/m") "Water volume"; - - parameter Modelica.Units.SI.Emissivity eps "Emissivity of Floor"; -parameter AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatCapacityPerArea C_ActivatedElement = 50000; -parameter Real c_top_ratio; -parameter Real PressureDropExponent; -parameter Real PressureDropCoefficient; -parameter Real diameter; - -annotation (Documentation(revisions="
    -
  • - February 14, 2014  by Ana Constantin:
    - Changed name of heat capacity per are to C_Activated Element, to be - able to use it for both heating and cooling. -
  • -
  • - September 20, 2013  by Mark Wesseling:
    - Implemented. -
  • -
-", - info="

- Overview -

-

- Base record for Active Walls (Ceiling and Floor) models. -

-

- Defines heat exchange properties and storage capacity of the active - part of the wall. -

-

- References -

-

- Base data definition for record used with EBC.HVAC.Components.ActiveWalls.Panelheating_1D_Dis -

-")); - -end ActiveWallBaseDataDefinition; diff --git a/BESMod/Components/UFH/PanelHeating.mo b/BESMod/Components/UFH/PanelHeating.mo deleted file mode 100644 index 87dbfe47..00000000 --- a/BESMod/Components/UFH/PanelHeating.mo +++ /dev/null @@ -1,336 +0,0 @@ -within BESMod.Components.UFH; -model PanelHeating - "A panel heating for e.g. floor heating with discretization" - - extends Modelica.Fluid.Interfaces.PartialTwoPort; - - replaceable parameter BESMod.Components.UFH.ActiveWallBaseDataDefinition floorHeatingType constrainedby - BESMod.Components.UFH.ActiveWallBaseDataDefinition - annotation (Dialog(group="Type"), choicesAllMatching=true); - - parameter Boolean isFloor = true "Floor or Ceiling heating" - annotation(Dialog(compact = true, descriptionLabel = true), choices( - choice = true "Floorheating", - choice = false "Ceilingheating", - radioButtons = true)); - parameter Modelica.Units.SI.Length Spacing=Modelica.Constants.pi* - floorHeatingType.k_top*floorHeatingType.diameter* - AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.logDT({ - floorHeatingType.Temp_nom[1],floorHeatingType.Temp_nom[2], - floorHeatingType.Temp_nom[3]})/(floorHeatingType.q_dot_nom*2) - "Spacing of Pipe"; - parameter Integer dis(min=1) = 5 "Number of Discreatisation Layers"; - - parameter Modelica.Units.SI.Area A "Area of floor / heating panel part"; - - parameter Modelica.Units.SI.Temperature T0= - Modelica.Units.Conversions.from_degC(20) - "Initial temperature, in degrees Celsius"; - parameter Integer calcMethod=2 "Calculation method for convective heat transfer coefficient at surface" annotation (Dialog(group="Heat convection", - descriptionLabel=true), choices( - choice=1 "EN ISO 6946 Appendix A >>Flat Surfaces<<", - choice=2 "By Bernd Glueck", - choice=3 "Custom hCon (constant)", - radioButtons=true)); - - parameter Modelica.Units.SI.CoefficientOfHeatTransfer hCon_const=2.5 - "Custom convective heat transfer coefficient" annotation (Dialog( - group="Heat convection", - descriptionLabel=true, - enable=if calcMethod == 3 then true else false)); - - final parameter Modelica.Units.SI.Emissivity eps=floorHeatingType.eps - "Emissivity"; - - final parameter Real cTopRatio(min=0,max=1)= floorHeatingType.c_top_ratio; - - final parameter - AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatCapacityPerArea cFloorHeating= - floorHeatingType.C_ActivatedElement; - - final parameter - AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatCapacityPerArea cTop= - cFloorHeating*cTopRatio; - - final parameter - AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatCapacityPerArea cDown= - cFloorHeating*(1 - cTopRatio); - - final parameter Modelica.Units.SI.Length tubeLength=A/Spacing; - - final parameter Modelica.Units.SI.Volume VWater= - Modelica.Units.Conversions.from_litre(Modelica.Constants.pi* - floorHeatingType.diameter^2*tubeLength/4) "Volume of Water"; - - // ACCORDING TO GLUECK, Bauteilaktivierung 1999 - - // According to equations 7.91 (for heat flow up) and 7.93 (for heat flow down) from page 41 - // final parameter Modelica.SIunits.Temperature T_Floor_nom= if Floor then - // (floorHeatingType.q_dot_nom/8.92)^(1/1.1) + floorHeatingType.Temp_nom[3] - // else floorHeatingType.q_dot_nom/6.7 + floorHeatingType.Temp_nom[3]; - - final parameter Modelica.Units.SI.CoefficientOfHeatTransfer kTop_nominal= - floorHeatingType.k_top; - - final parameter Modelica.Units.SI.CoefficientOfHeatTransfer kDown_nominal= - floorHeatingType.k_down; - - Modelica.Fluid.Sensors.TemperatureTwoPort TFlow(redeclare package Medium = - Medium) - annotation (Placement(transformation(extent={{-70,-40},{-50,-20}}))); - Modelica.Fluid.Sensors.TemperatureTwoPort TReturn(redeclare package Medium = - Medium) - annotation (Placement(transformation(extent={{60,-36},{80,-16}}))); - Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a ThermDown annotation ( - Placement(transformation(extent={{-10,-72},{10,-52}}), - iconTransformation(extent={{-2,-38},{18,-18}}))); - Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a thermConv annotation ( - Placement(transformation(extent={{4,48},{24,68}}), iconTransformation( - extent={{4,30},{24,50}}))); - AixLib.Utilities.Interfaces.RadPort starRad annotation (Placement(transformation(extent={{-26,50},{-6,70}}), iconTransformation(extent={{-22,28},{-2,48}}))); - PanelHeatingSegment panelHeatingSegment[dis]( - redeclare package Medium = Medium, - each final A=tubeLength*floorHeatingType.diameter*Modelica.Constants.pi/dis/ - 2, - each final eps=eps, - each final T0=T0, - each final VWater=VWater/dis, - each final kTop=kTop_nominal, - each final kDown=kDown_nominal, - each final cTop=cTop, - each final cDown=cDown, - each final isFloor=isFloor, - each final calcMethod=calcMethod, - each final hCon_const=hCon_const, - each final A_floor=A) annotation (Placement(transformation(extent={{-58,1},{-8,51}}))); - - AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.PressureDropPH pressureDrop( - redeclare package Medium = Medium, - final tubeLength=tubeLength, - final n=floorHeatingType.PressureDropExponent, - final m=floorHeatingType.PressureDropCoefficient) - annotation (Placement(transformation(extent={{8,0},{54,52}}))); -equation - - // HEAT CONNECTIONS - for i in 1:dis loop - connect(panelHeatingSegment[i].thermConvWall, ThermDown); - connect(panelHeatingSegment[i].thermConvRoom, thermConv); - connect(panelHeatingSegment[i].starRad, starRad); - end for; - - // FLOW CONNECTIONS - - //OUTER CONNECTIONS - - connect(TFlow.port_b, panelHeatingSegment[1].port_a); - connect(pressureDrop.port_a, panelHeatingSegment[dis].port_b); - - //INNER CONNECTIONS - - if dis > 1 then - for i in 1:(dis-1) loop - connect(panelHeatingSegment[i].port_b, panelHeatingSegment[i + 1].port_a); - end for; - end if; - - connect(port_a, TFlow.port_a) annotation (Line( - points={{-100,0},{-88,0},{-88,-30},{-70,-30}}, - color={0,127,255}, - smooth=Smooth.None)); - - connect(TReturn.port_b, port_b) annotation (Line( - points={{80,-26},{84,-26},{84,0},{100,0}}, - color={0,127,255}, - smooth=Smooth.None)); - connect(pressureDrop.port_b, TReturn.port_a) annotation (Line( - points={{54,26},{60,26},{60,-26}}, - color={0,127,255}, - smooth=Smooth.None)); - -annotation (Diagram(graphics, - coordinateSystem(preserveAspectRatio=false,extent={{-100, - -60},{100,60}})), Icon(coordinateSystem(preserveAspectRatio=false, - extent={{-100,-25},{100,35}}), - graphics={ - Rectangle( - extent={{-100,14},{100,-26}}, - lineColor={200,200,200}, - fillColor={150,150,150}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-100,35},{100,14}}, - lineColor={200,200,200}, - fillColor={170,255,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-84,-2},{-76,-10}}, - lineColor={200,200,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-68,-2},{-60,-10}}, - lineColor={200,200,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-52,-2},{-44,-10}}, - lineColor={200,200,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-36,-2},{-28,-10}}, - lineColor={200,200,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-20,-2},{-12,-10}}, - lineColor={200,200,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{-4,-2},{4,-10}}, - lineColor={200,200,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{12,-2},{20,-10}}, - lineColor={200,200,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{28,-2},{36,-10}}, - lineColor={200,200,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{44,-2},{52,-10}}, - lineColor={200,200,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{60,-2},{68,-10}}, - lineColor={200,200,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Ellipse( - extent={{76,-2},{84,-10}}, - lineColor={200,200,200}, - fillColor={0,128,255}, - fillPattern=FillPattern.Solid), - Line( - points={{-80,8},{-80,0}}, - color={255,0,0}, - smooth=Smooth.None, - arrow={Arrow.Filled,Arrow.None}, - thickness=1), - Line( - points={{-64,8},{-64,0}}, - color={255,0,0}, - smooth=Smooth.None, - arrow={Arrow.Filled,Arrow.None}), - Line( - points={{-48,8},{-48,0}}, - color={255,0,0}, - smooth=Smooth.None, - arrow={Arrow.Filled,Arrow.None}), - Line( - points={{-32,8},{-32,0}}, - color={255,0,0}, - smooth=Smooth.None, - arrow={Arrow.Filled,Arrow.None}), - Line( - points={{-16,8},{-16,0}}, - color={255,0,0}, - smooth=Smooth.None, - arrow={Arrow.Filled,Arrow.None}), - Line( - points={{0,8},{0,0}}, - color={255,0,0}, - smooth=Smooth.None, - arrow={Arrow.Filled,Arrow.None}), - Line( - points={{16,8},{16,0}}, - color={255,0,0}, - smooth=Smooth.None, - arrow={Arrow.Filled,Arrow.None}), - Line( - points={{32,8},{32,0}}, - color={255,0,0}, - smooth=Smooth.None, - arrow={Arrow.Filled,Arrow.None}), - Line( - points={{48,8},{48,0}}, - color={255,0,0}, - smooth=Smooth.None, - arrow={Arrow.Filled,Arrow.None}), - Line( - points={{64,8},{64,0}}, - color={255,0,0}, - smooth=Smooth.None, - arrow={Arrow.Filled,Arrow.None}), - Line( - points={{80,8},{80,0}}, - color={255,0,0}, - smooth=Smooth.None, - arrow={Arrow.Filled,Arrow.None})}), - Documentation(info="

- Overview -

-

- Model for floor heating, with one pipe running through the whole - floor. -

-

- Concept -

-

- The assumption is made that there is one pipe that runs thorugh the - whole floor. Which means that a discretisation of the floor heating - is done, the discretisation elements will be connected in series: the - flow temperature of one element is the return temperature of the - element before. -

-

- The pressure drop is calculated at the end for the whole length of - the pipe. -

-

- Reference -

-

- Source: -

-
    -
  • Bernd Glueck, Bauteilaktivierung 1999, Page 41 -
  • -
-

- Example Results -

-

- AixLib.Fluid.HeatExchangers.Examples.ActiveWalls.ActiveWalls_Test -

-", - revisions="
    -
  • - February 06, 2017  by Philipp Mehrfeld:
    - Use kTop and kDown instead of k_insulation. Naming according to - AixLib standards. -
  • -
  • - June 15, 2017  by Tobias Blacha:
    - Moved into AixLib -
  • -
  • - March 25, 2015  by Ana Constantin:
    - Uses components from MSL -
  • -
  • - November 06, 2014  by Ana Constantin:
    - Added documentation. -
  • -
-")); -end PanelHeating; diff --git a/BESMod/Components/UFH/PanelHeatingSegment.mo b/BESMod/Components/UFH/PanelHeatingSegment.mo deleted file mode 100644 index b53d19c8..00000000 --- a/BESMod/Components/UFH/PanelHeatingSegment.mo +++ /dev/null @@ -1,235 +0,0 @@ -within BESMod.Components.UFH; -model PanelHeatingSegment "One segment of the discretized panel heating" - -extends Modelica.Fluid.Interfaces.PartialTwoPort; - -parameter Boolean isFloor = true; - - parameter Modelica.Units.SI.Area A "Area of Floor part"; - - parameter Modelica.Units.SI.Emissivity eps=0.95 "Emissivity"; - - parameter Modelica.Units.SI.Temperature T0= - Modelica.Units.Conversions.from_degC(20) - "Initial temperature, in degrees Celsius"; - - parameter Modelica.Units.SI.Volume VWater "Volume of Water in m^3"; - - parameter Modelica.Units.SI.CoefficientOfHeatTransfer kTop; - parameter Modelica.Units.SI.CoefficientOfHeatTransfer kDown; - -parameter - AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatCapacityPerArea cTop; -parameter - AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatCapacityPerArea cDown; - - parameter Integer calcMethod=2 "Calculation method for convective heat transfer coefficient at surface" - annotation (Dialog(group="Heat convection", - descriptionLabel=true), choices( - choice=1 "EN ISO 6946 Appendix A >>Flat Surfaces<<", - choice=2 "By Bernd Glueck", - choice=3 "Custom hCon (constant)", - radioButtons=true)); - - parameter Modelica.Units.SI.CoefficientOfHeatTransfer hCon_const=2.5 - "Constant heat transfer coefficient" annotation (Dialog( - group="Heat convection", - descriptionLabel=true, - enable=if calcMethod == 3 then true else false)); - - Modelica.Fluid.Vessels.ClosedVolume vol( - redeclare package Medium = Medium, - energyDynamics=system.energyDynamics, - use_HeatTransfer=true, - T_start=T0, - redeclare model HeatTransfer = - Modelica.Fluid.Vessels.BaseClasses.HeatTransfer.IdealHeatTransfer, - use_portsData=false, - V=VWater, - nPorts=2) annotation (Placement(transformation(extent={{-14,-26},{8,-4}}))); - - Modelica.Fluid.Sensors.TemperatureTwoPort TFlow(redeclare package Medium = - Medium) - annotation (Placement(transformation(extent={{-70,-36},{-50,-16}}))); - Modelica.Fluid.Sensors.TemperatureTwoPort TReturn(redeclare package Medium = - Medium) - annotation (Placement(transformation(extent={{50,-36},{70,-16}}))); - Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a thermConvWall - annotation (Placement(transformation(extent={{-22,-110},{-2,-90}}))); - AixLib.Utilities.HeatTransfer.HeatToRad twoStar_RadEx(A=A_floor, eps=eps) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-30,74}))); - AixLib.Utilities.HeatTransfer.HeatConvInside HeatConv( - final A=A_floor, - final calcMethod=calcMethod, - final hCon_const=hCon_const, - surfaceOrientation=if isFloor then 2 else 1) annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={1.77636e-015,74}))); - Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a thermConvRoom - annotation (Placement(transformation(extent={{-12,90},{8,110}}))); - AixLib.Utilities.Interfaces.RadPort starRad annotation (Placement(transformation(extent={{-38,92},{-18,112}}))); - AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatConductionSegment panel_Segment1( - kA=kTop*A, - mc_p=cTop*A, - T0=T0) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-16,30}))); - AixLib.Fluid.HeatExchangers.ActiveWalls.BaseClasses.HeatConductionSegment panel_Segment2( - T0=T0, - kA=kDown*A, - mc_p=cDown*A) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={-12,-56}))); - parameter Modelica.Units.SI.Area A_floor=A "Area of surface of wall / Floor"; -equation - - connect(port_a, TFlow.port_a) annotation (Line( - points={{-100,0},{-88,0},{-88,-26},{-70,-26}}, - color={0,127,255}, - smooth=Smooth.None)); - - connect(TFlow.port_b, vol.ports[1]) annotation (Line( - points={{-50,-26},{-4.1,-26}}, - color={0,127,255}, - smooth=Smooth.None)); - connect(vol.ports[2], TReturn.port_a) annotation (Line( - points={{-1.9,-26},{50,-26}}, - color={0,127,255}, - smooth=Smooth.None)); - connect(TReturn.port_b, port_b) annotation (Line( - points={{70,-26},{84,-26},{84,0},{100,0}}, - color={0,127,255}, - smooth=Smooth.None)); - connect(HeatConv.port_a, thermConvRoom) annotation (Line( - points={{3.60822e-015,84},{3.60822e-015,92.5},{-2,92.5},{-2,100}}, - color={191,0,0}, - smooth=Smooth.None)); - connect(twoStar_RadEx.radPort, starRad) annotation (Line( - points={{-30,84.1},{-30,102},{-28,102}}, - color={95,95,95}, - pattern=LinePattern.None, - smooth=Smooth.None)); - connect(thermConvWall, thermConvWall) annotation (Line( - points={{-12,-100},{-12,-100}}, - color={191,0,0}, - smooth=Smooth.None)); - connect(panel_Segment1.port_b, twoStar_RadEx.convPort) annotation (Line( - points={{-16.9,39.1},{-16.9,51.55},{-30,51.55},{-30,64}}, - color={191,0,0}, - smooth=Smooth.None)); - connect(panel_Segment1.port_b, HeatConv.port_b) annotation (Line( - points={{-16.9,39.1},{-16.9,51.55},{0,51.55},{0,64}}, - color={191,0,0}, - smooth=Smooth.None)); - connect(panel_Segment1.port_a, vol.heatPort) annotation (Line( - points={{-16.9,20.9},{-16.9,2},{-14,2},{-14,-15}}, - color={191,0,0}, - smooth=Smooth.None)); - connect(panel_Segment2.port_b, thermConvWall) annotation (Line( - points={{-11.1,-65.1},{-11.1,-81.55},{-12,-81.55},{-12,-100}}, - color={191,0,0}, - smooth=Smooth.None)); - connect(panel_Segment2.port_a, vol.heatPort) annotation (Line( - points={{-11.1,-46.9},{-11.1,-31.45},{-14,-31.45},{-14,-15}}, - color={191,0,0}, - smooth=Smooth.None)); - annotation (Diagram(graphics, - coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Icon(graphics={ - Rectangle( - extent={{-100,20},{100,-22}}, - lineColor={0,0,0}, - fillColor={0,0,255}, - fillPattern=FillPattern.HorizontalCylinder), - Rectangle( - extent={{-100,66},{100,40}}, - lineColor={166,166,166}, - pattern=LinePattern.None, - fillColor={190,190,190}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{100,100},{-100,66}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={156,156,156}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{100,40},{-100,20}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={156,156,156}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{100,-22},{-100,-56}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={156,156,156}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-100,-56},{100,-82}}, - lineColor={166,166,166}, - pattern=LinePattern.None, - fillColor={190,190,190}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{100,-82},{-100,-102}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={156,156,156}, - fillPattern=FillPattern.Solid), - Line( - points={{-22,26},{-22,82}}, - color={255,0,0}, - thickness=0.5, - arrow={Arrow.None,Arrow.Filled}), - Text( - extent={{-20,62},{62,40}}, - lineColor={255,0,0}, - textString="Q_flow"), - Text( - extent={{-20,-46},{62,-68}}, - lineColor={255,0,0}, - textString="Q_flow"), - Line( - points={{0,-28},{0,28}}, - color={255,0,0}, - thickness=0.5, - arrow={Arrow.None,Arrow.Filled}, - origin={-22,-54}, - rotation=180)}), - Documentation(revisions="
    -
  • - February 06, 2017  by Philipp Mehrfeld:
    - Naming according to IBPSA standards. -
  • -
  • - June 15, 2017  by Tobias Blacha:
    - Moved into IBPSA -
  • -
  • - March 25, 2015  by Ana Constantin:
    - Uses components from MSL -
  • -
  • - November 06, 2014  by Ana Constantin:
    - Added documentation. -
  • -
-", - info="

- Overview -

-

- Model for a panel heating element, consisting of a water volume, heat - conduction upwards and downwards through the wall layers, convection - and radiation exchange at the room facing side. -

-")); -end PanelHeatingSegment; diff --git a/BESMod/Components/UFH/package.mo b/BESMod/Components/UFH/package.mo deleted file mode 100644 index adb9d2a0..00000000 --- a/BESMod/Components/UFH/package.mo +++ /dev/null @@ -1,9 +0,0 @@ -within BESMod.Components; -package UFH - extends Modelica.Icons.InternalPackage; - - -annotation (Documentation(info=" -


Based on the UFH heating model in the AixLib with smaller error fixes. As soon as the new IBPSA-based UFH model is merged into the AixLib development, this package will be fully obsolete.

-")); -end UFH; diff --git a/BESMod/Components/UFH/package.order b/BESMod/Components/UFH/package.order deleted file mode 100644 index d720493e..00000000 --- a/BESMod/Components/UFH/package.order +++ /dev/null @@ -1,3 +0,0 @@ -PanelHeating -PanelHeatingSegment -ActiveWallBaseDataDefinition diff --git a/BESMod/Components/package.mo b/BESMod/Components/package.mo deleted file mode 100644 index 441224bd..00000000 --- a/BESMod/Components/package.mo +++ /dev/null @@ -1,23 +0,0 @@ -within BESMod; -package Components "Package for all additional compontents developted for this project" - extends Modelica.Icons.Package; - -annotation (Documentation(info=" -

Components used in building energy systems which are not given in an existing model library to the modeling depth required by the simulation.

-

Most of these components shall not stay in this library but rather

-
    -
  • be integrated into the corresponding component library. For instance, we modified the heating rod model in the IBPSA. This will be added to the IBPSA in the near future
  • -
  • be replaced by better fitting models. For instance, the ArtificalPumps were used starting this library but are replaced one after another be the movers from IBPSA
  • -
  • be moved to a matching project library. For instance, we simulated an UFH system in one project. Moving the UFH-subsystem and these models into an own project library is more straightforward.
  • -
-


This is true not only for this package but all packages named "Components".

-"), Icon(graphics={ - Polygon(points={{-72,34},{66,-36},{66,34},{0,-2},{-72,-34},{-72,34}}, - lineColor={0,0,0}), - Line(points={{0,50},{0,-2}}), - Rectangle( - extent={{-20,58},{20,50}}, - lineColor={0,0,0}, - fillColor={0,0,0}, - fillPattern=FillPattern.Solid)})); -end Components; diff --git a/BESMod/Components/package.order b/BESMod/Components/package.order deleted file mode 100644 index a5b41f99..00000000 --- a/BESMod/Components/package.order +++ /dev/null @@ -1,3 +0,0 @@ -Pumps -UFH -HeatingRodWithSecurityControl diff --git a/BESMod/Systems/Demand/DHW/DHW.mo b/BESMod/Systems/Demand/DHW/DHW.mo index d5ff5380..f33fad85 100644 --- a/BESMod/Systems/Demand/DHW/DHW.mo +++ b/BESMod/Systems/Demand/DHW/DHW.mo @@ -9,11 +9,11 @@ model DHW "Standard DHW subsystem" pumpData annotation (choicesAllMatching=true, Placement(transformation(extent={{-96,-96},{-84,-84}}))); - Components.Pumps.ArtificalPumpFixedT artificalPumpFixedT( + Hydraulical.Components.Pumps.ArtificalPumpFixedT artificalPumpFixedT( redeclare package Medium = Medium, p=p_start, - T_fixed=parameters.TDHWCold_nominal) if not use_pressure - annotation (Placement(transformation( + T_fixed=parameters.TDHWCold_nominal) if not use_pressure annotation ( + Placement(transformation( extent={{-14,-14},{14,14}}, rotation=270, origin={-60,-8}))); diff --git a/BESMod/package.order b/BESMod/package.order index 06f1b7a6..962924e4 100644 --- a/BESMod/package.order +++ b/BESMod/package.order @@ -1,5 +1,4 @@ UsersGuide -Components Systems Utilities Examples diff --git a/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml b/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml index c3967e84..d6dd85d1 100644 --- a/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml +++ b/bin/templates/03_ci_templates/02_UnitTests/check_model.gitlab-ci.yml @@ -1 +1 @@ -stages: - check - create_whitelist .check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cat dependencies.json - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: - external_pull_requests retry: max: 2 when: runner_system_failure except: variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ Check_BESMod_Examples: variables: lib_package: Examples extends: .check_model_job Check_BESMod_Utilities: variables: lib_package: Utilities extends: .check_model_job Check_BESMod_Systems: variables: lib_package: Systems extends: .check_model_job Check_BESMod_Tutorial: variables: lib_package: Tutorial extends: .check_model_job Check_BESMod_Components: variables: lib_package: Components extends: .check_model_job .check_changed_models_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - git diff --raw --diff-filter=AMT HEAD^1 > bin/Configfiles/ci_changed_model_list.txt - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 -CM artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day except: refs: - external_pull_requests variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ retry: max: 2 when: runner_system_failure Check_BESMod_Examples_changed_models: variables: lib_package: Examples only: changes: - BESMod/Examples/**/* extends: .check_changed_models_job Check_BESMod_Utilities_changed_models: variables: lib_package: Utilities only: changes: - BESMod/Utilities/**/* extends: .check_changed_models_job Check_BESMod_Tutorial_changed_models: variables: lib_package: Tutorial only: changes: - BESMod/Tutorial/**/* extends: .check_changed_models_job Check_BESMod_Systems_changed_models: variables: lib_package: Systems only: changes: - BESMod/Systems/**/* extends: .check_changed_models_job Check_BESMod_Components_changed_models: variables: lib_package: Components only: changes: - BESMod/Components/**/* extends: .check_changed_models_job .CI_check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 --filterwhitelist artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_check/ except: refs: - external_pull_requests retry: max: 2 when: runner_system_failure CI_Check_BESMod_Examples: variables: lib_package: Examples extends: .CI_check_model_job CI_Check_BESMod_Utilities: variables: lib_package: Utilities extends: .CI_check_model_job CI_Check_BESMod_Tutorial: variables: lib_package: Tutorial extends: .CI_check_model_job CI_Check_BESMod_Systems: variables: lib_package: Systems extends: .CI_check_model_job CI_Check_BESMod_Components: variables: lib_package: Components extends: .CI_check_model_job whitelist_job: stage: create_whitelist before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - eval $(ssh-agent -s) - mkdir -p ~/.ssh - ssh-keyscan github.com >> ~/.ssh/known_hosts - ssh-agent -a /tmp/ssh_agent.sock > /dev/null - echo "${GITHUB_PRIVATE_KEY}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - git config --global user.name "${GITLAB_USER_NAME}" - git config --global user.email "${GITLAB_USER_EMAIL}" script: - mkdir whitelist && cd whitelist - git clone --single-branch --branch $CI_COMMIT_REF_NAME git@github.com:${Github_Repository}.git - cd ${CI_PROJECT_NAME} - echo "FAIL" > bin/Configfiles/exit.sh - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py -DS 2022 --repo-dir BESMod --library BESMod --wh-library BESMod --whitelist after_script: - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cd whitelist && cd ${CI_PROJECT_NAME} - if cat bin/Configfiles/exit.sh | grep "FAIL"; then message="Automatic push of CI - Update model_whitelist. Please pull the new files before push again. [skip ci]" ; git add bin/ci_whitelist/model_whitelist.txt ; git commit -m "$message" ; git push git@github.com:${Github_Repository}.git ; GREEN='\033[0;32m' ; NC='\033[0m' ; echo -e "$GREEN New html whitelist files were pushed to this branch.$NC" ; exit 0; else echo 'successful' > bin/Configfiles/exit.sh ; echo -e "$GREEN Whitelist is already up to date. Please delete the version number in file bin/ci_whitelist/model_whitelist.txt, if you want to recreate the whitelist.$NC" ; exit 0 ; fi artifacts: paths: - whitelist/${CI_PROJECT_NAME}/bin/ci_whitelist/model_whitelist.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ except: refs: - external_pull_requests \ No newline at end of file +stages: - check - create_whitelist .check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cat dependencies.json - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: - external_pull_requests retry: max: 2 when: runner_system_failure except: variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ Check_BESMod_Examples: variables: lib_package: Examples extends: .check_model_job Check_BESMod_Utilities: variables: lib_package: Utilities extends: .check_model_job Check_BESMod_Systems: variables: lib_package: Systems extends: .check_model_job Check_BESMod_Tutorial: variables: lib_package: Tutorial extends: .check_model_job .check_changed_models_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - git diff --raw --diff-filter=AMT HEAD^1 > bin/Configfiles/ci_changed_model_list.txt - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 -CM artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day except: refs: - external_pull_requests variables: - $CI_COMMIT_MESSAGE =~ /ci_update_ref/ - $CI_COMMIT_MESSAGE =~ /ci_dif_ref/ - $CI_COMMIT_MESSAGE =~ /ci_correct_html/ - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ - $CI_COMMIT_MESSAGE =~ /Update WhiteList_CheckModel.txt and HTML_IBPSA_WhiteList.txt/ - $CI_COMMIT_MESSAGE =~ /Automatic push of CI with new regression reference files. Please pull the new files before push again./ - $CI_COMMIT_MESSAGE =~ /New reference files were pushed to this branch. The job was successfully and the newly added files are tested in another commit./ - $CI_COMMIT_MESSAGE =~ /ci_show_ref/ - $CI_COMMIT_MESSAGE =~ /ci_regression_test/ - $CI_COMMIT_MESSAGE =~ /ci_check/ - $CI_COMMIT_MESSAGE =~ /ci_simulate/ - $CI_COMMIT_MESSAGE =~ /ci_create_html_whitelist/ - $CI_COMMIT_MESSAGE =~ /ci_html/ - $CI_COMMIT_MESSAGE =~ /ci_setting/ retry: max: 2 when: runner_system_failure Check_BESMod_Examples_changed_models: variables: lib_package: Examples only: changes: - BESMod/Examples/**/* extends: .check_changed_models_job Check_BESMod_Utilities_changed_models: variables: lib_package: Utilities only: changes: - BESMod/Utilities/**/* extends: .check_changed_models_job Check_BESMod_Tutorial_changed_models: variables: lib_package: Tutorial only: changes: - BESMod/Tutorial/**/* extends: .check_changed_models_job Check_BESMod_Systems_changed_models: variables: lib_package: Systems only: changes: - BESMod/Systems/**/* extends: .check_changed_models_job .CI_check_model_job: stage: check before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - python install_dependencies.py full script: - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py --single-package "${lib_package}" --library BESMod -DS 2022 --filterwhitelist artifacts: when: on_failure paths: - BESMod/BESMod.${lib_package}-log.txt - BESMod/BESMod.${lib_package}-errorlog.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_check/ except: refs: - external_pull_requests retry: max: 2 when: runner_system_failure CI_Check_BESMod_Examples: variables: lib_package: Examples extends: .CI_check_model_job CI_Check_BESMod_Utilities: variables: lib_package: Utilities extends: .CI_check_model_job CI_Check_BESMod_Tutorial: variables: lib_package: Tutorial extends: .CI_check_model_job CI_Check_BESMod_Systems: variables: lib_package: Systems extends: .CI_check_model_job whitelist_job: stage: create_whitelist before_script: - Xvfb :77 -extension RANDR -extension GLX & export DISPLAY=:77.0 && - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' - eval $(ssh-agent -s) - mkdir -p ~/.ssh - ssh-keyscan github.com >> ~/.ssh/known_hosts - ssh-agent -a /tmp/ssh_agent.sock > /dev/null - echo "${GITHUB_PRIVATE_KEY}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - git config --global user.name "${GITLAB_USER_NAME}" - git config --global user.email "${GITLAB_USER_EMAIL}" script: - mkdir whitelist && cd whitelist - git clone --single-branch --branch $CI_COMMIT_REF_NAME git@github.com:${Github_Repository}.git - cd ${CI_PROJECT_NAME} - echo "FAIL" > bin/Configfiles/exit.sh - python bin/CITests/02_UnitTests/CheckPackages/validatetest.py -DS 2022 --repo-dir BESMod --library BESMod --wh-library BESMod --whitelist after_script: - export PIP_CACHE_DIR="/opt/cache/pip" - source activate myenv - export PYTHONIOENCODING=utf-8 # just in case - cd whitelist && cd ${CI_PROJECT_NAME} - if cat bin/Configfiles/exit.sh | grep "FAIL"; then message="Automatic push of CI - Update model_whitelist. Please pull the new files before push again. [skip ci]" ; git add bin/ci_whitelist/model_whitelist.txt ; git commit -m "$message" ; git push git@github.com:${Github_Repository}.git ; GREEN='\033[0;32m' ; NC='\033[0m' ; echo -e "$GREEN New html whitelist files were pushed to this branch.$NC" ; exit 0; else echo 'successful' > bin/Configfiles/exit.sh ; echo -e "$GREEN Whitelist is already up to date. Please delete the version number in file bin/ci_whitelist/model_whitelist.txt, if you want to recreate the whitelist.$NC" ; exit 0 ; fi artifacts: paths: - whitelist/${CI_PROJECT_NAME}/bin/ci_whitelist/model_whitelist.txt expire_in: 7 day only: variables: - $CI_COMMIT_MESSAGE =~ /ci_create_whitelist/ except: refs: - external_pull_requests \ No newline at end of file From 1499904f3fa3673125b1b60704f1fed28093e8ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Thu, 1 Sep 2022 18:58:20 +0200 Subject: [PATCH 040/131] Fix connectors, parameters etc. to avoid errors within HOM example (#6) --- BESMod/Examples/UseCaseHOM/BES_HOM.mo | 14 ++- BESMod/Examples/UseCaseHOM/HOMSystem.mo | 4 +- .../Demand/Building/AixLibHighOrder.mo | 20 +++- .../BaseClasses/PartialAixLibHighOrder.mo | 3 + .../Building/Components/AixLibHighOrderOFD.mo | 98 ++++++++++++++----- .../UserProfiles/AixLibHighOrderProfiles.mo | 30 ++++-- 6 files changed, 130 insertions(+), 39 deletions(-) diff --git a/BESMod/Examples/UseCaseHOM/BES_HOM.mo b/BESMod/Examples/UseCaseHOM/BES_HOM.mo index 4c5883da..3c3a17f8 100644 --- a/BESMod/Examples/UseCaseHOM/BES_HOM.mo +++ b/BESMod/Examples/UseCaseHOM/BES_HOM.mo @@ -4,10 +4,18 @@ model BES_HOM redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare BESMod.Systems.Demand.Building.AixLibHighOrder building( useConstVentRate=false, - Latitude=weaDat.lat, - Longitude=weaDat.lon, + Latitude=Modelica.Units.Conversions.to_deg(weaDat.lat), + Longitude=Modelica.Units.Conversions.to_deg(weaDat.lon), TimeCorrection=0, - DiffWeatherDataTime=weaDat.timZon, + DiffWeatherDataTime=Modelica.Units.Conversions.to_hour(weaDat.timZon), + redeclare PCMgoesHIL.DataBase.WallsAndWindows.EnEV2009Heavy_AddIsulation + wallTypes, + redeclare model WindowModel = + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.WindowSimple, + redeclare AixLib.DataBase.WindowsDoors.Simple.WindowSimple_EnEV2009 + Type_Win, + redeclare model CorrSolarGainWin = + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.CorGSimple, redeclare BESMod.Systems.Demand.Building.Components.AixLibHighOrderOFD aixLiBHighOrderOFD), redeclare BESMod.Systems.Control.NoControl control, diff --git a/BESMod/Examples/UseCaseHOM/HOMSystem.mo b/BESMod/Examples/UseCaseHOM/HOMSystem.mo index 0efc9084..de8297fa 100644 --- a/BESMod/Examples/UseCaseHOM/HOMSystem.mo +++ b/BESMod/Examples/UseCaseHOM/HOMSystem.mo @@ -2,11 +2,11 @@ within BESMod.Examples.UseCaseHOM; record HOMSystem extends Systems.RecordsCollection.SystemParametersBaseDataDefinition( use_elecHeating=false, - nZones=11, + nZones=10, filNamWea=Modelica.Utilities.Files.loadResource( "modelica://BESMod/Resources/WeatherData/TRY2015_507931060546_Jahr_City_Aachen_Normal.mos"), use_ventilation=false, - QBui_flow_nominal={1124.867,569.6307,53.59064,679.86365,809.8547,786.87427,552.7661,0,666.1303,635.3303,0}, + QBui_flow_nominal={1124.867,569.6307,53.59064,679.86365,809.8547,786.87427,552.7661,0,666.1303,635.3303}, THydSup_nominal=fill(328.15,nZones), TOda_nominal=265.35); diff --git a/BESMod/Systems/Demand/Building/AixLibHighOrder.mo b/BESMod/Systems/Demand/Building/AixLibHighOrder.mo index 7a42f0fb..c9fdc0ea 100644 --- a/BESMod/Systems/Demand/Building/AixLibHighOrder.mo +++ b/BESMod/Systems/Demand/Building/AixLibHighOrder.mo @@ -46,12 +46,14 @@ model AixLibHighOrder "High order building model from AixLib library" AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow (windowarea=2) constrainedby - AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow + annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); replaceable parameter AixLib.DataBase.WindowsDoors.Simple.OWBaseDataDefinition_Simple Type_Win "Window parametrization" annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); replaceable model CorrSolarGainWin = AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG constrainedby - AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG "Correction model for solar irradiance as transmitted radiation" annotation (choicesAllMatching=true, Dialog(tab="Outer walls", group="Windows", enable = withWindow and outside)); + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG + "Correction model for solar irradiance as transmitted radiation" annotation (choicesAllMatching=true, Dialog(tab="Outer walls", group="Windows", enable = withWindow and outside)); parameter Boolean use_sunblind=false "Will sunblind become active automatically?" annotation (Dialog(tab="Outer walls", group="Sunblind")); parameter Modelica.Units.SI.CoefficientOfHeatTransfer UValOutDoors=2.5 @@ -120,6 +122,8 @@ model AixLibHighOrder "High order building model from AixLib library" origin={-52,-60}))); + Utilities.Electrical.ZeroLoad zeroLoad + annotation (Placement(transformation(extent={{24,-108},{44,-88}}))); equation connect(weaBus.TDryBul, tempOutside.T) annotation (Line( points={{-47,98},{-47,58},{-18,58},{-18,52.8}}, @@ -228,6 +232,18 @@ equation horizontalAlignment=TextAlignment.Left)); connect(constVentRate.y, aixLiBHighOrderOFD.AirExchangePort) annotation (Line( points={{-53.5,-1},{-50,-1},{-50,10.9},{-23.8,10.9}}, color={0,0,127})); + connect(aixLiBHighOrderOFD.TZoneMea, buiMeaBus.TZoneMea) annotation (Line( + points={{-23.2,-18.5},{-44,-18.5},{-44,-10},{-72,-10},{-72,90},{0,90},{ + 0,99}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( + Line( + points={{44,-98},{56,-98},{56,-82},{70,-82},{70,-96}}, + color={0,0,0}, + thickness=1)); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); end AixLibHighOrder; diff --git a/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo b/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo index 6dcaeb45..55e1d455 100644 --- a/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo +++ b/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo @@ -49,6 +49,9 @@ partial model PartialAixLibHighOrder annotation (Placement(transformation(extent={{-126,42},{-86,82}}))); Modelica.Blocks.Interfaces.RealInput AirExchangePort[nZones] annotation (Placement(transformation(extent={{-126,14},{-86,54}}))); + Modelica.Blocks.Interfaces.RealOutput TZoneMea[nZones] annotation (Placement( + transformation(extent={{-86,-76},{-132,-30}}), iconTransformation( + extent={{-84,-70},{-124,-30}}))); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); end PartialAixLibHighOrder; diff --git a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo index a3db0ee8..1684ae1e 100644 --- a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo +++ b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo @@ -1,7 +1,10 @@ within BESMod.Systems.Demand.Building.Components; model AixLibHighOrderOFD "High order OFD" extends Building.BaseClasses.PartialAixLibHighOrder( - final nZones=11); + final nZones=nZonesHeated); + + parameter Integer nZonesHeated = 10 "Heated rooms of the building"; + parameter Integer nZonesNonHeated = 1 "Non heated rooms of the building"; // Dynamics parameter Modelica.Fluid.Types.Dynamics energyDynamicsWalls=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial @@ -48,7 +51,7 @@ model AixLibHighOrderOFD "High order OFD" final parameter Modelica.Units.SI.Area ABui = sum(AZone) "Total area of all zones"; final parameter Modelica.Units.SI.Length hBui = hZone[1] + hZone[6] + hZone[11] "Total hight of building"; final parameter Modelica.Units.SI.Area ARoof = sum(ARoofZone) "Total area of roof"; - final parameter Modelica.Units.SI.Area AZone[nZones]= + final parameter Modelica.Units.SI.Area AZone[nZonesHeated+nZonesNonHeated]= {wholeHouseBuildingEnvelope.groundFloor_Building.Livingroom.room_length * wholeHouseBuildingEnvelope.groundFloor_Building.Livingroom.room_width, wholeHouseBuildingEnvelope.groundFloor_Building.Hobby.room_length * @@ -71,7 +74,7 @@ model AixLibHighOrderOFD "High order OFD" wholeHouseBuildingEnvelope.upperFloor_Building.Children2.room_width_long, wholeHouseBuildingEnvelope.attic_2Ro_5Rooms.length* wholeHouseBuildingEnvelope.attic_2Ro_5Rooms.width}; - final parameter Modelica.Units.SI.Length hZone[nZones]= + final parameter Modelica.Units.SI.Length hZone[nZonesHeated+nZonesNonHeated]= {wholeHouseBuildingEnvelope.groundFloor_Building.Livingroom.room_height, wholeHouseBuildingEnvelope.groundFloor_Building.Hobby.room_height, wholeHouseBuildingEnvelope.groundFloor_Building.Corridor.room_height, @@ -83,7 +86,7 @@ model AixLibHighOrderOFD "High order OFD" wholeHouseBuildingEnvelope.upperFloor_Building.Bath.room_height_long, wholeHouseBuildingEnvelope.upperFloor_Building.Children2.room_height_long, wholeHouseBuildingEnvelope.attic_2Ro_5Rooms.room_V/AZone[11]}; - final parameter Modelica.Units.SI.Area ARoofZone[nZones]= + final parameter Modelica.Units.SI.Area ARoofZone[nZonesHeated+nZonesNonHeated]= {0,0,0,0,0, wholeHouseBuildingEnvelope.upperFloor_Building.Bedroom.roof_width* wholeHouseBuildingEnvelope.upperFloor_Building.Bedroom.room_length, @@ -114,50 +117,93 @@ model AixLibHighOrderOFD "High order OFD" n50=n50, energyDynamics=energyDynamics, redeclare package Medium = MediumZone, - UValOutDoors=UValOutDoors) - annotation (Placement(transformation(extent={{-46,-40},{48,72}}))); + UValOutDoors=UValOutDoors, + useVentAirPort=true) + annotation (Placement(transformation(extent={{-44,-40},{50,72}}))); + AixLib.Utilities.Interfaces.Adaptors.ConvRadToCombPort convRadToCombPort + annotation (Placement(transformation(extent={{-46,-48},{-26,-64}}))); + Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow InternalGains(Q_flow=0) + annotation (Placement(transformation( + extent={{7,-7},{-7,7}}, + rotation=0, + origin={-9,-51}))); + Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow InternalGains1(Q_flow=0) + annotation (Placement(transformation( + extent={{7,-7},{-7,7}}, + rotation=0, + origin={-9,-61}))); + AixLib.Fluid.Sources.Boundary_pT bou(redeclare package Medium = MediumZone, nPorts=2) + annotation (Placement(transformation(extent={{28,-64},{40,-52}}))); equation + // Romm Temperatures + + TZoneMea[1]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.groundFloor_Building.Livingroom.airload.heatPort.T); + TZoneMea[2]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.groundFloor_Building.Hobby.airload.heatPort.T); + TZoneMea[3]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.groundFloor_Building.Corridor.airload.heatPort.T); + TZoneMea[4]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.groundFloor_Building.WC_Storage.airload.heatPort.T); + TZoneMea[5]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.groundFloor_Building.Kitchen.airload.heatPort.T); + TZoneMea[6]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.upperFloor_Building.Bedroom.airload.heatPort.T); + TZoneMea[7]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.upperFloor_Building.Children1.airload.heatPort.T); + TZoneMea[8]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.upperFloor_Building.Corridor.airload.heatPort.T); + TZoneMea[9]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.upperFloor_Building.Bath.airload.heatPort.T); + TZoneMea[10]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.upperFloor_Building.Children2.airload.heatPort.T); + + connect(wholeHouseBuildingEnvelope.groPlateUp, wholeHouseBuildingEnvelope.groFloDown) - annotation (Line(points={{-46,-28.8},{-54,-28.8},{-54,-15.36},{-46,-15.36}}, + annotation (Line(points={{-44,-28.8},{-54,-28.8},{-54,-15.36},{-44,-15.36}}, color={191,0,0})); connect(wholeHouseBuildingEnvelope.groFloUp, wholeHouseBuildingEnvelope.uppFloDown) - annotation (Line(points={{-46,16},{-54,16},{-54,29.44},{-46,29.44}}, color={ + annotation (Line(points={{-44,16},{-54,16},{-54,29.44},{-44,29.44}}, color={ 191,0,0})); - connect(wholeHouseBuildingEnvelope.heatingToRooms, heatingToRooms1) - annotation (Line(points={{-46,0.32},{-98,0}}, color={191,0,0})); - connect(wholeHouseBuildingEnvelope.AirExchangePort, AirExchangePort) - annotation (Line(points={{-50.7,44},{-64,44},{-64,34},{-106,34}}, color={0,0, - 127})); connect(wholeHouseBuildingEnvelope.WindSpeedPort, WindSpeedPort) annotation ( - Line(points={{-50.7,55.2},{-72,55.2},{-72,62},{-106,62}}, color={0,0,127})); + Line(points={{-48.7,55.2},{-72,55.2},{-72,62},{-106,62}}, color={0,0,127})); connect(wholeHouseBuildingEnvelope.thermOutside, thermOutside) annotation ( - Line(points={{-46,70.88},{-60,70.88},{-60,90},{-98,90}}, color={191,0,0})); + Line(points={{-44,70.88},{-60,70.88},{-60,90},{-98,90}}, color={191,0,0})); - connect(wholeHouseBuildingEnvelope.West, West) annotation (Line(points={{50.82, + connect(wholeHouseBuildingEnvelope.West, West) annotation (Line(points={{52.82, -5.28},{76,-5.28},{76,-38},{108,-38}}, color={255,128,0})); - connect(wholeHouseBuildingEnvelope.South, South) annotation (Line(points={{50.82, + connect(wholeHouseBuildingEnvelope.South, South) annotation (Line(points={{52.82, 8.16},{86,8.16},{86,-12},{108,-12}}, color={255,128,0})); - connect(wholeHouseBuildingEnvelope.East, East) annotation (Line(points={{50.82, + connect(wholeHouseBuildingEnvelope.East, East) annotation (Line(points={{52.82, 22.72},{80,22.72},{80,14},{108,14}}, color={255,128,0})); - connect(wholeHouseBuildingEnvelope.North, North) annotation (Line(points={{50.82, + connect(wholeHouseBuildingEnvelope.North, North) annotation (Line(points={{52.82, 37.28},{78,37.28},{78,40},{108,40}}, color={255,128,0})); connect(wholeHouseBuildingEnvelope.SolarRadiationPort_RoofS, - SolarRadiationPort_RoofS) annotation (Line(points={{50.82,51.84},{76,51.84}, + SolarRadiationPort_RoofS) annotation (Line(points={{52.82,51.84},{76,51.84}, {76,64},{108,64}}, color={255,128,0})); connect(wholeHouseBuildingEnvelope.SolarRadiationPort_RoofN, - SolarRadiationPort_RoofN) annotation (Line(points={{50.82,66.4},{64,66.4},{64, + SolarRadiationPort_RoofN) annotation (Line(points={{52.82,66.4},{64,66.4},{64, 90},{108,90}}, color={255,128,0})); - connect(wholeHouseBuildingEnvelope.portVent_out, portVent_out) annotation ( - Line(points={{49.41,-31.6},{56,-31.6},{56,-92},{100,-92}}, color={0,127,255})); - connect(wholeHouseBuildingEnvelope.portVent_in, portVent_in) annotation (Line( - points={{48.47,-19.28},{68,-19.28},{68,-66},{100,-66}}, color={0,127,255})); + for i in 1:size(wholeHouseBuildingEnvelope.groundTemp, 1) loop connect(groundTemp, wholeHouseBuildingEnvelope.groundTemp[i]) annotation ( - Line(points={{0,-100},{0,-44},{1,-44},{1,-40}}, color={191,0,0})); + Line(points={{0,-100},{0,-44},{3,-44},{3,-40}}, color={191,0,0})); end for; + for i in 1:nZonesHeated loop + connect(heatingToRooms1[i], wholeHouseBuildingEnvelope.heatingToRooms[i]) annotation (Line(points={{-98,0},{-52,0},{-52,0.32},{-44,0.32}}, color={191,0,0})); + connect(wholeHouseBuildingEnvelope.portVent_out[i], portVent_out[i]) annotation ( + Line(points={{51.41,-31.6},{56,-31.6},{56,-92},{100,-92}}, color={0,127,255})); + connect(wholeHouseBuildingEnvelope.portVent_in[i], portVent_in[i]) annotation (Line( + points={{50.47,-19.28},{68,-19.28},{68,-66},{100,-66}}, color={0,127,255})); + connect(wholeHouseBuildingEnvelope.AirExchangePort[i], AirExchangePort[i]) + annotation (Line(points={{-48.7,44},{-80,44},{-80,34},{-106,34}}, color={0,0, + 127})); + end for; + + connect(wholeHouseBuildingEnvelope.portVent_out[11], bou.ports[1]) annotation ( + Line(points={{51.41,-28.0364},{56,-28.0364},{56,-56.8},{40,-56.8}}, + color={0,127,255})); + connect(wholeHouseBuildingEnvelope.portVent_in[11], bou.ports[2]) annotation (Line( + points={{50.47,-15.7164},{68,-15.7164},{68,-59.2},{40,-59.2}}, + color={0,127,255})); + connect(convRadToCombPort.portConvRadComb, wholeHouseBuildingEnvelope.heatingToRooms[11]) annotation (Line(points={{-46,-56},{-72,-56},{-72,5.41091},{-44,5.41091}}, + color={191,0,0})); + connect(InternalGains1.port, convRadToCombPort.portRad) annotation (Line(points={{-16,-61},{-26,-61}}, color={191,0,0})); + connect(InternalGains.port, convRadToCombPort.portConv) annotation (Line(points={{-16,-51},{-26,-51}}, color={191,0,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); end AixLibHighOrderOFD; diff --git a/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo b/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo index d6b88f5a..88735436 100644 --- a/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo +++ b/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo @@ -7,7 +7,7 @@ model AixLibHighOrderProfiles "Standard TEASER Profiles" parameter AixLib.DataBase.Profiles.ProfileBaseDataDefinition VentilationProfile = AixLib.DataBase.Profiles.Ventilation2perDayMean05perH(); parameter AixLib.DataBase.Profiles.ProfileBaseDataDefinition TSetProfile = AixLib.DataBase.Profiles.SetTemperaturesVentilation2perDay(); - parameter Real gain "Gain value multiplied with internal gains. Used to e.g. disable single gains." annotation (Dialog(group= + parameter Real gain=1 "Gain value multiplied with internal gains. Used to e.g. disable single gains." annotation (Dialog(group= "Internal Gains", tab="Inputs")); Modelica.Blocks.Sources.CombiTimeTable tableInternalGains( @@ -39,7 +39,19 @@ model AixLibHighOrderProfiles "Standard TEASER Profiles" tableOnFile=false, table=TSetProfile.Profile) annotation(Placement(transformation(extent={{-92, -118},{-72,-98}}))); + Modelica.Blocks.Sources.Constant const1[nZones](k=293.15) + annotation (Placement(transformation(extent={{-94,-70},{-74,-50}}))); + Modelica.Blocks.Sources.Constant const2[nZones](k=0.1) + annotation (Placement(transformation(extent={{-102,84},{-82,104}}))); + Modelica.Blocks.Interfaces.RealOutput y1[size(TSet.y, 1)] + "Connector of Real output signals" + annotation (Placement(transformation(extent={{-22,-116},{-2,-96}}))); + Modelica.Blocks.Interfaces.RealOutput y2[size(NaturalVentilation.y, 1)] + "Connector of Real output signals" + annotation (Placement(transformation(extent={{-58,48},{-38,68}}))); equation + //for i in nZones loop + //end for; connect(tableInternalGains.y, gainIntGains.u) annotation (Line(points={{-1.7,1}, {-1.7,0.5},{17.4,0.5},{17.4,1}}, color={0,0,127})); connect(gainIntGains.y, useProBus.intGains) annotation (Line(points={{70.3,1}, @@ -48,17 +60,23 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(NaturalVentilation.y, useProBus.NaturalVentilation) annotation (Line( - points={{-80,59},{-18,59},{-18,50},{110,50},{110,-1},{115,-1}}, color={0, - 0,127}), Text( + + + connect(const1.y, useProBus.TZoneSet) annotation (Line(points={{-73,-60},{115, + -60},{115,-1}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(TSet.y, useProBus.TZoneSet) annotation (Line(points={{-71,-108},{114, - -108},{114,-1},{115,-1}}, color={0,0,127}), Text( + connect(const2.y, useProBus.NaturalVentilation) annotation (Line(points={{-81, + 94},{-56,94},{-56,92},{-36,92},{-36,44},{115,44},{115,-1}}, color={0,0, + 127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); + connect(TSet.y, y1) annotation (Line(points={{-71,-108},{-44,-108},{-44,-112}, + {-12,-112},{-12,-106}}, color={0,0,127})); + connect(NaturalVentilation.y, y2) annotation (Line(points={{-80,59},{-64,59}, + {-64,58},{-48,58}}, color={0,0,127})); end AixLibHighOrderProfiles; From 9dc5e0798f87bfca6194113347dc415b414dc99e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Fri, 2 Sep 2022 08:22:12 +0200 Subject: [PATCH 041/131] fix size of arrays (#6) --- BESMod/Examples/UseCaseHOM/HOMSystem.mo | 2 +- BESMod/Systems/Demand/Building/AixLibHighOrder.mo | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/BESMod/Examples/UseCaseHOM/HOMSystem.mo b/BESMod/Examples/UseCaseHOM/HOMSystem.mo index de8297fa..67b5a4ff 100644 --- a/BESMod/Examples/UseCaseHOM/HOMSystem.mo +++ b/BESMod/Examples/UseCaseHOM/HOMSystem.mo @@ -6,7 +6,7 @@ record HOMSystem filNamWea=Modelica.Utilities.Files.loadResource( "modelica://BESMod/Resources/WeatherData/TRY2015_507931060546_Jahr_City_Aachen_Normal.mos"), use_ventilation=false, - QBui_flow_nominal={1124.867,569.6307,53.59064,679.86365,809.8547,786.87427,552.7661,0,666.1303,635.3303}, + QBui_flow_nominal={1124.867,569.6307,53.59064,679.86365,809.8547,786.87427,552.7661,10,666.1303,635.3303}, THydSup_nominal=fill(328.15,nZones), TOda_nominal=265.35); diff --git a/BESMod/Systems/Demand/Building/AixLibHighOrder.mo b/BESMod/Systems/Demand/Building/AixLibHighOrder.mo index c9fdc0ea..fb0aecd2 100644 --- a/BESMod/Systems/Demand/Building/AixLibHighOrder.mo +++ b/BESMod/Systems/Demand/Building/AixLibHighOrder.mo @@ -3,8 +3,8 @@ model AixLibHighOrder "High order building model from AixLib library" extends BaseClasses.PartialDemand( nZones = aixLiBHighOrderOFD.nZones, - final AZone=aixLiBHighOrderOFD.AZone, - final hZone=aixLiBHighOrderOFD.hZone, + final AZone=aixLiBHighOrderOFD.AZone[1:nZones], + final hZone=aixLiBHighOrderOFD.hZone[1:nZones], final ABui=aixLiBHighOrderOFD.ABui, final hBui=aixLiBHighOrderOFD.hBui, final ARoo=aixLiBHighOrderOFD.ARoof); @@ -46,14 +46,12 @@ model AixLibHighOrder "High order building model from AixLib library" AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow (windowarea=2) constrainedby - AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow - annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); replaceable parameter AixLib.DataBase.WindowsDoors.Simple.OWBaseDataDefinition_Simple Type_Win "Window parametrization" annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); replaceable model CorrSolarGainWin = AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG constrainedby - AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG - "Correction model for solar irradiance as transmitted radiation" annotation (choicesAllMatching=true, Dialog(tab="Outer walls", group="Windows", enable = withWindow and outside)); + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG "Correction model for solar irradiance as transmitted radiation" annotation (choicesAllMatching=true, Dialog(tab="Outer walls", group="Windows", enable = withWindow and outside)); parameter Boolean use_sunblind=false "Will sunblind become active automatically?" annotation (Dialog(tab="Outer walls", group="Sunblind")); parameter Modelica.Units.SI.CoefficientOfHeatTransfer UValOutDoors=2.5 From 6ec0019bb970aa9a513af2d7205598532484c34e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Fri, 2 Sep 2022 17:15:05 +0200 Subject: [PATCH 042/131] fix arrays within HOM model (#6) --- .../Building/Components/AixLibHighOrderOFD.mo | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo index 1684ae1e..c801e28b 100644 --- a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo +++ b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo @@ -1,9 +1,8 @@ within BESMod.Systems.Demand.Building.Components; model AixLibHighOrderOFD "High order OFD" extends Building.BaseClasses.PartialAixLibHighOrder( - final nZones=nZonesHeated); + final nZones=10); - parameter Integer nZonesHeated = 10 "Heated rooms of the building"; parameter Integer nZonesNonHeated = 1 "Non heated rooms of the building"; // Dynamics @@ -51,7 +50,7 @@ model AixLibHighOrderOFD "High order OFD" final parameter Modelica.Units.SI.Area ABui = sum(AZone) "Total area of all zones"; final parameter Modelica.Units.SI.Length hBui = hZone[1] + hZone[6] + hZone[11] "Total hight of building"; final parameter Modelica.Units.SI.Area ARoof = sum(ARoofZone) "Total area of roof"; - final parameter Modelica.Units.SI.Area AZone[nZonesHeated+nZonesNonHeated]= + final parameter Modelica.Units.SI.Area AZone[nZones+nZonesNonHeated]= {wholeHouseBuildingEnvelope.groundFloor_Building.Livingroom.room_length * wholeHouseBuildingEnvelope.groundFloor_Building.Livingroom.room_width, wholeHouseBuildingEnvelope.groundFloor_Building.Hobby.room_length * @@ -74,7 +73,7 @@ model AixLibHighOrderOFD "High order OFD" wholeHouseBuildingEnvelope.upperFloor_Building.Children2.room_width_long, wholeHouseBuildingEnvelope.attic_2Ro_5Rooms.length* wholeHouseBuildingEnvelope.attic_2Ro_5Rooms.width}; - final parameter Modelica.Units.SI.Length hZone[nZonesHeated+nZonesNonHeated]= + final parameter Modelica.Units.SI.Length hZone[nZones+nZonesNonHeated]= {wholeHouseBuildingEnvelope.groundFloor_Building.Livingroom.room_height, wholeHouseBuildingEnvelope.groundFloor_Building.Hobby.room_height, wholeHouseBuildingEnvelope.groundFloor_Building.Corridor.room_height, @@ -86,7 +85,7 @@ model AixLibHighOrderOFD "High order OFD" wholeHouseBuildingEnvelope.upperFloor_Building.Bath.room_height_long, wholeHouseBuildingEnvelope.upperFloor_Building.Children2.room_height_long, wholeHouseBuildingEnvelope.attic_2Ro_5Rooms.room_V/AZone[11]}; - final parameter Modelica.Units.SI.Area ARoofZone[nZonesHeated+nZonesNonHeated]= + final parameter Modelica.Units.SI.Area ARoofZone[nZones+nZonesNonHeated]= {0,0,0,0,0, wholeHouseBuildingEnvelope.upperFloor_Building.Bedroom.roof_width* wholeHouseBuildingEnvelope.upperFloor_Building.Bedroom.room_length, @@ -133,8 +132,8 @@ model AixLibHighOrderOFD "High order OFD" extent={{7,-7},{-7,7}}, rotation=0, origin={-9,-61}))); - AixLib.Fluid.Sources.Boundary_pT bou(redeclare package Medium = MediumZone, nPorts=2) - annotation (Placement(transformation(extent={{28,-64},{40,-52}}))); + Modelica.Blocks.Sources.Constant const1 + annotation (Placement(transformation(extent={{-86,14},{-74,26}}))); equation // Romm Temperatures @@ -182,7 +181,7 @@ equation Line(points={{0,-100},{0,-44},{3,-44},{3,-40}}, color={191,0,0})); end for; - for i in 1:nZonesHeated loop + for i in 1:nZones loop connect(heatingToRooms1[i], wholeHouseBuildingEnvelope.heatingToRooms[i]) annotation (Line(points={{-98,0},{-52,0},{-52,0.32},{-44,0.32}}, color={191,0,0})); connect(wholeHouseBuildingEnvelope.portVent_out[i], portVent_out[i]) annotation ( Line(points={{51.41,-31.6},{56,-31.6},{56,-92},{100,-92}}, color={0,127,255})); @@ -193,17 +192,14 @@ equation 127})); end for; - connect(wholeHouseBuildingEnvelope.portVent_out[11], bou.ports[1]) annotation ( - Line(points={{51.41,-28.0364},{56,-28.0364},{56,-56.8},{40,-56.8}}, - color={0,127,255})); - connect(wholeHouseBuildingEnvelope.portVent_in[11], bou.ports[2]) annotation (Line( - points={{50.47,-15.7164},{68,-15.7164},{68,-59.2},{40,-59.2}}, - color={0,127,255})); connect(convRadToCombPort.portConvRadComb, wholeHouseBuildingEnvelope.heatingToRooms[11]) annotation (Line(points={{-46,-56},{-72,-56},{-72,5.41091},{-44,5.41091}}, color={191,0,0})); connect(InternalGains1.port, convRadToCombPort.portRad) annotation (Line(points={{-16,-61},{-26,-61}}, color={191,0,0})); connect(InternalGains.port, convRadToCombPort.portConv) annotation (Line(points={{-16,-51},{-26,-51}}, color={191,0,0})); + connect(const1.y, wholeHouseBuildingEnvelope.AirExchangePort[11]) annotation ( + Line(points={{-73.4,20},{-68,20},{-68,49.0909},{-48.7,49.0909}}, color={0,0, + 127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); end AixLibHighOrderOFD; From 19ddab518ffc3a60dfea07271256a623ca4b8ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Fri, 2 Sep 2022 17:15:39 +0200 Subject: [PATCH 043/131] Add TSet and NaturalVentialtion profile from AixLib examples to userProfile of HOM (#6) --- .../UserProfiles/AixLibHighOrderProfiles.mo | 104 ++++++++++++------ 1 file changed, 73 insertions(+), 31 deletions(-) diff --git a/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo b/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo index 88735436..9ca25b80 100644 --- a/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo +++ b/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo @@ -1,10 +1,8 @@ within BESMod.Systems.UserProfiles; model AixLibHighOrderProfiles "Standard TEASER Profiles" - extends BaseClasses.RecordBasedDHWUser; + extends BaseClasses.RecordBasedDHWUser(nZones=10); parameter String fileNameIntGains=Modelica.Utilities.Files.loadResource("modelica://BESMod/Resources/InternalGainsHOM.txt") - "File where matrix is stored" - annotation (Dialog(tab="Inputs", group="Internal Gains")); - + "File where matrix is stored" annotation (Dialog(tab="Inputs", group="Internal Gains")); parameter AixLib.DataBase.Profiles.ProfileBaseDataDefinition VentilationProfile = AixLib.DataBase.Profiles.Ventilation2perDayMean05perH(); parameter AixLib.DataBase.Profiles.ProfileBaseDataDefinition TSetProfile = AixLib.DataBase.Profiles.SetTemperaturesVentilation2perDay(); parameter Real gain=1 "Gain value multiplied with internal gains. Used to e.g. disable single gains." annotation (Dialog(group= @@ -31,27 +29,77 @@ model AixLibHighOrderProfiles "Standard TEASER Profiles" columns={2,3,4,5,7}, extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, tableOnFile=false, - table=VentilationProfile.Profile) annotation(Placement(transformation(extent={{-101,49}, - {-81,69}}))); + table=VentilationProfile.Profile) annotation(Placement(transformation(extent={{-88,50}, + {-68,70}}))); Modelica.Blocks.Sources.CombiTimeTable TSet( columns={2,3,4,5,6,7}, extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, tableOnFile=false, - table=TSetProfile.Profile) annotation(Placement(transformation(extent={{-92, - -118},{-72,-98}}))); - Modelica.Blocks.Sources.Constant const1[nZones](k=293.15) - annotation (Placement(transformation(extent={{-94,-70},{-74,-50}}))); - Modelica.Blocks.Sources.Constant const2[nZones](k=0.1) - annotation (Placement(transformation(extent={{-102,84},{-82,104}}))); - Modelica.Blocks.Interfaces.RealOutput y1[size(TSet.y, 1)] - "Connector of Real output signals" - annotation (Placement(transformation(extent={{-22,-116},{-2,-96}}))); - Modelica.Blocks.Interfaces.RealOutput y2[size(NaturalVentilation.y, 1)] - "Connector of Real output signals" - annotation (Placement(transformation(extent={{-58,48},{-38,68}}))); + table=TSetProfile.Profile) annotation(Placement(transformation(extent={{-88, + -104},{-68,-84}}))); + Modelica.Blocks.Routing.RealPassThrough realPassThrough[10] + annotation (Placement(transformation(extent={{-48,52},{-32,68}}))); + Modelica.Blocks.Routing.RealPassThrough realPassThrough1 + [10] + annotation (Placement(transformation(extent={{-32,-102},{-16,-86}}))); equation - //for i in nZones loop - //end for; + connect(TSet.y[1], realPassThrough1[6].u) annotation (Line(points={{-67,-94},{ + -33.6,-94}}, color={0, + 0,127})); + connect(TSet.y[1], realPassThrough1[1].u) annotation (Line(points={{-67,-94},{ + -33.6,-94}}, color={ + 0,0,127})); + + connect(TSet.y[2], realPassThrough1[7].u) annotation (Line(points={{-67,-94},{ + -33.6,-94}}, color={0, + 0,127})); + connect(TSet.y[2], realPassThrough1[2].u) annotation (Line(points={{-67,-94},{ + -33.6,-94}}, color={ + 0,0,127})); + + connect(TSet.y[6], realPassThrough1[3].u) annotation (Line(points={{-67,-94},{ + -33.6,-94}}, color={ + 0,0,127})); + connect(TSet.y[6], realPassThrough1[8].u) annotation (Line(points={{-67,-94},{ + -33.6,-94}}, color={ + 0,0,127})); + + connect(TSet.y[4], realPassThrough1[9].u) annotation (Line(points={{-67,-94},{ + -33.6,-94}}, color={0, + 0,127})); + connect(TSet.y[5], realPassThrough1[4].u) annotation (Line(points={{-67,-94},{ + -33.6,-94}}, color= + {0,0,127})); + + connect(TSet.y[3], realPassThrough1[10].u) annotation (Line(points={{-67,-94}, + {-33.6,-94}}, + color={0,0,127})); + connect(TSet.y[3], realPassThrough1[5].u) annotation (Line(points={{-67,-94},{ + -33.6,-94}}, color= + {0,0,127})); + + + connect(NaturalVentilation.y[1], realPassThrough[1].u) annotation (Line( + points={{-67,60},{-49.6,60}}, color={0,0, + 127})); + connect(NaturalVentilation.y[1], realPassThrough[6].u) annotation (Line( + points={{-67,60},{-49.6,60}}, color={0,0,127})); + connect(NaturalVentilation.y[2], realPassThrough[2].u) annotation (Line( + points={{-67,60},{-49.6,60}}, color={0,0,127})); + connect(NaturalVentilation.y[2], realPassThrough[7].u) annotation (Line( points={{-67,60},{-49.6,60}}, color={0,0,127})); + connect(NaturalVentilation.y[3], realPassThrough[4].u) annotation (Line( + points={{-67,60},{-49.6,60}}, color={0,0,127})); + connect(NaturalVentilation.y[3], realPassThrough[9].u) annotation (Line( + points={{-67,60},{-49.6,60}}, color={0,0,127})); + connect(NaturalVentilation.y[4], realPassThrough[5].u) annotation (Line( + points={{-67,60},{-49.6,60}}, color={0,0,127})); + connect(NaturalVentilation.y[4], realPassThrough[10].u) annotation (Line( + points={{-67,60},{-49.6,60}}, color={0,0,127})); + connect(NaturalVentilation.y[5], realPassThrough[3].u) annotation (Line( + points={{-67,60},{-49.6,60}}, color={0,0,127})); + connect(NaturalVentilation.y[5], realPassThrough[8].u) annotation (Line( + points={{-67,60},{-49.6,60}}, color={0,0,127})); + connect(tableInternalGains.y, gainIntGains.u) annotation (Line(points={{-1.7,1}, {-1.7,0.5},{17.4,0.5},{17.4,1}}, color={0,0,127})); connect(gainIntGains.y, useProBus.intGains) annotation (Line(points={{70.3,1}, @@ -60,23 +108,17 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - - - connect(const1.y, useProBus.TZoneSet) annotation (Line(points={{-73,-60},{115, - -60},{115,-1}}, color={0,0,127}), Text( + connect(realPassThrough.y, useProBus.NaturalVentilation) annotation (Line( + points={{-31.2,60},{114,60},{114,4},{115,4},{115,-1}}, color={0,0,127}), + Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(const2.y, useProBus.NaturalVentilation) annotation (Line(points={{-81, - 94},{-56,94},{-56,92},{-36,92},{-36,44},{115,44},{115,-1}}, color={0,0, - 127}), Text( + connect(realPassThrough1.y, useProBus.TZoneSet) annotation (Line(points={{-15.2, + -94},{115,-94},{115,-1}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(TSet.y, y1) annotation (Line(points={{-71,-108},{-44,-108},{-44,-112}, - {-12,-112},{-12,-106}}, color={0,0,127})); - connect(NaturalVentilation.y, y2) annotation (Line(points={{-80,59},{-64,59}, - {-64,58},{-48,58}}, color={0,0,127})); end AixLibHighOrderProfiles; From f9d5d88952fae7f3b8a73d1cd247d2f5cc5e414b Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 5 Sep 2022 14:22:15 +0200 Subject: [PATCH 044/131] add models --- .../Components/Valves/PressureReliefValve.mo | 127 ++++++++++++++++++ .../Components/Valves/ReliefValveHead.mo | 95 +++++++++++++ .../Components/Valves/package.order | 2 + .../Transfer/RadiatorPressureBased.mo | 18 ++- 4 files changed, 241 insertions(+), 1 deletion(-) create mode 100644 BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo create mode 100644 BESMod/Systems/Hydraulical/Distribution/Components/Valves/ReliefValveHead.mo diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo new file mode 100644 index 00000000..027b2a0a --- /dev/null +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo @@ -0,0 +1,127 @@ +within BESMod.Systems.Hydraulical.Distribution.Components.Valves; +model PressureReliefValve + extends AixLib.Fluid.Interfaces.PartialTwoPortInterface(final m_flow_nominal=m_flowMin); + parameter Modelica.Units.SI.PressureDifference dpFullOpen_nominal "Pressure difference at which valve is fully open"; + parameter Modelica.Units.SI.PressureDifference dpThreshold_nominal = 0.95*dpFullOpen_nominal "Threshold at which valve starts to open"; + AixLib.Fluid.Actuators.Valves.TwoWayEqualPercentage val( + redeclare package Medium = Medium, + final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=m_flow_nominal, + final dpValve_nominal=dpValve_nominal, + final use_inputFilter=use_inputFilter, + final riseTime(displayUnit="s") = riseTime, + final init=init, + y_start=y_start, + final dpFixed_nominal=0, + final l=l) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + ReliefValveHead reliefValveHead(final dpThreshold=dpThreshold_nominal, final dpFullOpen=dpFullOpen_nominal) + annotation (Placement(transformation(extent={{-60,20}, + {-40,40}}))); + AixLib.Fluid.Sensors.RelativePressure senRelPre(redeclare package Medium = Medium) + annotation (Placement(transformation(extent={{-10,50},{10,30}}))); + parameter Modelica.Units.SI.MassFlowRate m_flowMin "Minimal mass flow rate that needs to be ensured by valve"; + parameter Real facDpValve_nominal(min=0, max=1) = 0.5 "Factor to design dpValve_nominal"; + parameter Real l=0.001 "Valve leakage, l=Kv(y=0)/Kv(y=1)"; + + parameter Boolean use_inputFilter=true "= true, if opening is filtered with a 2nd order CriticalDamping filter" annotation (Dialog(tab="Dynamics", group="Filtered opening")); + parameter Modelica.Units.SI.Time riseTime=10 "Rise time of the filter (time to reach 99.6 % of an opening step)" annotation (Dialog( + tab="Dynamics", + group="Filtered opening", + enable=use_inputFilter)); + + parameter Modelica.Blocks.Types.Init init=Modelica.Blocks.Types.Init.InitialOutput "Type of initialization (no init/steady state/initial state/initial output)" annotation (Dialog( + tab="Dynamics", + group="Filtered opening", + enable=use_inputFilter)); + parameter Real y_start=1 "Initial value of output" annotation (Dialog( + tab="Dynamics", + group="Filtered opening", + enable=use_inputFilter)); +protected + parameter Modelica.Units.SI.PressureDifference dpValve_nominal = facDpValve_nominal*(dpFullOpen_nominal - dpThreshold_nominal) + dpThreshold_nominal; + +equation + connect(val.port_a, senRelPre.port_a) annotation (Line(points={{-10,0},{-20,0},{-20,40},{-10,40}}, color={0,127,255})); + connect(val.port_b, senRelPre.port_b) annotation (Line(points={{10,0},{20,0},{20,40},{10,40}}, color={0,127,255})); + connect(port_a, val.port_a) annotation (Line(points={{-100,0},{-10,0}}, color={0,127,255})); + connect(val.port_b, port_b) annotation (Line(points={{10,0},{100,0}}, color={0,127,255})); + connect(senRelPre.p_rel, reliefValveHead.pressureSignal) annotation (Line(points={{0,49},{ + 0,54},{-34,54},{-34,37},{-39,37}}, color={0,0,127})); + connect(reliefValveHead.y, val.y) annotation (Line(points={{-39,30},{0,30},{0, + 12}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-24,92},{22,20}}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Polygon( + points={{4,24},{4,66},{8,66},{8,24},{16,66},{20,66},{12,24},{4,24}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid, + origin={44,70}, + rotation=90), + Rectangle( + extent={{-100,40},{100,-40}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={192,192,192}), + Rectangle( + extent={{-100,22},{100,-24}}, + lineColor={0,0,0}, + fillPattern=FillPattern.HorizontalCylinder, + fillColor={0,127,255}), Rectangle( + extent={{-60,40},{60,-40}}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Polygon( + points={{0,0},{-76,60},{-76,-60},{0,0}}, + lineColor={0,0,0}, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,-0},{76,60},{76,-60},{0,0}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Line( + points={{0,26},{0,0}}), + Polygon( + points={{4,24},{4,66},{8,66},{8,24},{16,66},{20,66},{12,24},{4,24}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid, + origin={44,54}, + rotation=90), + Polygon( + points={{4,24},{4,66},{8,66},{8,24},{16,66},{20,66},{12,24},{4,24}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid, + origin={44,38}, + rotation=90), + Polygon( + points={{4,24},{4,66},{8,66},{8,24},{16,66},{20,66},{12,24},{4,24}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid, + origin={44,22}, + rotation=90), + Rectangle( + extent={{-22,94},{20,90}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.CrossDiag), + Rectangle( + extent={{-26,94},{-22,20}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.CrossDiag), + Rectangle( + extent={{20,94},{24,20}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.CrossDiag)}), Diagram(coordinateSystem(preserveAspectRatio=false))); +end PressureReliefValve; diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ReliefValveHead.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ReliefValveHead.mo new file mode 100644 index 00000000..a71c16df --- /dev/null +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ReliefValveHead.mo @@ -0,0 +1,95 @@ +within BESMod.Systems.Hydraulical.Distribution.Components.Valves; +model ReliefValveHead + parameter Modelica.Units.SI.PressureDifference dpThreshold=0.98*dpFullOpen; + parameter Modelica.Units.SI.PressureDifference dpFullOpen; + final parameter Real nu=dpThreshold/(dpFullOpen); + parameter Real fGain=1 "Gain value multiplied with input signal"; + final parameter Modelica.Units.SI.Area fUnit=1 "To convert unit Pa to N (Pa*m2)"; + final parameter Real offset=0 "Offset for s_rel0"; + parameter Real fSpringConst=1 "Factor for spring constant"; + + Modelica.Mechanics.Translational.Components.Fixed + fixed1(s0(displayUnit="m") = 0) + annotation (Placement( + transformation(extent={{-86,50},{-66,70}}))); + Modelica.Mechanics.Translational.Components.Spring spring( + c=-dpThreshold*fUnit/spring.s_rel0, + s_rel0(displayUnit="m") = nu/(1 - nu) + offset, + s_rel( + fixed=false, + displayUnit="m", + start=0)) annotation (Placement(transformation(extent={{-56,50},{-36,70}}))); + Modelica.Mechanics.Translational.Sources.Force force annotation (Placement(transformation(extent={{10,50},{-10,70}}))); + Modelica.Mechanics.Translational.Sensors.PositionSensor positionSensor1 annotation (Placement(transformation(extent={{-10,22},{10,42}}))); + Modelica.Blocks.Nonlinear.Limiter limiter(uMax=1, uMin=0) annotation (Placement(transformation(extent={{56,14},{66,24}}))); + Modelica.Blocks.Interfaces.RealOutput y( + unit="1", + min=0, + max=1) "Connector of Real output signal" annotation (Placement(transformation(extent={{88,8},{110,30}}), iconTransformation(extent={{100,-10},{120,10}}))); + + Modelica.Blocks.Interfaces.RealInput pressureSignal(quantity="PressureDifference", unit="Pa") "Input signal connector" annotation (Placement(transformation(extent={{112,48},{88,72}}), iconTransformation(extent={{120,60},{100,80}}))); + + Modelica.Blocks.Math.Gain gain(k=fGain) annotation (Placement(transformation(extent={{28,14},{38,24}}))); + + Modelica.Blocks.Math.Gain unitConv(k=fUnit) annotation (Placement(transformation(extent={{52,56},{44,64}}))); +initial equation + assert( + dpFullOpen > dpThreshold, + "dpFullOpen must be greater than dpThreshold", + AssertionLevel.error); +equation + connect(spring.flange_a, fixed1.flange) annotation (Line(points={{-56,60},{-76,60}}, color={0,127,0})); + connect(spring.flange_b, force.flange) annotation (Line(points={{-36,60},{-10,60}}, color={0,127,0})); + connect(force.flange, positionSensor1.flange) annotation (Line(points={{-10,60},{-10,32}}, color={0,127,0})); + connect(limiter.y, y) annotation (Line(points={{66.5,19},{99,19}}, color={0,0,127})); + connect(positionSensor1.s, gain.u) annotation (Line(points={{11,32},{16,32},{16,19},{27,19}}, color={0,0,127})); + connect(gain.y, limiter.u) annotation (Line(points={{38.5,19},{55,19}}, color={0,0,127})); + connect(pressureSignal, unitConv.u) annotation (Line(points={{100,60},{52.8,60}}, color={0,0,127})); + connect(unitConv.y, force.f) annotation (Line(points={{43.6,60},{12,60}}, color={0,0,127})); + annotation (preferredView="Documentation", + Icon(graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Polygon( + points={{80,70},{80,-62},{70,-62},{70,70},{50,-62},{40,-62},{60,70},{80,70}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid), + Polygon( + points={{40,70},{40,-62},{30,-62},{30,70},{10,-62},{0,-62},{20,70},{40,70}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,70},{0,-62},{-10,-62},{-10,70},{-30,-62},{-40,-62},{-20,70},{0,70}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-92,80},{-80,-72}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.CrossDiag), + Rectangle( + extent={{-80,80},{88,70}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.CrossDiag), + Rectangle( + extent={{-80,-62},{88,-72}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.CrossDiag), + Polygon( + points={{-40,70},{-40,-62},{-50,-62},{-50,70},{-70,-62},{-80,-62},{-60,70},{-40,70}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid)}), Documentation(info=" +

How to use

+

The bandwidth between dpThreshold and dpFullOpen is crucial. If a simulation becomes unstabile, make this bandwidth broader.

+

If the pressure relief valve should open later, raise the parameter dpThreshold.

+")); +end ReliefValveHead; diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order index edea0748..d2daa062 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order @@ -1,3 +1,5 @@ ThreeWayValveWithFlowReturn ArtificialThreeWayValve +PressureReliefValve +ReliefValveHead Tests diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index e56febf0..ad67e98a 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -5,7 +5,8 @@ model RadiatorPressureBased "Pressure Based transfer system" ABui=1, hBui=1, final dp_nominal=rad.dp_nominal .+ val.dpValve_nominal .+ res.dp_nominal .+ val.dpFixed_nominal, final nParallelSup=1); - + parameter Boolean use_preRelVal=true "=false to disable pressure relief valve"; + parameter Real perPreRelValOpens=0.99 "Percentage of nominal pressure difference at which the pressure relief valve starts to open" annotation(Dialog(enable=use_preRelVal)); replaceable parameter RecordsCollection.TransferDataBaseDefinition transferDataBaseDefinition constrainedby RecordsCollection.TransferDataBaseDefinition( @@ -117,6 +118,17 @@ model RadiatorPressureBased "Pressure Based transfer system" BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) annotation (Placement(transformation(extent={{34,-94},{54,-74}}))); + Distribution.Components.Valves.PressureReliefValve pressureReliefValve( + redeclare final package Medium = Medium, + final dpFullOpen_nominal=dp_nominal[1], + final dpThreshold_nominal=perPreRelValOpens*dp_nominal[1], + final m_flowMin=mSup_flow_nominal[1], + final facDpValve_nominal=transferDataBaseDefinition.valveAutho[1], + final l=transferDataBaseDefinition.leakageOpening) if use_preRelVal + annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={-90,-10}))); equation connect(rad.heatPortRad, heatPortRad) annotation (Line(points={{-5.08,-27.2}, {40,-27.2},{40,-40},{100,-40}}, color={191,0,0})); @@ -155,4 +167,8 @@ equation thickness=1)); connect(realToElecCon.PEleLoa, pump.P) annotation (Line(points={{32,-80},{ 22,-80},{22,47},{-63,47}}, color={0,0,127})); + connect(pressureReliefValve.port_b, portTra_out[1]) annotation (Line(points={{-90,-20}, + {-90,-42},{-100,-42}}, color={0,127,255})); + connect(pump.port_b, pressureReliefValve.port_a) annotation (Line(points={{-64,38}, + {-60,38},{-60,30},{-90,30},{-90,0}}, color={0,127,255})); end RadiatorPressureBased; From 71a44e9d9758580405a03fa723da4aa55a7f4372 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 6 Sep 2022 12:17:09 +0200 Subject: [PATCH 045/131] rm ReliefValveHead.mo --- .../Components/Valves/PressureReliefValve.mo | 40 ++++++-- .../Components/Valves/ReliefValveHead.mo | 95 ------------------- .../Components/Valves/package.order | 1 - .../Transfer/RadiatorPressureBased.mo | 2 +- 4 files changed, 32 insertions(+), 106 deletions(-) delete mode 100644 BESMod/Systems/Hydraulical/Distribution/Components/Valves/ReliefValveHead.mo diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo index 027b2a0a..bd62e2a4 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Distribution.Components.Valves; model PressureReliefValve - extends AixLib.Fluid.Interfaces.PartialTwoPortInterface(final m_flow_nominal=m_flowMin); + extends AixLib.Fluid.Interfaces.PartialTwoPortInterface; parameter Modelica.Units.SI.PressureDifference dpFullOpen_nominal "Pressure difference at which valve is fully open"; parameter Modelica.Units.SI.PressureDifference dpThreshold_nominal = 0.95*dpFullOpen_nominal "Threshold at which valve starts to open"; AixLib.Fluid.Actuators.Valves.TwoWayEqualPercentage val( @@ -14,12 +14,8 @@ model PressureReliefValve y_start=y_start, final dpFixed_nominal=0, final l=l) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - ReliefValveHead reliefValveHead(final dpThreshold=dpThreshold_nominal, final dpFullOpen=dpFullOpen_nominal) - annotation (Placement(transformation(extent={{-60,20}, - {-40,40}}))); AixLib.Fluid.Sensors.RelativePressure senRelPre(redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-10,50},{10,30}}))); - parameter Modelica.Units.SI.MassFlowRate m_flowMin "Minimal mass flow rate that needs to be ensured by valve"; parameter Real facDpValve_nominal(min=0, max=1) = 0.5 "Factor to design dpValve_nominal"; parameter Real l=0.001 "Valve leakage, l=Kv(y=0)/Kv(y=1)"; @@ -37,6 +33,26 @@ model PressureReliefValve tab="Dynamics", group="Filtered opening", enable=use_inputFilter)); + Modelica.Blocks.Nonlinear.Limiter limiter(final uMax=1, final uMin=0) + annotation (Placement(transformation(extent={{-10,-10}, + {10,10}}, + rotation=0, + origin={-50,30}))); + Modelica.Blocks.Math.Add add(final k1=+1, final k2=-1) annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-10,70}))); + Modelica.Blocks.Math.Gain gain(k=1/(dpFullOpen_nominal - dpThreshold_nominal)) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-50,70}))); + Modelica.Blocks.Sources.Constant const(final k=dpThreshold_nominal) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={30,90}))); protected parameter Modelica.Units.SI.PressureDifference dpValve_nominal = facDpValve_nominal*(dpFullOpen_nominal - dpThreshold_nominal) + dpThreshold_nominal; @@ -45,10 +61,16 @@ equation connect(val.port_b, senRelPre.port_b) annotation (Line(points={{10,0},{20,0},{20,40},{10,40}}, color={0,127,255})); connect(port_a, val.port_a) annotation (Line(points={{-100,0},{-10,0}}, color={0,127,255})); connect(val.port_b, port_b) annotation (Line(points={{10,0},{100,0}}, color={0,127,255})); - connect(senRelPre.p_rel, reliefValveHead.pressureSignal) annotation (Line(points={{0,49},{ - 0,54},{-34,54},{-34,37},{-39,37}}, color={0,0,127})); - connect(reliefValveHead.y, val.y) annotation (Line(points={{-39,30},{0,30},{0, - 12}}, color={0,0,127})); + connect(senRelPre.p_rel, add.u1) annotation (Line(points={{0,49},{0,56},{20,56}, + {20,64},{2,64}}, color={0,0,127})); + connect(const.y, add.u2) annotation (Line(points={{19,90},{18,90},{18,76},{2,76}}, + color={0,0,127})); + connect(limiter.y, val.y) annotation (Line(points={{-39,30},{-26,30},{-26,20}, + {0,20},{0,12}}, color={0,0,127})); + connect(gain.u, add.y) + annotation (Line(points={{-38,70},{-21,70}}, color={0,0,127})); + connect(gain.y, limiter.u) annotation (Line(points={{-61,70},{-68,70},{-68,30}, + {-62,30}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ Rectangle( extent={{-24,92},{22,20}}, diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ReliefValveHead.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ReliefValveHead.mo deleted file mode 100644 index a71c16df..00000000 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ReliefValveHead.mo +++ /dev/null @@ -1,95 +0,0 @@ -within BESMod.Systems.Hydraulical.Distribution.Components.Valves; -model ReliefValveHead - parameter Modelica.Units.SI.PressureDifference dpThreshold=0.98*dpFullOpen; - parameter Modelica.Units.SI.PressureDifference dpFullOpen; - final parameter Real nu=dpThreshold/(dpFullOpen); - parameter Real fGain=1 "Gain value multiplied with input signal"; - final parameter Modelica.Units.SI.Area fUnit=1 "To convert unit Pa to N (Pa*m2)"; - final parameter Real offset=0 "Offset for s_rel0"; - parameter Real fSpringConst=1 "Factor for spring constant"; - - Modelica.Mechanics.Translational.Components.Fixed - fixed1(s0(displayUnit="m") = 0) - annotation (Placement( - transformation(extent={{-86,50},{-66,70}}))); - Modelica.Mechanics.Translational.Components.Spring spring( - c=-dpThreshold*fUnit/spring.s_rel0, - s_rel0(displayUnit="m") = nu/(1 - nu) + offset, - s_rel( - fixed=false, - displayUnit="m", - start=0)) annotation (Placement(transformation(extent={{-56,50},{-36,70}}))); - Modelica.Mechanics.Translational.Sources.Force force annotation (Placement(transformation(extent={{10,50},{-10,70}}))); - Modelica.Mechanics.Translational.Sensors.PositionSensor positionSensor1 annotation (Placement(transformation(extent={{-10,22},{10,42}}))); - Modelica.Blocks.Nonlinear.Limiter limiter(uMax=1, uMin=0) annotation (Placement(transformation(extent={{56,14},{66,24}}))); - Modelica.Blocks.Interfaces.RealOutput y( - unit="1", - min=0, - max=1) "Connector of Real output signal" annotation (Placement(transformation(extent={{88,8},{110,30}}), iconTransformation(extent={{100,-10},{120,10}}))); - - Modelica.Blocks.Interfaces.RealInput pressureSignal(quantity="PressureDifference", unit="Pa") "Input signal connector" annotation (Placement(transformation(extent={{112,48},{88,72}}), iconTransformation(extent={{120,60},{100,80}}))); - - Modelica.Blocks.Math.Gain gain(k=fGain) annotation (Placement(transformation(extent={{28,14},{38,24}}))); - - Modelica.Blocks.Math.Gain unitConv(k=fUnit) annotation (Placement(transformation(extent={{52,56},{44,64}}))); -initial equation - assert( - dpFullOpen > dpThreshold, - "dpFullOpen must be greater than dpThreshold", - AssertionLevel.error); -equation - connect(spring.flange_a, fixed1.flange) annotation (Line(points={{-56,60},{-76,60}}, color={0,127,0})); - connect(spring.flange_b, force.flange) annotation (Line(points={{-36,60},{-10,60}}, color={0,127,0})); - connect(force.flange, positionSensor1.flange) annotation (Line(points={{-10,60},{-10,32}}, color={0,127,0})); - connect(limiter.y, y) annotation (Line(points={{66.5,19},{99,19}}, color={0,0,127})); - connect(positionSensor1.s, gain.u) annotation (Line(points={{11,32},{16,32},{16,19},{27,19}}, color={0,0,127})); - connect(gain.y, limiter.u) annotation (Line(points={{38.5,19},{55,19}}, color={0,0,127})); - connect(pressureSignal, unitConv.u) annotation (Line(points={{100,60},{52.8,60}}, color={0,0,127})); - connect(unitConv.y, force.f) annotation (Line(points={{43.6,60},{12,60}}, color={0,0,127})); - annotation (preferredView="Documentation", - Icon(graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,0}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Polygon( - points={{80,70},{80,-62},{70,-62},{70,70},{50,-62},{40,-62},{60,70},{80,70}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.Solid), - Polygon( - points={{40,70},{40,-62},{30,-62},{30,70},{10,-62},{0,-62},{20,70},{40,70}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.Solid), - Polygon( - points={{0,70},{0,-62},{-10,-62},{-10,70},{-30,-62},{-40,-62},{-20,70},{0,70}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-92,80},{-80,-72}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.CrossDiag), - Rectangle( - extent={{-80,80},{88,70}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.CrossDiag), - Rectangle( - extent={{-80,-62},{88,-72}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.CrossDiag), - Polygon( - points={{-40,70},{-40,-62},{-50,-62},{-50,70},{-70,-62},{-80,-62},{-60,70},{-40,70}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.Solid)}), Documentation(info=" -

How to use

-

The bandwidth between dpThreshold and dpFullOpen is crucial. If a simulation becomes unstabile, make this bandwidth broader.

-

If the pressure relief valve should open later, raise the parameter dpThreshold.

-")); -end ReliefValveHead; diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order index d2daa062..cdc350ae 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order @@ -1,5 +1,4 @@ ThreeWayValveWithFlowReturn ArtificialThreeWayValve PressureReliefValve -ReliefValveHead Tests diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index ad67e98a..ab875706 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -120,9 +120,9 @@ model RadiatorPressureBased "Pressure Based transfer system" annotation (Placement(transformation(extent={{34,-94},{54,-74}}))); Distribution.Components.Valves.PressureReliefValve pressureReliefValve( redeclare final package Medium = Medium, + m_flow_nominal=mSup_flow_nominal[1], final dpFullOpen_nominal=dp_nominal[1], final dpThreshold_nominal=perPreRelValOpens*dp_nominal[1], - final m_flowMin=mSup_flow_nominal[1], final facDpValve_nominal=transferDataBaseDefinition.valveAutho[1], final l=transferDataBaseDefinition.leakageOpening) if use_preRelVal annotation (Placement(transformation( From b6854a9e36633ff5a4ae063e31bf3a8a06ad2148 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 6 Sep 2022 13:43:55 +0200 Subject: [PATCH 046/131] change default and add test --- .../Transfer/RadiatorPressureBased.mo | 2 +- .../TransferDataBaseDefinition.mo | 4 ++-- .../TestPressureBasedSystemWithReliefValve.mo | 19 +++++++++++++++++++ .../Hydraulical/Transfer/Tests/package.order | 1 + 4 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index ab875706..f6e99ed1 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -5,7 +5,7 @@ model RadiatorPressureBased "Pressure Based transfer system" ABui=1, hBui=1, final dp_nominal=rad.dp_nominal .+ val.dpValve_nominal .+ res.dp_nominal .+ val.dpFixed_nominal, final nParallelSup=1); - parameter Boolean use_preRelVal=true "=false to disable pressure relief valve"; + parameter Boolean use_preRelVal=false "=false to disable pressure relief valve"; parameter Real perPreRelValOpens=0.99 "Percentage of nominal pressure difference at which the pressure relief valve starts to open" annotation(Dialog(enable=use_preRelVal)); replaceable parameter RecordsCollection.TransferDataBaseDefinition transferDataBaseDefinition constrainedby diff --git a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferDataBaseDefinition.mo b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferDataBaseDefinition.mo index 43388e5e..a5be6195 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferDataBaseDefinition.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferDataBaseDefinition.mo @@ -48,8 +48,8 @@ partial record TransferDataBaseDefinition "Data record for hydraulic heat transf parameter Boolean use_hydrBalAutom = true "Use automatic hydraluic balancing to set dpHeaSysPreValve_nominal" annotation(Dialog(group="Thermostatic Valve")); parameter Modelica.Units.SI.PressureDifference dpHeaSysPreValve_nominal[ - nZones](each min=Modelica.Constants.eps)=if use_hydrBalAutom then max(dpRad_nominal) .- (dpRad_nominal) - else fill(Modelica.Constants.eps, nZones) + nZones]=if use_hydrBalAutom then max(dpRad_nominal) .- (dpRad_nominal) + else fill(0, nZones) "Pressure difference of each branch in heat distribution system as pre set value for valves (hydraulic balance)" annotation (Dialog(group="Thermostatic Valve", enable=use_hydrBalAutom)); parameter Real leakageOpening = 0.0001 diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo new file mode 100644 index 00000000..99240c3e --- /dev/null +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo @@ -0,0 +1,19 @@ +within BESMod.Systems.Hydraulical.Transfer.Tests; +model TestPressureBasedSystemWithReliefValve + extends BESMod.Systems.Hydraulical.Transfer.Tests.PartialTest( + redeclare + BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased + transfer( + use_preRelVal=true, + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData + transferDataBaseDefinition, + redeclare + BESMod.Systems.RecordsCollection.Movers.DefaultMover + pumpData, + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + radParameters)); + extends Modelica.Icons.Example; + +end TestPressureBasedSystemWithReliefValve; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/package.order b/BESMod/Systems/Hydraulical/Transfer/Tests/package.order index ca0542a2..d669d501 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/package.order @@ -2,3 +2,4 @@ TestIdealValveRadiatorSystem TestPressureBasedSystem TestUnderfloorHeating PartialTest +TestPressureBasedSystemWithReliefValve From 416a85ca03c23c3d2f6b6b5a8f63779d2cf0eb28 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 6 Sep 2022 13:46:55 +0200 Subject: [PATCH 047/131] Add doc --- .../Distribution/Components/Valves/PressureReliefValve.mo | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo index bd62e2a4..15cbf84f 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo @@ -145,5 +145,9 @@ equation extent={{20,94},{24,20}}, lineColor={0,0,0}, fillColor={215,215,215}, - fillPattern=FillPattern.CrossDiag)}), Diagram(coordinateSystem(preserveAspectRatio=false))); + fillPattern=FillPattern.CrossDiag)}), Diagram(coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +

Model for a pressure relief valve. If the pressure difference between supply and return passes dpThreshold_nominal, the valve starts to open. At dpFullOpen_nominal, the valve is fully opened.

+

Using this valve ensure a minimal mass flow rate in a transfer system.

+")); end PressureReliefValve; From 4f99321c940c05130b688307d6ef244f20b1ea43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Tue, 6 Sep 2022 15:30:14 +0200 Subject: [PATCH 048/131] Set nZones of HOM userProfiles according to building model --- BESMod/Resources/InternalGainsHOM2.txt | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 BESMod/Resources/InternalGainsHOM2.txt diff --git a/BESMod/Resources/InternalGainsHOM2.txt b/BESMod/Resources/InternalGainsHOM2.txt new file mode 100644 index 00000000..ab5cc0e8 --- /dev/null +++ b/BESMod/Resources/InternalGainsHOM2.txt @@ -0,0 +1,38 @@ +#1 +double Internals(35, 12) +0 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +3600 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +7200 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +10800 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +14400 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +18000 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +21600 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +25190 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +25210 0 426.8 50 163.4 355 0 0 50 447.6 0 0 +28790 0 426.8 50 163.4 355 0 0 50 447.6 0 0 +28810 0 0 50 0 0 0 0 50 0 0 0 +32400 0 0 50 0 0 0 0 50 0 0 0 +36000 0 0 50 0 0 0 0 50 0 0 0 +39600 0 0 50 0 0 0 0 50 0 0 0 +43200 0 0 50 0 0 0 0 50 0 0 0 +46800 0 0 50 0 0 0 0 50 0 0 0 +50390 0 0 50 0 0 0 0 50 0 0 0 +50410 0 0 50 0 0 0 126 50 0 126 0 +54000 0 0 50 0 0 0 126 50 0 126 0 +57590 0 0 50 0 0 0 126 50 0 126 0 +57610 0 0 50 0 0 0 0 50 0 0 0 +61190 0 0 50 0 0 0 0 50 0 0 0 +61210 300.8 0 50 0 0 0 300.8 50 0 300.8 0 +64790 300.8 0 50 0 0 0 300.8 50 0 300.8 0 +64810 300.8 652.8 50 163.4 681 0 0 50 0 0 0 +68390 300.8 652.8 50 163.4 681 0 0 50 0 0 0 +68410 504.4 426.8 50 0 329 0 0 50 0 0 0 +71990 504.4 426.8 50 0 329 0 0 50 0 0 0 +72010 504.4 0 50 0 0 0 213.4 50 221.6 213.4 0 +75590 504.4 0 50 0 0 0 213.4 50 221.6 213.4 0 +75610 454.4 0 50 0 0 0 82.8 50 271.6 82.8 0 +79190 454.4 0 50 0 0 0 82.8 50 271.6 82.8 0 +79210 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +82800 0 0 50 0 0 165.6 82.8 50 0 82.8 0 +86400 0 0 50 0 0 165.6 82.8 50 0 82.8 0 + From 9eadcfd1d8bc1176f475e049aace8e4a6cd73390 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 9 Sep 2022 09:23:29 +0200 Subject: [PATCH 049/131] Merge main branch changes --- BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo | 2 +- BESMod/Systems/UserProfiles/NoUserHOM.mo | 5 +---- dependencies.json | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo b/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo index 9ca25b80..b92971a2 100644 --- a/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo +++ b/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo @@ -1,6 +1,6 @@ within BESMod.Systems.UserProfiles; model AixLibHighOrderProfiles "Standard TEASER Profiles" - extends BaseClasses.RecordBasedDHWUser(nZones=10); + extends BaseClasses.PartialUserProfiles(nZones=10); parameter String fileNameIntGains=Modelica.Utilities.Files.loadResource("modelica://BESMod/Resources/InternalGainsHOM.txt") "File where matrix is stored" annotation (Dialog(tab="Inputs", group="Internal Gains")); parameter AixLib.DataBase.Profiles.ProfileBaseDataDefinition VentilationProfile = AixLib.DataBase.Profiles.Ventilation2perDayMean05perH(); diff --git a/BESMod/Systems/UserProfiles/NoUserHOM.mo b/BESMod/Systems/UserProfiles/NoUserHOM.mo index 6bb584c2..1ba4d331 100644 --- a/BESMod/Systems/UserProfiles/NoUserHOM.mo +++ b/BESMod/Systems/UserProfiles/NoUserHOM.mo @@ -1,9 +1,6 @@ within BESMod.Systems.UserProfiles; model NoUserHOM "No user" - extends BaseClasses.RecordBasedDHWUser( - final use_dhwCalc=false, - redeclare final BESMod.Systems.Demand.DHW.RecordsCollection.NoDHW - DHWProfile); + extends BaseClasses.PartialUserProfiles; Modelica.Blocks.Sources.Constant constZero[nZones](each k=0) annotation (Placement(transformation(extent={{-20,-20},{18,18}}))); diff --git a/dependencies.json b/dependencies.json index fe182212..1f63efa2 100644 --- a/dependencies.json +++ b/dependencies.json @@ -10,7 +10,7 @@ "optional": { "AixLib": { "url": "https://github.com/RWTH-EBC/AixLib", - "commit": "b341e6903b36fe032e0aff256496cef456c8ceca", + "commit": "a7c56fb58910bded5d594e3366d92acd4873c3a4", "default_branch": "development", "mo": "AixLib//package.mo" }, From e37dbf18b27a40761597eb97a511027338715209 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 9 Sep 2022 16:00:24 +0200 Subject: [PATCH 050/131] Adjust heating curve, adjust TOdaMea --- .../PartialTwoPoint_HPS_Controller.mo | 106 +++++++++--------- .../Control/Components/HeatingCurve.mo | 14 ++- .../Control/MonovalentGasBoiler.mo | 11 +- ...lDistributionTwoStorageParallelDetailed.mo | 3 +- .../BufferStorage/DefaultDetailedStorage.mo | 4 +- .../Generation/HeatPumpAndHeatingRod.mo | 20 ++-- .../PartialGetHeatGenerationCurve.mo | 8 +- 7 files changed, 95 insertions(+), 71 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo index 704da289..225c4d3a 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo @@ -6,11 +6,11 @@ partial model PartialTwoPoint_HPS_Controller replaceable BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController DHWOnOffContoller annotation (choicesAllMatching=true, Placement( - transformation(extent={{-128,78},{-112,94}}))); + transformation(extent={{-128,70},{-112,86}}))); replaceable BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController BufferOnOffController annotation (choicesAllMatching=true, Placement( - transformation(extent={{-128,34},{-112,48}}))); + transformation(extent={{-126,36},{-110,50}}))); replaceable BESMod.Systems.Hydraulical.Control.RecordsCollection.HeatPumpSafetyControl safetyControl annotation (choicesAllMatching=true,Placement(transformation(extent={{200,30},{220,50}}))); @@ -30,11 +30,10 @@ partial model PartialTwoPoint_HPS_Controller 90}}))); BESMod.Systems.Hydraulical.Control.Components.HeatingCurve heatingCurve( - TRoomSet=bivalentControlData.TSetRoomConst, GraHeaCurve=bivalentControlData.gradientHeatCurve, THeaThres=bivalentControlData.TSetRoomConst, dTOffSet_HC=bivalentControlData.dTOffSetHeatCurve) - annotation (Placement(transformation(extent={{-212,18},{-190,40}}))); + annotation (Placement(transformation(extent={{-160,20},{-140,40}}))); Modelica.Blocks.MathBoolean.Or HRactive(nu=3) annotation (Placement(transformation( @@ -101,10 +100,6 @@ partial model PartialTwoPoint_HPS_Controller rotation=0, origin={-181,-85}))); - Modelica.Blocks.Routing.RealPassThrough realPassThrough_T_Amb1 - "Only used to make warning disappear, has no effect on model veloccity" - annotation (Placement(transformation(extent={{-242,-102},{-220,-80}}))); - Modelica.Blocks.Logical.Switch switchHR annotation (Placement(transformation( extent={{-5,-5},{5,5}}, rotation=0, @@ -145,26 +140,30 @@ partial model PartialTwoPoint_HPS_Controller parameter BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType supCtrlTypeDHWSet=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local "Type of supervisory control for DHW Setpoint"; + Modelica.Blocks.Math.MinMax minMax(nu=transferParameters.nParallelDem) + annotation (Placement(transformation(extent={{-202,32},{-182,52}}))); equation connect(BufferOnOffController.T_Top, sigBusDistr.TStoBufTopMea) annotation ( - Line(points={{-128.8,45.9},{-316,45.9},{-316,-166},{4,-166},{4,-100},{1,-100}}, + Line(points={{-126.8,47.9},{-128,47.9},{-128,48},{-130,48},{-130,-86},{4,-86}, + {4,-100},{1,-100}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(DHWOnOffContoller.T_Top, sigBusDistr.TStoDHWTopMea) annotation (Line( - points={{-128.8,91.6},{-316,91.6},{-316,-166},{1,-166},{1,-100}}, + points={{-128.8,83.6},{-316,83.6},{-316,-166},{1,-166},{1,-100}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(heatingCurve.TSet, BufferOnOffController.T_Set) annotation (Line( - points={{-188.9,29},{-120,29},{-120,33.3}}, color={0,0,127})); + points={{-139,30},{-139,28},{-118,28},{-118,35.3}}, + color={0,0,127})); connect(DHWOnOffContoller.T_bot, sigBusDistr.TStoDHWTopMea) annotation (Line( - points={{-128.8,82},{-318,82},{-318,-166},{1,-166},{1,-100}}, + points={{-128.8,74},{-318,74},{-318,-166},{1,-166},{1,-100}}, color={0,0,127}), Text( string="%second", index=1, @@ -182,10 +181,10 @@ equation horizontalAlignment=TextAlignment.Right)); connect(DHWOnOffContoller.Auxilliar_Heater_On, HRactive.u[1]) annotation ( - Line(points={{-110.88,82},{-22,82},{-22,23.8333},{10,23.8333}}, color={ + Line(points={{-110.88,74},{-22,74},{-22,23.8333},{10,23.8333}}, color={ 255,0,255})); connect(BufferOnOffController.Auxilliar_Heater_On, HRactive.u[2]) annotation ( - Line(points={{-110.88,37.5},{-94,37.5},{-94,25},{10,25}}, color= + Line(points={{-108.88,39.5},{-94,39.5},{-94,25},{10,25}}, color= {255,0,255})); connect(TSet_DHW.y, HRactive.u[3]) annotation (Line(points={{-190.8,71.04},{ -96,71.04},{-96,26.1667},{10,26.1667}}, color= @@ -224,11 +223,11 @@ equation horizontalAlignment=TextAlignment.Left)); connect(HP_nSet_Controller.n_Set, securityControl.nSet) annotation (Line( points={{113.5,78},{144,78},{144,84.4},{191.867,84.4}}, color={0,0,127})); - connect(BufferOnOffController.HP_On, HP_active.u2) annotation (Line(points={{-110.88, - 45.9},{-78,45.9},{-78,54},{-38,54},{-38,87},{21,87}}, + connect(BufferOnOffController.HP_On, HP_active.u2) annotation (Line(points={{-108.88, + 47.9},{-78,47.9},{-78,54},{-38,54},{-38,87},{21,87}}, color={255,0,255})); connect(DHWOnOffContoller.HP_On, HP_active.u1) annotation (Line(points={{-110.88, - 91.6},{-32,91.6},{-32,91},{21,91}}, color={255,0,255})); + 83.6},{-32,83.6},{-32,91},{21,91}}, color={255,0,255})); connect(DHWHysOrLegionella.y, sigBusDistr.dhw_on) annotation (Line( points={{-71.25,69},{-26,69},{-26,-100},{1,-100}}, color={255,0,255}), Text( @@ -239,40 +238,20 @@ equation connect(DHWHysOrLegionella.y, switch1.u2) annotation (Line(points={{-71.25,69}, {-20,69},{-20,73},{57,73}}, color={255,0,255})); - connect(realPassThrough_T_Amb1.y, sigBusGen.hp_bus.TOdaMea) annotation (Line( - points={{-218.9,-91},{-200,-91},{-200,-99},{-152,-99}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(realPassThrough_T_Amb1.u, weaBus.TDryBul) annotation ( - Line(points={{-244.2,-91},{-256,-91},{-256,2},{-237,2}}, color= - {0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); connect(TSet_DHW.y, DHWHysOrLegionella.u[1]) annotation (Line(points={{-190.8, 71.04},{-96,71.04},{-96,67.6875},{-82,67.6875}}, color={255,0,255})); connect(DHWOnOffContoller.Auxilliar_Heater_On, DHWHysOrLegionella.u[2]) - annotation (Line(points={{-110.88,82},{-92,82},{-92,68.5625},{-82,68.5625}}, + annotation (Line(points={{-110.88,74},{-92,74},{-92,68.5625},{-82,68.5625}}, color={ 255,0,255})); connect(DHWOnOffContoller.HP_On, DHWHysOrLegionella.u[3]) annotation (Line( - points={{-110.88,91.6},{-90,91.6},{-90,69.4375},{-82,69.4375}}, + points={{-110.88,83.6},{-90,83.6},{-90,69.4375},{-82,69.4375}}, color={255,0,255})); connect(TSet_DHW.y, DHWHysOrLegionella.u[4]) annotation (Line(points={{-190.8, 71.04},{-136.4,71.04},{-136.4,70.3125},{-82,70.3125}}, color={255,0,255})); - connect(realPassThrough_T_Amb1.y, DHWOnOffContoller.T_oda) annotation (Line( - points={{-218.9,-91},{-218.9,-62},{-250,-62},{-250,92},{-120,92},{-120, - 94.96}}, color={0,0,127})); - connect(realPassThrough_T_Amb1.y, BufferOnOffController.T_oda) annotation ( - Line(points={{-218.9,-91},{-218.9,-64},{-252,-64},{-252,48.84},{-120, - 48.84}}, color={0,0,127})); connect(BufferOnOffController.T_bot, sigBusDistr.TStoBufTopMea) annotation ( - Line(points={{-128.8,37.5},{-130,37.5},{-130,-86},{134,-86},{134,-100},{1, + Line(points={{-126.8,39.5},{-130,39.5},{-130,-86},{134,-86},{134,-100},{1, -100}}, color={0,0,127}), Text( string="%second", index=1, @@ -285,10 +264,10 @@ equation connect(max.y, switchHR.u1) annotation (Line(points={{28.4,38},{37,38},{37,29}}, color={0,0,127})); connect(BufferOnOffController.Auxilliar_Heater_set, max.u1) annotation (Line( - points={{-110.88,34.98},{-84,34.98},{-84,35.6},{19.2,35.6}}, color={0,0, + points={{-108.88,36.98},{-84,36.98},{-84,35.6},{19.2,35.6}}, color={0,0, 127})); connect(DHWOnOffContoller.Auxilliar_Heater_set, max.u2) annotation (Line( - points={{-110.88,79.12},{-104,79.12},{-104,64},{-10,64},{-10,40.4},{19.2, + points={{-110.88,71.12},{-104,71.12},{-104,64},{-10,64},{-10,40.4},{19.2, 40.4}}, color={0,0,127})); connect(switchHR.y, sigBusGen.hr_on) annotation (Line(points={{48.5,25},{62,25}, {62,-48},{-152,-48},{-152,-99}}, color={0,0,127}), Text( @@ -296,9 +275,6 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(realPassThrough_T_Amb1.y, heatingCurve.TOda) annotation (Line( - points={{-218.9,-91},{-208,-91},{-208,-28},{-226,-28},{-226,29},{ - -214.2,29}}, color={0,0,127})); connect(HP_nSet_Controller.IsOn, sigBusGen.hp_bus.onOffMea) annotation (Line( points={{88,61.2},{88,-58},{-152,-58},{-152,-99}}, color={255,0,255}), Text( @@ -310,8 +286,9 @@ equation {24,74},{24,80},{35,80}}, color={0,0,127})); connect(switch1.y, HP_nSet_Controller.T_Set) annotation (Line(points={{68.5, 73},{70,73},{70,86.4},{79,86.4}}, color={0,0,127})); - connect(heatingCurve.TSet, add_dT_LoadingBuf.u1) annotation (Line(points={{ - -188.9,29},{4,29},{4,62},{37,62}}, color={0,0,127})); + connect(heatingCurve.TSet, add_dT_LoadingBuf.u1) annotation (Line(points={{-139,30}, + {-139,28},{4,28},{4,66},{32,66},{32,62},{37,62}}, + color={0,0,127})); connect(add_dT_LoadingBuf.y, switch1.u3) annotation (Line(points={{48.5,59},{ 54,59},{54,69},{57,69}}, color={0,0,127})); connect(add_dT_LoadingDHW.y, switch1.u1) annotation (Line(points={{46.5,83},{ @@ -332,8 +309,8 @@ equation points={{-190.8,78},{-188,78},{-188,73.2},{-183.2,73.2}}, color={0,0, 127})); connect(supervisoryControlDHW.y, DHWOnOffContoller.T_Set) annotation (Line( - points={{-168.8,78},{-150,78},{-150,74},{-122,74},{-122,77.2},{-120, - 77.2}}, color={0,0,127})); + points={{-168.8,78},{-150,78},{-150,74},{-122,74},{-122,69.2},{-120,69.2}}, + color={0,0,127})); connect(supervisoryControlDHW.y, add_dT_LoadingDHW.u1) annotation (Line( points={{-168.8,78},{-150,78},{-150,76},{-10,76},{-10,86},{35,86}}, color={0,0,127})); @@ -351,6 +328,35 @@ equation index=1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); + connect(heatingCurve.TOda, weaBus.TDryBul) annotation (Line(points={{-162,30}, + {-236,30},{-236,2},{-237,2}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(BufferOnOffController.T_oda, weaBus.TDryBul) annotation (Line(points={ + {-118,50.84},{-118,58},{-236,58},{-236,30},{-237,30},{-237,2}}, color= + {0,0,127}), Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(DHWOnOffContoller.T_oda, weaBus.TDryBul) annotation (Line(points={{-120, + 86.96},{-192,86.96},{-192,94},{-248,94},{-248,2},{-237,2}}, color={0,0, + 127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(minMax.u, useProBus.TZoneSet) annotation (Line(points={{-202,42},{-206, + 42},{-206,52},{-208,52},{-208,60},{-119,60},{-119,103}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(minMax.yMax, heatingCurve.TSetRoom) + annotation (Line(points={{-181,48},{-150,48},{-150,42}}, color={0,0,127})); annotation (Diagram(graphics={ Rectangle( extent={{-240,100},{-50,60}}, @@ -366,7 +372,7 @@ equation lineColor={0,140,72}, lineThickness=1), Text( - extent={{-216,-16},{-122,18}}, + extent={{-216,-14},{-122,20}}, lineColor={0,140,72}, lineThickness=1, textString="Buffer Control"), diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatingCurve.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatingCurve.mo index b2db66fc..88491149 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatingCurve.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/HeatingCurve.mo @@ -1,9 +1,6 @@ -within BESMod.Systems.Hydraulical.Control.Components; +within BESMod.Systems.Hydraulical.Control.Components; model HeatingCurve "Defines T_supply of buffer storage tank (in dependency of ambient temperature)" - - parameter Modelica.Units.SI.Temperature TRoomSet=295.15 - "Expected room temperature (22°C)"; parameter Real GraHeaCurve=1 "Heat curve gradient"; parameter Modelica.Units.SI.Temperature THeaThres=273.15 + 15 "Constant heating threshold temperature"; @@ -15,12 +12,17 @@ model HeatingCurve Modelica.Blocks.Interfaces.RealOutput TSet annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Interfaces.RealInput TSetRoom annotation (Placement( + transformation( + extent={{-20,-20},{20,20}}, + rotation=270, + origin={0,120}))); equation if TOda < THeaThres then - TSet = GraHeaCurve*(TRoomSet - TOda) + TRoomSet + dTOffSet_HC; + TSet = GraHeaCurve*(TSetRoom - TOda) + TSetRoom + dTOffSet_HC; else // No heating required. - TSet = TRoomSet + dTOffSet_HC; + TSet = TSetRoom + dTOffSet_HC; end if; annotation (Icon(graphics={Rectangle( extent={{-100,100},{100,-100}}, diff --git a/BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo b/BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo index b9f981f5..d887c85e 100644 --- a/BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo @@ -3,7 +3,6 @@ model MonovalentGasBoiler "PI Control of gas boiler" extends BaseClasses.SystemWithThermostaticValveControl; BESMod.Systems.Hydraulical.Control.Components.HeatingCurve heatingCurve( - TRoomSet=monovalentControlParas.TSetRoomConst, GraHeaCurve=monovalentControlParas.gradientHeatCurve, THeaThres=monovalentControlParas.TSetRoomConst, dTOffSet_HC=monovalentControlParas.dTOffSetHeatCurve) @@ -68,6 +67,8 @@ model MonovalentGasBoiler "PI Control of gas boiler" annotation (Placement(transformation(extent={{46,48},{66,68}}))); Modelica.Blocks.Math.BooleanToReal booleanToReal annotation (Placement(transformation(extent={{40,0},{60,20}}))); + Modelica.Blocks.Math.MinMax minMax(nu=transferParameters.nParallelDem) + annotation (Placement(transformation(extent={{-240,50},{-220,70}}))); equation connect(sigBusDistr,TSet_DHW. sigBusDistr) annotation (Line( points={{1,-100},{10,-100},{10,-146},{-280,-146},{-280,89.9},{-220,89.9}}, @@ -175,4 +176,12 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); + connect(minMax.yMax, heatingCurve.TSetRoom) + annotation (Line(points={{-219,66},{-210,66},{-210,42}}, color={0,0,127})); + connect(minMax.u, useProBus.TZoneSet) annotation (Line(points={{-240,60},{-244, + 60},{-244,103},{-119,103}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); end MonovalentGasBoiler; diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo index 4a41edfa..01f36cb0 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo @@ -229,7 +229,8 @@ partial model PartialDistributionTwoStorageParallelDetailed rotation=0, origin={62,87}))); replaceable Generation.RecordsCollection.HeatingRodBaseDataDefinition heatingRodAftBufParameters - if use_heatingRodAfterBuffer "Parameters for heating rod after buffer storage" + if use_heatingRodAfterBuffer + "Parameters for heating rod after buffer storage" annotation (choicesAllMatching=true, Placement(transformation( extent={{-6,-6},{6,6}}, rotation=0, diff --git a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/DefaultDetailedStorage.mo b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/DefaultDetailedStorage.mo index 6ce2c2a1..fed5e153 100644 --- a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/DefaultDetailedStorage.mo +++ b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/DefaultDetailedStorage.mo @@ -2,6 +2,6 @@ within BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage; record DefaultDetailedStorage extends BufferStorageBaseDataDefinition( dTLoadingHC1=5, - redeclare AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC2, - redeclare AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1); + redeclare AixLib.DataBase.Pipes.Copper.Copper_28x0_9 pipeHC2, + redeclare AixLib.DataBase.Pipes.Copper.Copper_28x0_9 pipeHC1); end DefaultDetailedStorage; diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index 0cd9c887..97ef82d4 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -332,14 +332,6 @@ equation horizontalAlignment=TextAlignment.Right)); connect(bou_air.T_in, switch2.y) annotation (Line(points={{-102,56},{-113,56}}, color={0,0,127})); - connect(sigBusGen.hp_bus.TOdaMea, switch2.u1) annotation (Line( - points={{2,98},{-150,98},{-150,64},{-136,64}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); connect(switch2.u2, AirOrSoil.y) annotation (Line(points={{-136,56},{-157.4,56}}, color={255,0,255})); connect(hea.u, sigBusGen.hr_on) annotation (Line(points={{18.8,89.6},{18.8,74}, @@ -480,6 +472,16 @@ equation extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); end if; - annotation (Diagram(coordinateSystem(extent={{-180,-140},{100,100}})), Icon( + connect(switch2.u1, weaBus.TDryBul) annotation (Line(points={{-136,64},{-144,64}, + {-144,80},{-101,80}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + annotation (Line( + points={{-52.775,-6.78},{-52.775,33.61},{-56,33.61},{-56,74}}, + color={255,204,51}, + thickness=0.5), + Diagram(coordinateSystem(extent={{-180,-140},{100,100}})), Icon( coordinateSystem(extent={{-180,-140},{100,100}}))); end HeatPumpAndHeatingRod; diff --git a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo index 1c9a9f78..b7ec5862 100644 --- a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo +++ b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo @@ -39,7 +39,6 @@ partial model PartialGetHeatGenerationCurve rotation=180, origin={82,54}))); Systems.Hydraulical.Control.Components.HeatingCurve heatingCurve( - TRoomSet=systemParameters.TSetZone_nominal[1], GraHeaCurve=bivalentHeatPumpControlDataDefinition.gradientHeatCurve, THeaThres=systemParameters.TSetZone_nominal[1], dTOffSet_HC=bivalentHeatPumpControlDataDefinition.dTOffSetHeatCurve - @@ -63,6 +62,8 @@ partial model PartialGetHeatGenerationCurve TSup_nominal=systemParameters.THydSup_nominal[1], TSetRoomConst=systemParameters.TSetZone_nominal[1]) annotation (choicesAllMatching=true,Placement(transformation(extent={{-100,82},{-80,102}}))); + Modelica.Blocks.Sources.Constant const3(k=max(systemParameters.TSetZone_nominal)) + annotation (Placement(transformation(extent={{-150,-114},{-130,-94}}))); equation connect(sigBusGen, generation.sigBusGen) annotation (Line( points={{-62,64},{-0.3,64},{-0.3,35.28}}, @@ -123,7 +124,10 @@ equation 127})); connect(realExpression.y, QCon_flow) annotation (Line(points={{51,82},{88,82}, {88,60},{110,60}}, color={0,0,127})); + connect(const3.y, heatingCurve.TSetRoom) annotation (Line(points={{-129,-104}, + {-96,-104},{-96,-106},{-30,-106},{-30,-57.8},{-7,-57.8}}, color={0,0, + 127})); annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); end PartialGetHeatGenerationCurve; From 210c3bdf96d56de73702958189b11503cb18933f Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 9 Sep 2022 16:00:56 +0200 Subject: [PATCH 051/131] correct unit in TZoneMea --- .../Building/Components/AixLibHighOrderOFD.mo | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo index c801e28b..3d6e8c25 100644 --- a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo +++ b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Demand.Building.Components; model AixLibHighOrderOFD "High order OFD" extends Building.BaseClasses.PartialAixLibHighOrder( - final nZones=10); + final nZones=10, TZoneMea(each final unit="K", each final displayUnit="degC")); parameter Integer nZonesNonHeated = 1 "Non heated rooms of the building"; @@ -27,12 +27,14 @@ model AixLibHighOrderOFD "High order OFD" AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow (windowarea=2) constrainedby - AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow + annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); replaceable parameter AixLib.DataBase.WindowsDoors.Simple.OWBaseDataDefinition_Simple Type_Win "Window parametrization" annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); replaceable model CorrSolarGainWin = AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG constrainedby - AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG "Correction model for solar irradiance as transmitted radiation" annotation (choicesAllMatching=true, Dialog(tab="Outer walls", group="Windows", enable = withWindow and outside)); + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG + "Correction model for solar irradiance as transmitted radiation" annotation (choicesAllMatching=true, Dialog(tab="Outer walls", group="Windows", enable = withWindow and outside)); parameter Boolean use_sunblind=false "Will sunblind become active automatically?" annotation (Dialog(tab="Outer walls", group="Sunblind")); parameter Modelica.Units.SI.CoefficientOfHeatTransfer UValOutDoors=2.5 @@ -137,16 +139,16 @@ model AixLibHighOrderOFD "High order OFD" equation // Romm Temperatures - TZoneMea[1]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.groundFloor_Building.Livingroom.airload.heatPort.T); - TZoneMea[2]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.groundFloor_Building.Hobby.airload.heatPort.T); - TZoneMea[3]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.groundFloor_Building.Corridor.airload.heatPort.T); - TZoneMea[4]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.groundFloor_Building.WC_Storage.airload.heatPort.T); - TZoneMea[5]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.groundFloor_Building.Kitchen.airload.heatPort.T); - TZoneMea[6]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.upperFloor_Building.Bedroom.airload.heatPort.T); - TZoneMea[7]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.upperFloor_Building.Children1.airload.heatPort.T); - TZoneMea[8]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.upperFloor_Building.Corridor.airload.heatPort.T); - TZoneMea[9]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.upperFloor_Building.Bath.airload.heatPort.T); - TZoneMea[10]=Modelica.Units.Conversions.to_degC(wholeHouseBuildingEnvelope.upperFloor_Building.Children2.airload.heatPort.T); + TZoneMea[1]=wholeHouseBuildingEnvelope.groundFloor_Building.Livingroom.airload.heatPort.T; + TZoneMea[2]=wholeHouseBuildingEnvelope.groundFloor_Building.Hobby.airload.heatPort.T; + TZoneMea[3]=wholeHouseBuildingEnvelope.groundFloor_Building.Corridor.airload.heatPort.T; + TZoneMea[4]=wholeHouseBuildingEnvelope.groundFloor_Building.WC_Storage.airload.heatPort.T; + TZoneMea[5]=wholeHouseBuildingEnvelope.groundFloor_Building.Kitchen.airload.heatPort.T; + TZoneMea[6]=wholeHouseBuildingEnvelope.upperFloor_Building.Bedroom.airload.heatPort.T; + TZoneMea[7]=wholeHouseBuildingEnvelope.upperFloor_Building.Children1.airload.heatPort.T; + TZoneMea[8]=wholeHouseBuildingEnvelope.upperFloor_Building.Corridor.airload.heatPort.T; + TZoneMea[9]=wholeHouseBuildingEnvelope.upperFloor_Building.Bath.airload.heatPort.T; + TZoneMea[10]=wholeHouseBuildingEnvelope.upperFloor_Building.Children2.airload.heatPort.T; connect(wholeHouseBuildingEnvelope.groPlateUp, wholeHouseBuildingEnvelope.groFloDown) @@ -192,13 +194,14 @@ equation 127})); end for; - connect(convRadToCombPort.portConvRadComb, wholeHouseBuildingEnvelope.heatingToRooms[11]) annotation (Line(points={{-46,-56},{-72,-56},{-72,5.41091},{-44,5.41091}}, + connect(convRadToCombPort.portConvRadComb, wholeHouseBuildingEnvelope.heatingToRooms[11]) annotation (Line(points={{-46,-56}, + {-72,-56},{-72,2.86545},{-44,2.86545}}, color={191,0,0})); connect(InternalGains1.port, convRadToCombPort.portRad) annotation (Line(points={{-16,-61},{-26,-61}}, color={191,0,0})); connect(InternalGains.port, convRadToCombPort.portConv) annotation (Line(points={{-16,-51},{-26,-51}}, color={191,0,0})); connect(const1.y, wholeHouseBuildingEnvelope.AirExchangePort[11]) annotation ( - Line(points={{-73.4,20},{-68,20},{-68,49.0909},{-48.7,49.0909}}, color={0,0, + Line(points={{-73.4,20},{-68,20},{-68,46.5455},{-48.7,46.5455}}, color={0,0, 127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); From c4c12196676a31052e24ff9fcd4079fceb284659 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 9 Sep 2022 18:39:58 +0200 Subject: [PATCH 052/131] Remove artificial pumps all together. --- .../MyOwnHeatingRodEfficiencyStudy/BES.mo | 14 +- .../SolarThermalSystem/SolarThermalHPS.mo | 4 - .../SolarThermalHPSBuildingsLib.mo | 4 - BESMod/Examples/UseCaseAachen/BES.mo | 16 +- BESMod/Examples/UseCaseAachenTimeBased/BES.mo | 15 +- BESMod/Examples/UseCaseHOM/BES_HOM.mo | 4 +- .../PartialModelicaConferenceUseCase.mo | 16 +- .../Building/HeatDemand/CalcHeaDemROM.mo | 6 +- .../Components/Pumps/ArtificalPumpFixedT.mo | 11 - .../Pumps/ArtificalPumpIsotermhal.mo | 19 -- .../Components/Pumps/ArtificalPump_h_in.mo | 19 -- .../Pumps/BaseClasses/PartialArtificalPump.mo | 29 --- .../BaseClasses/PartialArtificalPumpT.mo | 13 -- .../BaseClasses/PartialArtificalPump_h.mo | 12 - .../Components/Pumps/BaseClasses/package.mo | 3 - .../Pumps/BaseClasses/package.order | 3 - .../Hydraulical/Components/Pumps/package.mo | 5 - .../Components/Pumps/package.order | 4 - .../Hydraulical/Components/package.order | 1 - .../PartialTwoPoint_HPS_Controller.mo | 31 ++- .../Valves/ArtificialThreeWayValve.mo | 209 ------------------ .../Tests/Test_ArtificalThreeWayValve.mo | 61 ----- .../DistributionTwoStorageParallel.mo | 97 +++++--- .../Distribution/Tests/TestSimpleStorages.mo | 10 +- .../Generation/HeatPumpAndHeatingRod.mo | 130 ++--------- .../UserProfiles/AixLibHighOrderProfiles.mo | 2 +- BESMod/Systems/UserProfiles/NoUserHOM.mo | 2 +- 27 files changed, 151 insertions(+), 589 deletions(-) delete mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpFixedT.mo delete mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpIsotermhal.mo delete mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPump_h_in.mo delete mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump.mo delete mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPumpT.mo delete mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump_h.mo delete mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.mo delete mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.order delete mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/package.mo delete mode 100644 BESMod/Systems/Hydraulical/Components/Pumps/package.order delete mode 100644 BESMod/Systems/Hydraulical/Distribution/Components/Valves/ArtificialThreeWayValve.mo delete mode 100644 BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/Test_ArtificalThreeWayValve.mo diff --git a/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BES.mo b/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BES.mo index 05e38485..b2b1b771 100644 --- a/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BES.mo +++ b/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BES.mo @@ -21,7 +21,6 @@ model BES BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR heatingRodParameters(eta_hr=parameterStudy.efficiceny_heating_rod), redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - redeclare package Medium_eva = AixLib.Media.Air), redeclare BESMod.Systems.Hydraulical.Control.Biv_PI_ConFlow_HPSController control( @@ -39,11 +38,15 @@ model BES bivalentControlData), redeclare BESMod.Systems.Hydraulical.Distribution.DistributionTwoStorageParallel - distribution(redeclare + distribution( + redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - bufParameters(dTLoadingHC1=10), redeclare + bufParameters(dTLoadingHC1=10), + redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters(dTLoadingHC1=10)), + dhwParameters(dTLoadingHC1=10), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + threeWayValveParameters), redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorTransferSystem transfer(redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData @@ -52,9 +55,7 @@ model BES redeclare BESMod.Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.Demand.DHW.TappingProfiles.PassThrough calcmFlow), - redeclare BESMod.Systems.UserProfiles.TEASERProfiles userProfiles, redeclare BESMod.Examples.MyOwnHeatingRodEfficiencyStudy.SimpleStudyOfHeatingRodEfficiency @@ -64,6 +65,7 @@ model BES THydSup_nominal={328.15}, use_ventilation=false, use_elecHeating=false)); + extends Modelica.Icons.Example; annotation (experiment( diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo index 461100d9..f4e87f41 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo @@ -9,7 +9,6 @@ model SolarThermalHPS "HPS which is supported by a solar thermal collector" redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( redeclare BESMod.Systems.Hydraulical.Generation.SolarThermalBivHP generation( - use_pressure=true, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap (refrigerant= "Propane", flowsheet="VIPhaseSeparatorFlowsheet"), @@ -62,13 +61,10 @@ model SolarThermalHPS "HPS which is supported by a solar thermal collector" BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData transferDataBaseDefinition, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), - redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, redeclare Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), - redeclare SolarThermalSystemParameters systemParameters, redeclare SolarThermalDesignOptimization parameterStudy( A=11, diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalHPSBuildingsLib.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalHPSBuildingsLib.mo index 4c9765a8..bfd0e3b6 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalHPSBuildingsLib.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalHPSBuildingsLib.mo @@ -10,7 +10,6 @@ model SolarThermalHPSBuildingsLib redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( redeclare BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib generation( - use_pressure=true, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap (refrigerant= "Propane", flowsheet="VIPhaseSeparatorFlowsheet"), @@ -63,13 +62,10 @@ model SolarThermalHPSBuildingsLib BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData transferDataBaseDefinition, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), - redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, redeclare Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), - redeclare SolarThermalSystemParameters systemParameters, redeclare SolarThermalDesignOptimization parameterStudy( A=11, diff --git a/BESMod/Examples/UseCaseAachen/BES.mo b/BESMod/Examples/UseCaseAachen/BES.mo index c97e1051..572d1bdf 100644 --- a/BESMod/Examples/UseCaseAachen/BES.mo +++ b/BESMod/Examples/UseCaseAachen/BES.mo @@ -9,14 +9,11 @@ model BES redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - redeclare package Medium_eva = AixLib.Media.Air, - use_pressure=false, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP heatPumpParameters( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal /parameterStudy.QHP_flow_biv, @@ -31,7 +28,6 @@ model BES redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, - refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet")), redeclare Systems.Hydraulical.Control.PartBiv_PI_ConOut_HPS control( @@ -52,14 +48,16 @@ model BES safetyControl, TCutOff=parameterStudy.TCutOff, QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.heatPumpParameters.scalingFactor), - redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel - distribution(redeclare + distribution( + redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage bufParameters(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), - redeclare + redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters(dTLoadingHC1=10)), + dhwParameters(dTLoadingHC1=10), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + threeWayValveParameters), redeclare Systems.Hydraulical.Transfer.RadiatorTransferSystem transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData @@ -67,7 +65,6 @@ model BES BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), @@ -78,6 +75,7 @@ model BES redeclare final package MediumZone = AixLib.Media.Air, redeclare final package MediumHyd = AixLib.Media.Water, redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + extends Modelica.Icons.Example; annotation (experiment( diff --git a/BESMod/Examples/UseCaseAachenTimeBased/BES.mo b/BESMod/Examples/UseCaseAachenTimeBased/BES.mo index 7f1af3e3..0a114e0b 100644 --- a/BESMod/Examples/UseCaseAachenTimeBased/BES.mo +++ b/BESMod/Examples/UseCaseAachenTimeBased/BES.mo @@ -15,12 +15,10 @@ model BES redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP heatPumpParameters(genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel), - redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR heatingRodParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - redeclare package Medium_eva = AixLib.Media.Air), redeclare BESMod.Systems.Hydraulical.Control.ConstHys_PI_ConOut_HPSController @@ -46,11 +44,15 @@ model BES TSet_DHW), redeclare BESMod.Systems.Hydraulical.Distribution.DistributionTwoStorageParallel - distribution(redeclare + distribution( + redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - bufParameters(dTLoadingHC1=0), redeclare + bufParameters(dTLoadingHC1=0), + redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters(dTLoadingHC1=10)), + dhwParameters(dTLoadingHC1=10), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + threeWayValveParameters), redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorTransferSystem transfer(redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData @@ -59,9 +61,7 @@ model BES redeclare BESMod.Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.Demand.DHW.TappingProfiles.PassThrough calcmFlow), - redeclare BESMod.Systems.UserProfiles.TEASERProfiles userProfiles, redeclare BESMod.Examples.UseCaseAachenTimeBased.ParametersToChange parameterStudy, @@ -70,6 +70,7 @@ model BES StopTime=31536000, Interval=600, __Dymola_Algorithm="Dassl")); + extends Modelica.Icons.Example; annotation (experiment( diff --git a/BESMod/Examples/UseCaseHOM/BES_HOM.mo b/BESMod/Examples/UseCaseHOM/BES_HOM.mo index 3c3a17f8..fe3579c5 100644 --- a/BESMod/Examples/UseCaseHOM/BES_HOM.mo +++ b/BESMod/Examples/UseCaseHOM/BES_HOM.mo @@ -23,12 +23,13 @@ model BES_HOM redeclare BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare package Medium_eva = AixLib.Media.Air, - use_pressure=false, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP heatPumpParameters( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal /parameterStudy.QHP_flow_biv, @@ -43,6 +44,7 @@ model BES_HOM redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, + refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet")), redeclare BESMod.Systems.Hydraulical.Control.ConstHys_OnOff_HPSControll diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 9b78c2e9..2e9474c9 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -11,9 +11,7 @@ partial model PartialModelicaConferenceUseCase generation( redeclare model CellTemperature = AixLib.Electrical.PVSystem.BaseClasses.CellTemperatureMountingContactToGround, - redeclare AixLib.DataBase.SolarElectric.SchuecoSPV170SME1 pVParameters, - lat=weaDat.lat, lon=weaDat.lon, alt=weaDat.alt, @@ -31,7 +29,6 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, redeclare package Medium_eva = AixLib.Media.Air, - use_pressure=false, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP heatPumpParameters( @@ -69,13 +66,16 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW TSet_DHW, supCtrlTypeDHWSet=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal), - redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel - distribution(redeclare + distribution( + redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - bufParameters(dTLoadingHC1=0), redeclare + bufParameters(dTLoadingHC1=0), + redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters(dTLoadingHC1=10)), + dhwParameters(dTLoadingHC1=10), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + threeWayValveParameters), redeclare Systems.Hydraulical.Transfer.RadiatorTransferSystem transfer( dTTra_nominal=fill(10, hydraulic.transfer.nParallelDem), f_design=fill(1.2, hydraulic.transfer.nParallelDem), @@ -83,7 +83,6 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), - redeclare Systems.Demand.DHW.DHW DHW( energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare final BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM @@ -114,7 +113,6 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParas, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover fanData, - redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor tempSensorData), diff --git a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemROM.mo b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemROM.mo index e136416d..fbc4065f 100644 --- a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemROM.mo +++ b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemROM.mo @@ -6,12 +6,12 @@ model CalcHeaDemROM KR_heater=building.zoneParam[1].KRHeat, h_heater=building.zoneParam.hHeat*10, redeclare BESMod.Examples.BAUSimStudy.BESParameters - systemParameters(TOda_nominal=261.05, THydSup_nominal={328.15}), + systemParameters(TOda_nominal=259.15, THydSup_nominal={328.15}), redeclare BESMod.Systems.Demand.Building.TEASERThermalZone building( nZones=1, - redeclare BESMod.Examples.BAUSimStudy.Buildings.Case_1_standard - oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0), + redeclare BESMod.Examples.BAUSimStudy.Buildings.Case_1_retrofit + oneZoneParam, final ventRate=0.5 .- building.zoneParam.baseACH)); extends Modelica.Icons.Example; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpFixedT.mo b/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpFixedT.mo deleted file mode 100644 index 6e02d57e..00000000 --- a/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpFixedT.mo +++ /dev/null @@ -1,11 +0,0 @@ -within BESMod.Systems.Hydraulical.Components.Pumps; -model ArtificalPumpFixedT - "Temperature of source is a given fixed value" - extends BaseClasses.PartialArtificalPumpT(final bou_sink(nPorts=1), - bou_source(final T=T_fixed)); - parameter Modelica.Media.Interfaces.Types.Temperature T_fixed=Medium.T_default - "Fixed value of temperature for outlet of pump"; -equation - connect(bou_sink.ports[1], port_a) - annotation (Line(points={{-62,0},{-100,0}}, color={0,127,255})); -end ArtificalPumpFixedT; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpIsotermhal.mo b/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpIsotermhal.mo deleted file mode 100644 index 67ba2d94..00000000 --- a/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPumpIsotermhal.mo +++ /dev/null @@ -1,19 +0,0 @@ -within BESMod.Systems.Hydraulical.Components.Pumps; -model ArtificalPumpIsotermhal - "Pump without temperature losses" -extends BaseClasses.PartialArtificalPumpT(bou_source(use_T_in=true), final - bou_sink(final nPorts=1)); - IBPSA.Fluid.Sensors.TemperatureTwoPort senTem( - redeclare final package Medium = Medium, - allowFlowReversal=false, m_flow_nominal=m_flow_nominal) - annotation (Placement(transformation(extent={{-90,-10},{-70,10}}))); - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal - "Nominal mass flow rate, used for regularization near zero flow"; -equation - connect(port_a, senTem.port_a) - annotation (Line(points={{-100,0},{-90,0}}, color={0,127,255})); - connect(bou_sink.ports[1], senTem.port_b) - annotation (Line(points={{-62,0},{-70,0}}, color={0,127,255})); -connect(senTem.T, bou_source.T_in) annotation (Line(points={{-80,11},{-78,11}, - {-78,26},{-40,26},{-40,24},{-16,24},{-16,4},{58,4}}, color={0,0,127})); -end ArtificalPumpIsotermhal; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPump_h_in.mo b/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPump_h_in.mo deleted file mode 100644 index e1a6f444..00000000 --- a/BESMod/Systems/Hydraulical/Components/Pumps/ArtificalPump_h_in.mo +++ /dev/null @@ -1,19 +0,0 @@ -within BESMod.Systems.Hydraulical.Components.Pumps; -model ArtificalPump_h_in "Artifical pump with enthalpy as input" - extends BaseClasses.PartialArtificalPump_h(bou_sink(nPorts=1), bou_source( - use_h_in=true)); - Modelica.Blocks.Interfaces.RealInput h_flow_in(final unit="J/(kg)") - "Prescribed enthaply flow rate" annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=270, - origin={-60,120}), iconTransformation( - extent={{-20,-20},{20,20}}, - rotation=270, - origin={-84,114}))); -equation - connect(port_a, bou_sink.ports[1]) - annotation (Line(points={{-100,0},{-62,0}}, color={0,127,255})); - connect(h_flow_in, bou_source.h_in) annotation (Line(points={{-60,120},{-60, - 42},{-28,42},{-28,4},{50,4}}, - color={0,0,127})); -end ArtificalPump_h_in; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump.mo b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump.mo deleted file mode 100644 index c6578eec..00000000 --- a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump.mo +++ /dev/null @@ -1,29 +0,0 @@ -within BESMod.Systems.Hydraulical.Components.Pumps.BaseClasses; -partial model PartialArtificalPump - "Partial model a sink combined with a source to avoid calculation of pump characteristics (time-consuming)" - extends IBPSA.Fluid.Interfaces.PartialTwoPort; - - parameter Modelica.Media.Interfaces.Types.AbsolutePressure p=Medium.p_default - "Fixed value of pressure"; - - IBPSA.Fluid.Sources.Boundary_ph bou_sink(redeclare package Medium = Medium, - p=p) - annotation (Placement(transformation(extent={{-42,-10},{-62,10}}))); - Modelica.Blocks.Interfaces.RealInput m_flow_in(final unit="kg/s") - "Prescribed mass flow rate" - annotation (Placement(transformation(extent={{-20,-20},{20,20}}, - rotation=270, - origin={0,120}), iconTransformation(extent={{-20,-20}, - {20,20}}, - rotation=270, - origin={0,116}))); - - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Ellipse(extent = {{-100, 96}, {100, -104}}, - lineColor = {0, 0, 0}, fillColor = {0, 127, 0}, - fillPattern=FillPattern.Solid), - Polygon(points = {{-42, 70}, {78, -4}, {-42, -78}, {-42, 70}}, - lineColor = {0, 0, 0}, fillColor = {175, 175, 175}, - fillPattern=FillPattern.Solid)}), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false))); -end PartialArtificalPump; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPumpT.mo b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPumpT.mo deleted file mode 100644 index 3f70210c..00000000 --- a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPumpT.mo +++ /dev/null @@ -1,13 +0,0 @@ -within BESMod.Systems.Hydraulical.Components.Pumps.BaseClasses; -partial model PartialArtificalPumpT "Setting m_flow and temperature possible" - extends PartialArtificalPump; - IBPSA.Fluid.Sources.MassFlowSource_T bou_source( - redeclare package Medium = Medium, final use_m_flow_in=true, - nPorts=1) - annotation (Placement(transformation(extent={{60,-10},{80,10}}))); -equation - connect(bou_source.ports[1], port_b) - annotation (Line(points={{80,0},{100,0}}, color={0,127,255})); - connect(m_flow_in, bou_source.m_flow_in) - annotation (Line(points={{0,120},{0,8},{58,8}}, color={0,0,127})); -end PartialArtificalPumpT; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump_h.mo b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump_h.mo deleted file mode 100644 index 47c927bb..00000000 --- a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/PartialArtificalPump_h.mo +++ /dev/null @@ -1,12 +0,0 @@ -within BESMod.Systems.Hydraulical.Components.Pumps.BaseClasses; -partial model PartialArtificalPump_h - extends PartialArtificalPump; - IBPSA.Fluid.Sources.MassFlowSource_h bou_source( - redeclare package Medium = Medium, use_m_flow_in=true, nPorts=1) - annotation (Placement(transformation(extent={{52,-10},{72,10}}))); -equation - connect(bou_source.ports[1], port_b) - annotation (Line(points={{72,0},{100,0}}, color={0,127,255})); - connect(m_flow_in, bou_source.m_flow_in) - annotation (Line(points={{0,120},{0,10},{50,10},{50,8}}, color={0,0,127})); -end PartialArtificalPump_h; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.mo b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.mo deleted file mode 100644 index 75b4405b..00000000 --- a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.mo +++ /dev/null @@ -1,3 +0,0 @@ -within BESMod.Systems.Hydraulical.Components.Pumps; -package BaseClasses "Base Classes for pumps" -end BaseClasses; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.order deleted file mode 100644 index a7dd40b9..00000000 --- a/BESMod/Systems/Hydraulical/Components/Pumps/BaseClasses/package.order +++ /dev/null @@ -1,3 +0,0 @@ -PartialArtificalPump -PartialArtificalPump_h -PartialArtificalPumpT diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/package.mo b/BESMod/Systems/Hydraulical/Components/Pumps/package.mo deleted file mode 100644 index 1597e52f..00000000 --- a/BESMod/Systems/Hydraulical/Components/Pumps/package.mo +++ /dev/null @@ -1,5 +0,0 @@ -within BESMod.Systems.Hydraulical.Components; -package Pumps "Package for pumps" - extends Modelica.Icons.InternalPackage; - -end Pumps; diff --git a/BESMod/Systems/Hydraulical/Components/Pumps/package.order b/BESMod/Systems/Hydraulical/Components/Pumps/package.order deleted file mode 100644 index 30dce38f..00000000 --- a/BESMod/Systems/Hydraulical/Components/Pumps/package.order +++ /dev/null @@ -1,4 +0,0 @@ -ArtificalPumpIsotermhal -ArtificalPump_h_in -ArtificalPumpFixedT -BaseClasses diff --git a/BESMod/Systems/Hydraulical/Components/package.order b/BESMod/Systems/Hydraulical/Components/package.order index a5b41f99..a5b62a2c 100644 --- a/BESMod/Systems/Hydraulical/Components/package.order +++ b/BESMod/Systems/Hydraulical/Components/package.order @@ -1,3 +1,2 @@ -Pumps UFH HeatingRodWithSecurityControl diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo index 225c4d3a..9ad9e21b 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo @@ -142,6 +142,17 @@ partial model PartialTwoPoint_HPS_Controller "Type of supervisory control for DHW Setpoint"; Modelica.Blocks.Math.MinMax minMax(nu=transferParameters.nParallelDem) annotation (Placement(transformation(extent={{-202,32},{-182,52}}))); + Modelica.Blocks.Math.BooleanToReal booleanToReal1 "Turn Pump in heat pump on" + annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={-170,-54}))); + Modelica.Blocks.Logical.Or HP_or_HR_active annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={-170,-24}))); equation connect(BufferOnOffController.T_Top, sigBusDistr.TStoBufTopMea) annotation ( Line(points={{-126.8,47.9},{-128,47.9},{-128,48},{-130,48},{-130,-86},{4,-86}, @@ -228,13 +239,6 @@ equation color={255,0,255})); connect(DHWOnOffContoller.HP_On, HP_active.u1) annotation (Line(points={{-110.88, 83.6},{-32,83.6},{-32,91},{21,91}}, color={255,0,255})); - connect(DHWHysOrLegionella.y, sigBusDistr.dhw_on) annotation (Line( - points={{-71.25,69},{-26,69},{-26,-100},{1,-100}}, - color={255,0,255}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(DHWHysOrLegionella.y, switch1.u2) annotation (Line(points={{-71.25,69}, {-20,69},{-20,73},{57,73}}, color={255,0,255})); @@ -357,6 +361,19 @@ equation horizontalAlignment=TextAlignment.Right)); connect(minMax.yMax, heatingCurve.TSetRoom) annotation (Line(points={{-181,48},{-150,48},{-150,42}}, color={0,0,127})); + connect(booleanToReal1.u, HP_or_HR_active.y) + annotation (Line(points={{-170,-42},{-170,-35}}, color={255,0,255})); + connect(booleanToReal1.y, sigBusGen.uPump) annotation (Line(points={{-170,-65}, + {-172,-65},{-172,-72},{-152,-72},{-152,-99}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(HP_or_HR_active.u1, HRactive.y) annotation (Line(points={{-170,-12},{ + -134,-12},{-134,-6},{-6,-6},{-6,18},{20.75,18},{20.75,25}}, color={ + 255,0,255})); + connect(HP_or_HR_active.u2, HP_active.y) annotation (Line(points={{-178,-12}, + {-178,2},{-10,2},{-10,91},{32.5,91}}, color={255,0,255})); annotation (Diagram(graphics={ Rectangle( extent={{-240,100},{-50,60}}, diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ArtificialThreeWayValve.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ArtificialThreeWayValve.mo deleted file mode 100644 index 3df2c040..00000000 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ArtificialThreeWayValve.mo +++ /dev/null @@ -1,209 +0,0 @@ -within BESMod.Systems.Hydraulical.Distribution.Components.Valves; -model ArtificialThreeWayValve - "Ideal valve either for either side, no in between" - - /******************************* Parameters *******************************/ - replaceable package Medium = - Modelica.Media.Interfaces.PartialMedium "Medium in the component" - annotation (choicesAllMatching = true); - - parameter Boolean allowFlowReversal = true - "= false to simplify equations, assuming, but not enforcing, no flow reversal" - annotation(Dialog(tab="Assumptions"), Evaluate=true); - parameter Modelica.Units.SI.Pressure p_hydr=2e5 "Hydraulic pressure in pipes" - annotation (Dialog(group="Demand")); - - /******************************* Components *******************************/ - - Modelica.Fluid.Interfaces.FluidPort_a port_a( - redeclare package Medium = Medium, - m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), - h_outflow(start = Medium.h_default, nominal = Medium.h_default)) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-110,30},{-90,50}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b( - redeclare package Medium = Medium, - m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0), - h_outflow(start = Medium.h_default, nominal = Medium.h_default)) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-90,-50},{-110,-30}}))); - - Modelica.Fluid.Interfaces.FluidPort_a port_dhw_a( - redeclare package Medium = Medium, - m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), - h_outflow(start=Medium.h_default, nominal=Medium.h_default)) - "Port connecting from dhw demand" - annotation (Placement(transformation(extent={{90,-90},{110,-70}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_dhw_b( - redeclare package Medium = Medium, - m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0), - h_outflow(start=Medium.h_default, nominal=Medium.h_default)) - "Port connecting into dhw demand" - annotation (Placement(transformation(extent={{110,-50},{90,-30}}))); - Modelica.Fluid.Interfaces.FluidPort_a port_buf_a( - redeclare package Medium = Medium, - m_flow(min=if allowFlowReversal then -Modelica.Constants.inf else 0), - h_outflow(start=Medium.h_default, nominal=Medium.h_default)) - "Port connecting from heating demand" - annotation (Placement(transformation(extent={{90,26},{110,46}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_buf_b( - redeclare package Medium = Medium, - m_flow(max=if allowFlowReversal then +Modelica.Constants.inf else 0), - h_outflow(start=Medium.h_default, nominal=Medium.h_default)) - "Port connecting to heating demand" - annotation (Placement(transformation(extent={{110,66},{90,86}}))); - Modelica.Blocks.Sources.Constant dummyZero(k=0) - annotation (Placement(transformation(extent={{-30,28}, - {-18,40}}))); - Modelica.Blocks.Sources.RealExpression dummyMassFlow(y=port_a.m_flow) - annotation (Placement(transformation(extent={{-44,0}, - {-16,20}}))); - Modelica.Blocks.Logical.Switch switch1 - annotation (Placement(transformation(extent={{-38,-26},{-50,-14}}))); - Modelica.Blocks.Logical.Switch switch2 - annotation (Placement(transformation(extent={{-40,-60},{-52,-48}}))); - Modelica.Blocks.Logical.Switch switch3 - annotation (Placement(transformation(extent={{24,-66},{36,-54}}))); - Modelica.Blocks.Logical.Switch switch4 - annotation (Placement(transformation(extent={{32,78},{44,90}}))); - Modelica.Blocks.Sources.RealExpression dummyEnthalpyDhw(y=inStream(port_buf_a.h_outflow)) - annotation (Placement(transformation(extent={{-8,-80},{-28,-60}}))); - Modelica.Blocks.Sources.RealExpression dummyEnthalpyBuf(y=inStream(port_dhw_a.h_outflow)) - annotation (Placement(transformation(extent={{-8,-56},{-28,-36}}))); - BESMod.Systems.Hydraulical.Components.Pumps.ArtificalPump_h_in - artificalPump_h_in_gen(redeclare package Medium = Medium) annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={-78,0}))); - BESMod.Systems.Hydraulical.Components.Pumps.ArtificalPump_h_in - artificalPump_h_in_buf(redeclare package Medium = Medium, p=p_hydr) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={68,-60}))); - BESMod.Systems.Hydraulical.Components.Pumps.ArtificalPump_h_in - artificalPump_h_in_dhw(redeclare final package Medium = Medium, final p= - p_hydr) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={66,60}))); - Modelica.Blocks.Sources.RealExpression dummyEnthalpy_hgen(y=inStream(port_a.h_outflow)) - annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={38,6}))); - Modelica.Blocks.Interfaces.BooleanInput dhw_on - annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=270, - origin={0,120}))); - Modelica.Blocks.Logical.Not or2 - annotation (Placement(transformation(extent={{-6,-6},{6,6}}, - rotation=0, - origin={14,84}))); - Modelica.Blocks.Sources.RealExpression dummyEnthalpyBuf1(y=port_dhw_a.m_flow) - annotation (Placement(transformation(extent={{-8,-20},{-28,0}}))); - Modelica.Blocks.Sources.RealExpression dummyEnthalpyBuf2(y=port_buf_a.m_flow) - annotation (Placement(transformation(extent={{-6,-38},{-26,-18}}))); -equation - connect(dummyZero.y, switch3.u3) annotation (Line(points={{-17.4,34},{14,34}, - {14,-64.8},{22.8,-64.8}}, - color={0,0,127})); - connect(dummyMassFlow.y, switch3.u1) annotation (Line(points={{-14.6,10},{16, - 10},{16,-55.2},{22.8,-55.2}}, - color={0,0,127})); - connect(dummyMassFlow.y, switch4.u1) annotation (Line(points={{-14.6,10},{16, - 10},{16,88.8},{30.8,88.8}}, - color={0,0,127})); - connect(dummyZero.y, switch4.u3) annotation (Line(points={{-17.4,34},{20,34}, - {20,79.2},{30.8,79.2}}, - color={0,0,127})); - connect(switch2.u3, dummyEnthalpyDhw.y) annotation (Line(points={{-38.8,-58.8}, - {-36,-58.8},{-36,-58},{-34,-58},{-34,-70},{-29,-70}}, - color={0,0,127})); - connect(switch2.u1, dummyEnthalpyBuf.y) annotation (Line(points={{-38.8,-49.2}, - {-34,-49.2},{-34,-50},{-32,-50},{-32,-46},{-29,-46}}, - color={0,0,127})); - connect(port_a, artificalPump_h_in_gen.port_a) - annotation (Line(points={{-100,40},{-78,40},{-78,10}}, color={0,127,255})); - connect(artificalPump_h_in_gen.port_b, port_b) annotation (Line(points={{-78,-10}, - {-78,-40},{-100,-40}}, color={0,127,255})); - connect(port_dhw_a, artificalPump_h_in_buf.port_a) annotation (Line(points={{100,-80}, - {68,-80},{68,-70}}, color={0,127,255})); - connect(artificalPump_h_in_buf.port_b, port_dhw_b) annotation (Line(points={{68,-50}, - {70,-50},{70,-40},{100,-40}}, color={0,127,255})); - connect(artificalPump_h_in_dhw.port_b, port_buf_b) annotation (Line(points={{66,70}, - {68,70},{68,76},{100,76}}, color={0,127,255})); - connect(port_buf_a, artificalPump_h_in_dhw.port_a) - annotation (Line(points={{100,36},{66,36},{66,50}}, color={0,127,255})); - connect(switch1.y, artificalPump_h_in_gen.m_flow_in) annotation (Line(points={{-50.6, - -20},{-56,-20},{-56,0},{-66.4,0}}, color={0,0,127})); - connect(switch4.y, artificalPump_h_in_dhw.m_flow_in) annotation (Line(points={{44.6,84}, - {44,84},{44,60},{54.4,60}}, color={0,0,127})); - connect(switch3.y, artificalPump_h_in_buf.m_flow_in) - annotation (Line(points={{36.6,-60},{56.4,-60}}, color={0,0,127})); - connect(switch2.y, artificalPump_h_in_gen.h_flow_in) annotation (Line(points={{-52.6, - -54},{-60,-54},{-60,8.4},{-66.6,8.4}}, - color={0,0,127})); - connect(dummyEnthalpy_hgen.y, artificalPump_h_in_buf.h_flow_in) annotation ( - Line(points={{49,6},{60,6},{60,-16},{48,-16},{48,-68},{56.6,-68},{56.6, - -68.4}}, color={0,0,127})); - connect(dummyEnthalpy_hgen.y, artificalPump_h_in_dhw.h_flow_in) annotation ( - Line(points={{49,6},{60,6},{60,24},{44,24},{44,52},{48,52},{48,51.6},{ - 54.6,51.6}}, color={0,0,127})); - connect(dhw_on, switch3.u2) annotation (Line(points={{0,120},{0,-60},{22.8, - -60}}, color={255,0,255})); - connect(dhw_on, switch2.u2) annotation (Line(points={{0,120},{0,-54},{-38.8, - -54}}, color={255,0,255})); - connect(dhw_on, or2.u) - annotation (Line(points={{0,120},{0,84},{6.8,84}}, color={255,0,255})); - connect(switch4.u2, or2.y) - annotation (Line(points={{30.8,84},{20.6,84}}, color={255,0,255})); - connect(switch1.u1, dummyEnthalpyBuf1.y) annotation (Line(points={{-36.8, - -15.2},{-32,-15.2},{-32,-10},{-29,-10}}, color={0,0,127})); - connect(switch1.u3, dummyEnthalpyBuf2.y) annotation (Line(points={{-36.8, - -24.8},{-32,-24.8},{-32,-28},{-27,-28}}, color={0,0,127})); - connect(dhw_on, switch1.u2) - annotation (Line(points={{0,120},{0,-20},{-36.8,-20}}, color={255,0,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,0}, - lineThickness=1, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), Text( - extent={{-124,-106},{156,-154}}, - lineColor={0,0,0}, - lineThickness=1, - textString="%name"), - Polygon( - points={{72,82},{72,28},{18,56},{72,82}}, - lineColor={0,0,0}, - lineThickness=0.5, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid), - Polygon( - points={{74,-24},{74,-78},{20,-50},{74,-24}}, - lineColor={0,0,0}, - lineThickness=0.5, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid), - Polygon( - points={{27,27},{27,-27},{-27,1},{27,27}}, - lineColor={0,0,0}, - lineThickness=0.5, - fillColor={28,108,200}, - fillPattern=FillPattern.Solid, - origin={-57,1}, - rotation=180), - Line( - points={{-28,0},{-4,0},{-4,56},{20,56}}, - color={0,0,0}, - thickness=0.5), - Line( - points={{-4,-2},{-4,-50},{20,-50}}, - color={0,0,0}, - thickness=0.5)}), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false))); -end ArtificialThreeWayValve; diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/Test_ArtificalThreeWayValve.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/Test_ArtificalThreeWayValve.mo deleted file mode 100644 index 71c443ec..00000000 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/Test_ArtificalThreeWayValve.mo +++ /dev/null @@ -1,61 +0,0 @@ -within BESMod.Systems.Hydraulical.Distribution.Components.Valves.Tests; -model Test_ArtificalThreeWayValve - extends Modelica.Icons.Example; - - /******************************* Parameters *******************************/ - replaceable package Medium = IBPSA.Media.Water; - - /******************************* Components *******************************/ - - Modelica.Blocks.Sources.BooleanPulse booleanPulse(period=100) - annotation (Placement(transformation(extent={{-44,40},{-24,60}}))); - Modelica.Fluid.Sources.MassFlowSource_T boundary( redeclare package - Medium = Medium, - m_flow=0.2, - T=313.15, - nPorts=1) - annotation (Placement(transformation(extent={{-84,0},{-64,20}}))); - ArtificialThreeWayValve artificialThreeWayValve(redeclare package Medium = - Medium) - annotation (Placement(transformation(extent={{-22,-22},{18,18}}))); - Modelica.Fluid.Sources.Boundary_ph boundary2(redeclare package Medium = - Medium, nPorts=1) - annotation (Placement(transformation(extent={{10,-10},{-10,10}}, - rotation=180, - origin={-74,-12}))); - IBPSA.Fluid.MixingVolumes.MixingVolume demandDHW( - each V=0.005, - redeclare package Medium = Medium, - each nPorts=2, - each m_flow_nominal=0.01) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={52,-14}))); - IBPSA.Fluid.MixingVolumes.MixingVolume demandBui( - each V=0.005, - redeclare package Medium = Medium, - each nPorts=2, - each m_flow_nominal=0.01) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={54,10}))); -equation - connect(boundary2.ports[1], artificialThreeWayValve.port_b) annotation (Line( - points={{-64,-12},{-46,-12},{-46,-10},{-22,-10}}, color={0,127,255})); - connect(boundary.ports[1], artificialThreeWayValve.port_a) annotation (Line( - points={{-64,10},{-46,10},{-46,6},{-22,6}}, color={0,127,255})); - connect(demandDHW.ports[1], artificialThreeWayValve.port_dhw_b) annotation ( - Line(points={{42,-13},{30,-13},{30,-10},{18,-10}}, color={0,127,255})); - connect(demandDHW.ports[2], artificialThreeWayValve.port_dhw_a) annotation ( - Line(points={{42,-15},{32,-15},{32,-18},{18,-18}}, color={0,127,255})); - connect(demandBui.ports[1], artificialThreeWayValve.port_buf_b) annotation ( - Line(points={{44,11},{32,11},{32,13.2},{18,13.2}}, color={0,127,255})); - connect(demandBui.ports[2], artificialThreeWayValve.port_buf_a) annotation ( - Line(points={{44,9},{32,9},{32,5.2},{18,5.2}}, color={0,127,255})); - connect(booleanPulse.y, artificialThreeWayValve.dhw_on) - annotation (Line(points={{-23,50},{-2,50},{-2,22}}, color={255,0,255})); - annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false)), - experiment(StopTime=1000, __Dymola_Algorithm="Dassl")); -end Test_ArtificalThreeWayValve; diff --git a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo index f7486707..52851a4d 100644 --- a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo @@ -6,7 +6,8 @@ model DistributionTwoStorageParallel final QDHWStoLoss_flow=dhwParameters.QLoss_flow, designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.PartStorage, final dpDem_nominal={0}, - final dpSup_nominal={0}, + final dpSup_nominal={2*(threeWayValveParameters.dpValve_nominal + max( + threeWayValveParameters.dp_nominal))}, final dTTraDHW_nominal=dhwParameters.dTLoadingHC1, final dTTra_nominal={bufParameters.dTLoadingHC1}, final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, @@ -66,9 +67,18 @@ model DistributionTwoStorageParallel final m_flow_small_layer_HE=1E-4*abs(storageBuf.m_flow_nominal_HE)) "The buffer storage (PS) for the building" annotation (Placement(transformation(extent={{66,40},{32,76}}))); - Components.Valves.ArtificialThreeWayValve artificialThreeWayValve(redeclare - final package Medium = MediumGen, final p_hydr=p_start) - annotation (Placement(transformation(extent={{-68,36},{-18,80}}))); + Components.Valves.ThreeWayValveWithFlowReturn + threeWayValveWithFlowReturn( + redeclare package Medium = MediumGen, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final X_start=X_start, + final C_start=C_start, + final C_nominal=C_nominal, + final mSenFac=mSenFac, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parameters=threeWayValveParameters) + annotation (Placement(transformation(extent={{-60,40},{-20,80}}))); Modelica.Blocks.Sources.RealExpression T_stoDHWTop(final y(unit="K", displayUnit="degC")=storageDHW.layer[ dhwParameters.nLayer].T) annotation (Placement(transformation( extent={{-5,-3},{5,3}}, @@ -150,6 +160,36 @@ model DistributionTwoStorageParallel annotation (Placement(transformation(extent={{-80,-110},{-60,-72}}))); BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{34,-110},{54,-90}}))); + replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve + threeWayValveParameters constrainedby + BESMod.Systems.RecordsCollection.Valves.ThreeWayValve( + final dp_nominal={resBui.dp_nominal, resDHW.dp_nominal}, + final m_flow_nominal=mSup_flow_nominal[1], + final fraK=1, + use_inputFilter=false) annotation (Placement( + transformation(extent={{-60,2},{-40,22}})), choicesAllMatching=true); + IBPSA.Fluid.FixedResistances.PressureDrop resBui( + redeclare final package Medium = MediumGen, + final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=mSup_flow_nominal[1], + final show_T=show_T, + final from_dp=false, + final dp_nominal=1000, + final linearized=false, + final deltaM=0.3) + "Assume some pressure loss to avoid division by zero error." + annotation (Placement(transformation(extent={{0,66},{20,86}}))); + IBPSA.Fluid.FixedResistances.PressureDrop resDHW( + redeclare final package Medium = MediumGen, + final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=mSup_flow_nominal[1], + final show_T=show_T, + final from_dp=false, + final dp_nominal=1000, + final linearized=false, + final deltaM=0.3) + "Assume some pressure loss to avoid division by zero error." + annotation (Placement(transformation(extent={{2,-38},{22,-18}}))); equation connect(fixedTemperatureBuf.port, storageBuf.heatPort) annotation (Line( points={{56,6},{80,6},{80,58},{62.6,58}}, color={191,0,0})); @@ -161,32 +201,8 @@ equation {48,-32},{48,-22},{100,-22}}, color={0,127,255})); connect(portDHW_in, storageDHW.port_a_consumer) annotation (Line(points={{100,-82}, {48,-82},{48,-70},{49,-70}}, color={0,127,255})); - connect(artificialThreeWayValve.port_buf_b, storageBuf.port_a_heatGenerator) - annotation (Line(points={{-18,74.72},{0,74.72},{0,73.84},{34.72,73.84}}, - color={0,127,255})); - connect(artificialThreeWayValve.port_buf_a, storageBuf.port_b_heatGenerator) - annotation (Line(points={{-18,65.92},{8,65.92},{8,43.6},{34.72,43.6}}, - color={0,127,255})); - connect(artificialThreeWayValve.port_dhw_b, storageDHW.port_a_heatGenerator) - annotation (Line(points={{-18,49.2},{-10,49.2},{-10,46},{8,46},{8,-34.28},{ - 34.72,-34.28}}, color={0,127,255})); - connect(artificialThreeWayValve.port_dhw_a, storageDHW.port_b_heatGenerator) - annotation (Line(points={{-18,40.4},{-16,40.4},{-16,36},{8,36},{8,-66.2},{ - 34.72,-66.2}}, color={0,127,255})); connect(fixedTemperatureDHW.port, storageDHW.heatPort) annotation (Line( points={{40,-90},{70,-90},{70,-51},{62.6,-51}}, color={191,0,0})); - connect(sigBusDistr.dhw_on, artificialThreeWayValve.dhw_on) annotation (Line( - points={{0,101},{-43,101},{-43,84.4}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); - connect(portGen_in[1], artificialThreeWayValve.port_a) annotation (Line( - points={{-100,80},{-83,80},{-83,66.8},{-68,66.8}}, color={0,127,255})); - connect(portGen_out[1], artificialThreeWayValve.port_b) annotation (Line( - points={{-100,40},{-78,40},{-78,49.2},{-68,49.2}}, color={0,127,255})); connect(internalKPICalculatorDHWLoss.KPIBus, outBusDist.QDHWLoss) annotation ( Line( points={{-59.8,-91},{-14,-91},{-14,-86},{0,-86},{0,-100}}, @@ -234,4 +250,29 @@ equation points={{54,-100},{54,-98},{70,-98}}, color={0,0,0}, thickness=1)); + connect(storageBuf.port_b_heatGenerator, threeWayValveWithFlowReturn.portBui_a) + annotation (Line(points={{34.72,43.6},{34.72,42},{-12,42},{-12,68},{-20,68}}, + color={0,127,255})); + connect(storageDHW.port_b_heatGenerator, threeWayValveWithFlowReturn.portDHW_a) + annotation (Line(points={{34.72,-66.2},{-20,-66.2},{-20,44.8}}, color={0,127, + 255})); + connect(threeWayValveWithFlowReturn.portGen_b, portGen_out[1]) annotation ( + Line(points={{-60,52.8},{-84,52.8},{-84,40},{-100,40}}, color={0,127,255})); + connect(portGen_in[1], threeWayValveWithFlowReturn.portGen_a) annotation ( + Line(points={{-100,80},{-66,80},{-66,68.8},{-60,68.8}}, color={0,127,255})); + connect(threeWayValveWithFlowReturn.uBuf, sigBusDistr.uThrWayVal) annotation ( + Line(points={{-40,84},{-40,98},{4,98},{4,100},{0,100},{0,101}}, color={0,0, + 127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(threeWayValveWithFlowReturn.portBui_b, resBui.port_a) + annotation (Line(points={{-20,76},{0,76}}, color={0,127,255})); + connect(storageBuf.port_a_heatGenerator, resBui.port_b) annotation (Line( + points={{34.72,73.84},{34.72,76},{20,76}}, color={0,127,255})); + connect(threeWayValveWithFlowReturn.portDHW_b, resDHW.port_a) annotation ( + Line(points={{-20,52.8},{-14,52.8},{-14,-28},{2,-28}}, color={0,127,255})); + connect(storageDHW.port_a_heatGenerator, resDHW.port_b) annotation (Line( + points={{34.72,-34.28},{22,-34.28},{22,-28}}, color={0,127,255})); end DistributionTwoStorageParallel; diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestSimpleStorages.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestSimpleStorages.mo index 7fa1d791..9fecf462 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestSimpleStorages.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestSimpleStorages.mo @@ -6,17 +6,19 @@ model TestSimpleStorages BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage bufParameters(dTLoadingHC1=5), redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters(dTLoadingHC1=5))); + dhwParameters(dTLoadingHC1=5), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + threeWayValveParameters)); extends Modelica.Icons.Example; - Modelica.Blocks.Sources.BooleanPulse booleanPulse(period=100) annotation ( + Modelica.Blocks.Sources.Pulse pulse( period=100) annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-68,88}))); equation - connect(booleanPulse.y, sigBusDistr.dhw_on) annotation (Line(points={{-57,88}, - {-42,88},{-42,81},{-14,81}}, color={255,0,255}), Text( + connect(pulse.y, sigBusDistr.uThrWayVal) annotation (Line(points={{-57,88},{ + -42,88},{-42,81},{-14,81}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index 97ef82d4..550c01b5 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -41,34 +41,6 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" if not use_heaRod annotation (Placement(transformation(extent={{32,74},{44,86}}))); - BESMod.Systems.Hydraulical.Components.Pumps.ArtificalPumpIsotermhal - artificalPumpIsotermhal( - redeclare package Medium = Medium, - final p=p_start, - final m_flow_nominal=m_flow_nominal[1]) if not use_pressure annotation ( - Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=180, - origin={70,-50}))); - Modelica.Blocks.Logical.Switch switch1 annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={46,-16}))); - Modelica.Blocks.Sources.RealExpression dummyMassFlow(final y=if use_pressure - then 1 else m_flow_nominal[1]) - annotation (Placement(transformation(extent={{84,-6},{64,14}}))); - Modelica.Blocks.Sources.RealExpression dummyZero annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={18,4}))); - Modelica.Blocks.MathBoolean.Or - or1(nu=3) - annotation (Placement(transformation( - extent={{-6,-6},{6,6}}, - rotation=270, - origin={46,14}))); - AixLib.Fluid.HeatPumps.HeatPump heatPump( redeclare package Medium_con = Medium, redeclare package Medium_eva = Medium_eva, @@ -132,12 +104,6 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" final nPorts=1) annotation (Placement(transformation(extent={{-100,42},{-80,62}}))); - Modelica.Blocks.Logical.GreaterThreshold isOnHP(threshold=Modelica.Constants.eps) - annotation (Placement(transformation( - extent={{-6,-6},{6,6}}, - rotation=270, - origin={16,38}))); - Modelica.Blocks.Logical.Switch switch2 annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -148,11 +114,6 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" extent={{-6,-6},{6,6}}, rotation=0, origin={-164,56}))); - Modelica.Blocks.Logical.GreaterThreshold isOnHR(threshold=Modelica.Constants.eps) - annotation (Placement(transformation( - extent={{-6,-6},{6,6}}, - rotation=270, - origin={40,36}))); BESMod.Utilities.KPIs.InputKPICalculator KPIWel( integralUnit="J", @@ -169,12 +130,6 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" calc_movAve=false) if use_heaRod annotation (Placement(transformation(extent={{-52,-62},{-40,-40}}))); - Modelica.Blocks.Sources.BooleanConstant constRunPump247(final k= - heatPumpParameters.use_refIne) - annotation (Placement(transformation( - extent={{-5,5},{5,-5}}, - rotation=180, - origin={79,27}))); IBPSA.Fluid.Movers.SpeedControlled_y pump( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, @@ -197,7 +152,7 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" final use_inputFilter=pumpData.use_inputFilter, final riseTime=pumpData.riseTimeInpFilter, final init=Modelica.Blocks.Types.Init.InitialOutput, - final y_start=1) if use_pressure annotation (Placement(transformation( + final y_start=1) annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=180, origin={16,-68}))); @@ -251,7 +206,7 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" redeclare package Medium = Medium, final p=p_start, final T=T_start, - final nPorts=1) if use_pressure annotation (Placement(transformation( + final nPorts=1) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={52,-86}))); @@ -275,7 +230,7 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" extent={{-10,-10},{10,10}}, rotation=180, origin={100,-78}))); - Modelica.Blocks.Math.MultiSum multiSum(nu=if (use_pressure and use_heaRod) then 3 elseif use_pressure and not use_heaRod then 2 elseif use_heaRod and not use_pressure then 2 else 1) annotation (Placement( + Modelica.Blocks.Math.MultiSum multiSum(nu=if use_heaRod then 3 else 2) annotation (Placement( transformation( extent={{-6,-6},{6,6}}, rotation=180, @@ -290,21 +245,6 @@ equation connect(KPIQHR.KPIBus, outBusGen.QHR_flow) annotation (Line(points={{-39.88,-93}, {-32,-93},{-32,-100},{0,-100}}, color={255,204,51}, thickness=0.5), Text(string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(dummyZero.y,switch1. u3) - annotation (Line(points={{29,4},{38,4},{38,-4}}, color={0,0,127})); - connect(dummyMassFlow.y,switch1. u1) - annotation (Line(points={{63,4},{54,4},{54,-4}}, color={0,0,127})); - connect(or1.y,switch1. u2) - annotation (Line(points={{46,7.1},{46,-4}}, - color={255,0,255})); - connect(switch1.y, artificalPumpIsotermhal.m_flow_in) - annotation (Line(points={{46,-27},{46,-38.4},{70,-38.4}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - - connect(artificalPumpIsotermhal.port_b, heatPump.port_a1) annotation (Line( - points={{60,-50},{-30.5,-50},{-30.5,-7}}, color={0,127,255}, - pattern=LinePattern.Dash)); connect(bou_air.ports[1], heatPump.port_a2) annotation (Line( points={{-80,52},{-57.5,52},{-57.5,37}}, color={0,127,255}, @@ -322,14 +262,6 @@ equation extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(sigBusGen.hp_bus.nSet, isOnHP.u) annotation (Line( - points={{2,98},{2,58},{16,58},{16,45.2}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); connect(bou_air.T_in, switch2.y) annotation (Line(points={{-102,56},{-113,56}}, color={0,0,127})); connect(switch2.u2, AirOrSoil.y) @@ -340,17 +272,6 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(sigBusGen.hr_on, isOnHR.u) annotation (Line( - points={{2,98},{2,60},{46,60},{46,43.2},{40,43.2}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(portGen_in[1], artificalPumpIsotermhal.port_a) annotation (Line( - points={{100,-2},{102,-2},{102,-50},{80,-50}}, color={0,127,255}, - pattern=LinePattern.Dash)); connect(KPIWel.u, sigBusGen.hp_bus.PelMea) annotation (Line(points={{-53.32,-65}, {-56,-65},{-56,-50},{-28,-50},{-28,-12},{2,-12},{2,98}}, color={0,0,127}), Text( @@ -377,34 +298,23 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(isOnHR.y, or1.u[1]) annotation (Line(points={{40,29.4},{40,26},{44.6,26}, - {44.6,20}}, color={255,0,255})); - connect(isOnHP.y, or1.u[2]) annotation (Line(points={{16,31.4},{16,24},{46,24}, - {46,20}}, color={255,0,255})); - connect(constRunPump247.y, or1.u[3]) annotation (Line(points={{73.5,27},{48.1, - 27},{48.1,20},{47.4,20}}, color={255,0,255})); connect(pump.port_a, portGen_in[1]) annotation (Line( points={{26,-68},{100,-68},{100,-2}}, - color={0,127,255}, - pattern=LinePattern.Dash)); + color={0,127,255})); connect(passThroughMediumHRBuf.port_a, heatPump.port_b1) annotation (Line( points={{32,80},{-30,80},{-30,78},{-30.5,78},{-30.5,37}}, color={0,127,255})); connect(pump.port_b, heatPump.port_a1) annotation (Line( points={{6,-68},{-30.5,-68},{-30.5,-7}}, - color={0,127,255}, - pattern=LinePattern.Dash)); + color={0,127,255})); connect(TSoil.y, switch2.u3) annotation (Line(points={{-157.4,32},{-146,32}, {-146,48},{-136,48}}, color={0,0,127})); connect(heatPump.port_b1, hea.port_a) annotation (Line(points={{-30.5,37},{ -30.5,80},{22,80}}, color={0,127,255})); connect(bouPumpHP.ports[1], pump.port_a) annotation (Line( points={{52,-76},{52,-68},{26,-68}}, - color={0,127,255}, - pattern=LinePattern.Dash)); - connect(switch1.y, pump.y) annotation (Line(points={{46,-27},{46,-38},{16,-38}, - {16,-56}}, color={0,0,127})); + color={0,127,255})); connect(hea.port_b, passThroughMediumHRBuf.port_a) annotation (Line(points={{54,80},{32,80}}, color={0,127,255})); connect(senTBuiSup.T, sigBusGen.THeaRodMea) annotation (Line(points={{71,86.6}, @@ -429,7 +339,7 @@ equation thickness=1)); connect(multiSum.y, realToElecCon.PEleLoa) annotation (Line(points={{122.98,-82},{112,-82}}, color={0,0,127})); - if use_heaRod and use_pressure then + if use_heaRod then connect(multiSum.u[2], hea.Pel) annotation (Line(points={{136,-82},{142,-82}, {142,89.6},{55.6,89.6}},color={0,0,127})); connect(multiSum.u[1], sigBusGen.hp_bus.PelMea) annotation (Line(points={{136, @@ -442,17 +352,7 @@ equation connect(multiSum.u[3], pump.P) annotation (Line(points={{136,-82},{140,-82},{ 140,-86},{144,-86},{144,-59},{5,-59}}, color={0,0,127})); - elseif use_heaRod then - connect(multiSum.u[2], hea.Pel) annotation (Line(points={{136,-82},{142,-82}, - {142,89.6},{55.6,89.6}},color={0,0,127})); - connect(multiSum.u[1], sigBusGen.hp_bus.PelMea) annotation (Line(points={{136, - -82},{140,-82},{140,96},{72,96},{72,98},{2,98}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - elseif use_pressure then + else connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-82},{144,-82}, {144,-114},{-14,-114},{-14,-58},{0,-58},{0,-59},{5,-59}}, color={0,0,127})); @@ -463,14 +363,6 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - else - connect(multiSum.u[1], sigBusGen.hp_bus.PelMea) annotation (Line(points={{136, - -82},{140,-82},{140,96},{72,96},{72,98},{2,98}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); end if; connect(switch2.u1, weaBus.TDryBul) annotation (Line(points={{-136,64},{-144,64}, {-144,80},{-101,80}}, color={0,0,127}), Text( @@ -478,6 +370,12 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); + connect(pump.y, sigBusGen.uPump) annotation (Line(points={{16,-56},{24,-56},{24, + -22},{2,-22},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); annotation (Line( points={{-52.775,-6.78},{-52.775,33.61},{-56,33.61},{-56,74}}, color={255,204,51}, diff --git a/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo b/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo index b92971a2..9f8d8e3f 100644 --- a/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo +++ b/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo @@ -1,5 +1,5 @@ within BESMod.Systems.UserProfiles; -model AixLibHighOrderProfiles "Standard TEASER Profiles" +model AixLibHighOrderProfiles "Profiles for high order model in the AixLib" extends BaseClasses.PartialUserProfiles(nZones=10); parameter String fileNameIntGains=Modelica.Utilities.Files.loadResource("modelica://BESMod/Resources/InternalGainsHOM.txt") "File where matrix is stored" annotation (Dialog(tab="Inputs", group="Internal Gains")); diff --git a/BESMod/Systems/UserProfiles/NoUserHOM.mo b/BESMod/Systems/UserProfiles/NoUserHOM.mo index 1ba4d331..fb7f9973 100644 --- a/BESMod/Systems/UserProfiles/NoUserHOM.mo +++ b/BESMod/Systems/UserProfiles/NoUserHOM.mo @@ -1,5 +1,5 @@ within BESMod.Systems.UserProfiles; -model NoUserHOM "No user" +model NoUserHOM "No user in high order model" extends BaseClasses.PartialUserProfiles; Modelica.Blocks.Sources.Constant constZero[nZones](each k=0) From 7670e0277791a2a901a501cbdea3b041b1eb3815 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 9 Sep 2022 18:53:08 +0200 Subject: [PATCH 053/131] order fixes --- .../Distribution/Components/Valves/Tests/package.order | 1 - .../Hydraulical/Distribution/Components/Valves/package.order | 1 - 2 files changed, 2 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order index f94791d1..753bffc9 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order @@ -1,2 +1 @@ -Test_ArtificalThreeWayValve TestThreeWayValve diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order index cdc350ae..e9eb0dad 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order @@ -1,4 +1,3 @@ ThreeWayValveWithFlowReturn -ArtificialThreeWayValve PressureReliefValve Tests From 070beed09dec9dae626c45507e43a980c745b7dc Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 12 Sep 2022 15:55:00 +0200 Subject: [PATCH 054/131] push discussed changes --- .../Building/HeatDemand/CalcHeaDemHOM.mo | 5 +- .../Valves/Tests/PressureReliefExample.mo | 107 ++++++++++++++++++ .../Valves/Tests/PressureReliefExampleDP.mo | 101 +++++++++++++++++ .../Components/Valves/Tests/m_flow.mo | 101 +++++++++++++++++ .../Components/Valves/Tests/package.order | 3 + .../Transfer/RadiatorPressureBased.mo | 13 ++- .../TransferDataBaseDefinition.mo | 9 +- .../Movers/EcodanWaterPump.mo | 6 + .../RecordsCollection/Movers/package.order | 1 + .../RecordsCollection/Valves/ThreeWayValve.mo | 2 +- 10 files changed, 337 insertions(+), 11 deletions(-) create mode 100644 BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo create mode 100644 BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExampleDP.mo create mode 100644 BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/m_flow.mo create mode 100644 BESMod/Systems/RecordsCollection/Movers/EcodanWaterPump.mo diff --git a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo index a365e390..5444885c 100644 --- a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo +++ b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo @@ -17,14 +17,13 @@ model CalcHeaDemHOM KR_heater=10000, h_heater=fill(100000,building.nZones), redeclare Examples.UseCaseHOM.HOMSystem systemParameters( - QDHW_flow_nomial=0, TOda_nominal=261.15, TSetZone_nominal(displayUnit="K") = {293.15,293.15,288.15,293.15,293.15,293.15, - 293.15,288.15,297.15,293.15,250.15}, + 293.15,288.15,297.15,293.15}, THydSup_nominal=fill(273.15 + 55, building.nZones)), redeclare AixLibHighOrder building( useConstVentRate=true, - ventRate={0.5,0.5,0,0.5,0.5,0.5,0.5,0,0.5,0.5,0}, + ventRate={0.5,0.5,0,0.5,0.5,0.5,0.5,0,0.5,0.5}, Latitude=Modelica.Units.Conversions.to_deg(weaDat.lat), Longitude=Modelica.Units.Conversions.to_deg(weaDat.lon), DiffWeatherDataTime=Modelica.Units.Conversions.to_hour(weaDat.timZon), diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo new file mode 100644 index 00000000..b84b1783 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo @@ -0,0 +1,107 @@ +within BESMod.Systems.Hydraulical.Distribution.Components.Valves.Tests; +model PressureReliefExample + extends IBPSA.Fluid.Interfaces.LumpedVolumeDeclarations(redeclare package + Medium = IBPSA.Media.Water); + extends Modelica.Icons.Example; + parameter Boolean use_relVal=true; + PressureReliefValve pressureReliefValve(redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + dpFullOpen_nominal=dp_nominal*1.4, + dpThreshold_nominal=dp_nominal*1.1, + use_inputFilter=false, + dpValve_nominal=dp_nominal) if use_relVal + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={-20,0}))); + IBPSA.Fluid.FixedResistances.PressureDrop res( + redeclare package Medium = Medium, + final dp_nominal=dp_nominal/2, + final m_flow_nominal=m_flow_nominal) "Hydraulic resistance of supply" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={10,30}))); + IBPSA.Fluid.Actuators.Valves.TwoWayLinear val( + redeclare package Medium = Medium, + final m_flow_nominal=m_flow_nominal, + each final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, + final dpValve_nominal=dp_nominal/2, + each final use_inputFilter=false, + final dpFixed_nominal=0) annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={50,30}))); + IBPSA.Fluid.Movers.SpeedControlled_y pump( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + redeclare + BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( + final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final m_flow_nominal=m_flow_nominal, + final dp_nominal=dp_nominal, + final rho(displayUnit="kg/m3") = 1000, + final V_flowCurve=pumpData.V_flowCurve, + final dpCurve=pumpData.dpCurve), + final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final use_inputFilter=false, + final y_start=1) annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-50,30}))); + replaceable parameter + BESMod.Systems.RecordsCollection.Movers.DefaultMover + pumpData(V_flowCurve={0.000422526,0.28816252,0.580972823,0.868712818, + 0.94983775,1.086736074,1.190677393,1.396024878,1.499966198}, dpCurve={ + 1.587002096,1.526205451,1.375262055,1.161425577,1.07966457,0.857442348, + 0.645702306,0.224318658,0}) + annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,76}, + {-72,98}}))); + Modelica.Blocks.Sources.Constant const(final k=1) + annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); + Modelica.Blocks.Sources.Ramp ramp( + height=-1, duration=1, + offset=1, + startTime=1) + annotation (Placement(transformation(extent={{0,62},{20,82}}))); + IBPSA.Fluid.Sources.Boundary_pT bouPump( + redeclare package Medium = Medium, + each final p=p_start, + each final T=T_start, + each final nPorts=1) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,0}))); + parameter Modelica.Units.SI.PressureDifference dp_nominal(displayUnit="Pa")= + 46536.58537 + "Pressure drop at nominal mass flow rate"; + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=0.286666667 + "Nominal mass flow rate"; + parameter Modelica.Units.SI.PressureDifference dpFullOpen_nominal=dp_nominal* + 10 + "Pressure difference at which valve is fully open"; + Modelica.Blocks.Sources.RealExpression dpPumpAbs(y=-pump.dp) + annotation (Placement(transformation(extent={{80,80},{100,100}}))); +equation + connect(res.port_b, val.port_a) + annotation (Line(points={{20,30},{40,30}}, color={0,127,255})); + connect(ramp.y, val.y) + annotation (Line(points={{21,72},{50,72},{50,42}}, color={0,0,127})); + connect(const.y, pump.y) + annotation (Line(points={{-79,50},{-50,50},{-50,42}}, color={0,0,127})); + connect(pump.port_b, pressureReliefValve.port_a) + annotation (Line(points={{-40,30},{-20,30},{-20,10}}, color={0,127,255})); + connect(pump.port_b, res.port_a) + annotation (Line(points={{-40,30},{0,30}}, color={0,127,255})); + connect(val.port_b, pump.port_a) annotation (Line(points={{60,30},{70,30},{70, + -34},{-70,-34},{-70,30},{-60,30}}, color={0,127,255})); + connect(pressureReliefValve.port_b, pump.port_a) annotation (Line(points={{-20, + -10},{-20,-34},{-70,-34},{-70,30},{-60,30}}, color={0,127,255})); + connect(bouPump.ports[1], pump.port_a) annotation (Line(points={{-80,0},{-70,0}, + {-70,30},{-60,30}}, color={0,127,255})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + experiment(StopTime=3, __Dymola_Algorithm="Dassl")); +end PressureReliefExample; diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExampleDP.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExampleDP.mo new file mode 100644 index 00000000..bc5cb44d --- /dev/null +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExampleDP.mo @@ -0,0 +1,101 @@ +within BESMod.Systems.Hydraulical.Distribution.Components.Valves.Tests; +model PressureReliefExampleDP + extends IBPSA.Fluid.Interfaces.LumpedVolumeDeclarations(redeclare package + Medium = IBPSA.Media.Water); + extends Modelica.Icons.Example; + parameter Boolean use_relVal=false; + PressureReliefValve pressureReliefValve(redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + dpFullOpen_nominal=dpFullOpen_nominal) if use_relVal + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={-20,0}))); + IBPSA.Fluid.FixedResistances.PressureDrop res( + redeclare package Medium = Medium, + final dp_nominal=dp_nominal, + final m_flow_nominal=m_flow_nominal) "Hydraulic resistance of supply" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={10,30}))); + IBPSA.Fluid.Actuators.Valves.TwoWayLinear val( + redeclare package Medium = Medium, + final m_flow_nominal=m_flow_nominal, + each final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, + final dpValve_nominal=0.5*dp_nominal/(1 - 0.5), + each final use_inputFilter=false, + final dpFixed_nominal=0) annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={50,30}))); + IBPSA.Fluid.Movers.FlowControlled_dp pump( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + redeclare + BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( + final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final m_flow_nominal=m_flow_nominal, + final dp_nominal=res.dp_nominal + val.dpValve_nominal + val.dpFixed_nominal, + + final rho(displayUnit="kg/m3") = 1, + final V_flowCurve=pumpData.V_flowCurve, + final dpCurve=pumpData.dpCurve), + final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final use_inputFilter=false) annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-50,30}))); + replaceable parameter + BESMod.Systems.RecordsCollection.Movers.DefaultMover + pumpData(V_flowCurve={0.000422526,0.28816252,0.580972823,0.868712818, + 0.94983775,1.086736074,1.190677393,1.396024878,1.499966198}, dpCurve={ + 1.587002096,1.526205451,1.375262055,1.161425577,1.07966457,0.857442348, + 0.645702306,0.224318658,0}) + annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,76}, + {-72,98}}))); + Modelica.Blocks.Sources.Constant const(final k=dp_nominal) + annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); + Modelica.Blocks.Sources.Ramp ramp( + height=-1, duration=1, + offset=1, + startTime=1) + annotation (Placement(transformation(extent={{0,62},{20,82}}))); + IBPSA.Fluid.Sources.Boundary_pT bouPump( + redeclare package Medium = Medium, + each final p=p_start, + each final T=T_start, + each final nPorts=1) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,0}))); + parameter Modelica.Units.SI.PressureDifference dp_nominal(displayUnit="Pa")= + 46536.58537/2 + "Pressure drop at nominal mass flow rate"; + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=0.286666667 + "Nominal mass flow rate"; + parameter Modelica.Units.SI.PressureDifference dpFullOpen_nominal=10000000 + "Pressure difference at which valve is fully open"; +equation + connect(res.port_b, val.port_a) + annotation (Line(points={{20,30},{40,30}}, color={0,127,255})); + connect(ramp.y, val.y) + annotation (Line(points={{21,72},{50,72},{50,42}}, color={0,0,127})); + connect(pump.port_b, pressureReliefValve.port_a) + annotation (Line(points={{-40,30},{-20,30},{-20,10}}, color={0,127,255})); + connect(pump.port_b, res.port_a) + annotation (Line(points={{-40,30},{0,30}}, color={0,127,255})); + connect(val.port_b, pump.port_a) annotation (Line(points={{60,30},{70,30},{70, + -34},{-70,-34},{-70,30},{-60,30}}, color={0,127,255})); + connect(pressureReliefValve.port_b, pump.port_a) annotation (Line(points={{-20, + -10},{-20,-34},{-70,-34},{-70,30},{-60,30}}, color={0,127,255})); + connect(bouPump.ports[1], pump.port_a) annotation (Line(points={{-80,0},{-70,0}, + {-70,30},{-60,30}}, color={0,127,255})); + connect(const.y, pump.dp_in) + annotation (Line(points={{-79,50},{-50,50},{-50,42}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + experiment(StopTime=3, __Dymola_Algorithm="Dassl")); +end PressureReliefExampleDP; diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/m_flow.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/m_flow.mo new file mode 100644 index 00000000..90edf311 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/m_flow.mo @@ -0,0 +1,101 @@ +within BESMod.Systems.Hydraulical.Distribution.Components.Valves.Tests; +model m_flow + extends IBPSA.Fluid.Interfaces.LumpedVolumeDeclarations(redeclare package + Medium = IBPSA.Media.Water); + extends Modelica.Icons.Example; + parameter Boolean use_relVal=false; + PressureReliefValve pressureReliefValve(redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + dpFullOpen_nominal=dpFullOpen_nominal) if use_relVal + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={-20,0}))); + IBPSA.Fluid.FixedResistances.PressureDrop res( + redeclare package Medium = Medium, + final dp_nominal=dp_nominal, + final m_flow_nominal=m_flow_nominal) "Hydraulic resistance of supply" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={10,30}))); + IBPSA.Fluid.Actuators.Valves.TwoWayLinear val( + redeclare package Medium = Medium, + final m_flow_nominal=m_flow_nominal, + each final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, + final dpValve_nominal=0.5*dp_nominal/(1 - 0.5), + each final use_inputFilter=false, + final dpFixed_nominal=0) annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={50,30}))); + IBPSA.Fluid.Movers.FlowControlled_m_flow pump( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + redeclare + BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( + final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final m_flow_nominal=m_flow_nominal, + final dp_nominal=res.dp_nominal + val.dpValve_nominal + val.dpFixed_nominal, + + final rho(displayUnit="kg/m3") = 1, + final V_flowCurve=pumpData.V_flowCurve, + final dpCurve=pumpData.dpCurve), + final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final use_inputFilter=false) annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-50,30}))); + replaceable parameter + BESMod.Systems.RecordsCollection.Movers.DefaultMover + pumpData(V_flowCurve={0.000422526,0.28816252,0.580972823,0.868712818, + 0.94983775,1.086736074,1.190677393,1.396024878,1.499966198}, dpCurve={ + 1.587002096,1.526205451,1.375262055,1.161425577,1.07966457,0.857442348, + 0.645702306,0.224318658,0}) + annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,76}, + {-72,98}}))); + Modelica.Blocks.Sources.Constant const(final k=m_flow_nominal) + annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); + Modelica.Blocks.Sources.Ramp ramp( + height=-0.001, duration=1, + offset=1, + startTime=1) + annotation (Placement(transformation(extent={{0,62},{20,82}}))); + IBPSA.Fluid.Sources.Boundary_pT bouPump( + redeclare package Medium = Medium, + each final p=p_start, + each final T=T_start, + each final nPorts=1) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,0}))); + parameter Modelica.Units.SI.PressureDifference dp_nominal(displayUnit="Pa")= + 46536.58537/2 + "Pressure drop at nominal mass flow rate"; + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=0.286666667 + "Nominal mass flow rate"; + parameter Modelica.Units.SI.PressureDifference dpFullOpen_nominal=10000000 + "Pressure difference at which valve is fully open"; +equation + connect(res.port_b, val.port_a) + annotation (Line(points={{20,30},{40,30}}, color={0,127,255})); + connect(ramp.y, val.y) + annotation (Line(points={{21,72},{50,72},{50,42}}, color={0,0,127})); + connect(pump.port_b, pressureReliefValve.port_a) + annotation (Line(points={{-40,30},{-20,30},{-20,10}}, color={0,127,255})); + connect(pump.port_b, res.port_a) + annotation (Line(points={{-40,30},{0,30}}, color={0,127,255})); + connect(val.port_b, pump.port_a) annotation (Line(points={{60,30},{70,30},{70, + -34},{-70,-34},{-70,30},{-60,30}}, color={0,127,255})); + connect(pressureReliefValve.port_b, pump.port_a) annotation (Line(points={{-20, + -10},{-20,-34},{-70,-34},{-70,30},{-60,30}}, color={0,127,255})); + connect(bouPump.ports[1], pump.port_a) annotation (Line(points={{-80,0},{-70,0}, + {-70,30},{-60,30}}, color={0,127,255})); + connect(const.y, pump.m_flow_in) + annotation (Line(points={{-79,50},{-50,50},{-50,42}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + experiment(StopTime=3, __Dymola_Algorithm="Dassl")); +end m_flow; diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order index 753bffc9..a0d5adc9 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order @@ -1 +1,4 @@ TestThreeWayValve +PressureReliefExample +m_flow +PressureReliefExampleDP diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index f6e99ed1..debab812 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -3,17 +3,20 @@ model RadiatorPressureBased "Pressure Based transfer system" // Abui =1 and hBui =1 to avaoid warnings, will be overwritten anyway extends BaseClasses.PartialTransfer( ABui=1, - hBui=1, final dp_nominal=rad.dp_nominal .+ val.dpValve_nominal .+ res.dp_nominal .+ val.dpFixed_nominal, - final nParallelSup=1); + hBui=1, + final dp_nominal=transferDataBaseDefinition.dp_nominal, + final nParallelSup=1); parameter Boolean use_preRelVal=false "=false to disable pressure relief valve"; parameter Real perPreRelValOpens=0.99 "Percentage of nominal pressure difference at which the pressure relief valve starts to open" annotation(Dialog(enable=use_preRelVal)); replaceable parameter RecordsCollection.TransferDataBaseDefinition transferDataBaseDefinition constrainedby RecordsCollection.TransferDataBaseDefinition( - final Q_flow_nominal=Q_flow_nominal.*f_design, + final Q_flow_nominal=Q_flow_nominal .* f_design, final nZones=nParallelDem, final AFloor=ABui, - final heiBui=hBui) + final heiBui=hBui, + mRad_flow_nominal=m_flow_nominal, + mHeaCir_flow_nominal=mSup_flow_nominal[1]) annotation (choicesAllMatching=true, Placement(transformation(extent={{-62,-98},{-42,-78}}))); replaceable parameter @@ -94,7 +97,7 @@ model RadiatorPressureBased "Pressure Based transfer system" redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( final speed_rpm_nominal=pumpData.speed_rpm_nominal, final m_flow_nominal=sum(m_flow_nominal), - final dp_nominal=1/sum({1/dp_nominal[i] for i in 1:nParallelDem}), + final dp_nominal=transferDataBaseDefinition.dpPumpHeaCir_nominal + dpSup_nominal[1], final rho=rho, final V_flowCurve=pumpData.V_flowCurve, final dpCurve=pumpData.dpCurve), diff --git a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferDataBaseDefinition.mo b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferDataBaseDefinition.mo index a5be6195..f7e33941 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferDataBaseDefinition.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferDataBaseDefinition.mo @@ -42,10 +42,9 @@ partial record TransferDataBaseDefinition "Data record for hydraulic heat transf // Valves parameter Real valveAutho[nZones](each min=0.2, each max=0.8, each unit="1") "Assumed valve authority (typical value: 0.5)" annotation(Dialog(group="Thermostatic Valve")); parameter Modelica.Units.SI.PressureDifference dpHeaSysValve_nominal[nZones](each min=Modelica.Constants.eps)= - (dpRad_nominal .+ dpHeaSysPreValve_nominal) ./ (1 .- valveAutho) + valveAutho .* (dpRad_nominal .+ dpHeaSysPreValve_nominal) ./ (1 .- valveAutho) "Nominal pressure drop over valve when fully opened at m_flowValve_nominal" annotation (Dialog(group="Thermostatic Valve")); - parameter Boolean use_hydrBalAutom = true "Use automatic hydraluic balancing to set dpHeaSysPreValve_nominal" annotation(Dialog(group="Thermostatic Valve")); parameter Modelica.Units.SI.PressureDifference dpHeaSysPreValve_nominal[ nZones]=if use_hydrBalAutom then max(dpRad_nominal) .- (dpRad_nominal) @@ -54,6 +53,12 @@ partial record TransferDataBaseDefinition "Data record for hydraulic heat transf annotation (Dialog(group="Thermostatic Valve", enable=use_hydrBalAutom)); parameter Real leakageOpening = 0.0001 "may be useful for simulation stability. Always check the influence it has on your results" annotation(Dialog(group="Thermostatic Valve")); + // Pump + parameter Modelica.Units.SI.MassFlowRate mRad_flow_nominal[nZones] "Nominal mass flow rate in each radiator"; + parameter Modelica.Units.SI.MassFlowRate mHeaCir_flow_nominal=sum(mRad_flow_nominal) "Total mass flow rate of heating ciruit"; + final parameter Modelica.Units.SI.Pressure dp_nominal[nZones]=dpRad_nominal .+ dpHeaSysValve_nominal .+ dpHeaDistr_nominal .+ dpHeaSysPreValve_nominal "Pressure difference array of all parallel radiators"; + final parameter Modelica.Units.SI.Pressure dpPumpHeaCir_nominal = (mHeaCir_flow_nominal / sum({sqrt(mRad_flow_nominal[i]^2/dp_nominal[i]) for i in 1:nZones}))^2 + "Nominal pressure difference the pump has to achieve for the single heating circuit with multiple parallel radiators"; annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, diff --git a/BESMod/Systems/RecordsCollection/Movers/EcodanWaterPump.mo b/BESMod/Systems/RecordsCollection/Movers/EcodanWaterPump.mo new file mode 100644 index 00000000..1df66478 --- /dev/null +++ b/BESMod/Systems/RecordsCollection/Movers/EcodanWaterPump.mo @@ -0,0 +1,6 @@ +within BESMod.Systems.RecordsCollection.Movers; +record EcodanWaterPump + extends DefaultMover(V_flowCurve={0.000422526,0.28816252,0.580972823,0.868712818,0.94983775, + 1.086736074,1.190677393,1.396024878,1.499966198}, dpCurve={1.587002096,1.526205451, + 1.375262055,1.161425577,1.07966457,0.857442348,0.645702306,0.224318658,0}); +end EcodanWaterPump; diff --git a/BESMod/Systems/RecordsCollection/Movers/package.order b/BESMod/Systems/RecordsCollection/Movers/package.order index 254c4935..63232098 100644 --- a/BESMod/Systems/RecordsCollection/Movers/package.order +++ b/BESMod/Systems/RecordsCollection/Movers/package.order @@ -1,3 +1,4 @@ AutomaticConfigurationData MoverBaseDataDefinition DefaultMover +EcodanWaterPump diff --git a/BESMod/Systems/RecordsCollection/Valves/ThreeWayValve.mo b/BESMod/Systems/RecordsCollection/Valves/ThreeWayValve.mo index d7a2cc19..7169f199 100644 --- a/BESMod/Systems/RecordsCollection/Valves/ThreeWayValve.mo +++ b/BESMod/Systems/RecordsCollection/Valves/ThreeWayValve.mo @@ -8,7 +8,7 @@ partial record ThreeWayValve parameter Modelica.Units.SI.PressureDifference dp_nominal[2](displayUnit="Pa") "Nominal pressure drop of connected resistances without the valve"; - parameter Modelica.Units.SI.PressureDifference dpValve_nominal=max(dp_nominal) + parameter Modelica.Units.SI.PressureDifference dpValve_nominal=valveAutho*max(dp_nominal) /(1 - valveAutho) "Nominal pressure drop of fully open valve, used if CvData=IBPSA.Fluid.Types.CvTypes.OpPoint"; parameter Modelica.Units.SI.PressureDifference dpFixed_nominal[2]=max( From 64ed47d01cb17333dcfc209cde5388fa6a8670d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Larissa=20K=C3=BChn?= Date: Tue, 13 Sep 2022 15:49:40 +0200 Subject: [PATCH 055/131] fixed errors in use-case for HOM --- BESMod/Examples/UseCaseHOM/BES_HOM.mo | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/BESMod/Examples/UseCaseHOM/BES_HOM.mo b/BESMod/Examples/UseCaseHOM/BES_HOM.mo index fe3579c5..4f77561a 100644 --- a/BESMod/Examples/UseCaseHOM/BES_HOM.mo +++ b/BESMod/Examples/UseCaseHOM/BES_HOM.mo @@ -8,8 +8,7 @@ model BES_HOM Longitude=Modelica.Units.Conversions.to_deg(weaDat.lon), TimeCorrection=0, DiffWeatherDataTime=Modelica.Units.Conversions.to_hour(weaDat.timZon), - redeclare PCMgoesHIL.DataBase.WallsAndWindows.EnEV2009Heavy_AddIsulation - wallTypes, + redeclare AixLib.DataBase.Walls.Collections.OFD.EnEV2009Heavy wallTypes, redeclare model WindowModel = AixLib.ThermalZones.HighOrder.Components.WindowsDoors.WindowSimple, redeclare AixLib.DataBase.WindowsDoors.Simple.WindowSimple_EnEV2009 @@ -23,13 +22,11 @@ model BES_HOM redeclare BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP heatPumpParameters( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal /parameterStudy.QHP_flow_biv, @@ -44,7 +41,6 @@ model BES_HOM redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, - refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet")), redeclare BESMod.Systems.Hydraulical.Control.ConstHys_OnOff_HPSControll @@ -63,28 +59,28 @@ model BES_HOM TSet_DHW), redeclare BESMod.Systems.Hydraulical.Distribution.DistributionTwoStorageParallel - distribution(redeclare + distribution( + redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage bufParameters(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), - redeclare + redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters(dTLoadingHC1=10)), + dhwParameters(dTLoadingHC1=10), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + threeWayValveParameters), redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorTransferSystem transfer(redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), redeclare BESMod.Systems.Demand.DHW.DHW DHW( - use_pressure=false, + redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), - redeclare BESMod.Systems.UserProfiles.AixLibHighOrderProfiles - userProfiles( - redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM - DHWProfile), + redeclare BESMod.Systems.UserProfiles.AixLibHighOrderProfiles userProfiles, redeclare HOMSystem systemParameters, - redeclare PCMgoesHIL.UseCaseHOM.ParametersToChange parameterStudy, + redeclare UseCaseAachen.ParametersToChange parameterStudy, redeclare final package MediumDHW = AixLib.Media.Water, redeclare final package MediumZone = AixLib.Media.Air, redeclare final package MediumHyd = AixLib.Media.Water, From 107bd17a1b1260d85f8e2bc29e73caadd08afd79 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 13 Sep 2022 16:43:10 +0200 Subject: [PATCH 056/131] Move files and fix relief valve using dp directly --- .../Components/Valves/PressureReliefValve.mo | 25 ++--- .../Valves/Tests/PressureReliefExampleDP.mo | 101 ------------------ .../Components/Valves/Tests/m_flow.mo | 101 ------------------ .../Components/Valves/Tests/package.order | 2 - .../Movers/EcodanWaterPump.mo | 6 -- .../RecordsCollection/Movers/package.order | 1 - 6 files changed, 13 insertions(+), 223 deletions(-) delete mode 100644 BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExampleDP.mo delete mode 100644 BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/m_flow.mo delete mode 100644 BESMod/Systems/RecordsCollection/Movers/EcodanWaterPump.mo diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo index 15cbf84f..29bb42df 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo @@ -1,12 +1,13 @@ within BESMod.Systems.Hydraulical.Distribution.Components.Valves; model PressureReliefValve - extends AixLib.Fluid.Interfaces.PartialTwoPortInterface; + extends IBPSA.Fluid.Interfaces.PartialTwoPortInterface; parameter Modelica.Units.SI.PressureDifference dpFullOpen_nominal "Pressure difference at which valve is fully open"; parameter Modelica.Units.SI.PressureDifference dpThreshold_nominal = 0.95*dpFullOpen_nominal "Threshold at which valve starts to open"; - AixLib.Fluid.Actuators.Valves.TwoWayEqualPercentage val( + IBPSA.Fluid.Actuators.Valves.TwoWayEqualPercentage val( redeclare package Medium = Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=m_flow_nominal, + show_T=show_T, final dpValve_nominal=dpValve_nominal, final use_inputFilter=use_inputFilter, final riseTime(displayUnit="s") = riseTime, @@ -14,8 +15,6 @@ model PressureReliefValve y_start=y_start, final dpFixed_nominal=0, final l=l) annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - AixLib.Fluid.Sensors.RelativePressure senRelPre(redeclare package Medium = Medium) - annotation (Placement(transformation(extent={{-10,50},{10,30}}))); parameter Real facDpValve_nominal(min=0, max=1) = 0.5 "Factor to design dpValve_nominal"; parameter Real l=0.001 "Valve leakage, l=Kv(y=0)/Kv(y=1)"; @@ -24,6 +23,7 @@ model PressureReliefValve tab="Dynamics", group="Filtered opening", enable=use_inputFilter)); + parameter Modelica.Units.SI.PressureDifference dpValve_nominal = facDpValve_nominal*(dpFullOpen_nominal - dpThreshold_nominal) + dpThreshold_nominal; parameter Modelica.Blocks.Types.Init init=Modelica.Blocks.Types.Init.InitialOutput "Type of initialization (no init/steady state/initial state/initial output)" annotation (Dialog( tab="Dynamics", @@ -33,7 +33,7 @@ model PressureReliefValve tab="Dynamics", group="Filtered opening", enable=use_inputFilter)); - Modelica.Blocks.Nonlinear.Limiter limiter(final uMax=1, final uMin=0) + Modelica.Blocks.Nonlinear.Limiter limiter(final uMax=1, final uMin=0.01) annotation (Placement(transformation(extent={{-10,-10}, {10,10}}, rotation=0, @@ -53,16 +53,15 @@ model PressureReliefValve extent={{-10,-10},{10,10}}, rotation=180, origin={30,90}))); -protected - parameter Modelica.Units.SI.PressureDifference dpValve_nominal = facDpValve_nominal*(dpFullOpen_nominal - dpThreshold_nominal) + dpThreshold_nominal; - + Modelica.Blocks.Sources.RealExpression + realExpression(y=dp) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={50,50}))); equation - connect(val.port_a, senRelPre.port_a) annotation (Line(points={{-10,0},{-20,0},{-20,40},{-10,40}}, color={0,127,255})); - connect(val.port_b, senRelPre.port_b) annotation (Line(points={{10,0},{20,0},{20,40},{10,40}}, color={0,127,255})); connect(port_a, val.port_a) annotation (Line(points={{-100,0},{-10,0}}, color={0,127,255})); connect(val.port_b, port_b) annotation (Line(points={{10,0},{100,0}}, color={0,127,255})); - connect(senRelPre.p_rel, add.u1) annotation (Line(points={{0,49},{0,56},{20,56}, - {20,64},{2,64}}, color={0,0,127})); connect(const.y, add.u2) annotation (Line(points={{19,90},{18,90},{18,76},{2,76}}, color={0,0,127})); connect(limiter.y, val.y) annotation (Line(points={{-39,30},{-26,30},{-26,20}, @@ -71,6 +70,8 @@ equation annotation (Line(points={{-38,70},{-21,70}}, color={0,0,127})); connect(gain.y, limiter.u) annotation (Line(points={{-61,70},{-68,70},{-68,30}, {-62,30}}, color={0,0,127})); + connect(realExpression.y, add.u1) annotation (Line(points={{39,50},{26,50},{26, + 64},{2,64}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ Rectangle( extent={{-24,92},{22,20}}, diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExampleDP.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExampleDP.mo deleted file mode 100644 index bc5cb44d..00000000 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExampleDP.mo +++ /dev/null @@ -1,101 +0,0 @@ -within BESMod.Systems.Hydraulical.Distribution.Components.Valves.Tests; -model PressureReliefExampleDP - extends IBPSA.Fluid.Interfaces.LumpedVolumeDeclarations(redeclare package - Medium = IBPSA.Media.Water); - extends Modelica.Icons.Example; - parameter Boolean use_relVal=false; - PressureReliefValve pressureReliefValve(redeclare package Medium = Medium, - m_flow_nominal=m_flow_nominal, - dpFullOpen_nominal=dpFullOpen_nominal) if use_relVal - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={-20,0}))); - IBPSA.Fluid.FixedResistances.PressureDrop res( - redeclare package Medium = Medium, - final dp_nominal=dp_nominal, - final m_flow_nominal=m_flow_nominal) "Hydraulic resistance of supply" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={10,30}))); - IBPSA.Fluid.Actuators.Valves.TwoWayLinear val( - redeclare package Medium = Medium, - final m_flow_nominal=m_flow_nominal, - each final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, - final dpValve_nominal=0.5*dp_nominal/(1 - 0.5), - each final use_inputFilter=false, - final dpFixed_nominal=0) annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={50,30}))); - IBPSA.Fluid.Movers.FlowControlled_dp pump( - redeclare package Medium = Medium, - m_flow_nominal=m_flow_nominal, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final speed_rpm_nominal=pumpData.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal, - final dp_nominal=res.dp_nominal + val.dpValve_nominal + val.dpFixed_nominal, - - final rho(displayUnit="kg/m3") = 1, - final V_flowCurve=pumpData.V_flowCurve, - final dpCurve=pumpData.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final use_inputFilter=false) annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-50,30}))); - replaceable parameter - BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData(V_flowCurve={0.000422526,0.28816252,0.580972823,0.868712818, - 0.94983775,1.086736074,1.190677393,1.396024878,1.499966198}, dpCurve={ - 1.587002096,1.526205451,1.375262055,1.161425577,1.07966457,0.857442348, - 0.645702306,0.224318658,0}) - annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,76}, - {-72,98}}))); - Modelica.Blocks.Sources.Constant const(final k=dp_nominal) - annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); - Modelica.Blocks.Sources.Ramp ramp( - height=-1, duration=1, - offset=1, - startTime=1) - annotation (Placement(transformation(extent={{0,62},{20,82}}))); - IBPSA.Fluid.Sources.Boundary_pT bouPump( - redeclare package Medium = Medium, - each final p=p_start, - each final T=T_start, - each final nPorts=1) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-90,0}))); - parameter Modelica.Units.SI.PressureDifference dp_nominal(displayUnit="Pa")= - 46536.58537/2 - "Pressure drop at nominal mass flow rate"; - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=0.286666667 - "Nominal mass flow rate"; - parameter Modelica.Units.SI.PressureDifference dpFullOpen_nominal=10000000 - "Pressure difference at which valve is fully open"; -equation - connect(res.port_b, val.port_a) - annotation (Line(points={{20,30},{40,30}}, color={0,127,255})); - connect(ramp.y, val.y) - annotation (Line(points={{21,72},{50,72},{50,42}}, color={0,0,127})); - connect(pump.port_b, pressureReliefValve.port_a) - annotation (Line(points={{-40,30},{-20,30},{-20,10}}, color={0,127,255})); - connect(pump.port_b, res.port_a) - annotation (Line(points={{-40,30},{0,30}}, color={0,127,255})); - connect(val.port_b, pump.port_a) annotation (Line(points={{60,30},{70,30},{70, - -34},{-70,-34},{-70,30},{-60,30}}, color={0,127,255})); - connect(pressureReliefValve.port_b, pump.port_a) annotation (Line(points={{-20, - -10},{-20,-34},{-70,-34},{-70,30},{-60,30}}, color={0,127,255})); - connect(bouPump.ports[1], pump.port_a) annotation (Line(points={{-80,0},{-70,0}, - {-70,30},{-60,30}}, color={0,127,255})); - connect(const.y, pump.dp_in) - annotation (Line(points={{-79,50},{-50,50},{-50,42}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false)), - experiment(StopTime=3, __Dymola_Algorithm="Dassl")); -end PressureReliefExampleDP; diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/m_flow.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/m_flow.mo deleted file mode 100644 index 90edf311..00000000 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/m_flow.mo +++ /dev/null @@ -1,101 +0,0 @@ -within BESMod.Systems.Hydraulical.Distribution.Components.Valves.Tests; -model m_flow - extends IBPSA.Fluid.Interfaces.LumpedVolumeDeclarations(redeclare package - Medium = IBPSA.Media.Water); - extends Modelica.Icons.Example; - parameter Boolean use_relVal=false; - PressureReliefValve pressureReliefValve(redeclare package Medium = Medium, - m_flow_nominal=m_flow_nominal, - dpFullOpen_nominal=dpFullOpen_nominal) if use_relVal - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={-20,0}))); - IBPSA.Fluid.FixedResistances.PressureDrop res( - redeclare package Medium = Medium, - final dp_nominal=dp_nominal, - final m_flow_nominal=m_flow_nominal) "Hydraulic resistance of supply" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={10,30}))); - IBPSA.Fluid.Actuators.Valves.TwoWayLinear val( - redeclare package Medium = Medium, - final m_flow_nominal=m_flow_nominal, - each final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, - final dpValve_nominal=0.5*dp_nominal/(1 - 0.5), - each final use_inputFilter=false, - final dpFixed_nominal=0) annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={50,30}))); - IBPSA.Fluid.Movers.FlowControlled_m_flow pump( - redeclare package Medium = Medium, - m_flow_nominal=m_flow_nominal, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final speed_rpm_nominal=pumpData.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal, - final dp_nominal=res.dp_nominal + val.dpValve_nominal + val.dpFixed_nominal, - - final rho(displayUnit="kg/m3") = 1, - final V_flowCurve=pumpData.V_flowCurve, - final dpCurve=pumpData.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final use_inputFilter=false) annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-50,30}))); - replaceable parameter - BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData(V_flowCurve={0.000422526,0.28816252,0.580972823,0.868712818, - 0.94983775,1.086736074,1.190677393,1.396024878,1.499966198}, dpCurve={ - 1.587002096,1.526205451,1.375262055,1.161425577,1.07966457,0.857442348, - 0.645702306,0.224318658,0}) - annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,76}, - {-72,98}}))); - Modelica.Blocks.Sources.Constant const(final k=m_flow_nominal) - annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); - Modelica.Blocks.Sources.Ramp ramp( - height=-0.001, duration=1, - offset=1, - startTime=1) - annotation (Placement(transformation(extent={{0,62},{20,82}}))); - IBPSA.Fluid.Sources.Boundary_pT bouPump( - redeclare package Medium = Medium, - each final p=p_start, - each final T=T_start, - each final nPorts=1) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-90,0}))); - parameter Modelica.Units.SI.PressureDifference dp_nominal(displayUnit="Pa")= - 46536.58537/2 - "Pressure drop at nominal mass flow rate"; - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=0.286666667 - "Nominal mass flow rate"; - parameter Modelica.Units.SI.PressureDifference dpFullOpen_nominal=10000000 - "Pressure difference at which valve is fully open"; -equation - connect(res.port_b, val.port_a) - annotation (Line(points={{20,30},{40,30}}, color={0,127,255})); - connect(ramp.y, val.y) - annotation (Line(points={{21,72},{50,72},{50,42}}, color={0,0,127})); - connect(pump.port_b, pressureReliefValve.port_a) - annotation (Line(points={{-40,30},{-20,30},{-20,10}}, color={0,127,255})); - connect(pump.port_b, res.port_a) - annotation (Line(points={{-40,30},{0,30}}, color={0,127,255})); - connect(val.port_b, pump.port_a) annotation (Line(points={{60,30},{70,30},{70, - -34},{-70,-34},{-70,30},{-60,30}}, color={0,127,255})); - connect(pressureReliefValve.port_b, pump.port_a) annotation (Line(points={{-20, - -10},{-20,-34},{-70,-34},{-70,30},{-60,30}}, color={0,127,255})); - connect(bouPump.ports[1], pump.port_a) annotation (Line(points={{-80,0},{-70,0}, - {-70,30},{-60,30}}, color={0,127,255})); - connect(const.y, pump.m_flow_in) - annotation (Line(points={{-79,50},{-50,50},{-50,42}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false)), - experiment(StopTime=3, __Dymola_Algorithm="Dassl")); -end m_flow; diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order index a0d5adc9..7d834d79 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order @@ -1,4 +1,2 @@ TestThreeWayValve PressureReliefExample -m_flow -PressureReliefExampleDP diff --git a/BESMod/Systems/RecordsCollection/Movers/EcodanWaterPump.mo b/BESMod/Systems/RecordsCollection/Movers/EcodanWaterPump.mo deleted file mode 100644 index 1df66478..00000000 --- a/BESMod/Systems/RecordsCollection/Movers/EcodanWaterPump.mo +++ /dev/null @@ -1,6 +0,0 @@ -within BESMod.Systems.RecordsCollection.Movers; -record EcodanWaterPump - extends DefaultMover(V_flowCurve={0.000422526,0.28816252,0.580972823,0.868712818,0.94983775, - 1.086736074,1.190677393,1.396024878,1.499966198}, dpCurve={1.587002096,1.526205451, - 1.375262055,1.161425577,1.07966457,0.857442348,0.645702306,0.224318658,0}); -end EcodanWaterPump; diff --git a/BESMod/Systems/RecordsCollection/Movers/package.order b/BESMod/Systems/RecordsCollection/Movers/package.order index 63232098..254c4935 100644 --- a/BESMod/Systems/RecordsCollection/Movers/package.order +++ b/BESMod/Systems/RecordsCollection/Movers/package.order @@ -1,4 +1,3 @@ AutomaticConfigurationData MoverBaseDataDefinition DefaultMover -EcodanWaterPump From 5f1b26c923833590a5264489dcbcf4d8ad3ada5c Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 16 Sep 2022 16:59:11 +0200 Subject: [PATCH 057/131] Add first order to preRelValve to prevent instability --- .../Components/Valves/PressureReliefValve.mo | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo index 29bb42df..56c958cc 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/PressureReliefValve.mo @@ -58,7 +58,12 @@ model PressureReliefValve annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, - origin={50,50}))); + origin={70,50}))); + Modelica.Blocks.Continuous.FirstOrder firstOrder(k=1, T=360) annotation ( + Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=180, + origin={30,52}))); equation connect(port_a, val.port_a) annotation (Line(points={{-100,0},{-10,0}}, color={0,127,255})); connect(val.port_b, port_b) annotation (Line(points={{10,0},{100,0}}, color={0,127,255})); @@ -70,8 +75,10 @@ equation annotation (Line(points={{-38,70},{-21,70}}, color={0,0,127})); connect(gain.y, limiter.u) annotation (Line(points={{-61,70},{-68,70},{-68,30}, {-62,30}}, color={0,0,127})); - connect(realExpression.y, add.u1) annotation (Line(points={{39,50},{26,50},{26, - 64},{2,64}}, color={0,0,127})); + connect(realExpression.y, firstOrder.u) + annotation (Line(points={{59,50},{59,52},{42,52}}, color={0,0,127})); + connect(firstOrder.y, add.u1) annotation (Line(points={{19,52},{10,52},{10,64}, + {2,64}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ Rectangle( extent={{-24,92},{22,20}}, From 5fc3d76346befa7eb2d102ae3c905bd01bead39f Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 16 Sep 2022 16:59:47 +0200 Subject: [PATCH 058/131] Update AixLib ref --- dependencies.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.json b/dependencies.json index 1f63efa2..31b8d8d6 100644 --- a/dependencies.json +++ b/dependencies.json @@ -10,7 +10,7 @@ "optional": { "AixLib": { "url": "https://github.com/RWTH-EBC/AixLib", - "commit": "a7c56fb58910bded5d594e3366d92acd4873c3a4", + "commit": "4a8f4ea05f2320673756a2aa454945dc155df99c", "default_branch": "development", "mo": "AixLib//package.mo" }, From 05646e207294db5dac3a7f87df61bf010a2e2da5 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 19 Oct 2022 10:35:59 +0200 Subject: [PATCH 059/131] fix control and examples --- .../PartialTwoPoint_HPS_Controller.mo | 9 +- .../Generation/HeatPumpAndHeatingRod.mo | 1 - .../HeatGeneration/GetHeatPumpCurveVCLib.mo | 8 +- .../PartialGetHeatGenerationCurve.mo | 114 +++++++++--------- 4 files changed, 70 insertions(+), 62 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo index 9ad9e21b..c0e4016e 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo @@ -372,8 +372,13 @@ equation connect(HP_or_HR_active.u1, HRactive.y) annotation (Line(points={{-170,-12},{ -134,-12},{-134,-6},{-6,-6},{-6,18},{20.75,18},{20.75,25}}, color={ 255,0,255})); - connect(HP_or_HR_active.u2, HP_active.y) annotation (Line(points={{-178,-12}, - {-178,2},{-10,2},{-10,91},{32.5,91}}, color={255,0,255})); + connect(HP_or_HR_active.u2, sigBusGen.hp_bus.onOffMea) annotation (Line( + points={{-178,-12},{-194,-12},{-194,-99},{-152,-99}}, color={255,0,255}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); annotation (Diagram(graphics={ Rectangle( extent={{-240,100},{-50,60}}, diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index 550c01b5..a53acb13 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -7,7 +7,6 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" i] > 44.9 + 273.15 then 8 else 5 for i in 1:nParallelDem}, dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal}, nParallelDem=1); - parameter Boolean use_pressure=false "=true to use a pump which works on pressure difference"; parameter Boolean use_heaRod=true "=false to disable the heating rod"; replaceable model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D diff --git a/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo b/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo index a65c7ac5..fedf0219 100644 --- a/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo +++ b/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo @@ -11,7 +11,6 @@ model GetHeatPumpCurveVCLib BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, redeclare package Medium_eva = IBPSA.Media.Air, - use_pressure=false, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP heatPumpParameters, @@ -26,5 +25,12 @@ model GetHeatPumpCurveVCLib offset=273.15 - 15, startTime=1000), realExpression(y=generation.heatPump.con.QFlow_in)); +equation + connect(const.y, sigBusGen.uPump) annotation (Line(points={{-79,60},{-70,60}, + {-70,64},{-62,64}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); annotation (experiment(StopTime=86400, __Dymola_Algorithm="Dassl")); end GetHeatPumpCurveVCLib; diff --git a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo index b7ec5862..53e32410 100644 --- a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo +++ b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo @@ -4,48 +4,42 @@ partial model PartialGetHeatGenerationCurve replaceable Systems.Hydraulical.Generation.BaseClasses.PartialGeneration generation constrainedby Systems.Hydraulical.Generation.BaseClasses.PartialGeneration( - redeclare final package Medium = IBPSA.Media.Water, - final Q_flow_nominal={sum(systemParameters.QBui_flow_nominal)}, - final TDem_nominal=systemParameters.THydSup_nominal, - final dp_nominal=fill(0, generation.nParallelDem), - final TOda_nominal=systemParameters.TOda_nominal, - final TAmb= systemParameters.TAmbHyd, - final dpDem_nominal={0}) annotation (choicesAllMatching=true, Placement( + redeclare final package Medium = IBPSA.Media.Water, + final Q_flow_nominal={sum(systemParameters.QBui_flow_nominal)}, + final TDem_nominal=systemParameters.THydSup_nominal, + final TOda_nominal=systemParameters.TOda_nominal, + final TAmb=systemParameters.TAmbHyd, + final dpDem_nominal={0}) annotation (choicesAllMatching=true, Placement( transformation(extent={{-36,-36},{34,36}}))); Systems.Hydraulical.Interfaces.GenerationControlBus sigBusGen annotation (Placement(transformation(extent={{-72,54},{-52,74}}))); Modelica.Blocks.Sources.Constant const(k=1) - annotation (Placement(transformation(extent={{-150,54},{-130,74}}))); + annotation (Placement(transformation(extent={{-100,50},{-80,70}}))); Modelica.Blocks.Sources.Constant const1(k=0) - annotation (Placement(transformation(extent={{-150,22},{-130,42}}))); + annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); Modelica.Blocks.Sources.BooleanConstant booleanConstant(k=true) - annotation (Placement(transformation(extent={{-148,-8},{-128,12}}))); + annotation (Placement(transformation(extent={{-100,-10},{-80,10}}))); Modelica.Blocks.Sources.Constant const2(k=1) - annotation (Placement(transformation(extent={{-148,-44},{-128,-24}}))); + annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); Modelica.Blocks.Sources.Ramp ramp - annotation (Placement(transformation(extent={{-150,-80},{-130,-60}}))); - IBPSA.Fluid.Sources.MassFlowSource_T boundary( + annotation (Placement(transformation(extent={{-100,-70},{-80,-50}}))); + IBPSA.Fluid.MixingVolumes.MixingVolume + vol( redeclare package Medium = IBPSA.Media.Water, - m_flow=generation.m_flow_nominal[1], - use_T_in=true, - T=313.15, - nPorts=1) annotation (Placement(transformation( + m_flow_nominal=generation.m_flow_nominal[1], + V=0.01, + nPorts=2) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={82,10}))); - IBPSA.Fluid.Sources.Boundary_pT bou1(redeclare package Medium = - IBPSA.Media.Water, nPorts=1) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={82,54}))); Systems.Hydraulical.Control.Components.HeatingCurve heatingCurve( GraHeaCurve=bivalentHeatPumpControlDataDefinition.gradientHeatCurve, THeaThres=systemParameters.TSetZone_nominal[1], dTOffSet_HC=bivalentHeatPumpControlDataDefinition.dTOffSetHeatCurve - generation.dTTra_nominal[1]) annotation (Placement(transformation( - extent={{-11,-11},{11,11}}, + extent={{-11,11},{11,-11}}, rotation=0, - origin={-7,-71}))); + origin={-9,-71}))); Modelica.Blocks.Interfaces.RealOutput TOda(unit="K", displayUnit="degC") "Connector of Real output signal" annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); @@ -63,7 +57,12 @@ partial model PartialGetHeatGenerationCurve TSetRoomConst=systemParameters.TSetZone_nominal[1]) annotation (choicesAllMatching=true,Placement(transformation(extent={{-100,82},{-80,102}}))); Modelica.Blocks.Sources.Constant const3(k=max(systemParameters.TSetZone_nominal)) - annotation (Placement(transformation(extent={{-150,-114},{-130,-94}}))); + annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); + IBPSA.BoundaryConditions.WeatherData.Bus weaBus "Weather data bus" + annotation (Placement(transformation(extent={{-46,66},{-26,86}}))); + Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature + prescribedTemperature + annotation (Placement(transformation(extent={{40,-80},{60,-60}}))); equation connect(sigBusGen, generation.sigBusGen) annotation (Line( points={{-62,64},{-0.3,64},{-0.3,35.28}}, @@ -73,60 +72,59 @@ equation index=-1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(const.y, sigBusGen.hp_bus.iceFacMea) annotation (Line(points={{-129,64}, - {-94,64},{-94,64},{-62,64}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(const1.y, sigBusGen.hr_on) annotation (Line(points={{-129,32},{-96,32}, - {-96,64},{-62,64}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(booleanConstant.y, sigBusGen.hp_bus.modeSet) annotation (Line(points={ - {-127,2},{-98,2},{-98,0},{-62,0},{-62,64}}, color={255,0,255}), Text( + connect(const.y, sigBusGen.hp_bus.iceFacMea) annotation (Line(points={{-79,60}, + {-79,64},{-62,64}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(const2.y, sigBusGen.hp_bus.nSet) annotation (Line(points={{-127,-34},{ - -62,-34},{-62,64}}, color={0,0,127}), Text( + connect(const1.y, sigBusGen.hr_on) annotation (Line(points={{-79,30},{-62,30}, + {-62,64}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(ramp.y, sigBusGen.weaBus.TDryBul) annotation (Line(points={{-129,-70}, - {-62,-70},{-62,64}}, color={0,0,127}), Text( + connect(booleanConstant.y, sigBusGen.hp_bus.modeSet) annotation (Line(points={{-79,0}, + {-62,0},{-62,64}}, color={255,0,255}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(ramp.y, sigBusGen.hp_bus.TOdaMea) annotation (Line(points={{-129,-70}, - {-62,-70},{-62,64}}, color={0,0,127}), Text( + connect(const2.y, sigBusGen.hp_bus.nSet) annotation (Line(points={{-79,-30},{ + -62,-30},{-62,64}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(generation.portGen_in, boundary.ports[1:1]) annotation (Line(points={{ - 34,14.4},{62,14.4},{62,10},{72,10}}, color={0,127,255})); - connect(generation.portGen_out, bou1.ports[1:1]) annotation (Line(points={{34, - 28.8},{62,28.8},{62,54},{72,54}}, color={0,127,255})); - connect(boundary.T_in, heatingCurve.TSet) annotation (Line(points={{94,6},{ - 100,6},{100,-71},{5.1,-71}}, + connect(generation.portGen_in, vol.ports[1:1]) annotation (Line(points={{34,14.4}, + {62,14.4},{62,20},{83,20}}, color={0,127,255})); + connect(heatingCurve.TOda, ramp.y) annotation (Line(points={{-22.2,-71},{-26, + -71},{-26,-92},{-79,-92},{-79,-60}}, color={0,0,127})); - connect(heatingCurve.TOda, ramp.y) annotation (Line(points={{-20.2,-71},{-36, - -71},{-36,-70},{-129,-70}}, - color={0,0,127})); - connect(ramp.y, TOda) annotation (Line(points={{-129,-70},{-116,-70},{-116, - -72},{-102,-72},{-102,-90},{62,-90},{62,-40},{110,-40}}, color={0,0, + connect(ramp.y, TOda) annotation (Line(points={{-79,-60},{-79,-92},{-26,-92}, + {-26,-44},{94,-44},{94,-40},{110,-40}}, color={0,0, 127})); connect(realExpression.y, QCon_flow) annotation (Line(points={{51,82},{88,82}, {88,60},{110,60}}, color={0,0,127})); - connect(const3.y, heatingCurve.TSetRoom) annotation (Line(points={{-129,-104}, - {-96,-104},{-96,-106},{-30,-106},{-30,-57.8},{-7,-57.8}}, color={0,0, + connect(const3.y, heatingCurve.TSetRoom) annotation (Line(points={{-79,-90},{ + -78,-90},{-78,-92},{-9,-92},{-9,-84.2}}, color={0,0, 127})); + connect(generation.weaBus, weaBus) annotation (Line( + points={{-35.3,21.6},{-35.3,76},{-36,76}}, + color={255,204,51}, + thickness=0.5)); + connect(ramp.y, weaBus.TDryBul) annotation (Line(points={{-79,-60},{-44,-60}, + {-44,62},{-36,62},{-36,76}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(prescribedTemperature.port, vol.heatPort) annotation (Line(points={{ + 60,-70},{66,-70},{66,-4},{96,-4},{96,10},{92,10}}, color={191,0,0})); + connect(generation.portGen_out[1], vol.ports[2]) + annotation (Line(points={{34,28.8},{81,28.8},{81,20}}, color={0,127,255})); + connect(heatingCurve.TSet, prescribedTemperature.T) annotation (Line(points={ + {3.1,-71},{20.55,-71},{20.55,-70},{38,-70}}, color={0,0,127})); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); From 3e797783ee27f22079b801ea99c66146f76786cf Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 21 Oct 2022 11:26:05 +0200 Subject: [PATCH 060/131] first fixes for openModelica --- BESMod/Examples/BAUSimStudy/PartialCase.mo | 6 --- .../SolarThermalSystem/SolarThermalHPS.mo | 2 - .../SolarThermalHPSBuildingsLib.mo | 2 - BESMod/Examples/UseCaseHOM/BES_HOM.mo | 7 +++- .../PartialModelicaConferenceUseCase.mo | 2 - .../Systems/BaseClasses/PartialBESExample.mo | 3 +- .../PartialBuildingEnergySystem.mo | 35 +++++++++-------- .../Building/Components/AixLibHighOrderOFD.mo | 6 +-- .../Electrical/Interfaces/ControlOutputs.mo | 2 +- .../Interfaces/DistributionOutputs.mo | 2 +- .../Interfaces/GenerationOutputs.mo | 2 +- .../Electrical/Interfaces/TransferOutputs.mo | 2 +- .../PartialTwoPoint_HPS_Controller.mo | 6 +-- .../Generation/Tests/HeatPumpAndHeatingRod.mo | 1 - .../SolarThermalAndHeatPumpAndHeatingRod.mo | 1 - .../Hydraulical/Interfaces/ControlOutputs.mo | 2 +- .../Interfaces/DistributionOutputs.mo | 2 +- .../Interfaces/GenerationOutputs.mo | 2 +- .../Hydraulical/Interfaces/TransferOutputs.mo | 2 +- .../Hydraulical/Transfer/Tests/PartialTest.mo | 38 ++++++++++--------- BESMod/Systems/Interfaces/ControlOutputs.mo | 2 +- BESMod/Systems/Interfaces/DHWOutputs.mo | 2 +- BESMod/Systems/Interfaces/DemandOutputs.mo | 2 +- .../Systems/Interfaces/ElectricalOutputs.mo | 2 +- BESMod/Systems/Interfaces/HydraulicOutputs.mo | 2 +- .../Icons => Systems/Interfaces}/KPIBus.mo | 2 +- BESMod/Systems/Interfaces/SystemOutputs.mo | 2 +- BESMod/Systems/Interfaces/UseProBus.mo | 4 +- .../Systems/Interfaces/VentilationOutputs.mo | 2 +- BESMod/Systems/Interfaces/package.order | 3 +- .../Ventilation/Interfaces/ControlOutputs.mo | 2 +- .../Interfaces/DistributionOutputs.mo | 2 +- .../Interfaces/GenerationOutputs.mo | 2 +- BESMod/Tutorial/BaseClasses/PartialSystem.mo | 6 ++- BESMod/Utilities/Icons/package.order | 1 - .../KPIs/BaseClasses/PartialKPICalculator.mo | 2 +- .../SupervisoryControl/SupervisoryControl.mo | 27 +++++++------ .../SupervisoryControlExample.mo | 7 ++-- BESMod/package.mo | 5 +-- 39 files changed, 97 insertions(+), 105 deletions(-) rename BESMod/{Utilities/Icons => Systems/Interfaces}/KPIBus.mo (98%) diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index e33db83a..6b783e3e 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -9,14 +9,11 @@ partial model PartialCase redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - redeclare package Medium_eva = AixLib.Media.Air, - use_pressure=true, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP heatPumpParameters( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=TBiv, scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal /5000, @@ -31,7 +28,6 @@ partial model PartialCase redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, - refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet")), redeclare Systems.Hydraulical.Control.ConstHys_PI_ConOut_HPSController @@ -89,10 +85,8 @@ partial model PartialCase BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData transferDataBaseDefinition, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), - redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo index f4e87f41..16cab740 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalHPS.mo @@ -15,12 +15,10 @@ model SolarThermalHPS "HPS which is supported by a solar thermal collector" redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP heatPumpParameters(genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentParallel), - redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR heatingRodParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Examples.SolarThermalSystem.SolarCollector solarThermalParas( diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalHPSBuildingsLib.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalHPSBuildingsLib.mo index bfd0e3b6..80a16887 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalHPSBuildingsLib.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalHPSBuildingsLib.mo @@ -16,12 +16,10 @@ model SolarThermalHPSBuildingsLib redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP heatPumpParameters(genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentParallel), - redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR heatingRodParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Examples.SolarThermalSystem.SolarCollector solarThermalParas( diff --git a/BESMod/Examples/UseCaseHOM/BES_HOM.mo b/BESMod/Examples/UseCaseHOM/BES_HOM.mo index 4f77561a..83d35964 100644 --- a/BESMod/Examples/UseCaseHOM/BES_HOM.mo +++ b/BESMod/Examples/UseCaseHOM/BES_HOM.mo @@ -46,8 +46,11 @@ model BES_HOM redeclare BESMod.Systems.Hydraulical.Control.ConstHys_OnOff_HPSControll control( redeclare - PCMgoesHIL.Systems.Hydraulic.Control.Components.ThermostaticValveControlHIL + BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled thermostaticValveController, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition + thermostaticValveParameters, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl safetyControl, @@ -85,7 +88,7 @@ model BES_HOM redeclare final package MediumZone = AixLib.Media.Air, redeclare final package MediumHyd = AixLib.Media.Water, redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); - + extends Modelica.Icons.Example; annotation (experiment( StopTime=31536000, Interval=600, diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 2e9474c9..cbc74319 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -27,13 +27,11 @@ partial model PartialModelicaConferenceUseCase redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( dTTra_nominal={10}, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP heatPumpParameters( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=271.15, scalingFactor=scalingFactorHP, useAirSource=true, diff --git a/BESMod/Systems/BaseClasses/PartialBESExample.mo b/BESMod/Systems/BaseClasses/PartialBESExample.mo index 23dd0817..a783bbdb 100644 --- a/BESMod/Systems/BaseClasses/PartialBESExample.mo +++ b/BESMod/Systems/BaseClasses/PartialBESExample.mo @@ -1,7 +1,8 @@ within BESMod.Systems.BaseClasses; partial model PartialBESExample "Partial example model" - BESMod.Systems.RecordsCollection.ExampleSystemParameters systemParameters "Parameters relevant for the whole energy system" annotation (Placement(transformation(extent={{76,-96},{96,-76}}))); + BESMod.Systems.RecordsCollection.ExampleSystemParameters systemParameters "Parameters relevant for the whole energy system" annotation (Placement(transformation(extent={{80,-100}, + {100,-80}}))); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, coordinateSystem(preserveAspectRatio=false)),experiment(StopTime=86400, __Dymola_Algorithm="Dassl")); diff --git a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo index 5a4cfefd..480e127d 100644 --- a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo +++ b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo @@ -153,12 +153,12 @@ protected equation connect(building.weaBus, weaDat.weaBus) annotation (Line( - points={{17.54,78.76},{24,78.76},{24,88},{-16,88},{-16,206},{-214,206},{ - -214,70},{-220,70}}, + points={{17.54,78.6909},{24,78.6909},{24,88},{-16,88},{-16,206},{-214,206}, + {-214,70},{-220,70}}, color={255,204,51}, thickness=0.5)); connect(building.outBusDem, outputs.building) annotation (Line( - points={{75.26,39.24},{75.26,38},{96,38},{96,0},{285,0}}, + points={{75.26,42.7636},{75.26,38},{96,38},{96,0},{285,0}}, color={175,175,175}, thickness=0.5), Text( string="%second", @@ -172,8 +172,8 @@ equation if systemParameters.use_hydraulic then connect(building.buiMeaBus, hydraulic.buiMeaBus) annotation (Line( - points={{39,77.62},{44,77.62},{44,88},{-26,88},{-26,10},{-86.7474,10},{ - -86.7474,-2.34286}}, + points={{39,77.6545},{44,77.6545},{44,88},{-26,88},{-26,10},{-86.7474,10}, + {-86.7474,-2.34286}}, color={255,128,0}, thickness=0.5)); connect(weaDat.weaBus, hydraulic.weaBus) annotation (Line( @@ -190,11 +190,12 @@ equation extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); connect(hydraulic.heatPortRad,building.heatPortRad) annotation (Line( - points={{-42,-50},{-42,-48},{-18,-48},{-18,18},{0,18},{0,17.2},{2, - 17.2}}, color={191, + points={{-42,-50},{-42,-48},{-18,-48},{-18,18},{0,18},{0,22.7273},{2, + 22.7273}}, color={191, 0,0})); connect(hydraulic.heatPortCon,building.heatPortCon) annotation (Line( - points={{-42,-23.2571},{-42,-24},{-20,-24},{-20,62.8},{2,62.8}},color= + points={{-42,-23.2571},{-42,-24},{-20,-24},{-20,64.1818},{2,64.1818}}, + color= {191,0,0})); connect(userProfiles.useProBus, hydraulic.useProBus) annotation (Line( points={{-225.167,150.775},{-214,150.775},{-214,16},{-157.358,16},{ @@ -243,9 +244,10 @@ equation if systemParameters.use_ventilation then connect(building.portVent_in, ventilation.portVent_in) annotation (Line( - points={{76,54.44},{84,54.44},{84,55.2},{122,55.2}}, color={0,127,255})); + points={{76,56.5818},{84,56.5818},{84,55.2},{122,55.2}}, + color={0,127,255})); connect(building.portVent_out, ventilation.portVent_out) annotation (Line( - points={{76,24.8},{84,24.8},{84,25.56},{122,25.56}}, + points={{76,29.6364},{84,29.6364},{84,25.56},{122,25.56}}, color={0,127,255})); connect(ventilation.outBusVen, outputs.ventilation) annotation (Line( points={{159,2},{158,2},{158,-26},{244,-26},{244,0},{285,0}}, @@ -265,7 +267,7 @@ equation color={0,127,0}, thickness=0.5)); connect(building.buiMeaBus, ventilation.buiMeaBus) annotation (Line( - points={{39,77.62},{44,77.62},{44,88},{177.87,88},{177.87,78.38}}, + points={{39,77.6545},{44,77.6545},{44,88},{177.87,88},{177.87,78.38}}, color={255,128,0}, thickness=0.5)); connect(control.sigBusVen, ventilation.sigBusVen) annotation (Line( @@ -284,15 +286,16 @@ equation connect(building.internalElectricalPin, electrical.internalElectricalPin[4]) annotation (Line( - points={{64.9,3.52},{64.9,-26},{112,-26},{112,-140},{-210,-140},{-210,118}, - {-198,118},{-198,118.171}}, + points={{64.9,10.2909},{64.9,-26},{112,-26},{112,-140},{-210,-140},{-210, + 118},{-198,118},{-198,118.171}}, color={0,0,0}, thickness=1)); if systemParameters.use_elecHeating then connect(electrical.heatPortCon, building.heatPortCon) annotation (Line(points={{ - -41.0824,92.8},{-30,92.8},{-30,62.8},{2,62.8}}, color={191,0,0})); + -41.0824,92.8},{-30,92.8},{-30,64.1818},{2,64.1818}}, + color={191,0,0})); connect(electrical.heatPortRad, building.heatPortRad) annotation (Line(points={{ - -41.0824,67.4286},{-24,67.4286},{-24,17.2},{2,17.2}}, + -41.0824,67.4286},{-24,67.4286},{-24,22.7273},{2,22.7273}}, color={191,0,0})); end if; connect(control.outBusCtrl, outputs.control) annotation (Line( @@ -309,7 +312,7 @@ equation thickness=0.5)); connect(electrical.buiMeaBus, building.buiMeaBus) annotation (Line( points={{-83.2941,136},{-82,136},{-82,146},{-16,146},{-16,88},{44,88},{44, - 82},{39,82},{39,77.62}}, + 82},{39,82},{39,77.6545}}, color={255,128,0}, thickness=0.5)); connect(electrical.outBusElect, outputs.electrical) annotation (Line( diff --git a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo index 3d6e8c25..e48b7170 100644 --- a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo +++ b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo @@ -27,14 +27,12 @@ model AixLibHighOrderOFD "High order OFD" AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow (windowarea=2) constrainedby - AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow - annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.PartialWindow annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); replaceable parameter AixLib.DataBase.WindowsDoors.Simple.OWBaseDataDefinition_Simple Type_Win "Window parametrization" annotation (Dialog(tab="Outer walls", group="Windows"), choicesAllMatching = true); replaceable model CorrSolarGainWin = AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG constrainedby - AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG - "Correction model for solar irradiance as transmitted radiation" annotation (choicesAllMatching=true, Dialog(tab="Outer walls", group="Windows", enable = withWindow and outside)); + AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.PartialCorG "Correction model for solar irradiance as transmitted radiation" annotation (choicesAllMatching=true, Dialog(tab="Outer walls", group="Windows", enable = withWindow and outside)); parameter Boolean use_sunblind=false "Will sunblind become active automatically?" annotation (Dialog(tab="Outer walls", group="Sunblind")); parameter Modelica.Units.SI.CoefficientOfHeatTransfer UValOutDoors=2.5 diff --git a/BESMod/Systems/Electrical/Interfaces/ControlOutputs.mo b/BESMod/Systems/Electrical/Interfaces/ControlOutputs.mo index 1005088a..9f3d0ba1 100644 --- a/BESMod/Systems/Electrical/Interfaces/ControlOutputs.mo +++ b/BESMod/Systems/Electrical/Interfaces/ControlOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Interfaces; expandable connector ControlOutputs "Control bus for controller outputs" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Systems/Electrical/Interfaces/DistributionOutputs.mo b/BESMod/Systems/Electrical/Interfaces/DistributionOutputs.mo index 86bf0320..e9d98057 100644 --- a/BESMod/Systems/Electrical/Interfaces/DistributionOutputs.mo +++ b/BESMod/Systems/Electrical/Interfaces/DistributionOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Interfaces; expandable connector DistributionOutputs - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Systems/Electrical/Interfaces/GenerationOutputs.mo b/BESMod/Systems/Electrical/Interfaces/GenerationOutputs.mo index dc579f84..bfe4ba8e 100644 --- a/BESMod/Systems/Electrical/Interfaces/GenerationOutputs.mo +++ b/BESMod/Systems/Electrical/Interfaces/GenerationOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Interfaces; expandable connector GenerationOutputs "Bus for outputs of electrical generation models" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Systems/Electrical/Interfaces/TransferOutputs.mo b/BESMod/Systems/Electrical/Interfaces/TransferOutputs.mo index ea6dec0c..cd38e8f1 100644 --- a/BESMod/Systems/Electrical/Interfaces/TransferOutputs.mo +++ b/BESMod/Systems/Electrical/Interfaces/TransferOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Interfaces; expandable connector TransferOutputs - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo index c0e4016e..69a57aad 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo @@ -318,9 +318,9 @@ equation connect(supervisoryControlDHW.y, add_dT_LoadingDHW.u1) annotation (Line( points={{-168.8,78},{-150,78},{-150,76},{-10,76},{-10,86},{35,86}}, color={0,0,127})); - connect(supervisoryControlDHW.activateInt, sigBusHyd.overwriteTSetDHW) - annotation (Line(points={{-183.2,78},{-186,78},{-186,94},{-28,94},{-28,101}}, - color={255,0,255}), Text( + connect(supervisoryControlDHW.actInt, sigBusHyd.overwriteTSetDHW) annotation + (Line(points={{-183.2,78},{-186,78},{-186,94},{-28,94},{-28,101}}, color={ + 255,0,255}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo index 20271fe5..bba5d3bb 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo @@ -3,7 +3,6 @@ model HeatPumpAndHeatingRod extends PartialTest( redeclare BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( - use_pressure=true, use_heaRod=true, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D (dataTable= diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo index 9cdd4e1e..7c45975e 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo @@ -3,7 +3,6 @@ model SolarThermalAndHeatPumpAndHeatingRod extends PartialTest( redeclare BESMod.Systems.Hydraulical.Generation.SolarThermalBivHP generation( - use_pressure=true, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap, redeclare diff --git a/BESMod/Systems/Hydraulical/Interfaces/ControlOutputs.mo b/BESMod/Systems/Hydraulical/Interfaces/ControlOutputs.mo index 07fad267..e8b4337a 100644 --- a/BESMod/Systems/Hydraulical/Interfaces/ControlOutputs.mo +++ b/BESMod/Systems/Hydraulical/Interfaces/ControlOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Interfaces; expandable connector ControlOutputs "Bus with ouputs of the control system" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation ( defaultComponentName = "outBusCtrl", diff --git a/BESMod/Systems/Hydraulical/Interfaces/DistributionOutputs.mo b/BESMod/Systems/Hydraulical/Interfaces/DistributionOutputs.mo index f0c6ea7d..5165eed4 100644 --- a/BESMod/Systems/Hydraulical/Interfaces/DistributionOutputs.mo +++ b/BESMod/Systems/Hydraulical/Interfaces/DistributionOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Interfaces; expandable connector DistributionOutputs "Bus with ouputs of the distribution system" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation ( defaultComponentName = "outBusDist", diff --git a/BESMod/Systems/Hydraulical/Interfaces/GenerationOutputs.mo b/BESMod/Systems/Hydraulical/Interfaces/GenerationOutputs.mo index dc50e9c4..82bd9f74 100644 --- a/BESMod/Systems/Hydraulical/Interfaces/GenerationOutputs.mo +++ b/BESMod/Systems/Hydraulical/Interfaces/GenerationOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Interfaces; expandable connector GenerationOutputs "Bus with ouputs of the generation system" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation ( defaultComponentName = "outBusGen", diff --git a/BESMod/Systems/Hydraulical/Interfaces/TransferOutputs.mo b/BESMod/Systems/Hydraulical/Interfaces/TransferOutputs.mo index 8f7ef08e..aa3dd883 100644 --- a/BESMod/Systems/Hydraulical/Interfaces/TransferOutputs.mo +++ b/BESMod/Systems/Hydraulical/Interfaces/TransferOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Interfaces; expandable connector TransferOutputs "Bus with ouputs of the tramsfer system" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation ( defaultComponentName = "outBusTra", diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTest.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTest.mo index 0a34145f..703498e5 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTest.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTest.mo @@ -24,15 +24,15 @@ partial model PartialTest displayUnit="K")) annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=180, - origin={64,0}))); + origin={70,10}))); Modelica.Blocks.Sources.Sine TRoom( amplitude=1, f=1/3600, offset=293.15 - 1) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=180, - origin={94,0}))); + rotation=90, + origin={90,-30}))); IBPSA.Fluid.MixingVolumes.MixingVolume vol[transfer.nParallelSup]( redeclare package Medium = IBPSA.Media.Water, each final energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, @@ -41,7 +41,7 @@ partial model PartialTest each final nPorts=3) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, - origin={-76,8}))); + origin={-70,10}))); IBPSA.Fluid.Sources.Boundary_pT bou1[transfer.nParallelSup]( redeclare package Medium = IBPSA.Media.Water, @@ -49,44 +49,46 @@ partial model PartialTest each final nPorts=1) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-70,-24}))); + origin={-70,-30}))); Interfaces.TransferControlBus traControlBus - annotation (Placement(transformation(extent={{-14,56},{6,76}}))); + annotation (Placement(transformation(extent={{0,60},{20,80}}), + iconTransformation(extent={{0,60},{20,80}}))); Modelica.Blocks.Sources.Constant constOpening[systemParameters.nZones](each final k=1) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-86,70}))); + origin={-90,70}))); equation connect(prescribedTemperature.port, transfer.heatPortCon[1]) annotation (Line( - points={{54,1.33227e-15},{50,1.33227e-15},{50,23},{36,23}}, color={191,0, + points={{60,10},{42,10},{42,23},{36,23}}, color={191,0, 0})); connect(prescribedTemperature.port, transfer.heatPortRad[1]) - annotation (Line(points={{54,0},{50,0},{50,-5},{36,-5}}, color={191,0,0})); + annotation (Line(points={{60,10},{42,10},{42,-5},{36,-5}}, + color={191,0,0})); connect(transfer.portTra_out, vol.ports[1]) annotation (Line(points={{-32, - -5.7},{-32,-4},{-58,-4},{-58,6.66667},{-66,6.66667}}, + -5.7},{-32,-4},{-58,-4},{-58,8.66667},{-60,8.66667}}, color={0,127,255})); connect(transfer.portTra_in, vol.ports[2]) annotation (Line(points={{-32,23}, - {-32,22},{-56,22},{-56,8},{-66,8}}, + {-32,22},{-56,22},{-56,10},{-60,10}}, color={0,127,255})); - connect(TRoom.y, prescribedTemperature.T) annotation (Line(points={{83,8.88178e-16}, - {79.5,8.88178e-16},{79.5,-1.55431e-15},{76,-1.55431e-15}}, color={0,0, + connect(TRoom.y, prescribedTemperature.T) annotation (Line(points={{90,-19},{ + 92,-19},{92,10},{82,10}}, color={0,0, 127})); connect(traControlBus, transfer.traControlBus) annotation (Line( - points={{-4,66},{-4,55},{2,55},{2,44}}, + points={{10,70},{10,50},{2,50},{2,44}}, color={255,204,51}, thickness=0.5), Text( string="%first", index=-1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(constOpening.y, traControlBus.opening) annotation (Line(points={{-75,70}, - {-42,70},{-42,66},{-4,66}}, color={0,0,127}), Text( + connect(constOpening.y, traControlBus.opening) annotation (Line(points={{-79,70}, + {10,70}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(bou1.ports[1], vol.ports[3]) annotation (Line(points={{-60,-24},{-54, - -24},{-54,-4},{-58,-4},{-58,9.33333},{-66,9.33333}}, color={0,127,255})); + connect(bou1.ports[1], vol.ports[3]) annotation (Line(points={{-60,-30},{-54, + -30},{-54,-4},{-58,-4},{-58,11.3333},{-60,11.3333}}, color={0,127,255})); end PartialTest; diff --git a/BESMod/Systems/Interfaces/ControlOutputs.mo b/BESMod/Systems/Interfaces/ControlOutputs.mo index dcf9de4c..8f69afde 100644 --- a/BESMod/Systems/Interfaces/ControlOutputs.mo +++ b/BESMod/Systems/Interfaces/ControlOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Interfaces; expandable connector ControlOutputs "Bus with ouputs of the control system" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation ( defaultComponentName = "outBusCtrl", diff --git a/BESMod/Systems/Interfaces/DHWOutputs.mo b/BESMod/Systems/Interfaces/DHWOutputs.mo index c91366f8..1bcbb283 100644 --- a/BESMod/Systems/Interfaces/DHWOutputs.mo +++ b/BESMod/Systems/Interfaces/DHWOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Interfaces; expandable connector DHWOutputs "Bus with ouputs of the DHW system" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation ( defaultComponentName = "outBusDem", Icon(graphics, diff --git a/BESMod/Systems/Interfaces/DemandOutputs.mo b/BESMod/Systems/Interfaces/DemandOutputs.mo index d8f3902a..e0289248 100644 --- a/BESMod/Systems/Interfaces/DemandOutputs.mo +++ b/BESMod/Systems/Interfaces/DemandOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Interfaces; expandable connector DemandOutputs "Bus with ouputs of the demand system" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation ( defaultComponentName = "outBusDem", diff --git a/BESMod/Systems/Interfaces/ElectricalOutputs.mo b/BESMod/Systems/Interfaces/ElectricalOutputs.mo index a1ae02fd..5cde7c1f 100644 --- a/BESMod/Systems/Interfaces/ElectricalOutputs.mo +++ b/BESMod/Systems/Interfaces/ElectricalOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Interfaces; expandable connector ElectricalOutputs "Bus with ouputs of the electrical system" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation ( defaultComponentName = "outBusHyd", diff --git a/BESMod/Systems/Interfaces/HydraulicOutputs.mo b/BESMod/Systems/Interfaces/HydraulicOutputs.mo index da0b1be6..b4f61a7b 100644 --- a/BESMod/Systems/Interfaces/HydraulicOutputs.mo +++ b/BESMod/Systems/Interfaces/HydraulicOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Interfaces; expandable connector HydraulicOutputs "Bus with ouputs of the hydraulic system" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation ( defaultComponentName = "outBusHyd", diff --git a/BESMod/Utilities/Icons/KPIBus.mo b/BESMod/Systems/Interfaces/KPIBus.mo similarity index 98% rename from BESMod/Utilities/Icons/KPIBus.mo rename to BESMod/Systems/Interfaces/KPIBus.mo index 11e97c84..c1531d41 100644 --- a/BESMod/Utilities/Icons/KPIBus.mo +++ b/BESMod/Systems/Interfaces/KPIBus.mo @@ -1,4 +1,4 @@ -within BESMod.Utilities.Icons; +within BESMod.Systems.Interfaces; expandable connector KPIBus "Icon for KPI bus" annotation ( diff --git a/BESMod/Systems/Interfaces/SystemOutputs.mo b/BESMod/Systems/Interfaces/SystemOutputs.mo index f79f2d7a..c84f4c14 100644 --- a/BESMod/Systems/Interfaces/SystemOutputs.mo +++ b/BESMod/Systems/Interfaces/SystemOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Interfaces; expandable connector SystemOutputs "Bus with ouputs of the overall system" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation ( defaultComponentName = "outBusGen", diff --git a/BESMod/Systems/Interfaces/UseProBus.mo b/BESMod/Systems/Interfaces/UseProBus.mo index 6279e2f6..f6448419 100644 --- a/BESMod/Systems/Interfaces/UseProBus.mo +++ b/BESMod/Systems/Interfaces/UseProBus.mo @@ -1,12 +1,10 @@ within BESMod.Systems.Interfaces; -expandable connector UseProBus "data bus with user profiles" +expandable connector UseProBus "Data bus with user profiles" extends BESMod.Utilities.Icons.UseProBus; - annotation ( defaultComponentName = "useProBus", Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, coordinateSystem(preserveAspectRatio=false))); - end UseProBus; diff --git a/BESMod/Systems/Interfaces/VentilationOutputs.mo b/BESMod/Systems/Interfaces/VentilationOutputs.mo index 8a2c8e2e..3fc17543 100644 --- a/BESMod/Systems/Interfaces/VentilationOutputs.mo +++ b/BESMod/Systems/Interfaces/VentilationOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Interfaces; expandable connector VentilationOutputs "Bus with ouputs of the ventilation system" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation ( defaultComponentName = "outBusVen", diff --git a/BESMod/Systems/Interfaces/package.order b/BESMod/Systems/Interfaces/package.order index 533c5f06..a2bd5ea4 100644 --- a/BESMod/Systems/Interfaces/package.order +++ b/BESMod/Systems/Interfaces/package.order @@ -2,9 +2,10 @@ BuiMeaBus ControlOutputs DemandOutputs DHWOutputs +ElectricalOutputs HEMSBus HydraulicOutputs SystemOutputs UseProBus VentilationOutputs -ElectricalOutputs +KPIBus diff --git a/BESMod/Systems/Ventilation/Interfaces/ControlOutputs.mo b/BESMod/Systems/Ventilation/Interfaces/ControlOutputs.mo index 5945fd67..84cb6f67 100644 --- a/BESMod/Systems/Ventilation/Interfaces/ControlOutputs.mo +++ b/BESMod/Systems/Ventilation/Interfaces/ControlOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Ventilation.Interfaces; expandable connector ControlOutputs "Bus with ouputs of the control system" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation ( defaultComponentName = "outBusCtrl", diff --git a/BESMod/Systems/Ventilation/Interfaces/DistributionOutputs.mo b/BESMod/Systems/Ventilation/Interfaces/DistributionOutputs.mo index 5c585212..6fd08286 100644 --- a/BESMod/Systems/Ventilation/Interfaces/DistributionOutputs.mo +++ b/BESMod/Systems/Ventilation/Interfaces/DistributionOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Ventilation.Interfaces; expandable connector DistributionOutputs "Bus with ouputs of the distribution system" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation ( defaultComponentName = "outBusDist", diff --git a/BESMod/Systems/Ventilation/Interfaces/GenerationOutputs.mo b/BESMod/Systems/Ventilation/Interfaces/GenerationOutputs.mo index 8811d6e7..400bce26 100644 --- a/BESMod/Systems/Ventilation/Interfaces/GenerationOutputs.mo +++ b/BESMod/Systems/Ventilation/Interfaces/GenerationOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Ventilation.Interfaces; expandable connector GenerationOutputs "Bus with ouputs of the generation system" - extends BESMod.Utilities.Icons.KPIBus; + extends BESMod.Systems.Interfaces.KPIBus; annotation ( defaultComponentName = "outBusGen", diff --git a/BESMod/Tutorial/BaseClasses/PartialSystem.mo b/BESMod/Tutorial/BaseClasses/PartialSystem.mo index 6f04b69a..8fc38092 100644 --- a/BESMod/Tutorial/BaseClasses/PartialSystem.mo +++ b/BESMod/Tutorial/BaseClasses/PartialSystem.mo @@ -2,10 +2,12 @@ within BESMod.Tutorial.BaseClasses; partial model PartialSystem parameter Real yMax "A top-down parameter. Example: Maximum value for y"; - replaceable BESMod.Tutorial.BaseClasses.PartialModule module constrainedby - BESMod.Tutorial.BaseClasses.PartialModule(final yMax=yMax) + replaceable BESMod.Tutorial.BaseClasses.PartialModule module + constrainedby BESMod.Tutorial.BaseClasses.PartialModule( + final yMax=yMax) "Correct overwrite of top-down parameters" annotation (Placement( transformation(extent={{-18,-18},{20,18}})), choicesAllMatching=true); + replaceable BESMod.Tutorial.BaseClasses.PartialModule moduleWrong(final yMax= yMax) constrainedby BESMod.Tutorial.BaseClasses.PartialModule "Wrong overwrite of top-down parameters" annotation (Placement( diff --git a/BESMod/Utilities/Icons/package.order b/BESMod/Utilities/Icons/package.order index f1f331e8..ab43b053 100644 --- a/BESMod/Utilities/Icons/package.order +++ b/BESMod/Utilities/Icons/package.order @@ -8,7 +8,6 @@ StorageIcon DistributionIcon DHWIcon ControlBus -KPIBus BuiMeaBus UseProBus ControlPackage diff --git a/BESMod/Utilities/KPIs/BaseClasses/PartialKPICalculator.mo b/BESMod/Utilities/KPIs/BaseClasses/PartialKPICalculator.mo index 848decc9..d2f70613 100644 --- a/BESMod/Utilities/KPIs/BaseClasses/PartialKPICalculator.mo +++ b/BESMod/Utilities/KPIs/BaseClasses/PartialKPICalculator.mo @@ -58,7 +58,7 @@ partial model PartialKPICalculator "Partial KPI Calculator" y_start=Modelica.Constants.eps, y(unit=integralUnit)) if calc_integral annotation (Placement(transformation(extent={{72,-90},{84,-78}}))); - Icons.KPIBus KPIBus + Systems.Interfaces.KPIBus KPIBus annotation (Placement(transformation(extent={{92,-10},{112,10}}))); Modelica.Blocks.Routing.RealPassThrough internalU(y(unit=unit)) diff --git a/BESMod/Utilities/SupervisoryControl/SupervisoryControl.mo b/BESMod/Utilities/SupervisoryControl/SupervisoryControl.mo index 3a6dd012..6f38f385 100644 --- a/BESMod/Utilities/SupervisoryControl/SupervisoryControl.mo +++ b/BESMod/Utilities/SupervisoryControl/SupervisoryControl.mo @@ -11,7 +11,7 @@ model SupervisoryControl Modelica.Blocks.Interfaces.RealInput uLoc "Local control input" annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}), iconTransformation(extent={{-140,-100},{-100,-60}}))); - Modelica.Blocks.Interfaces.BooleanInput activateInt if ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal + Modelica.Blocks.Interfaces.BooleanInput actInt if ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); Modelica.Blocks.Interfaces.RealOutput y "Control output" @@ -19,20 +19,19 @@ model SupervisoryControl Modelica.Blocks.Logical.Switch swi "Switch between external signal and direct feedthrough signal" annotation (Placement(transformation(extent={{0,-16},{32,16}}))); - Modelica.Blocks.Sources.BooleanExpression activateExt if ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.External + Modelica.Blocks.Sources.BooleanExpression actExt if ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.External "Block to activate use of external signal" annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); Modelica.Blocks.Sources.RealExpression uExt if ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.External "External input signal" annotation (Placement(transformation(extent={{-60,10},{-40,30}}))); - Modelica.Blocks.Sources.BooleanConstant deactivateAlways(final k=false) - if ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local + Modelica.Blocks.Sources.BooleanConstant deActAlw(final k=false) if ctrlType + == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local "Block to activate use of external signal" annotation (Placement(transformation(extent={{-60,-40},{-40,-20}}))); - Modelica.Blocks.Sources.Constant uSupDeacticate(final k=0) if ctrlType == - BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local + Modelica.Blocks.Sources.Constant uSupDeAct(final k=0) if ctrlType == BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local "Constant zero for deactivated sup control" - annotation (Placement(transformation(extent={{-56,32},{-40,48}}))); + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); equation connect(uLoc, swi.u3) annotation (Line(points={{-120,-80},{-12,-80},{-12,-12.8}, {-3.2,-12.8}}, color={0,0,127})); @@ -40,16 +39,16 @@ equation annotation (Line(points={{33.6,0},{120,0}}, color={0,0,127})); connect(uExt.y, swi.u1) annotation (Line(points={{-39,20},{-20,20},{-20,12.8}, {-3.2,12.8}}, color={0,0,127})); - connect(activateExt.y, swi.u2) + connect(actExt.y, swi.u2) annotation (Line(points={{-39,0},{-3.2,0}}, color={255,0,255})); - connect(activateInt, swi.u2) annotation (Line(points={{-120,0},{-64,0},{-64,-12}, - {-30,-12},{-30,0},{-3.2,0}},color={255,0,255})); - connect(deactivateAlways.y, swi.u2) annotation (Line(points={{-39,-30},{-24,-30}, - {-24,0},{-3.2,0}}, color={255,0,255})); + connect(actInt, swi.u2) annotation (Line(points={{-120,0},{-64,0},{-64,-12},{ + -30,-12},{-30,0},{-3.2,0}}, color={255,0,255})); + connect(deActAlw.y, swi.u2) annotation (Line(points={{-39,-30},{-24,-30},{-24, + 0},{-3.2,0}}, color={255,0,255})); connect(uSup, swi.u1) annotation (Line(points={{-120,80},{-12,80},{-12,12.8},{ -3.2,12.8}}, color={0,0,127})); - connect(uSupDeacticate.y, swi.u1) annotation (Line(points={{-39.2,40},{-20,40}, - {-20,12.8},{-3.2,12.8}}, color={0,0,127})); + connect(uSupDeAct.y, swi.u1) annotation (Line(points={{-39,50},{-12,50},{-12, + 12.8},{-3.2,12.8}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ Text( extent={{-102,-88},{102,-184}}, diff --git a/BESMod/Utilities/SupervisoryControl/SupervisoryControlExample.mo b/BESMod/Utilities/SupervisoryControl/SupervisoryControlExample.mo index 73950394..45a22ec8 100644 --- a/BESMod/Utilities/SupervisoryControl/SupervisoryControlExample.mo +++ b/BESMod/Utilities/SupervisoryControl/SupervisoryControlExample.mo @@ -6,8 +6,9 @@ model SupervisoryControlExample SupervisoryControl intCtrl(ctrlType=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal) annotation (Placement(transformation(extent={{-18,-18},{14,14}}))); SupervisoryControl extCtrl( + actExt(y=activateSupCtrl.y), ctrlType=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.External, - activateExt(y=activateSupCtrl.y), + uExt(y=pulseSup.y)) annotation (Placement(transformation(extent={{-20,38},{12,70}}))); @@ -26,8 +27,8 @@ equation {-76,41.2},{-23.2,41.2}}, color={0,0,127})); connect(pulseSup.y, intCtrl.uSup) annotation (Line(points={{-79,20},{-52,20}, {-52,10.8},{-21.2,10.8}}, color={0,0,127})); - connect(activateSupCtrl.y, intCtrl.activateInt) annotation (Line(points={{-79, - -20},{-52,-20},{-52,-2},{-21.2,-2}}, color={255,0,255})); + connect(activateSupCtrl.y, intCtrl.actInt) annotation (Line(points={{-79,-20}, + {-52,-20},{-52,-2},{-21.2,-2}}, color={255,0,255})); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, coordinateSystem(preserveAspectRatio=false)), diff --git a/BESMod/package.mo b/BESMod/package.mo index e9fe12c3..42832013 100644 --- a/BESMod/package.mo +++ b/BESMod/package.mo @@ -7,10 +7,9 @@ package BESMod uses( BuildingSystems(version="2.0.0-beta"), Modelica(version="4.0.0"), - ModelicaServices(version="4.0.0"), SDF(version="0.4.2"), - IBPSA(version="3.0.0"), - AixLib(version="1.3.1")), + AixLib(version="1.3.2"), + IBPSA(version="3.0.0")), Icon(graphics={Bitmap(extent={{-100,-100},{100,100}}, fileName="modelica://BESMod/Resources/Images/BESMod_icon.png")})); end BESMod; From 87d5879d659f35e70116e1eba6cdc3e2a6e067bd Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sat, 22 Oct 2022 16:32:21 +0200 Subject: [PATCH 061/131] rework KPIs --- .../Demand/Building/TEASERThermalZone.mo | 526 ++++-------------- BESMod/Systems/Demand/DHW/DHW.mo | 27 +- .../Electrical/Generation/PVSystemMultiSub.mo | 25 +- .../Electrical/Interfaces/ControlOutputs.mo | 2 +- .../Interfaces/DistributionOutputs.mo | 2 +- .../Interfaces/GenerationOutputs.mo | 2 +- .../Electrical/Interfaces/TransferOutputs.mo | 7 +- .../PartialTwoPoint_HPS_Controller.mo | 4 +- ...lDistributionTwoStorageParallelDetailed.mo | 137 ++--- .../Hydraulical/Distribution/CombiStorage.mo | 31 +- .../DistributionTwoStorageParallel.mo | 58 +- .../Generation/ElectricalHeater.mo | 48 +- .../Hydraulical/Generation/GasBoiler.mo | 45 +- .../Generation/HeatPumpAndHeatingRod.mo | 143 +++-- .../Generation/SolarThermalBivHP.mo | 56 +- .../Generation/SolarThermalBivHPBuiLib.mo | 21 +- .../Hydraulical/Interfaces/ControlOutputs.mo | 2 +- .../Interfaces/DistributionOutputs.mo | 2 +- .../Interfaces/GenerationOutputs.mo | 2 +- .../Hydraulical/Interfaces/TransferOutputs.mo | 2 +- .../Transfer/RadiatorTransferSystem.mo | 57 +- .../Hydraulical/Transfer/UFHTransferSystem.mo | 63 +-- BESMod/Systems/Interfaces/ControlOutputs.mo | 2 +- BESMod/Systems/Interfaces/DHWOutputs.mo | 2 +- BESMod/Systems/Interfaces/DemandOutputs.mo | 2 +- .../Systems/Interfaces/ElectricalOutputs.mo | 2 +- BESMod/Systems/Interfaces/HydraulicOutputs.mo | 2 +- BESMod/Systems/Interfaces/SystemOutputs.mo | 2 +- .../Systems/Interfaces/VentilationOutputs.mo | 2 +- BESMod/Systems/Interfaces/package.order | 1 - .../Ventilation/Interfaces/ControlOutputs.mo | 2 +- .../Interfaces/DistributionOutputs.mo | 2 +- .../Interfaces/GenerationOutputs.mo | 2 +- .../Icons/OutputsBus.mo} | 6 +- BESMod/Utilities/Icons/package.order | 1 + .../Utilities/KPIs/BaseClasses/KPIDevice.mo | 16 + BESMod/Utilities/KPIs/BaseClasses/KPIIcon.mo | 17 + .../Utilities/KPIs/BaseClasses/KPIIntegral.mo | 11 + .../KPIs/BaseClasses/PartialKPICalculator.mo | 197 ------- .../KPIs/BaseClasses/PartialKPIConnector.mo | 21 + .../Utilities/KPIs/BaseClasses/package.order | 5 +- BESMod/Utilities/KPIs/ComfortCalculator.mo | 12 +- BESMod/Utilities/KPIs/CountOnTime.mo | 53 -- BESMod/Utilities/KPIs/CountTimeDiscomfort.mo | 19 +- BESMod/Utilities/KPIs/DeviceKPICalculator.mo | 110 ++++ BESMod/Utilities/KPIs/InputKPICalculator.mo | 13 - .../Utilities/KPIs/IntegralKPICalculator.mo | 56 ++ .../Utilities/KPIs/InternalKPICalculator.mo | 19 - BESMod/Utilities/KPIs/package.order | 5 +- .../SupervisoryControlExample.mo | 1 - 50 files changed, 716 insertions(+), 1129 deletions(-) rename BESMod/{Systems/Interfaces/KPIBus.mo => Utilities/Icons/OutputsBus.mo} (95%) create mode 100644 BESMod/Utilities/KPIs/BaseClasses/KPIDevice.mo create mode 100644 BESMod/Utilities/KPIs/BaseClasses/KPIIcon.mo create mode 100644 BESMod/Utilities/KPIs/BaseClasses/KPIIntegral.mo delete mode 100644 BESMod/Utilities/KPIs/BaseClasses/PartialKPICalculator.mo create mode 100644 BESMod/Utilities/KPIs/BaseClasses/PartialKPIConnector.mo delete mode 100644 BESMod/Utilities/KPIs/CountOnTime.mo create mode 100644 BESMod/Utilities/KPIs/DeviceKPICalculator.mo delete mode 100644 BESMod/Utilities/KPIs/InputKPICalculator.mo create mode 100644 BESMod/Utilities/KPIs/IntegralKPICalculator.mo delete mode 100644 BESMod/Utilities/KPIs/InternalKPICalculator.mo diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index 0a49915e..e0042211 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -46,60 +46,44 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=180, origin={74,30}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorTraGain[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) if use_hydraulic and use_verboseEnergyBalance + BESMod.Utilities.KPIs.IntegralKPICalculator intKPICalTraGain[nZones]( + final unit=fill("W", nZones), + final intUnit=fill("J", nZones), + each final use_inpCon=true) if use_hydraulic and use_verboseEnergyBalance annotation (Placement(transformation( - extent={{-7,-11},{7,11}}, + extent={{-10,-10},{10,10}}, rotation=0, - origin={-7,-63}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorTraLoss[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) if use_hydraulic and use_verboseEnergyBalance + origin={-30,-102}))); + BESMod.Utilities.KPIs.IntegralKPICalculator intKPICalTraLoss[nZones]( + final unit=fill("W", nZones), + final intUnit=fill("J", nZones), + each final use_inpCon=true) if use_hydraulic and use_verboseEnergyBalance annotation (Placement(transformation( - extent={{-7,-12},{7,12}}, + extent={{-10,-10},{10,10}}, rotation=0, - origin={-7,-80}))); + 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={{-28,-66},{-22,-60}}))); + 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={{-30,-82},{-24,-76}}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculator[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( + annotation (Placement(transformation(extent={{-80,-140},{-60,-120}}))); + BESMod.Utilities.KPIs.IntegralKPICalculator intKPICal[nZones]( + final unit=fill("W", nZones), + final intUnit=fill("J", nZones), + each final use_inpCon=true) if use_verboseEnergyBalance annotation ( Placement(transformation( - extent={{-7,-13},{7,13}}, + extent={{-10,-10},{10,10}}, rotation=180, - origin={25,-81}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorVentGain[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) if use_ventilation and + origin={30,-110}))); + BESMod.Utilities.KPIs.IntegralKPICalculator intKPICalVentGain[nZones]( + final unit=fill("W", nZones), + final intUnit=fill("J", nZones), + each final use_inpCon=true) if use_ventilation and use_verboseEnergyBalance annotation (Placement(transformation( - extent={{-7,-11},{7,11}}, + extent={{-10,-10},{10,10}}, rotation=180, - origin={25,-97}))); + 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 @@ -107,69 +91,57 @@ model TEASERThermalZone Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, - origin={62,-106}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorVentLoss[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) if use_ventilation and + origin={90,-196}))); + BESMod.Utilities.KPIs.IntegralKPICalculator intKPICalVentLoss[nZones]( + final unit=fill("W", nZones), + final intUnit=fill("J", nZones), + each final use_inpCon=true) if use_ventilation and use_verboseEnergyBalance annotation (Placement(transformation( - extent={{-7,-12},{7,12}}, + extent={{-10,-10},{10,10}}, rotation=180, - origin={25,-114}))); + 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={{-3,-3},{3,3}}, + annotation (Placement(transformation(extent={{-9,-9},{9,9}}, rotation=180, - origin={43,-97}))); + 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={{-3,-3},{3,3}}, + annotation (Placement(transformation(extent={{-9,-9},{9,9}}, rotation=180, - origin={41,-115}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorTraGain2[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( + origin={63,-205}))); + BESMod.Utilities.KPIs.IntegralKPICalculator intKPICalTraGain2[nZones]( + final unit=fill("W", nZones), + final intUnit=fill("J", nZones), + each final use_inpCon=true) if use_verboseEnergyBalance annotation ( Placement(transformation( - extent={{-7,-11},{7,11}}, + extent={{-10,-10},{10,10}}, rotation=0, - origin={-7,-97}))); + origin={-30,-156}))); 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={-48,-106}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorTraLoss2[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( + origin={-90,-166}))); + BESMod.Utilities.KPIs.IntegralKPICalculator intKPICalTraLoss2[nZones]( + final unit=fill("W", nZones), + final intUnit=fill("J", nZones), + each final use_inpCon=true) if use_verboseEnergyBalance annotation ( Placement(transformation( - extent={{-7,-12},{7,12}}, + extent={{-10,-10},{10,10}}, rotation=0, - origin={-7,-114}))); + 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={{-28,-100},{-22,-94}}))); + 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={{-30,-116},{-24,-110}}))); + annotation (Placement(transformation(extent={{-70,-196},{-50,-176}}))); Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heatFlowSensorRad[ nZones] annotation (Placement(transformation(extent={{-82,-70},{-62,-50}}))); @@ -179,173 +151,17 @@ model TEASERThermalZone Modelica.Blocks.Math.Add addTra [nZones] if use_hydraulic and use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-52,-80},{-42,-70}}))); + 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={{-24,-52},{-4,-32}}))); + 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={{-24,-30},{-4,-10}}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorOwaGain[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( - Placement(transformation( - extent={{-7,-11},{7,11}}, - rotation=0, - origin={-7,-137}))); - Modelica.Blocks.Sources.RealExpression QOwa[nZones](y= - thermalZone.ROM.extWall.Q_flow) if use_verboseEnergyBalance "Internal gains" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-48,-146}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorOwaLoss[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( - Placement(transformation( - extent={{-7,-12},{7,12}}, - rotation=0, - origin={-7,-154}))); - Modelica.Blocks.Nonlinear.Limiter limAirExcUp1 - [nZones](each final - uMax=Modelica.Constants.inf, each final uMin=0) if use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-28,-140},{-22,-134}}))); - Modelica.Blocks.Nonlinear.Limiter limAixExDown1 - [nZones](each final - uMax=0, each final uMin=-Modelica.Constants.inf) if use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-30,-156},{-24,-150}}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorFloorGain[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) - if oneZoneParam.AFloor > 0 and use_verboseEnergyBalance annotation ( - Placement(transformation( - extent={{-7,-11},{7,11}}, - rotation=0, - origin={-7,-173}))); - Modelica.Blocks.Sources.RealExpression QFloor[nZones](y= - thermalZone.ROM.floor.Q_flow) - if oneZoneParam.AFloor > 0 and use_verboseEnergyBalance "Internal gains" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-48,-182}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorFloorLoss[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) - if oneZoneParam.AFloor > 0 and use_verboseEnergyBalance annotation ( - Placement(transformation( - extent={{-7,-12},{7,12}}, - rotation=0, - origin={-7,-190}))); - Modelica.Blocks.Nonlinear.Limiter limAirExcUp2 - [nZones](each final - uMax=Modelica.Constants.inf, each final uMin=0) - if oneZoneParam.AFloor > 0 and use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-28,-176},{-22,-170}}))); - Modelica.Blocks.Nonlinear.Limiter limAixExDown2 - [nZones](each final - uMax=0, each final uMin=-Modelica.Constants.inf) - if oneZoneParam.AFloor > 0 and use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-30,-192},{-24,-186}}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorRoofGain[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( - Placement(transformation( - extent={{-7,-11},{7,11}}, - rotation=0, - origin={-75,-137}))); - Modelica.Blocks.Sources.RealExpression QRoof[nZones](y= - thermalZone.ROM.roof.Q_flow) if use_verboseEnergyBalance "Internal gains" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-116,-146}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorRoofLoss[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( - Placement(transformation( - extent={{-7,-12},{7,12}}, - rotation=0, - origin={-75,-154}))); - Modelica.Blocks.Nonlinear.Limiter limAirExcUp3 - [nZones](each final - uMax=Modelica.Constants.inf, each final uMin=0) if use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-96,-140},{-90,-134}}))); - Modelica.Blocks.Nonlinear.Limiter limAixExDown3 - [nZones](each final - uMax=0, each final uMin=-Modelica.Constants.inf) if use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-98,-156},{-92,-150}}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorWinGain[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( - Placement(transformation( - extent={{-7,-11},{7,11}}, - rotation=0, - origin={-75,-173}))); - Modelica.Blocks.Sources.RealExpression QWin[nZones](y= - thermalZone.ROM.window.Q_flow) if use_verboseEnergyBalance "Internal gains" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-116,-182}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorWinLoss[nZones]( - unit=fill("W", nZones), - integralUnit=fill("J", nZones), - each calc_singleOnTime=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false, - each calc_intBelThres=false) if use_verboseEnergyBalance annotation ( - Placement(transformation( - extent={{-7,-12},{7,12}}, - rotation=0, - origin={-75,-190}))); - Modelica.Blocks.Nonlinear.Limiter limAirExcUp4 - [nZones](each final - uMax=Modelica.Constants.inf, each final uMin=0) if use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-96,-176},{-90,-170}}))); - Modelica.Blocks.Nonlinear.Limiter limAixExDown4 - [nZones](each final - uMax=0, each final uMin=-Modelica.Constants.inf) if use_verboseEnergyBalance - annotation (Placement(transformation(extent={{-98,-192},{-92,-186}}))); - Modelica.Blocks.Math.MultiSum multiSum[nZones](each final nu=3) if use_verboseEnergyBalance annotation (Placement(transformation(extent={{-5,-5},{5,5}}, + 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={53,-81}))); + origin={69,-129}))); BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement( transformation( @@ -404,92 +220,91 @@ equation // KPIs if use_hydraulic then - connect(inputKPICalculatorTraGain.KPIBus, outBusDem.QTraGain) annotation ( + connect(intKPICalTraGain.KPI, outBusDem.QTraGain) annotation ( Line( - points={{0.14,-63},{6,-63},{6,-64},{10,-64},{10,-2},{98,-2}}, - color={255,204,51}, + points={{-17.8,-102},{8,-102},{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(inputKPICalculatorTraLoss.KPIBus, outBusDem.QTraLoss) annotation ( + connect(intKPICalTraLoss.KPI, outBusDem.QTraLoss) annotation ( Line( - points={{0.14,-80},{10,-80},{10,-2},{98,-2}}, - color={255,204,51}, + points={{-17.8,-130},{8,-130},{8,-156},{116,-156},{116,-2},{98,-2}}, + color={135,135,135}, thickness=0.5), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(limUp.y, inputKPICalculatorTraGain.u) - annotation (Line(points={{-21.7,-63},{-15.54,-63}}, + connect(limUp.y, intKPICalTraGain.u) + annotation (Line(points={{-59,-100},{-59,-102},{-41.8,-102}}, color={0,0,127})); - connect(limDown.y, inputKPICalculatorTraLoss.u) annotation (Line(points={{-23.7, - -79},{-22,-79},{-22,-80},{-15.54,-80}}, - color={0,0,127})); + connect(limDown.y, intKPICalTraLoss.u) annotation (Line(points={{-59,-130}, + {-41.8,-130}}, color={0,0,127})); end if; - connect(inputKPICalculator.KPIBus, outBusDem.QIntGain) annotation (Line( - points={{17.86,-81},{14,-81},{14,-82},{10,-82},{10,-2},{98,-2}}, - color={255,204,51}, + connect(intKPICal.KPI, outBusDem.QIntGain) annotation (Line( + points={{17.8,-110},{8,-110},{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(limAirExcUp.y, inputKPICalculatorTraGain2.u) - annotation (Line(points={{-21.7,-97},{-15.54,-97}}, color={0,0,127})); - connect(limAixExDown.y, inputKPICalculatorTraLoss2.u) annotation (Line(points={{-23.7, - -113},{-22,-113},{-22,-114},{-15.54,-114}}, color={0,0,127})); - connect(QAirExc.y, limAirExcUp.u) annotation (Line(points={{-37,-106},{-38, - -106},{-38,-97},{-28.6,-97}}, + 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={{-37,-106},{-37, - -113},{-30.6,-113}}, + connect(QAirExc.y, limAixExDown.u) annotation (Line(points={{-79,-166},{-74, + -166},{-74,-186},{-72,-186}}, color={0,0,127})); - connect(inputKPICalculatorTraGain2.KPIBus, outBusDem.QAirExcGain) annotation ( + connect(intKPICalTraGain2.KPI, outBusDem.QAirExcGain) annotation ( Line( - points={{0.14,-97},{10,-97},{10,-2},{98,-2}}, - color={255,204,51}, + points={{-17.8,-156},{116,-156},{116,-18},{84,-18},{84,-2},{98,-2}}, + color={135,135,135}, thickness=0.5), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(inputKPICalculatorTraLoss2.KPIBus, outBusDem.QAirExcLoss) annotation ( + connect(intKPICalTraLoss2.KPI, outBusDem.QAirExcLoss) annotation ( Line( - points={{0.14,-114},{10,-114},{10,-2},{98,-2}}, - color={255,204,51}, + points={{-17.8,-186},{8,-186},{8,-2},{98,-2}}, + color={135,135,135}, thickness=0.5), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); if use_ventilation then - connect(limVentUp.y, inputKPICalculatorVentGain.u) annotation (Line(points={{39.7, - -97},{33.54,-97}}, color={0,0,127})); - connect(limVentDown.y, inputKPICalculatorVentLoss.u) annotation (Line(points={{37.7, - -115},{37.7,-114},{33.54,-114}}, color={0,0,127})); - connect(QVent.y, limVentUp.u) annotation (Line(points={{51,-106},{56,-106},{ - 56,-97},{46.6,-97}}, - color={0,0,127})); - connect(QVent.y, limVentDown.u) annotation (Line(points={{51,-106},{51,-114}, - {44.6,-114},{44.6,-115}}, + 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(inputKPICalculatorVentGain.KPIBus, outBusDem.QVentGain) annotation ( + connect(intKPICalVentGain.KPI, outBusDem.QVentGain) annotation ( Line( - points={{17.86,-97},{17.86,-96},{10,-96},{10,-2},{98,-2}}, - color={255,204,51}, + 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(inputKPICalculatorVentLoss.KPIBus, outBusDem.QVentLoss) annotation ( + connect(intKPICalVentLoss.KPI, outBusDem.QVentLoss) annotation ( Line( - points={{17.86,-114},{10,-114},{10,-2},{98,-2}}, - color={255,204,51}, + 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, @@ -507,16 +322,16 @@ equation 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={{-41.5,-75},{-32,-75},{ - -32,-63},{-28.6,-63}}, + 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={{-41.5,-75},{-36,-75},{ - -36,-79},{-30.6,-79}}, + 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,-78},{-53,-78}}, color={0,0,127})); + 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,-72},{-53,-72}}, color={0,0,127})); + {-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( string="%second", @@ -524,123 +339,18 @@ equation extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(thermalZone.TAir, comfortCalculatorHea.TZone) annotation (Line(points={{-42.7, - 76.8},{-48,76.8},{-48,-20},{-26,-20}}, color={0,0,127})); + 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,-42},{-26,-42}}, color={0,0,127})); + 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={{-3,-42},{10,-42},{10,-2},{98,-2}}, color={0,0,127}), Text( + points={{1,-50},{6,-50},{6,-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={{-3,-20},{10,-20},{10,-2},{98,-2}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(limAirExcUp1.y, inputKPICalculatorOwaGain.u) - annotation (Line(points={{-21.7,-137},{-15.54,-137}}, color={0,0,127})); - connect(limAixExDown1.y, inputKPICalculatorOwaLoss.u) annotation (Line(points= - {{-23.7,-153},{-22,-153},{-22,-154},{-15.54,-154}}, color={0,0,127})); - connect(QOwa.y, limAirExcUp1.u) annotation (Line(points={{-37,-146},{-38,-146}, - {-38,-137},{-28.6,-137}}, color={0,0,127})); - connect(QOwa.y, limAixExDown1.u) annotation (Line(points={{-37,-146},{-37, - -153},{-30.6,-153}}, color={0,0,127})); - connect(limAirExcUp2.y, inputKPICalculatorFloorGain.u) - annotation (Line(points={{-21.7,-173},{-15.54,-173}}, color={0,0,127})); - connect(limAixExDown2.y, inputKPICalculatorFloorLoss.u) annotation (Line( - points={{-23.7,-189},{-22,-189},{-22,-190},{-15.54,-190}}, color={0,0, - 127})); - connect(QFloor.y, limAirExcUp2.u) annotation (Line(points={{-37,-182},{-38, - -182},{-38,-173},{-28.6,-173}}, color={0,0,127})); - connect(QFloor.y, limAixExDown2.u) annotation (Line(points={{-37,-182},{-37, - -189},{-30.6,-189}}, color={0,0,127})); - connect(limAirExcUp3.y, inputKPICalculatorRoofGain.u) - annotation (Line(points={{-89.7,-137},{-83.54,-137}}, color={0,0,127})); - connect(limAixExDown3.y, inputKPICalculatorRoofLoss.u) annotation (Line( - points={{-91.7,-153},{-90,-153},{-90,-154},{-83.54,-154}}, color={0,0, - 127})); - connect(QRoof.y, limAirExcUp3.u) annotation (Line(points={{-105,-146},{-106, - -146},{-106,-137},{-96.6,-137}}, color={0,0,127})); - connect(QRoof.y, limAixExDown3.u) annotation (Line(points={{-105,-146},{-105, - -153},{-98.6,-153}}, color={0,0,127})); - connect(limAirExcUp4.y, inputKPICalculatorWinGain.u) - annotation (Line(points={{-89.7,-173},{-83.54,-173}}, color={0,0,127})); - connect(limAixExDown4.y, inputKPICalculatorWinLoss.u) annotation (Line(points= - {{-91.7,-189},{-90,-189},{-90,-190},{-83.54,-190}}, color={0,0,127})); - connect(QWin.y, limAirExcUp4.u) annotation (Line(points={{-105,-182},{-106, - -182},{-106,-173},{-96.6,-173}}, color={0,0,127})); - connect(QWin.y, limAixExDown4.u) annotation (Line(points={{-105,-182},{-105, - -189},{-98.6,-189}}, color={0,0,127})); - connect(inputKPICalculatorOwaGain.KPIBus, outBusDem.QOwaGain) annotation ( - Line( - points={{0.14,-137},{8,-137},{8,-2},{98,-2}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(inputKPICalculatorOwaLoss.KPIBus, outBusDem.QOwaLoss) annotation ( - Line( - points={{0.14,-154},{12,-154},{12,-2},{98,-2}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(inputKPICalculatorFloorGain.KPIBus, outBusDem.QFloorGain) annotation ( - Line( - points={{0.14,-173},{10,-173},{10,-2},{98,-2}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(inputKPICalculatorFloorLoss.KPIBus, outBusDem.QFloorLoss) annotation ( - Line( - points={{0.14,-190},{10,-190},{10,-2},{98,-2}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(inputKPICalculatorWinLoss.KPIBus, outBusDem.QWinLoss) annotation ( - Line( - points={{-67.86,-190},{10,-190},{10,-2},{98,-2}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(inputKPICalculatorWinGain.KPIBus, outBusDem.QWinGain) annotation ( - Line( - points={{-67.86,-173},{12,-173},{12,-2},{98,-2}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(inputKPICalculatorRoofLoss.KPIBus, outBusDem.QRoofLoss) annotation ( - Line( - points={{-67.86,-154},{-26,-154},{-26,-152},{10,-152},{10,-2},{98,-2}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(inputKPICalculatorRoofGain.KPIBus, outBusDem.QRoofGain) annotation ( - Line( - points={{-67.86,-137},{12,-137},{12,-2},{98,-2}}, - color={255,204,51}, - thickness=0.5), Text( + points={{1,-10},{0,-10},{0,-2},{98,-2}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, @@ -651,10 +361,12 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(multiSum.y, inputKPICalculator.u) - annotation (Line(points={{47.15,-81},{33.54,-81}}, color={0,0,127})); - connect(multiSum.u, thermalZone.QIntGains_flow) annotation (Line(points={{58,-81}, - {64,-81},{64,-80},{68,-80},{68,-4},{-50,-4},{-50,33.6},{-42.7,33.6}}, + connect(multiSum.y, intKPICal.u) + annotation (Line(points={{58.47,-129},{54,-129},{54,-110},{41.8,-110}}, + color={0,0,127})); + connect(multiSum.u, thermalZone.QIntGains_flow) annotation (Line(points={{78,-129}, + {86,-129},{86,-110},{56,-110},{56,4},{-28,4},{-28,10},{-32,10},{-32,8}, + {-42.7,8},{-42.7,33.6}}, color={0,0,127})); connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( Line( @@ -667,6 +379,6 @@ equation 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})); - annotation (Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon(graphics, - coordinateSystem(extent={{-100,-120},{100,100}}))); + annotation (Diagram(coordinateSystem(extent={{-100,-220},{100,100}})), Icon(graphics, + coordinateSystem(extent={{-100,-220},{100,100}}))); end TEASERThermalZone; diff --git a/BESMod/Systems/Demand/DHW/DHW.mo b/BESMod/Systems/Demand/DHW/DHW.mo index 5a7b1667..fa4d0ea8 100644 --- a/BESMod/Systems/Demand/DHW/DHW.mo +++ b/BESMod/Systems/Demand/DHW/DHW.mo @@ -41,15 +41,12 @@ Modelica.Blocks.Math.UnitConversions.From_degC fromDegC extent={{10,-10},{-10,10}}, rotation=0, origin={30,-10}))); - BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculator( + Utilities.KPIs.IntegralKPICalculator integralKPICalculator( + use_inpCon=false, unit="W", - integralUnit="J", - final calc_singleOnTime=false, - final calc_totalOnTime=false, - final calc_numSwi=false, - final calc_movAve=false, - final y=-port_b.m_flow*cp*(TIs.y - TDHWCold_nominal)) - annotation (Placement(transformation(extent={{60,-68},{80,-32}}))); + intUnit="J", + y=-port_b.m_flow*cp*(TIs.y - TDHWCold_nominal)) + annotation (Placement(transformation(extent={{60,-60},{80,-40}}))); IBPSA.Fluid.Movers.FlowControlled_m_flow pump( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, @@ -117,14 +114,6 @@ Modelica.Blocks.Math.UnitConversions.From_degC fromDegC equation connect(fromDegC.y, calcmFlow.TSet) annotation (Line(points={{19,-10},{8,-10}, {8,9.2},{-0.6,9.2}}, color={0,0,127})); - connect(internalKPICalculator.KPIBus, outBusDHW.Q_flow) annotation (Line( - points={{80.2,-50},{104,-50},{104,0},{100,0}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(pump.port_a, bouSou.ports[1]) annotation (Line( points={{-60,-50.5},{-50,-50.5},{-50,-50},{-40,-50}}, color={0,127,255})); @@ -149,4 +138,10 @@ equation {-0.6,20}}, color={0,0,127})); connect(port_a, bou_sink.ports[1]) annotation (Line(points={{-100,60},{-60,60}}, color={0,127,255})); + connect(integralKPICalculator.KPI, outBusDHW.Q_flow) annotation (Line(points={ + {82.2,-50},{100,-50},{100,0}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); end DHW; diff --git a/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo b/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo index 171ce153..fc7fa081 100644 --- a/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo +++ b/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo @@ -54,15 +54,11 @@ model PVSystemMultiSub parameter Modelica.Units.SI.Angle azi[numGenUnits]=fill(0*Modelica.Constants.pi/180,numGenUnits) "Surface's azimut angle (0:South)"; parameter Modelica.Units.SI.Area ARoof(min=0) "Roof area of building" annotation(Dialog(group="Design - Top Down: Parameters are given by the parent system")); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculator( + Utilities.KPIs.IntegralKPICalculator intKPICalPElePV( + use_inpCon=true, unit="W", - integralUnit="J", - calc_singleOnTime=false, - calc_totalOnTime=false, - calc_numSwi=false, - calc_movAve=false, - calc_intBelThres=false) - annotation (Placement(transformation(extent={{56,-78},{76,-42}}))); + intUnit="J") + annotation (Placement(transformation(extent={{60,-60},{80,-40}}))); equation for i in 1:numGenUnits loop connect(pVSystem[i].weaBus, weaBus); @@ -76,19 +72,16 @@ equation thickness=1)); connect(pVSystem.DCOutputPower, sumOfPower.u) annotation (Line(points={{28.9,-1},{50,-1},{50,8}}, color={0,0,127})); - connect(sumOfPower.y, inputKPICalculator.u) annotation (Line(points={{50,31}, - {50,38},{68,38},{68,-34},{46,-34},{46,-60},{53.8,-60}}, color={0,0, - 127})); - connect(inputKPICalculator.KPIBus, outBusGen.WelPV) annotation (Line( - points={{76.2,-60},{86,-60},{86,-99},{1.77636e-15,-99}}, - color={255,204,51}, - thickness=0.5), Text( + connect(sumOfPower.y, intKPICalPElePV.u) annotation (Line(points={{50,31},{50, + 38},{68,38},{68,-34},{46,-34},{46,-50},{58.2,-50}}, color={0,0,127})); + connect(intKPICalPElePV.KPI, outBusGen.PElePV) annotation (Line(points={{82.2, + -50},{96,-50},{96,-99},{1.77636e-15,-99}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); annotation(Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem"), Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); end PVSystemMultiSub; diff --git a/BESMod/Systems/Electrical/Interfaces/ControlOutputs.mo b/BESMod/Systems/Electrical/Interfaces/ControlOutputs.mo index 9f3d0ba1..bad3c59b 100644 --- a/BESMod/Systems/Electrical/Interfaces/ControlOutputs.mo +++ b/BESMod/Systems/Electrical/Interfaces/ControlOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Interfaces; expandable connector ControlOutputs "Control bus for controller outputs" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Systems/Electrical/Interfaces/DistributionOutputs.mo b/BESMod/Systems/Electrical/Interfaces/DistributionOutputs.mo index e9d98057..1f26e120 100644 --- a/BESMod/Systems/Electrical/Interfaces/DistributionOutputs.mo +++ b/BESMod/Systems/Electrical/Interfaces/DistributionOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Interfaces; expandable connector DistributionOutputs - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Systems/Electrical/Interfaces/GenerationOutputs.mo b/BESMod/Systems/Electrical/Interfaces/GenerationOutputs.mo index bfe4ba8e..27779295 100644 --- a/BESMod/Systems/Electrical/Interfaces/GenerationOutputs.mo +++ b/BESMod/Systems/Electrical/Interfaces/GenerationOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Interfaces; expandable connector GenerationOutputs "Bus for outputs of electrical generation models" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Systems/Electrical/Interfaces/TransferOutputs.mo b/BESMod/Systems/Electrical/Interfaces/TransferOutputs.mo index cd38e8f1..774b23eb 100644 --- a/BESMod/Systems/Electrical/Interfaces/TransferOutputs.mo +++ b/BESMod/Systems/Electrical/Interfaces/TransferOutputs.mo @@ -1,7 +1,6 @@ within BESMod.Systems.Electrical.Interfaces; expandable connector TransferOutputs - extends BESMod.Systems.Interfaces.KPIBus; - annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false))); + + Modelica.Blocks.Interfaces.RealOutput val(unit="W"); + end TransferOutputs; diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo index 69a57aad..3e6106bc 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo @@ -318,8 +318,8 @@ equation connect(supervisoryControlDHW.y, add_dT_LoadingDHW.u1) annotation (Line( points={{-168.8,78},{-150,78},{-150,76},{-10,76},{-10,86},{35,86}}, color={0,0,127})); - connect(supervisoryControlDHW.actInt, sigBusHyd.overwriteTSetDHW) annotation - (Line(points={{-183.2,78},{-186,78},{-186,94},{-28,94},{-28,101}}, color={ + connect(supervisoryControlDHW.actInt, sigBusHyd.overwriteTSetDHW) annotation ( + Line(points={{-183.2,78},{-186,78},{-186,94},{-28,94},{-28,101}}, color={ 255,0,255}), Text( string="%second", index=1, diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo index 01f36cb0..05c207f6 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo @@ -283,28 +283,18 @@ partial model PartialDistributionTwoStorageParallelDetailed redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parameters=threeWayValveParameters) annotation (Placement(transformation(extent={{-84,54},{-64,74}}))); - BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculatorBufLoss( + Utilities.KPIs.IntegralKPICalculator integralKPICalculator3( + use_inpCon=false, unit="W", - integralUnit="J", - calc_singleOnTime=false, - calc_integral=true, - calc_totalOnTime=false, - calc_numSwi=false, - calc_movAve=false, - calc_intBelThres=false, + intUnit="J", y=fixedTemperatureBuf.port.Q_flow) - annotation (Placement(transformation(extent={{-52,-134},{-32,-96}}))); - BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculatorDHWLoss( - unit="W", - integralUnit="J", - calc_singleOnTime=false, - calc_integral=true, - calc_totalOnTime=false, - calc_numSwi=false, - calc_movAve=false, - calc_intBelThres=false, + annotation (Placement(transformation(extent={{-40,-108},{-22,-90}}))); + Utilities.KPIs.IntegralKPICalculator integralKPICalculator1( + final use_inpCon=false, + final unit="W", + final intUnit="J", y=fixedTemperatureDHW.port.Q_flow) - annotation (Placement(transformation(extent={{-52,-154},{-32,-116}}))); + annotation (Placement(transformation(extent={{-40,-140},{-20,-120}}))); IBPSA.Fluid.Sensors.TemperatureTwoPort senTBuiSup( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal, @@ -322,38 +312,29 @@ partial model PartialDistributionTwoStorageParallelDetailed BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{30,-108},{50,-88}}))); - BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculatorDHWHR( + Utilities.KPIs.IntegralKPICalculator integralKPICalculator4( + use_inpCon=false, unit="W", - integralUnit="J", - calc_singleOnTime=false, - calc_integral=true, - calc_totalOnTime=false, - calc_numSwi=true, - calc_movAve=false, - calc_intBelThres=false, - y=QHRStoDHWPre_flow.Q_flow) if dhwParameters.use_hr - annotation (Placement(transformation(extent={{-84,-134},{-64,-96}}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculator( + intUnit="J", + y=QHRStoDHWPre_flow.Q_flow) if dhwParameters.use_hr annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={30,-168}))); + Utilities.KPIs.IntegralKPICalculator integralKPICalculator( + use_inpCon=true, unit="W", - integralUnit="J", - calc_singleOnTime=false, - calc_integral=true, - calc_totalOnTime=false, - calc_numSwi=true, - calc_movAve=false, - calc_intBelThres=false) if use_heatingRodAfterBuffer - annotation (Placement(transformation(extent={{-84,-156},{-64,-118}}))); - BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculatorDHWHR1( + intUnit="J") if use_heatingRodAfterBuffer annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={30,-130}))); + Utilities.KPIs.IntegralKPICalculator integralKPICalculator2( + use_inpCon=false, unit="W", - integralUnit="J", - calc_singleOnTime=false, - calc_integral=true, - calc_totalOnTime=false, - calc_numSwi=true, - calc_movAve=false, - calc_intBelThres=false, + intUnit="J", y=QHRStoBufPre_flow1.Q_flow) if bufParameters.use_hr - annotation (Placement(transformation(extent={{-108,-134},{-88,-96}}))); + annotation (Placement(transformation(extent={{-40,-170},{-20,-150}}))); equation connect(T_stoDHWBot.y, sigBusDistr.TStoDHWBotMea) annotation (Line(points={{-16.4, 95},{2.5,95},{2.5,101},{0,101}}, color={0,0,127}), Text( @@ -456,24 +437,6 @@ equation index=1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(internalKPICalculatorBufLoss.KPIBus, outBusDist.QBufLoss) annotation ( - Line( - points={{-31.8,-115},{0,-115},{0,-100}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(internalKPICalculatorDHWLoss.KPIBus, outBusDist.QDHWLoss) annotation ( - Line( - points={{-31.8,-135},{-16,-135},{-16,-136},{0,-136},{0,-100}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(senTBuiSup.port_a, hea.port_b) annotation (Line(points={{82,80},{74,80},{74,87}}, color={0,127,255})); connect(senTBuiSup.port_b, portBui_out[1]) annotation (Line(points={{92,80},{ @@ -494,33 +457,43 @@ equation thickness=1)); connect(storageDHW.fluidportTop2, portDHW_out) annotation (Line(points={{-12.375, -27.77},{-12.375,-20},{100,-20},{100,-22}}, color={0,127,255})); - connect(internalKPICalculatorDHWHR.KPIBus, outBusDist.WelHRDHW) annotation ( - Line( - points={{-63.8,-115},{0,-115},{0,-100}}, - color={255,204,51}, - thickness=0.5), Text( + connect(hea.Pel, integralKPICalculator.u) annotation (Line(points={{75.2,93.6}, + {75.2,88},{78,88},{78,-84},{84,-84},{84,-116},{41.8,-116},{41.8,-130}}, + color={0,0,127})); + connect(integralKPICalculator3.KPI, outBusDist.QBufLos_flow) annotation (Line( + points={{-20.02,-99},{-20.02,-86},{0,-86},{0,-100}}, color={135,135,135}), + Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(inputKPICalculator.KPIBus, outBusDist.WelHRAftBuf) annotation (Line( - points={{-63.8,-137},{0,-137},{0,-100}}, - color={255,204,51}, - thickness=0.5), Text( + connect(integralKPICalculator1.KPI, outBusDist.QDHWLos_flow) annotation (Line( + points={{-17.8,-130},{-17.8,-84},{0,-84},{0,-100}}, color={135,135,135}), + Text( + string="%second", + index=1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + connect(integralKPICalculator2.KPI, outBusDist.PEleHRPreBuf) annotation (Line( + points={{-17.8,-160},{-17.8,-120},{-14,-120},{-14,-88},{0,-88},{0,-100}}, + color={135,135,135}), Text( + string="%second", + index=1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + connect(integralKPICalculator4.KPI, outBusDist.PEleHRPreDHW) annotation (Line( + points={{17.8,-168},{17.8,-86},{12,-86},{12,-84},{0,-84},{0,-100}}, + color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(hea.Pel, inputKPICalculator.u) annotation (Line(points={{75.2,93.6},{ - 132,93.6},{132,-150},{-92,-150},{-92,-137},{-86.2,-137}}, color={0,0, - 127})); - connect(internalKPICalculatorDHWHR1.KPIBus, outBusDist.WelHRBufSto) - annotation (Line( - points={{-87.8,-115},{-43.9,-115},{-43.9,-100},{0,-100}}, - color={255,204,51}, - thickness=0.5), Text( + connect(integralKPICalculator.KPI, outBusDist.PEleHRAftBuf) annotation (Line( + points={{17.8,-130},{17.8,-86},{0,-86},{0,-100}}, color={135,135,135}), + Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); + annotation (Diagram(coordinateSystem(extent={{-100,-180},{100,100}}))); end PartialDistributionTwoStorageParallelDetailed; diff --git a/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo b/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo index de693c33..8e314ffc 100644 --- a/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo +++ b/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo @@ -109,18 +109,12 @@ model CombiStorage bufferStorage.layer.T) annotation (Placement(transformation(extent={{-42,-122},{-22,-102}}))); - BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculatorBufLoss( + Utilities.KPIs.IntegralKPICalculator integralKPICalculator( + use_inpCon=false, unit="W", - integralUnit="J", - thresholdOn=Modelica.Constants.eps, - calc_singleOnTime=false, - calc_integral=true, - calc_totalOnTime=false, - calc_numSwi=false, - calc_movAve=false, - calc_intBelThres=false, + intUnit="J", y=fixedTemperatureBuf.port.Q_flow) - annotation (Placement(transformation(extent={{-76,-124},{-56,-86}}))); + annotation (Placement(transformation(extent={{-80,-120},{-60,-100}}))); BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{30,-108},{50,-88}}))); equation @@ -207,19 +201,16 @@ equation extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(internalKPICalculatorBufLoss.KPIBus, outBusDist.QStoLoss) annotation ( - Line( - points={{-55.8,-105},{-48,-105},{-48,-90},{-14,-90},{-14,-86},{0,-86},{0, - -100}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( Line( points={{50,-98},{70,-98}}, color={0,0,0}, thickness=1)); + connect(integralKPICalculator.KPI, outBusDist.QStoLos_flow) annotation (Line( + points={{-57.8,-110},{-54,-110},{-54,-100},{0,-100},{0,-100}}, color={ + 135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); end CombiStorage; diff --git a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo index 52851a4d..19b2ea1c 100644 --- a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo @@ -134,30 +134,18 @@ model DistributionTwoStorageParallel rotation=0, origin={30,-90}))); - BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculatorBufLoss( + Utilities.KPIs.IntegralKPICalculator integralKPICalculator1( + use_inpCon=false, unit="W", - integralUnit="J", - thresholdOn=Modelica.Constants.eps, - calc_singleOnTime=false, - calc_integral=true, - calc_totalOnTime=false, - calc_numSwi=false, - calc_movAve=false, - calc_intBelThres=false, + intUnit="J", y=fixedTemperatureBuf.port.Q_flow) - annotation (Placement(transformation(extent={{-80,-90},{-60,-52}}))); - BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculatorDHWLoss( + annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); + Utilities.KPIs.IntegralKPICalculator integralKPICalculator( + use_inpCon=false, unit="W", - integralUnit="J", - thresholdOn=Modelica.Constants.eps, - calc_singleOnTime=false, - calc_integral=true, - calc_totalOnTime=false, - calc_numSwi=false, - calc_movAve=false, - calc_intBelThres=false, + intUnit="J", y=fixedTemperatureDHW.port.Q_flow) - annotation (Placement(transformation(extent={{-80,-110},{-60,-72}}))); + annotation (Placement(transformation(extent={{-80,-100},{-60,-80}}))); BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{34,-110},{54,-90}}))); replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve @@ -203,24 +191,6 @@ equation {48,-82},{48,-70},{49,-70}}, color={0,127,255})); connect(fixedTemperatureDHW.port, storageDHW.heatPort) annotation (Line( points={{40,-90},{70,-90},{70,-51},{62.6,-51}}, color={191,0,0})); - connect(internalKPICalculatorDHWLoss.KPIBus, outBusDist.QDHWLoss) annotation ( - Line( - points={{-59.8,-91},{-14,-91},{-14,-86},{0,-86},{0,-100}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(internalKPICalculatorBufLoss.KPIBus, outBusDist.QBufLoss) annotation ( - Line( - points={{-59.8,-71},{0,-71},{0,-100}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(T_stoDHWBot.y, sigBusDistr.TStoDHWBotMea) annotation (Line(points={{31.5, 99},{0,99},{0,101}}, color={0,0,127}), Text( string="%second", @@ -275,4 +245,16 @@ equation Line(points={{-20,52.8},{-14,52.8},{-14,-28},{2,-28}}, color={0,127,255})); connect(storageDHW.port_a_heatGenerator, resDHW.port_b) annotation (Line( points={{34.72,-34.28},{22,-34.28},{22,-28}}, color={0,127,255})); + connect(integralKPICalculator.KPI, outBusDist.QDHWLos_flow) annotation (Line( + points={{-57.8,-90},{0,-90},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(integralKPICalculator1.KPI, outBusDist.QBufLos_flow) annotation (Line( + points={{-57.8,-50},{0,-50},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); end DistributionTwoStorageParallel; diff --git a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo index e0c9b2f8..916e541f 100644 --- a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo @@ -82,23 +82,24 @@ model ElectricalHeater "Only heat using a heating rod" rotation=90, origin={62,-74}))); - BESMod.Utilities.KPIs.InternalKPICalculator KPIQHR( + Utilities.KPIs.IntegralKPICalculator KPIQHR( + use_inpCon=false, unit="W", - integralUnit="J", - calc_singleOnTime=false, - calc_integral=true, - calc_totalOnTime=false, - calc_numSwi=false, - calc_movAve=false, - calc_intBelThres=false, + intUnit="J", y=hea.vol.heatPort.Q_flow) - annotation (Placement(transformation(extent={{-40,-128},{-28,-106}}))); + annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}))); replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition pumpData annotation (choicesAllMatching=true, Placement(transformation(extent={{14,-64}, {28,-52}}))); BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) annotation (Placement(transformation(extent={{32,-108},{52,-88}}))); + Utilities.KPIs.DeviceKPICalculator KPIHeaRod1( + use_reaInp=true, + calc_singleOnTime=true, + calc_totalOnTime=true, + calc_numSwi=true) + annotation (Placement(transformation(extent={{-60,-100},{-40,-80}}))); equation connect(dummyZero.y,switch1. u3) annotation (Line(points={{29,4},{38,4},{38,-4}}, color={0,0,127})); @@ -124,14 +125,6 @@ equation annotation (Line(points={{46,7.4},{46,-4}}, color={255,0,255})); connect(hea.port_a, pump.port_b) annotation (Line(points={{-32,-6},{-34,-6},{ -34,-48},{38,-48}}, color={0,127,255})); - connect(KPIQHR.KPIBus, outBusGen.QHR) annotation (Line( - points={{-27.88,-117},{0,-117},{0,-100}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(hea.u, sigBusGen.uHR) annotation (Line(points={{-41.6,-9.2},{-41.6, -24},{-56,-24},{-56,98},{2,98}}, color={0,0,127}), Text( string="%second", @@ -150,5 +143,24 @@ equation color={0,0,0}, thickness=1)); connect(realToElecCon.PEleLoa, hea.Pel) annotation (Line(points={{30,-94},{ - -64,-94},{-64,27.6},{-41.6,27.6}}, color={0,0,127})); + -80,-94},{-80,28},{-60,28},{-60,27.6},{-41.6,27.6}}, + color={0,0,127})); + connect(KPIQHR.KPI, outBusGen.QHR_flow) annotation (Line(points={{-17.8,-70}, + {0,-70},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIHeaRod1.KPI, outBusGen.heaRod) annotation (Line(points={{-37.8,-90}, + {-14,-90},{-14,-86},{0,-86},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIHeaRod1.uRea, sigBusGen.uHR) annotation (Line(points={{-62.2,-90}, + {-76,-90},{-76,98},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); end ElectricalHeater; diff --git a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo index 16ecaf2f..0ce4e40c 100644 --- a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo @@ -25,17 +25,12 @@ model GasBoiler "Just a gas boiler" paramBoiler "Parameters for Boiler" annotation(choicesAllMatching=true); parameter Real etaTempBased[:,2]=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99] "Table matrix for temperature based efficiency"; - BESMod.Utilities.KPIs.InternalKPICalculator KPIQHR( + Utilities.KPIs.IntegralKPICalculator KPIQHR( + use_inpCon=false, unit="W", - integralUnit="J", - calc_singleOnTime=false, - calc_integral=true, - calc_totalOnTime=false, - calc_numSwi=false, - calc_movAve=false, - calc_intBelThres=false, + intUnit="J", y=boilerNoControl.QflowCalculation.y) - annotation (Placement(transformation(extent={{-46,-106},{-24,-70}}))); + annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}))); replaceable parameter BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition temperatureSensorData @@ -81,6 +76,12 @@ model GasBoiler "Just a gas boiler" origin={66,-26}))); BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{26,-108},{46,-88}}))); + Utilities.KPIs.DeviceKPICalculator KPIHeaRod1( + use_reaInp=true, + calc_singleOnTime=true, + calc_totalOnTime=true, + calc_numSwi=true) + annotation (Placement(transformation(extent={{-60,-80},{-40,-60}}))); equation connect(boilerNoControl.port_b, portGen_out[1]) annotation (Line(points={{-34, @@ -103,14 +104,6 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(KPIQHR.KPIBus, outBusGen.QBoi) annotation (Line( - points={{-23.78,-88},{0,-88},{0,-100}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(portGen_in[1], pump.port_a) annotation (Line(points={{100,-2},{94,-2}, {94,-6},{86,-6},{86,-50},{56,-50}}, color={0,127,255})); connect(boilerNoControl.port_a, pump.port_b) annotation (Line(points={{-66,10}, @@ -128,4 +121,22 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); + connect(KPIQHR.KPI, outBusGen.QBoi_flow) annotation (Line(points={{-17.8,-90}, + {-10,-90},{-10,-88},{0,-88},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIHeaRod1.KPI, outBusGen.boi) annotation (Line(points={{-37.8,-70},{ + 0,-70},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIHeaRod1.uRea, sigBusGen.uBoiSet) annotation (Line(points={{-62.2, + -70},{-74,-70},{-74,98},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); end GasBoiler; diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index a53acb13..2e5aeb73 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -114,20 +114,16 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" rotation=0, origin={-164,56}))); - BESMod.Utilities.KPIs.InputKPICalculator KPIWel( - integralUnit="J", - calc_singleOnTime=true, - calc_integral=true, - calc_movAve=false, + Utilities.KPIs.IntegralKPICalculator KPIWel( + use_inpCon=true, + intUnit="J", unit="W") - annotation (Placement(transformation(extent={{-52,-76},{-40,-54}}))); - BESMod.Utilities.KPIs.InputKPICalculator KPIWHRel( + annotation (Placement(transformation(extent={{-180,-80},{-160,-60}}))); + Utilities.KPIs.IntegralKPICalculator KPIWHRel( + use_inpCon=true, unit="W", - integralUnit="J", - calc_singleOnTime=true, - calc_integral=true, - calc_movAve=false) if use_heaRod - annotation (Placement(transformation(extent={{-52,-62},{-40,-40}}))); + intUnit="J") if use_heaRod + annotation (Placement(transformation(extent={{-180,-48},{-160,-28}}))); IBPSA.Fluid.Movers.SpeedControlled_y pump( redeclare final package Medium = Medium, @@ -178,28 +174,18 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" rotation=0, origin={-164,32}))); - BESMod.Utilities.KPIs.InternalKPICalculator KPIQHP( + Utilities.KPIs.IntegralKPICalculator KPIQHP( + use_inpCon=false, unit="W", - integralUnit="J", - calc_singleOnTime=false, - calc_integral=true, - calc_totalOnTime=false, - calc_numSwi=false, - calc_movAve=false, - calc_intBelThres=false, + intUnit="J", y=heatPump.con.QFlow_in) - annotation (Placement(transformation(extent={{-52,-90},{-40,-68}}))); - BESMod.Utilities.KPIs.InternalKPICalculator KPIQHR( + annotation (Placement(transformation(extent={{-180,-112},{-160,-92}}))); + Utilities.KPIs.IntegralKPICalculator KPIQHR( + use_inpCon=false, unit="W", - integralUnit="J", - calc_singleOnTime=false, - calc_integral=true, - calc_totalOnTime=false, - calc_numSwi=false, - calc_movAve=false, - calc_intBelThres=false, + intUnit="J", y=hea.vol.heatPort.Q_flow) if use_heaRod - annotation (Placement(transformation(extent={{-52,-104},{-40,-82}}))); + annotation (Placement(transformation(extent={{-180,-140},{-160,-120}}))); IBPSA.Fluid.Sources.Boundary_pT bouPumpHP( redeclare package Medium = Medium, @@ -234,15 +220,23 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" extent={{-6,-6},{6,6}}, rotation=180, origin={130,-82}))); + Utilities.KPIs.DeviceKPICalculator KPIHeaRod( + use_reaInp=false, + calc_singleOnTime=true, + calc_totalOnTime=true, + calc_numSwi=true) + annotation (Placement(transformation(extent={{-180,-20},{-160,0}}))); + Utilities.KPIs.DeviceKPICalculator KPIHeaRod1( + use_reaInp=true, + calc_singleOnTime=true, + calc_totalOnTime=true, + calc_numSwi=true) + annotation (Placement(transformation(extent={{-140,-120},{-120,-100}}))); protected parameter Modelica.Units.SI.PressureDifference dpHeaRod_nominal=if use_heaRod then heatingRodParameters.dp_nominal else 0; equation - connect(KPIQHP.KPIBus, outBusGen.QHP_flow) annotation (Line(points={{-39.88,-79}, - {-36,-79},{-36,-80},{-32,-80},{-32,-100},{0,-100}}, color={255,204,51}, thickness=0.5), Text(string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIQHR.KPIBus, outBusGen.QHR_flow) annotation (Line(points={{-39.88,-93}, - {-32,-93},{-32,-100},{0,-100}}, color={255,204,51}, thickness=0.5), Text(string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(bou_air.ports[1], heatPump.port_a2) annotation (Line( points={{-80,52},{-57.5,52},{-57.5,37}}, @@ -271,32 +265,16 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(KPIWel.u, sigBusGen.hp_bus.PelMea) annotation (Line(points={{-53.32,-65}, - {-56,-65},{-56,-50},{-28,-50},{-28,-12},{2,-12},{2,98}}, + connect(KPIWel.u, sigBusGen.hp_bus.PelMea) annotation (Line(points={{-181.8, + -70},{-196,-70},{-196,120},{-22,120},{-22,122},{26,122},{26,98},{2,98}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(KPIWel.KPIBus, outBusGen.WHPel) annotation (Line( - points={{-39.88,-65},{-32,-65},{-32,-100},{0,-100}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(hea.Pel, KPIWHRel.u) annotation (Line(points={{55.6,89.6},{56,89.6},{56, - 110},{-176,110},{-176,104},{-174,104},{-174,-42},{-60,-42},{-60,-51},{ - -53.32,-51}}, color={0,0,127})); - connect(KPIWHRel.KPIBus, outBusGen.WHRel) annotation (Line( - points={{-39.88,-51},{-38,-51},{-38,-54},{-28,-54},{-28,-100},{0,-100}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); + connect(hea.Pel, KPIWHRel.u) annotation (Line(points={{55.6,89.6},{58,89.6},{ + 58,114},{-184,114},{-184,-38},{-181.8,-38}}, + color={0,0,127})); connect(pump.port_a, portGen_in[1]) annotation (Line( points={{26,-68},{100,-68},{100,-2}}, color={0,127,255})); @@ -375,10 +353,61 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); + connect(KPIQHR.KPI, outBusGen.QHR_flow) annotation (Line(points={{-157.8,-130}, + {-146,-130},{-146,-102},{0,-102},{0,-100}}, color={135,135,135}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIQHP.KPI, outBusGen.QHP_flow) annotation (Line(points={{-157.8,-102}, + {-16,-102},{-16,-100},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIWel.KPI, outBusGen.PEleHP) annotation (Line(points={{-157.8,-70},{ + -144,-70},{-144,-102},{-14,-102},{-14,-100},{0,-100}}, color={135,135, + 135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIWHRel.KPI, outBusGen.PEleHR) annotation (Line(points={{-157.8,-38}, + {-146,-38},{-146,-102},{0,-102},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIHeaRod.KPI, outBusGen.heaPum) annotation (Line(points={{-157.8,-10}, + {-146,-10},{-146,-12},{-138,-12},{-138,-100},{0,-100}}, color={135, + 135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIHeaRod.u, sigBusGen.hp_bus.onOffMea) annotation (Line(points={{ + -182.2,-10},{-198,-10},{-198,98},{2,98}}, color={255,0,255}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIHeaRod1.KPI, outBusGen.heaRod) annotation (Line(points={{-117.8, + -110},{0,-110},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIHeaRod1.uRea, sigBusGen.hr_on) annotation (Line(points={{-142.2, + -110},{-168,-110},{-168,-112},{-190,-112},{-190,98},{2,98}}, color={0, + 0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); annotation (Line( points={{-52.775,-6.78},{-52.775,33.61},{-56,33.61},{-56,74}}, color={255,204,51}, thickness=0.5), - Diagram(coordinateSystem(extent={{-180,-140},{100,100}})), Icon( - coordinateSystem(extent={{-180,-140},{100,100}}))); + Diagram(coordinateSystem(extent={{-180,-140},{100,100}}))); end HeatPumpAndHeatingRod; diff --git a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo index af6e9cbd..b49b67e3 100644 --- a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo +++ b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo @@ -86,19 +86,17 @@ model SolarThermalBivHP rotation=180, origin={50,-170}))); - BESMod.Utilities.KPIs.InternalKPICalculator KPIWel1( + Utilities.KPIs.IntegralKPICalculator KPIWel1( + use_inpCon=false, unit="W", - integralUnit="J", - calc_singleOnTime=true, - calc_integral=true, - calc_movAve=false, + intUnit="J", y=-solarThermal.heater.port.Q_flow) - annotation (Placement(transformation(extent={{-52,-118},{-40,-96}}))); + annotation (Placement(transformation(extent={{-60,-100},{-40,-80}}))); - Modelica.Blocks.Sources.RealExpression realExpression(y=solarThermal.senTCold.T) - annotation (Placement(transformation(extent={{-90,-114},{-70,-94}}))); - Modelica.Blocks.Sources.RealExpression realExpression1(y=solarThermal.senTHot.T) - annotation (Placement(transformation(extent={{-90,-104},{-70,-84}}))); + Modelica.Blocks.Sources.RealExpression reaExpSolTheTCol(y=solarThermal.senTCold.T) + annotation (Placement(transformation(extent={{-100,-120},{-80,-100}}))); + Modelica.Blocks.Sources.RealExpression reaExpSolTheTHot(y=solarThermal.senTHot.T) + annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); protected parameter Modelica.Units.SI.PressureDifference dpST_nominal=solarThermalParas.m_flow_nominal @@ -127,28 +125,20 @@ equation horizontalAlignment=TextAlignment.Right)); connect(AirOrSoil1.y, pumpST.y) annotation (Line(points={{39,-170},{10,-170}, {10,-162}}, color={0,0,127})); - connect(KPIWel1.KPIBus, outBusGen.QST_flow) annotation (Line( - points={{-39.88,-107},{-16,-107},{-16,-100},{0,-100}}, - color={255,204,51}, - thickness=0.5), Text( + connect(reaExpSolTheTCol.y, outBusGen.TSolCol_in) annotation (Line(points={{ + -79,-110},{-62,-110},{-62,-126},{0,-126},{0,-100}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(reaExpSolTheTHot.y, outBusGen.TSolCol_out) annotation (Line(points={{ + -79,-90},{-66,-90},{-66,-108},{-16,-108},{-16,-116},{0,-116},{0,-100}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(realExpression.y, outBusGen.TSolCol_in) annotation (Line(points={{-69, - -104},{-56,-104},{-56,-122},{0,-122},{0,-100}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(realExpression1.y, outBusGen.TSolCol_out) annotation (Line(points={{-69,-94}, - {-60,-94},{-60,-124},{0,-124},{0,-100}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(solarThermal.T_air, weaBus.TDryBul) annotation (Line(points={{-24, -158},{-24,-178},{-194,-178},{-194,80},{-101,80}}, @@ -164,6 +154,13 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); + connect(KPIWel1.KPI, outBusGen.QSolThe_flow) annotation (Line(points={{-37.8, + -90},{-24,-90},{-24,-88},{0,-88},{0,-100}}, color={135,135,135}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); annotation (Diagram(coordinateSystem(extent={{-200,-180},{100,100}}), graphics={Rectangle( extent={{100,-180},{-200,-118}}, @@ -171,6 +168,5 @@ equation lineThickness=1), Text( extent={{-188,-122},{-124,-140}}, textColor={0,0,0}, - textString="Solar Thermal")}), Icon(coordinateSystem(extent={{-200, - -180},{100,100}}))); + textString="Solar Thermal")})); end SolarThermalBivHP; diff --git a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo index a0b636af..5fc36e1c 100644 --- a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo +++ b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo @@ -95,14 +95,12 @@ model SolarThermalBivHPBuiLib rotation=0, origin={-188,-160}))); - BESMod.Utilities.KPIs.InternalKPICalculator KPIWel1( + Utilities.KPIs.IntegralKPICalculator KPIWel1( + use_inpCon=false, unit="W", - integralUnit="J", - calc_singleOnTime=true, - calc_integral=true, - calc_movAve=false, + intUnit="J", y=sum(solCol.vol.heatPort.Q_flow)) - annotation (Placement(transformation(extent={{-52,-118},{-40,-96}}))); + annotation (Placement(transformation(extent={{-60,-120},{-40,-100}}))); Modelica.Blocks.Logical.Switch switch3 annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -140,14 +138,6 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(KPIWel1.KPIBus, outBusGen.QST_flow) annotation (Line( - points={{-39.88,-107},{-16,-107},{-16,-100},{0,-100}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(weaBus, solCol.weaBus) annotation (Line( points={{-101,80},{-101,-6},{-104,-6},{-104,-108},{-108,-108},{-108,-184}, @@ -183,6 +173,5 @@ equation textString="Solar Thermal"), Rectangle( extent={{94,-198},{-218,-136}}, lineColor={0,0,0}, - lineThickness=1)}), Icon(coordinateSystem(extent={{-220,-200},{100, - 100}}))); + lineThickness=1)})); end SolarThermalBivHPBuiLib; diff --git a/BESMod/Systems/Hydraulical/Interfaces/ControlOutputs.mo b/BESMod/Systems/Hydraulical/Interfaces/ControlOutputs.mo index e8b4337a..49f448f2 100644 --- a/BESMod/Systems/Hydraulical/Interfaces/ControlOutputs.mo +++ b/BESMod/Systems/Hydraulical/Interfaces/ControlOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Interfaces; expandable connector ControlOutputs "Bus with ouputs of the control system" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation ( defaultComponentName = "outBusCtrl", diff --git a/BESMod/Systems/Hydraulical/Interfaces/DistributionOutputs.mo b/BESMod/Systems/Hydraulical/Interfaces/DistributionOutputs.mo index 5165eed4..4895b202 100644 --- a/BESMod/Systems/Hydraulical/Interfaces/DistributionOutputs.mo +++ b/BESMod/Systems/Hydraulical/Interfaces/DistributionOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Interfaces; expandable connector DistributionOutputs "Bus with ouputs of the distribution system" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation ( defaultComponentName = "outBusDist", diff --git a/BESMod/Systems/Hydraulical/Interfaces/GenerationOutputs.mo b/BESMod/Systems/Hydraulical/Interfaces/GenerationOutputs.mo index 82bd9f74..02404754 100644 --- a/BESMod/Systems/Hydraulical/Interfaces/GenerationOutputs.mo +++ b/BESMod/Systems/Hydraulical/Interfaces/GenerationOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Interfaces; expandable connector GenerationOutputs "Bus with ouputs of the generation system" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation ( defaultComponentName = "outBusGen", diff --git a/BESMod/Systems/Hydraulical/Interfaces/TransferOutputs.mo b/BESMod/Systems/Hydraulical/Interfaces/TransferOutputs.mo index aa3dd883..1a915ec0 100644 --- a/BESMod/Systems/Hydraulical/Interfaces/TransferOutputs.mo +++ b/BESMod/Systems/Hydraulical/Interfaces/TransferOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Interfaces; expandable connector TransferOutputs "Bus with ouputs of the tramsfer system" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation ( defaultComponentName = "outBusTra", diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo index 6f6c8c28..62138fae 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo @@ -46,24 +46,17 @@ model RadiatorTransferSystem replaceable parameter BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters annotation (choicesAllMatching=true, Placement(transformation(extent={{-100,-98},{-80,-78}}))); - BESMod.Utilities.KPIs.InternalKPICalculator internalKPICalculator( + Utilities.KPIs.IntegralKPICalculator intKPICalHeaFlo( + use_inpCon=false, unit="W", - integralUnit="J", - calc_singleOnTime=false, - calc_totalOnTime=false, - calc_numSwi=false, - calc_movAve=false, + intUnit="J", y=sum(-heatPortRad.Q_flow) + sum(-heatPortCon.Q_flow)) - annotation (Placement(transformation(extent={{-32,-96},{-12,-60}}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculator[nParallelDem]( + annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}))); + Utilities.KPIs.IntegralKPICalculator intKPICal[nParallelDem]( + use_inpCon=true, unit=fill("", nParallelDem), - integralUnit=fill("s", nParallelDem), - each calc_singleOnTime=false, - each calc_integral=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false) - annotation (Placement(transformation(extent={{-32,-124},{-12,-88}}))); + intUnit=fill("s", nParallelDem)) + annotation (Placement(transformation(extent={{-40,-110},{-20,-90}}))); IBPSA.Fluid.Movers.FlowControlled_m_flow pumpFix_m_flow[nParallelDem]( redeclare final package Medium = Medium, each final energyDynamics=energyDynamics, @@ -121,25 +114,9 @@ equation {-76,39.5},{-51,39.5}}, color={0,127,255})); end for; - connect(internalKPICalculator.KPIBus, outBusTra.Q_flow) annotation (Line( - points={{-11.8,-78},{0,-78},{0,-104}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(inputKPICalculator.KPIBus, outBusTra.openings) annotation (Line( - points={{-11.8,-106},{-6,-106},{-6,-104},{0,-104}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(inputKPICalculator.u, traControlBus.opening) annotation (Line(points= - {{-34.2,-106},{-36,-106},{-36,-62},{26,-62},{26,90},{0,90},{0,100}}, - color={0,0,127}), Text( + connect(intKPICal.u, traControlBus.opening) annotation (Line(points={{-41.8, + -100},{-48,-100},{-48,-14},{-12,-14},{-12,-8},{24,-8},{24,86},{8,86}, + {8,90},{0,90},{0,100}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, @@ -164,4 +141,16 @@ equation points={{50,-96},{72,-96},{72,-98}}, color={0,0,0}, thickness=1)); + connect(intKPICalHeaFlo.KPI, outBusTra.QRad_flow) annotation (Line(points={{ + -17.8,-70},{0,-70},{0,-104}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(intKPICal.KPI, outBusTra.opening) annotation (Line(points={{-17.8, + -100},{-8,-100},{-8,-104},{0,-104}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); end RadiatorTransferSystem; diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index f7e0d8a6..8d76eeda 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -60,26 +60,12 @@ model UFHTransferSystem constrainedby RecordsCollection.UFHData(nZones=nParallelDem, area=AZone) annotation (choicesAllMatching=true, Placement(transformation(extent={{22,12},{42,32}}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorOpening[ - nParallelDem]( - unit=fill("", nParallelDem), - integralUnit=fill("s", nParallelDem), - each calc_singleOnTime=false, - each calc_integral=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false) - annotation (Placement(transformation(extent={{-46,-94},{-26,-58}}))); - BESMod.Utilities.KPIs.InputKPICalculator inputKPICalculatorLossUFH[ - nParallelDem]( - unit=fill("W", nParallelDem), - integralUnit=fill("J", nParallelDem), - each calc_singleOnTime=false, - each calc_integral=false, - each calc_totalOnTime=false, - each calc_numSwi=false, - each calc_movAve=false) - annotation (Placement(transformation(extent={{-46,-120},{-26,-84}}))); + Utilities.KPIs.IntegralKPICalculator integralKPICalculator1[nParallelDem]( + unit=fill("", nParallelDem), intUnit=fill("s", nParallelDem)) + annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}))); + Utilities.KPIs.IntegralKPICalculator integralKPICalculator[nParallelDem](unit + =fill("W", nParallelDem), intUnit=fill("J", nParallelDem)) + annotation (Placement(transformation(extent={{-40,-120},{-20,-100}}))); IBPSA.Fluid.Sources.Boundary_pT bouPumpHP[nParallelDem]( redeclare package Medium = Medium, each final p=p_start, @@ -185,29 +171,12 @@ equation index=1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(gain.y, inputKPICalculatorOpening.u) annotation (Line(points={{-28,61}, - {-28,54},{-46,54},{-46,8},{-60,8},{-60,-76},{-48.2,-76}}, color={0,0, + connect(gain.y, integralKPICalculator1.u) annotation (Line(points={{-28,61},{ + -28,54},{-46,54},{-46,8},{-60,8},{-60,-70},{-41.8,-70}}, color={0,0, 127})); - connect(inputKPICalculatorOpening.KPIBus, outBusTra.opening) annotation (Line( - points={{-25.8,-76},{0,-76},{0,-104}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(heatFlowSensor.Q_flow, inputKPICalculatorLossUFH.u) annotation (Line( - points={{-46,-17},{-46,-22},{-62,-22},{-62,-102},{-48.2,-102}}, color={ + connect(heatFlowSensor.Q_flow, integralKPICalculator.u) annotation (Line( + points={{-46,-17},{-46,-54},{-54,-54},{-54,-110},{-41.8,-110}}, color={ 0,0,127})); - connect(inputKPICalculatorLossUFH.KPIBus, outBusTra.QLossUFH) annotation ( - Line( - points={{-25.8,-102},{-14,-102},{-14,-100},{0,-100},{0,-104}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(bouPumpHP.ports[1],pumpFix_m_flow. port_a) annotation (Line(points={{-58,58}, {-48,58},{-48,37},{-34,37}}, color={0,127,255})); connect(res1.port_b, pumpFix_m_flow.port_a) annotation (Line(points={{-54,38}, @@ -221,4 +190,16 @@ equation points={{52,-98},{72,-98}}, color={0,0,0}, thickness=1)); + connect(integralKPICalculator.KPI, outBusTra.QUFH_flow) annotation (Line( + points={{-17.8,-110},{0,-110},{0,-104}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(integralKPICalculator1.KPI, outBusTra.opening) annotation (Line( + points={{-17.8,-70},{0,-70},{0,-104}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); end UFHTransferSystem; diff --git a/BESMod/Systems/Interfaces/ControlOutputs.mo b/BESMod/Systems/Interfaces/ControlOutputs.mo index 8f69afde..939fa222 100644 --- a/BESMod/Systems/Interfaces/ControlOutputs.mo +++ b/BESMod/Systems/Interfaces/ControlOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Interfaces; expandable connector ControlOutputs "Bus with ouputs of the control system" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation ( defaultComponentName = "outBusCtrl", diff --git a/BESMod/Systems/Interfaces/DHWOutputs.mo b/BESMod/Systems/Interfaces/DHWOutputs.mo index 1bcbb283..0c20f08a 100644 --- a/BESMod/Systems/Interfaces/DHWOutputs.mo +++ b/BESMod/Systems/Interfaces/DHWOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Interfaces; expandable connector DHWOutputs "Bus with ouputs of the DHW system" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation ( defaultComponentName = "outBusDem", Icon(graphics, diff --git a/BESMod/Systems/Interfaces/DemandOutputs.mo b/BESMod/Systems/Interfaces/DemandOutputs.mo index e0289248..ece38a8a 100644 --- a/BESMod/Systems/Interfaces/DemandOutputs.mo +++ b/BESMod/Systems/Interfaces/DemandOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Interfaces; expandable connector DemandOutputs "Bus with ouputs of the demand system" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation ( defaultComponentName = "outBusDem", diff --git a/BESMod/Systems/Interfaces/ElectricalOutputs.mo b/BESMod/Systems/Interfaces/ElectricalOutputs.mo index 5cde7c1f..89a22924 100644 --- a/BESMod/Systems/Interfaces/ElectricalOutputs.mo +++ b/BESMod/Systems/Interfaces/ElectricalOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Interfaces; expandable connector ElectricalOutputs "Bus with ouputs of the electrical system" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation ( defaultComponentName = "outBusHyd", diff --git a/BESMod/Systems/Interfaces/HydraulicOutputs.mo b/BESMod/Systems/Interfaces/HydraulicOutputs.mo index b4f61a7b..afa96cd1 100644 --- a/BESMod/Systems/Interfaces/HydraulicOutputs.mo +++ b/BESMod/Systems/Interfaces/HydraulicOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Interfaces; expandable connector HydraulicOutputs "Bus with ouputs of the hydraulic system" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation ( defaultComponentName = "outBusHyd", diff --git a/BESMod/Systems/Interfaces/SystemOutputs.mo b/BESMod/Systems/Interfaces/SystemOutputs.mo index c84f4c14..7707431f 100644 --- a/BESMod/Systems/Interfaces/SystemOutputs.mo +++ b/BESMod/Systems/Interfaces/SystemOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Interfaces; expandable connector SystemOutputs "Bus with ouputs of the overall system" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation ( defaultComponentName = "outBusGen", diff --git a/BESMod/Systems/Interfaces/VentilationOutputs.mo b/BESMod/Systems/Interfaces/VentilationOutputs.mo index 3fc17543..8c7db306 100644 --- a/BESMod/Systems/Interfaces/VentilationOutputs.mo +++ b/BESMod/Systems/Interfaces/VentilationOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Interfaces; expandable connector VentilationOutputs "Bus with ouputs of the ventilation system" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation ( defaultComponentName = "outBusVen", diff --git a/BESMod/Systems/Interfaces/package.order b/BESMod/Systems/Interfaces/package.order index a2bd5ea4..af6a2cb3 100644 --- a/BESMod/Systems/Interfaces/package.order +++ b/BESMod/Systems/Interfaces/package.order @@ -8,4 +8,3 @@ HydraulicOutputs SystemOutputs UseProBus VentilationOutputs -KPIBus diff --git a/BESMod/Systems/Ventilation/Interfaces/ControlOutputs.mo b/BESMod/Systems/Ventilation/Interfaces/ControlOutputs.mo index 84cb6f67..dc22b940 100644 --- a/BESMod/Systems/Ventilation/Interfaces/ControlOutputs.mo +++ b/BESMod/Systems/Ventilation/Interfaces/ControlOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Ventilation.Interfaces; expandable connector ControlOutputs "Bus with ouputs of the control system" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation ( defaultComponentName = "outBusCtrl", diff --git a/BESMod/Systems/Ventilation/Interfaces/DistributionOutputs.mo b/BESMod/Systems/Ventilation/Interfaces/DistributionOutputs.mo index 6fd08286..9577a182 100644 --- a/BESMod/Systems/Ventilation/Interfaces/DistributionOutputs.mo +++ b/BESMod/Systems/Ventilation/Interfaces/DistributionOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Ventilation.Interfaces; expandable connector DistributionOutputs "Bus with ouputs of the distribution system" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation ( defaultComponentName = "outBusDist", diff --git a/BESMod/Systems/Ventilation/Interfaces/GenerationOutputs.mo b/BESMod/Systems/Ventilation/Interfaces/GenerationOutputs.mo index 400bce26..f8dc312b 100644 --- a/BESMod/Systems/Ventilation/Interfaces/GenerationOutputs.mo +++ b/BESMod/Systems/Ventilation/Interfaces/GenerationOutputs.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Ventilation.Interfaces; expandable connector GenerationOutputs "Bus with ouputs of the generation system" - extends BESMod.Systems.Interfaces.KPIBus; + extends BESMod.Utilities.Icons.OutputsBus; annotation ( defaultComponentName = "outBusGen", diff --git a/BESMod/Systems/Interfaces/KPIBus.mo b/BESMod/Utilities/Icons/OutputsBus.mo similarity index 95% rename from BESMod/Systems/Interfaces/KPIBus.mo rename to BESMod/Utilities/Icons/OutputsBus.mo index c1531d41..a50f50fb 100644 --- a/BESMod/Systems/Interfaces/KPIBus.mo +++ b/BESMod/Utilities/Icons/OutputsBus.mo @@ -1,5 +1,5 @@ -within BESMod.Systems.Interfaces; -expandable connector KPIBus "Icon for KPI bus" +within BESMod.Utilities.Icons; +expandable connector OutputsBus "Icon for outputs bus" annotation ( Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}, initialScale=0.2), graphics={ @@ -59,4 +59,4 @@ expandable connector KPIBus "Icon for KPI bus" Documentation(info=" This icon is designed for a control bus connector. ")); -end KPIBus; +end OutputsBus; diff --git a/BESMod/Utilities/Icons/package.order b/BESMod/Utilities/Icons/package.order index ab43b053..bf4afdec 100644 --- a/BESMod/Utilities/Icons/package.order +++ b/BESMod/Utilities/Icons/package.order @@ -11,3 +11,4 @@ ControlBus BuiMeaBus UseProBus ControlPackage +OutputsBus diff --git a/BESMod/Utilities/KPIs/BaseClasses/KPIDevice.mo b/BESMod/Utilities/KPIs/BaseClasses/KPIDevice.mo new file mode 100644 index 00000000..9e7dc687 --- /dev/null +++ b/BESMod/Utilities/KPIs/BaseClasses/KPIDevice.mo @@ -0,0 +1,16 @@ +within BESMod.Utilities.KPIs.BaseClasses; +connector KPIDevice "Connector for KPIs of number of switches" + + extends PartialKPIConnector; + + Modelica.Blocks.Interfaces.IntegerOutput numSwi + "Number of switches"; + Modelica.Blocks.Interfaces.RealOutput sinOnTim( + final unit="s", + final displayUnit="h") + "Time the device is on in a single on-cycle"; + Modelica.Blocks.Interfaces.RealOutput totOnTim( + final unit="s", + final displayUnit="h") + "Total time the device is on"; +end KPIDevice; diff --git a/BESMod/Utilities/KPIs/BaseClasses/KPIIcon.mo b/BESMod/Utilities/KPIs/BaseClasses/KPIIcon.mo new file mode 100644 index 00000000..3344e9c1 --- /dev/null +++ b/BESMod/Utilities/KPIs/BaseClasses/KPIIcon.mo @@ -0,0 +1,17 @@ +within BESMod.Utilities.KPIs.BaseClasses; +partial model KPIIcon "Icon for KPI calculators" + + annotation (Icon(graphics={ + Rectangle( + extent={{-100,100},{102,-100}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid), Text( + extent={{-98,-100},{100,-160}}, + lineColor={0,0,0}, + textString="%name")}), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}})), + Documentation(info=" +

Icon for KPI calculation

+")); +end KPIIcon; diff --git a/BESMod/Utilities/KPIs/BaseClasses/KPIIntegral.mo b/BESMod/Utilities/KPIs/BaseClasses/KPIIntegral.mo new file mode 100644 index 00000000..211c43a3 --- /dev/null +++ b/BESMod/Utilities/KPIs/BaseClasses/KPIIntegral.mo @@ -0,0 +1,11 @@ +within BESMod.Utilities.KPIs.BaseClasses; +connector KPIIntegral "Connector for KPIs" + + extends PartialKPIConnector; + + Modelica.Blocks.Interfaces.RealOutput value + "Current value"; + Modelica.Blocks.Interfaces.RealOutput integral + "Integral of value"; + +end KPIIntegral; diff --git a/BESMod/Utilities/KPIs/BaseClasses/PartialKPICalculator.mo b/BESMod/Utilities/KPIs/BaseClasses/PartialKPICalculator.mo deleted file mode 100644 index d2f70613..00000000 --- a/BESMod/Utilities/KPIs/BaseClasses/PartialKPICalculator.mo +++ /dev/null @@ -1,197 +0,0 @@ -within BESMod.Utilities.KPIs.BaseClasses; -partial model PartialKPICalculator "Partial KPI Calculator" - parameter String unit "Unit of signal"; - parameter String integralUnit "Unit of integral of signal"; - parameter Real thresholdOn=Modelica.Constants.eps * 100 - "If u is greater or equal to this treshhold the device is considered on."; - parameter Real thresholdOff=Modelica.Constants.eps - "If u is lower or equal to this treshhold, the device is considered off."; - parameter Boolean calc_singleOnTime=true - "True to calc singleOnTime"; - parameter Boolean calc_integral=true - "True to calc integral"; - parameter Boolean calc_totalOnTime=true - "True to calc totalOnTime"; - parameter Boolean calc_numSwi=true - "True to calc number of device on-switches"; - parameter Boolean calc_movAve=true - "True to calc moving average"; - parameter Boolean calc_intBelThres=true - "True to calc integral below threshold, e.g. for discomfort"; - parameter Modelica.Units.SI.Time aveTime=24*3600 - "Time span for moving average" annotation (Dialog(enable=calc_movAve)); - Modelica.Blocks.Logical.Switch switch1 if calc_singleOnTime - annotation (Placement(transformation(extent={{40,-10},{60,10}}))); - Modelica.Blocks.Sources.Constant const(k=1) if calc_singleOnTime - annotation (Placement(transformation(extent={{6,14},{26,34}}))); - Modelica.Blocks.Sources.Constant const1(k=0) if calc_singleOnTime - annotation (Placement(transformation(extent={{6,-28},{26,-8}}))); - Modelica.Blocks.Continuous.Integrator integrator3(use_reset=true, y(unit="s")) - if calc_singleOnTime - annotation (Placement(transformation(extent={{76,-6},{88,6}}))); - Modelica.Blocks.Logical.Hysteresis isOn( - final uLow=thresholdOff, - final uHigh=thresholdOn, - final pre_y_start=false) if calc_numSwi or calc_singleOnTime or calc_totalOnTime - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - - Modelica.Blocks.Logical.Not not1 if calc_singleOnTime - annotation (Placement(transformation(extent={{8,-70},{28,-50}}))); - Modelica.Blocks.Sources.IntegerConstant integerConstant(final k=1) - if calc_numSwi - annotation (Placement(transformation(extent={{-48,136},{-32,152}}))); - Modelica.Blocks.MathInteger.TriggeredAdd triggeredAdd(final use_reset=false, - final y_start=0) if calc_numSwi - "To count on-off cycles" - annotation (Placement(transformation(extent={{-16,134},{0,152}}))); - Modelica.Blocks.Logical.Switch switch3 if calc_totalOnTime - annotation (Placement(transformation(extent={{40,78},{60,98}}))); - Modelica.Blocks.Sources.Constant const2(k=1) if calc_totalOnTime - annotation (Placement(transformation(extent={{6,102},{26,122}}))); - Modelica.Blocks.Sources.Constant const3(k=0) if calc_totalOnTime - annotation (Placement(transformation(extent={{6,60},{26,80}}))); - Modelica.Blocks.Continuous.Integrator integrator1(y(unit="s")) - if calc_totalOnTime - annotation (Placement(transformation(extent={{76,82},{88,94}}))); - - Modelica.Blocks.Continuous.Integrator integrator2(use_reset=false, - y_start=Modelica.Constants.eps, y(unit=integralUnit)) - if calc_integral - annotation (Placement(transformation(extent={{72,-90},{84,-78}}))); - Systems.Interfaces.KPIBus KPIBus - annotation (Placement(transformation(extent={{92,-10},{112,10}}))); - - Modelica.Blocks.Routing.RealPassThrough internalU(y(unit=unit)) - annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-78,0}))); - AixLib.Utilities.Math.MovingAverage movingAverage(aveTime=aveTime, y(unit= - unit)) - if calc_movAve - annotation (Placement(transformation(extent={{-34,-168},{-14,-148}}))); - - Modelica.Blocks.Continuous.Integrator integratorDiscomfort(final k=1, - use_reset=false, - y(unit=integralUnit)) - if calc_intBelThres - annotation (Placement(transformation(extent={{70,-28},{82,-16}}))); - Modelica.Blocks.Sources.Constant const4(k=thresholdOn) - if calc_intBelThres - annotation (Placement(transformation(extent={{-46,-54},{-26,-34}}))); - Modelica.Blocks.Math.Add add(final k1=-1, final k2=+1) - if calc_intBelThres - annotation (Placement(transformation(extent={{28,-48},{48,-28}}))); - Modelica.Blocks.Nonlinear.Limiter limiter(final uMax=Modelica.Constants.inf, - final uMin=0) if calc_intBelThres - annotation (Placement(transformation(extent={{54,-44},{66,-32}}))); -equation - connect(switch1.u1, const.y) annotation (Line(points={{38,8},{32,8},{32,24},{ - 27,24}}, color={0,0,127})); - connect(const1.y, switch1.u3) annotation (Line(points={{27,-18},{34,-18},{34, - -8},{38,-8}}, - color={0,0,127})); - connect(switch1.y, integrator3.u) - annotation (Line(points={{61,0},{74.8,0}}, color={0,0,127})); - connect(isOn.y, switch1.u2) - annotation (Line(points={{-29,0},{38,0}}, color={255,0,255})); - connect(not1.y, integrator3.reset) annotation (Line(points={{29,-60},{86,-60}, - {86,-7.2},{85.6,-7.2}}, color={255,0,255})); - connect(isOn.y, not1.u) annotation (Line(points={{-29,0},{-22,0},{-22,-60},{6, - -60}}, color={255,0,255})); - connect(integerConstant.y,triggeredAdd. u) annotation (Line(points={{-31.2,144}, - {-23.6,144},{-23.6,143},{-19.2,143}}, - color={255,127,0})); - connect(switch3.u1, const2.y) annotation (Line(points={{38,96},{32,96},{32,112}, - {27,112}}, color={0,0,127})); - connect(const3.y,switch3. u3) annotation (Line(points={{27,70},{34,70},{34,80}, - {38,80}}, color={0,0,127})); - connect(switch3.y,integrator1. u) - annotation (Line(points={{61,88},{74.8,88}}, color={0,0,127})); - connect(integrator2.y, KPIBus.integral) annotation (Line(points={{84.6,-84},{102, - -84},{102,0}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(triggeredAdd.y, KPIBus.numSwi) annotation (Line(points={{1.6,143},{102, - 143},{102,0}}, color={255,127,0}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(isOn.y, switch3.u2) annotation (Line(points={{-29,0},{-18,0},{-18,88}, - {38,88}}, color={255,0,255})); - connect(isOn.y, triggeredAdd.trigger) annotation (Line(points={{-29,0},{-12.8, - 0},{-12.8,132.2}}, color={255,0,255})); - connect(integrator3.y, KPIBus.singleOnTime) annotation (Line(points={{88.6,0}, - {102,0}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(integrator1.y, KPIBus.totalOnTime) annotation (Line(points={{88.6,88}, - {90,88},{90,0},{102,0}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(isOn.u, internalU.y) - annotation (Line(points={{-52,0},{-67,0}}, color={0,0,127})); - connect(internalU.y, integrator2.u) - annotation (Line(points={{-67,0},{-62,0},{-62,-84},{70.8,-84}}, - color={0,0,127})); - connect(internalU.y, KPIBus.value) annotation (Line(points={{-67,0},{-62,0},{-62, - -132},{102,-132},{102,0}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(internalU.y, movingAverage.u) annotation (Line(points={{-67,0},{-64,0}, - {-64,2},{-62,2},{-62,-158},{-36,-158}}, color={0,0,127})); - connect(movingAverage.y, KPIBus.movAve) annotation (Line(points={{-13,-158},{102, - -158},{102,0}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(internalU.y, add.u1) annotation (Line(points={{-67,0},{-62,0},{ - -62,-32},{26,-32}}, color={0,0,127})); - connect(add.u2, const4.y) - annotation (Line(points={{26,-44},{-25,-44}}, color={0,0,127})); - connect(add.y, limiter.u) - annotation (Line(points={{49,-38},{52.8,-38}}, color={0,0,127})); - connect(limiter.y, integratorDiscomfort.u) annotation (Line(points={{66.6,-38}, - {68.8,-38},{68.8,-22}}, color={0,0,127})); - connect(integratorDiscomfort.y, KPIBus.IntBelowThreshold) annotation (Line( - points={{82.6,-22},{90,-22},{90,-24},{102,-24},{102,0}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-180}, - {100,180}}), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.Solid), Text( - extent={{-62,52},{66,-68}}, - lineColor={0,0,0}, - textString="%name")}), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false, extent={ - {-100,-180},{100,180}})), - Documentation(info=" -

Calculates a list of KPIs. Each KPI may be turned on or off. As integrators and Integer conversions are used, disabling KPIs may improve simulation speed. Nevertheless, most KPIs will be handy to understand and explain the BES behaviour better.

-

Options

-
    -
  • Calculate how long a device is turned in total (totalOnTime) and how long it's on for each on-cycle (singleOnTime)
  • -
  • Calculate how many times it is turned on (numSwi)
  • -
  • The integral
  • -
  • The moving average, useful for e.g. temperatures or COPs
  • -
  • The integral below a given threshold. This may be useful to estimate discomfort, seperate cooling and heating loads etc. (intBelowThreshold)
  • -
-")); -end PartialKPICalculator; diff --git a/BESMod/Utilities/KPIs/BaseClasses/PartialKPIConnector.mo b/BESMod/Utilities/KPIs/BaseClasses/PartialKPIConnector.mo new file mode 100644 index 00000000..54875347 --- /dev/null +++ b/BESMod/Utilities/KPIs/BaseClasses/PartialKPIConnector.mo @@ -0,0 +1,21 @@ +within BESMod.Utilities.KPIs.BaseClasses; +partial connector PartialKPIConnector "Partial emtpy KPI connector for icon" + + annotation ( + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}, initialScale=0.2), + graphics={Polygon( + points={{-100,100},{-100,-100},{102,0},{-100,100}}, + lineColor={135,135,135}, + fillColor={175,175,175}, + fillPattern=FillPattern.Solid), Text( + extent={{-98,-100},{98,-140}}, + textColor={135,135,135}, + textString="KPIs")}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + initialScale=0.2)), + Documentation(info=" +This icon is designed for a control bus connector. +")); +end PartialKPIConnector; diff --git a/BESMod/Utilities/KPIs/BaseClasses/package.order b/BESMod/Utilities/KPIs/BaseClasses/package.order index 2d02f595..68ad5171 100644 --- a/BESMod/Utilities/KPIs/BaseClasses/package.order +++ b/BESMod/Utilities/KPIs/BaseClasses/package.order @@ -1 +1,4 @@ -PartialKPICalculator +KPIIcon +KPIIntegral +KPIDevice +PartialKPIConnector diff --git a/BESMod/Utilities/KPIs/ComfortCalculator.mo b/BESMod/Utilities/KPIs/ComfortCalculator.mo index 4233de66..c36bb13d 100644 --- a/BESMod/Utilities/KPIs/ComfortCalculator.mo +++ b/BESMod/Utilities/KPIs/ComfortCalculator.mo @@ -1,6 +1,7 @@ within BESMod.Utilities.KPIs; model ComfortCalculator "Cacluate the discomort in K*s" + extends BaseClasses.KPIIcon; parameter Modelica.Units.SI.Temperature TComBou "Comfort boundary temperature"; parameter Boolean for_heating = true "=false to calculate comfort during cooling period (summer). = true for heating"; @@ -37,16 +38,7 @@ equation annotation (Line(points={{-28,0},{-120,0}}, color={0,0,127})); connect(add.y, lim.u) annotation (Line(points={{-5,-6},{0,-6},{0,-4},{6,-4}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.Solid), Text( - extent={{-62,52},{66,-68}}, - lineColor={0,0,0}, - textString="%name")}), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false)), + annotation ( Documentation(info="

Calculate the comfort during either heating or cooling period. Based on EN 15251, which defines a 2 K bandwith around a set temperature of 22 °C.

")); diff --git a/BESMod/Utilities/KPIs/CountOnTime.mo b/BESMod/Utilities/KPIs/CountOnTime.mo deleted file mode 100644 index 9543ea5b..00000000 --- a/BESMod/Utilities/KPIs/CountOnTime.mo +++ /dev/null @@ -1,53 +0,0 @@ -within BESMod.Utilities.KPIs; -model CountOnTime - Modelica.Blocks.Sources.IntegerConstant integerConstant(final k=1) - annotation (Placement(transformation(extent={{-48,26},{-32,42}}))); - Modelica.Blocks.MathInteger.TriggeredAdd triggeredAdd(final use_reset=false, - final y_start=0) - "To count on-off cycles" - annotation (Placement(transformation(extent={{-16,24},{0,42}}))); - Modelica.Blocks.Interfaces.BooleanInput u - annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - Modelica.Blocks.Interfaces.IntegerOutput numSwi "Integer output signal" - annotation (Placement(transformation(extent={{100,70},{120,90}}))); - Modelica.Blocks.Logical.Switch switch1 - annotation (Placement(transformation(extent={{40,-60},{60,-40}}))); - Modelica.Blocks.Sources.Constant const(k=1) - annotation (Placement(transformation(extent={{6,-36},{26,-16}}))); - Modelica.Blocks.Sources.Constant const1(k=0) - annotation (Placement(transformation(extent={{6,-78},{26,-58}}))); - Modelica.Blocks.Interfaces.RealOutput onTime - "Connector of Real output signal" - annotation (Placement(transformation(extent={{100,-60},{120,-40}}))); - Modelica.Blocks.Continuous.Integrator integrator3 - annotation (Placement(transformation(extent={{76,-56},{88,-44}}))); -equation - connect(integerConstant.y, triggeredAdd.u) annotation (Line(points={{-31.2,34}, - {-23.6,34},{-23.6,33},{-19.2,33}}, color={255,127,0})); - connect(triggeredAdd.trigger, u) annotation (Line(points={{-12.8,22.2},{-12.8, - 0},{-120,0}}, color={255,0,255})); - connect(triggeredAdd.y, numSwi) annotation (Line(points={{1.6,33},{39.8,33},{39.8, - 80},{110,80}}, color={255,127,0})); - connect(u, switch1.u2) annotation (Line(points={{-120,0},{-14,0},{-14,-50},{38, - -50}}, color={255,0,255})); - connect(switch1.u1, const.y) annotation (Line(points={{38,-42},{32,-42},{32,-26}, - {27,-26}}, color={0,0,127})); - connect(const1.y, switch1.u3) annotation (Line(points={{27,-68},{34,-68},{34,-58}, - {38,-58}}, color={0,0,127})); - connect(switch1.y, integrator3.u) - annotation (Line(points={{61,-50},{74.8,-50}}, color={0,0,127})); - connect(onTime, integrator3.y) - annotation (Line(points={{110,-50},{88.6,-50}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.Solid), Text( - extent={{-62,52},{66,-68}}, - lineColor={0,0,0}, - textString="%name")}), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false)), - Documentation(info=" -")); -end CountOnTime; diff --git a/BESMod/Utilities/KPIs/CountTimeDiscomfort.mo b/BESMod/Utilities/KPIs/CountTimeDiscomfort.mo index 0ee669dc..8793e55a 100644 --- a/BESMod/Utilities/KPIs/CountTimeDiscomfort.mo +++ b/BESMod/Utilities/KPIs/CountTimeDiscomfort.mo @@ -1,5 +1,8 @@ within BESMod.Utilities.KPIs; -model CountTimeDiscomfort +model CountTimeDiscomfort "Count the time of discomfort" + extends BaseClasses.KPIIcon; + parameter Modelica.Media.Interfaces.Types.Temperature TRoomSet=293.15 + "Room set temperature"; Modelica.Blocks.Logical.Switch switch1 annotation (Placement(transformation(extent={{40,-10},{60,10}}))); Modelica.Blocks.Sources.Constant const(k=1) @@ -16,8 +19,7 @@ model CountTimeDiscomfort Modelica.Blocks.Logical.LessThreshold switch2(threshold=TRoomSet) annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - parameter Modelica.Media.Interfaces.Types.Temperature TRoomSet=293.15 - "Room set temperature"; + Modelica.Blocks.Logical.Not not1 annotation (Placement(transformation(extent={{8,-70},{28,-50}}))); equation @@ -38,16 +40,7 @@ equation {90,-7.2},{85.6,-7.2}}, color={255,0,255})); connect(switch2.y, not1.u) annotation (Line(points={{-29,0},{-22,0},{-22,-60}, {6,-60}}, color={255,0,255})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.Solid), Text( - extent={{-62,52},{66,-68}}, - lineColor={0,0,0}, - textString="%name")}), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false)), + annotation ( Documentation(info="

Calculate the time discomfort is present. Useful to check if discomfort values are high due to frequent small deviations or some long, possibly big deviations. The latter may indicate the system is undersized for the given demand.

")); diff --git a/BESMod/Utilities/KPIs/DeviceKPICalculator.mo b/BESMod/Utilities/KPIs/DeviceKPICalculator.mo new file mode 100644 index 00000000..9540df25 --- /dev/null +++ b/BESMod/Utilities/KPIs/DeviceKPICalculator.mo @@ -0,0 +1,110 @@ +within BESMod.Utilities.KPIs; +model DeviceKPICalculator "KPI useful for the analysis of a device" + extends BaseClasses.KPIIcon; + parameter Boolean use_reaInp=false "=true to use a real input"; + parameter Real thrOn=Modelica.Constants.eps*100 + "If uRea is greater or equal to this treshhold the device is on" + annotation(Dialog(enable=use_reaInp)); + parameter Real thrOff=Modelica.Constants.eps + "If uRea is lower or equal to this treshhold, the device is off" + annotation(Dialog(enable=use_reaInp)); + parameter Boolean calc_singleOnTime=true + "True to calc singleOnTime"; + parameter Boolean calc_totalOnTime=true + "True to calc totalOnTime"; + parameter Boolean calc_numSwi=true + "True to calc number of device on-switches"; + Modelica.Blocks.Logical.Hysteresis isOn( + final uLow=thrOff, + final uHigh=thrOn, + final pre_y_start=false) if use_reaInp + annotation (Placement(transformation(extent={{-90,10},{-70,30}}))); + + Modelica.Blocks.Logical.Switch switch1 if calc_singleOnTime + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + Modelica.Blocks.Sources.Constant const(k=1) if calc_singleOnTime + annotation (Placement(transformation(extent={{-42,10},{-22,30}}))); + Modelica.Blocks.Sources.Constant const1(k=0) if calc_singleOnTime + annotation (Placement(transformation(extent={{-42,-30},{-22,-10}}))); + Modelica.Blocks.Continuous.Integrator integrator3(use_reset=true, y(unit="s")) + if calc_singleOnTime + annotation (Placement(transformation(extent={{26,-40},{46,-20}}))); + Modelica.Blocks.Logical.Not not1 if calc_singleOnTime + annotation (Placement(transformation(extent={{-34,-60},{-14,-40}}))); + Modelica.Blocks.Sources.IntegerConstant integerConstant(final k=1) + if calc_numSwi + annotation (Placement(transformation(extent={{-34,60},{-14,80}}))); + Modelica.Blocks.MathInteger.TriggeredAdd triggeredAdd(final use_reset=false, + final y_start=0) if calc_numSwi + "To count on-off cycles" + annotation (Placement(transformation(extent={{6,60},{26,80}}))); + Modelica.Blocks.Continuous.Integrator integrator1(y(unit="s")) + if calc_totalOnTime + annotation (Placement(transformation(extent={{26,20},{46,40}}))); + BaseClasses.KPIDevice KPI + annotation (Placement(transformation(extent={{102,-20},{142,20}}), + iconTransformation(extent={{102,-20},{142,20}}))); + Modelica.Blocks.Interfaces.BooleanInput u if not use_reaInp + "=true if device is on" + annotation (Placement(transformation(extent={{-142,-20},{-102,20}}), + iconTransformation(extent={{-142,-20},{-102,20}}))); + Modelica.Blocks.Interfaces.RealInput uRea if use_reaInp "Real input" + annotation (Placement(transformation(extent={{-140,0},{-100,40}}), + iconTransformation(extent={{-142,-20},{-102,20}}))); +equation + connect(switch1.u1,const. y) annotation (Line(points={{-12,8},{-14,8},{-14,20}, + {-21,20}}, color={0,0,127})); + connect(const1.y,switch1. u3) annotation (Line(points={{-21,-20},{-10,-20},{-10, + -8},{-12,-8}}, + color={0,0,127})); + connect(switch1.y,integrator3. u) + annotation (Line(points={{11,0},{18,0},{18,-30},{24,-30}}, + color={0,0,127})); + connect(not1.y,integrator3. reset) annotation (Line(points={{-13,-50},{42,-50}, + {42,-42}}, color={255,0,255})); + connect(integerConstant.y,triggeredAdd. u) annotation (Line(points={{-13,70},{ + 2,70}}, color={255,127,0})); + connect(triggeredAdd.y, KPI.numSwi) annotation (Line(points={{28,70},{70,70},{ + 70,0.1},{122.1,0.1}}, + color={255,127,0}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(integrator1.y, KPI.totOnTim) annotation (Line(points={{47,30},{70,30}, + {70,0.1},{122.1,0.1}}, + color={0,0,127})); + connect(integrator3.y, KPI.sinOnTim) annotation (Line(points={{47,-30},{70,-30}, + {70,0.1},{122.1,0.1}}, + color={0,0,127})); + connect(switch1.y,integrator1. u) + annotation (Line(points={{11,0},{16,0},{16,30},{24,30}}, color={0,0,127})); + connect(not1.u, u) annotation (Line(points={{-36,-50},{-48,-50},{-48,0},{-122, + 0}}, color={255,0,255})); + connect(u, switch1.u2) + annotation (Line(points={{-122,0},{-12,0}}, color={255,0,255})); + connect(triggeredAdd.trigger, u) annotation (Line(points={{10,58},{10,52},{-48, + 52},{-48,0},{-122,0}}, color={255,0,255})); + connect(isOn.y, switch1.u2) annotation (Line(points={{-69,20},{-62,20},{-62,0}, + {-12,0}}, color={255,0,255})); + connect(isOn.y, not1.u) annotation (Line(points={{-69,20},{-62,20},{-62,-50},{ + -36,-50}}, color={255,0,255})); + connect(isOn.y, triggeredAdd.trigger) annotation (Line(points={{-69,20},{-60,20}, + {-60,54},{10,54},{10,58}}, color={255,0,255})); + connect(uRea, isOn.u) + annotation (Line(points={{-120,20},{-92,20}}, color={0,0,127})); + annotation(Dialog(enable=use_reaInp), + Dialog(enable=use_reaInp), + Documentation(info=" +

Calculates a list of KPIs relevant for the operation of a device.

+

Each KPI may be turned on or off.

+

As integrators and Integer conversions are used, disabling KPIs may improve simulation speed.

+

Nevertheless, most KPIs will be handy to understand and explain the BES behaviour better.

+

Options

+
    +
  • Calculate how long a device is turned in total (totalOnTime)
  • +
  • and how long it's on for each on-cycle (singleOnTime)
  • +
  • Calculate how many times it is turned on (numSwi)
  • +
+")); +end DeviceKPICalculator; diff --git a/BESMod/Utilities/KPIs/InputKPICalculator.mo b/BESMod/Utilities/KPIs/InputKPICalculator.mo deleted file mode 100644 index 6b709384..00000000 --- a/BESMod/Utilities/KPIs/InputKPICalculator.mo +++ /dev/null @@ -1,13 +0,0 @@ -within BESMod.Utilities.KPIs; -model InputKPICalculator "Calculate for given input" - extends BaseClasses.PartialKPICalculator; - Modelica.Blocks.Interfaces.RealInput u(unit=unit) - "Connector of Real input signal" - annotation (Placement(transformation(extent={{-142,-20},{-102,20}}))); -equation - connect(internalU.u, u) - annotation (Line(points={{-90,0},{-122,0}}, color={0,0,127})); - annotation (Documentation(info=" -

Calculate a set of KPIs for the given Real input signal

-")); -end InputKPICalculator; diff --git a/BESMod/Utilities/KPIs/IntegralKPICalculator.mo b/BESMod/Utilities/KPIs/IntegralKPICalculator.mo new file mode 100644 index 00000000..b46f2610 --- /dev/null +++ b/BESMod/Utilities/KPIs/IntegralKPICalculator.mo @@ -0,0 +1,56 @@ +within BESMod.Utilities.KPIs; +model IntegralKPICalculator "Give integral and value as KPI" + extends BaseClasses.KPIIcon; + parameter Boolean use_inpCon + "= false to use an internal variable as input"; + parameter String unit "Unit of signal"; + parameter String intUnit "Unit of integral of signal"; + + Modelica.Blocks.Interfaces.RealInput y if not use_inpCon + "Value of Real input"; + + Modelica.Blocks.Continuous.Integrator integrator2( + use_reset=false, + y_start=Modelica.Constants.eps, + y(unit=intUnit)) + annotation (Placement(transformation(extent={{20,-40},{40,-20}}))); + Modelica.Blocks.Sources.RealExpression internal_u(y=y) if not use_inpCon + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,-20}))); + Modelica.Blocks.Routing.RealPassThrough internalU(y(unit=unit)) + annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-30,0}))); + Modelica.Blocks.Interfaces.RealInput u(unit=unit) if use_inpCon + "Connector of Real input signal" + annotation (Placement(transformation(extent={{-138,-20},{-98,20}}))); + BaseClasses.KPIIntegral KPI + annotation (Placement(transformation(extent={{102,-20},{142,20}}), + iconTransformation(extent={{102,-20},{142,20}}))); +equation + connect(internalU.y, KPI.value) annotation (Line(points={{-19,0},{50,0},{50, + 0.1},{122.1,0.1}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(integrator2.u, internalU.y) annotation (Line(points={{18,-30},{-8,-30}, + {-8,0},{-19,0}}, color={0,0,127})); + connect(integrator2.y, KPI.integral) annotation (Line(points={{41,-30},{72, + -30},{72,0.1},{122.1,0.1}}, + color={0,0,127})); + connect(internalU.u,u) + annotation (Line(points={{-42,0},{-118,0}}, color={0,0,127})); + connect(internalU.u,internal_u. y) + annotation (Line(points={{-42,0},{-72,0},{-72,-20},{-79,-20}}, + color={0,0,127})); + annotation (Documentation(info=" +

Calculates the integral of the given value and passes the value as well.

+

Useful to output value and integral directly.

+")); +end IntegralKPICalculator; diff --git a/BESMod/Utilities/KPIs/InternalKPICalculator.mo b/BESMod/Utilities/KPIs/InternalKPICalculator.mo deleted file mode 100644 index 0465d348..00000000 --- a/BESMod/Utilities/KPIs/InternalKPICalculator.mo +++ /dev/null @@ -1,19 +0,0 @@ -within BESMod.Utilities.KPIs; -model InternalKPICalculator - "KPIs for internal variables. Add via Attributes -> y=someVar" - extends BaseClasses.PartialKPICalculator; - - Modelica.Blocks.Interfaces.RealInput y "Value of Real input"; - - Modelica.Blocks.Sources.RealExpression internal_u(y=y) annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-112,0}))); -equation - connect(internalU.u, internal_u.y) - annotation (Line(points={{-90,0},{-101,0}}, color={0,0,127})); - annotation (Documentation(info=" -

If no input is given, specify "y=..." as a modifier.

-")); -end InternalKPICalculator; diff --git a/BESMod/Utilities/KPIs/package.order b/BESMod/Utilities/KPIs/package.order index 567e85c3..8ff98283 100644 --- a/BESMod/Utilities/KPIs/package.order +++ b/BESMod/Utilities/KPIs/package.order @@ -1,6 +1,5 @@ -CountOnTime CountTimeDiscomfort ComfortCalculator -InternalKPICalculator -InputKPICalculator +DeviceKPICalculator +IntegralKPICalculator BaseClasses diff --git a/BESMod/Utilities/SupervisoryControl/SupervisoryControlExample.mo b/BESMod/Utilities/SupervisoryControl/SupervisoryControlExample.mo index 45a22ec8..62feebb6 100644 --- a/BESMod/Utilities/SupervisoryControl/SupervisoryControlExample.mo +++ b/BESMod/Utilities/SupervisoryControl/SupervisoryControlExample.mo @@ -8,7 +8,6 @@ model SupervisoryControlExample SupervisoryControl extCtrl( actExt(y=activateSupCtrl.y), ctrlType=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.External, - uExt(y=pulseSup.y)) annotation (Placement(transformation(extent={{-20,38},{12,70}}))); From 4d85c263c808420f210bd8067e20973d44a398af Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sat, 22 Oct 2022 17:50:28 +0200 Subject: [PATCH 062/131] rename to better fitting name --- .../{RadiatorTransferSystem.mo => IdealValveRadiator.mo} | 4 ++-- BESMod/Systems/Hydraulical/Transfer/Tests/package.order | 2 +- BESMod/Systems/Hydraulical/Transfer/package.order | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename BESMod/Systems/Hydraulical/Transfer/{RadiatorTransferSystem.mo => IdealValveRadiator.mo} (99%) diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo similarity index 99% rename from BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo rename to BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo index 62138fae..69a0c311 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo @@ -1,5 +1,5 @@ within BESMod.Systems.Hydraulical.Transfer; -model RadiatorTransferSystem +model IdealValveRadiator "Subsystem using a radiator and ideal thermostatic valves" extends BaseClasses.PartialTransfer( final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, @@ -153,4 +153,4 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); -end RadiatorTransferSystem; +end IdealValveRadiator; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/package.order b/BESMod/Systems/Hydraulical/Transfer/Tests/package.order index d669d501..1d5c8f6a 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/package.order @@ -1,5 +1,5 @@ TestIdealValveRadiatorSystem TestPressureBasedSystem TestUnderfloorHeating -PartialTest TestPressureBasedSystemWithReliefValve +PartialTest diff --git a/BESMod/Systems/Hydraulical/Transfer/package.order b/BESMod/Systems/Hydraulical/Transfer/package.order index ea6d8517..7e47a4cb 100644 --- a/BESMod/Systems/Hydraulical/Transfer/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/package.order @@ -1,4 +1,4 @@ -RadiatorTransferSystem +IdealValveRadiator UFHTransferSystem RadiatorPressureBased NoHeatTransfer From c1fd6be99ee1910305516103bd04d0e62ffb025c Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sat, 22 Oct 2022 17:51:02 +0200 Subject: [PATCH 063/131] Open modelica fixes --- .../Building/HeatDemand/CalcHeaDemHOM.mo | 2 +- .../BaseClasses/PartialElectricalSystem.mo | 19 ++++++++++------- .../Electrical/Interfaces/TransferOutputs.mo | 2 +- .../BaseClasses/PartialHydraulicSystem.mo | 16 +++++++------- .../Valves/DefaultThreeWayValve.mo | 2 -- .../RecordsCollection/Valves/ThreeWayValve.mo | 2 +- .../Tests/ControlledDomesticVentilation.mo | 8 +++++++ .../Utilities/KPIs/IntegralKPICalculator.mo | 21 +++++++------------ 8 files changed, 38 insertions(+), 34 deletions(-) diff --git a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo index 5444885c..50059828 100644 --- a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo +++ b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo @@ -18,7 +18,7 @@ model CalcHeaDemHOM h_heater=fill(100000,building.nZones), redeclare Examples.UseCaseHOM.HOMSystem systemParameters( TOda_nominal=261.15, - TSetZone_nominal(displayUnit="K") = {293.15,293.15,288.15,293.15,293.15,293.15, + TSetZone_nominal(each displayUnit="K") = {293.15,293.15,288.15,293.15,293.15,293.15, 293.15,288.15,297.15,293.15}, THydSup_nominal=fill(273.15 + 55, building.nZones)), redeclare AixLibHighOrder building( diff --git a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo index cac0a579..0d9f83d1 100644 --- a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo +++ b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo @@ -97,8 +97,8 @@ equation index=1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(distribution.OutputDistr, outBusElect.distribution) annotation (Line( - points={{6,-100.62},{4,-100.62},{4,-140},{1,-140}}, + connect(distribution.OutputDistr, outBusElect.dis) annotation (Line( + points={{6,-100.62},{4,-100.62},{4,-139.9},{1.115,-139.9}}, color={175,175,175}, thickness=0.5), Text( string="%second", @@ -106,8 +106,8 @@ equation extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(generation.outBusGen, outBusElect.generation) annotation (Line( - points={{-105,-101.31},{-105,-140},{1,-140}}, + connect(generation.outBusGen, outBusElect.gen) annotation (Line( + points={{-105,-101.31},{-105,-139.9},{1.115,-139.9}}, color={175,175,175}, thickness=0.5)); connect(distribution.externalElectricalPin, externalElectricalPin1) @@ -147,8 +147,8 @@ equation points={{104.2,56.25},{104.2,45.125},{106,45.125},{106,34.62}}, color={215,215,215}, thickness=0.5)); - connect(transfer.transferOutputs, outBusElect.transfer) annotation (Line( - points={{106,-101.31},{106,-140},{1,-140}}, + connect(transfer.transferOutputs, outBusElect.tra) annotation (Line( + points={{106,-101.31},{106,-139.9},{1.115,-139.9}}, color={175,175,175}, thickness=0.5), Text( string="%second", @@ -163,6 +163,11 @@ equation else connect(zeroTraLoad.internalElectricalPin, distribution.internalElectricalPin[1]); end if; + connect(control.controlOutputs, outBusElect.ctrl) annotation (Line( + points={{141.4,81.25},{141.4,-24},{142,-24},{142,-130},{1.115,-130},{1.115, + -139.9}}, + color={175,175,175}, + thickness=0.5)); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-180,-140}, {160,140}}), graphics={ Rectangle( @@ -183,6 +188,6 @@ equation thickness=1), Text( extent={{-98,-134},{106,-230}}, lineColor={0,0,0}, - textString="%name%")}), Diagram(graphics, + textString="%name%")}), Diagram( coordinateSystem(preserveAspectRatio=false, extent={{-180,-140},{160,140}}))); end PartialElectricalSystem; diff --git a/BESMod/Systems/Electrical/Interfaces/TransferOutputs.mo b/BESMod/Systems/Electrical/Interfaces/TransferOutputs.mo index 774b23eb..c7094cc8 100644 --- a/BESMod/Systems/Electrical/Interfaces/TransferOutputs.mo +++ b/BESMod/Systems/Electrical/Interfaces/TransferOutputs.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Interfaces; expandable connector TransferOutputs + extends BESMod.Utilities.Icons.OutputsBus; - Modelica.Blocks.Interfaces.RealOutput val(unit="W"); end TransferOutputs; diff --git a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo index 9785766b..01f27121 100644 --- a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo +++ b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo @@ -227,32 +227,32 @@ equation connect(transfer.heatPortRad, heatPortRad) annotation (Line(points={{180, -22.4},{200,-22.4},{200,0}}, color={191,0,0})); - connect(distribution.outBusDist, outBusHyd.storage) annotation (Line( - points={{39,-104},{39,-142},{-1,-142}}, + connect(distribution.outBusDist, outBusHyd.dis) annotation (Line( + points={{39,-104},{39,-141.88},{-0.855,-141.88}}, color={135,135,135}, thickness=0.5), Text( string="%second", index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(generation.outBusGen, outBusHyd.generation) annotation (Line( - points={{-82,-104},{-82,-142},{-1,-142}}, + connect(generation.outBusGen, outBusHyd.gen) annotation (Line( + points={{-82,-104},{-82,-141.88},{-0.855,-141.88}}, color={135,135,135}, thickness=0.5), Text( string="%second", index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(transfer.outBusTra, outBusHyd.transfer) annotation (Line( - points={{146,-45.44},{146,-68},{214,-68},{214,-142},{-1,-142}}, + connect(transfer.outBusTra, outBusHyd.tra) annotation (Line( + points={{146,-45.44},{146,-68},{214,-68},{214,-141.88},{-0.855,-141.88}}, color={135,135,135}, thickness=0.5), Text( string="%second", index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(control.outBusCtrl, outBusHyd.control) annotation (Line( - points={{154,88},{214,88},{214,-142},{-1,-142}}, + connect(control.outBusCtrl, outBusHyd.ctrl) annotation (Line( + points={{154,88},{214,88},{214,-141.88},{-0.855,-141.88}}, color={135,135,135}, thickness=0.5), Text( string="%second", diff --git a/BESMod/Systems/RecordsCollection/Valves/DefaultThreeWayValve.mo b/BESMod/Systems/RecordsCollection/Valves/DefaultThreeWayValve.mo index 41d1e8da..cb04844f 100644 --- a/BESMod/Systems/RecordsCollection/Valves/DefaultThreeWayValve.mo +++ b/BESMod/Systems/RecordsCollection/Valves/DefaultThreeWayValve.mo @@ -1,8 +1,6 @@ within BESMod.Systems.RecordsCollection.Valves; record DefaultThreeWayValve extends ThreeWayValve( - dpFixed_nominal(displayUnit="Pa"), - dpValve_nominal(displayUnit="Pa"), from_dp=true, y_start=1, valveAutho=0.5, diff --git a/BESMod/Systems/RecordsCollection/Valves/ThreeWayValve.mo b/BESMod/Systems/RecordsCollection/Valves/ThreeWayValve.mo index 7169f199..0617d3c9 100644 --- a/BESMod/Systems/RecordsCollection/Valves/ThreeWayValve.mo +++ b/BESMod/Systems/RecordsCollection/Valves/ThreeWayValve.mo @@ -5,7 +5,7 @@ partial record ThreeWayValve parameter Modelica.Units.SI.MassFlowRate m_flow_nominal "Nominal mass flow rate"; - parameter Modelica.Units.SI.PressureDifference dp_nominal[2](displayUnit="Pa") + parameter Modelica.Units.SI.PressureDifference dp_nominal[2](each displayUnit="Pa") "Nominal pressure drop of connected resistances without the valve"; parameter Modelica.Units.SI.PressureDifference dpValve_nominal=valveAutho*max(dp_nominal) diff --git a/BESMod/Systems/Ventilation/Generation/Tests/ControlledDomesticVentilation.mo b/BESMod/Systems/Ventilation/Generation/Tests/ControlledDomesticVentilation.mo index f850e943..5d402da9 100644 --- a/BESMod/Systems/Ventilation/Generation/Tests/ControlledDomesticVentilation.mo +++ b/BESMod/Systems/Ventilation/Generation/Tests/ControlledDomesticVentilation.mo @@ -24,6 +24,8 @@ model ControlledDomesticVentilation Interfaces.GenerationControlBus sigBusGen annotation (Placement(transformation(extent={{-4,54},{16,74}}))); + Modelica.Blocks.Sources.Step step(height=1, startTime=1800) + annotation (Placement(transformation(extent={{-100,0},{-80,20}}))); equation connect(sigBusGen, generation.sigBusGen) annotation (Line( points={{6,64},{6,46.51},{5.52,46.51},{5.52,29.02}}, @@ -33,4 +35,10 @@ equation index=-1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); + connect(step.y, sigBusGen.uByPass) annotation (Line(points={{-79,10},{-26,10}, + {-26,64},{6,64}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); end ControlledDomesticVentilation; diff --git a/BESMod/Utilities/KPIs/IntegralKPICalculator.mo b/BESMod/Utilities/KPIs/IntegralKPICalculator.mo index b46f2610..557ecf54 100644 --- a/BESMod/Utilities/KPIs/IntegralKPICalculator.mo +++ b/BESMod/Utilities/KPIs/IntegralKPICalculator.mo @@ -1,12 +1,12 @@ within BESMod.Utilities.KPIs; model IntegralKPICalculator "Give integral and value as KPI" extends BaseClasses.KPIIcon; - parameter Boolean use_inpCon + parameter Boolean use_inpCon=true "= false to use an internal variable as input"; parameter String unit "Unit of signal"; parameter String intUnit "Unit of integral of signal"; - Modelica.Blocks.Interfaces.RealInput y if not use_inpCon + Modelica.Blocks.Interfaces.RealInput y(unit=unit) if not use_inpCon "Value of Real input"; Modelica.Blocks.Continuous.Integrator integrator2( @@ -14,11 +14,6 @@ model IntegralKPICalculator "Give integral and value as KPI" y_start=Modelica.Constants.eps, y(unit=intUnit)) annotation (Placement(transformation(extent={{20,-40},{40,-20}}))); - Modelica.Blocks.Sources.RealExpression internal_u(y=y) if not use_inpCon - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-90,-20}))); Modelica.Blocks.Routing.RealPassThrough internalU(y(unit=unit)) annotation (Placement( transformation( @@ -32,21 +27,19 @@ model IntegralKPICalculator "Give integral and value as KPI" annotation (Placement(transformation(extent={{102,-20},{142,20}}), iconTransformation(extent={{102,-20},{142,20}}))); equation - connect(internalU.y, KPI.value) annotation (Line(points={{-19,0},{50,0},{50, - 0.1},{122.1,0.1}}, - color={0,0,127}), Text( + connect(internalU.y, KPI.value) annotation (Line(points={{-19,0},{50,0},{50,0.1}, + {122.1,0.1}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(integrator2.u, internalU.y) annotation (Line(points={{18,-30},{-8,-30}, {-8,0},{-19,0}}, color={0,0,127})); - connect(integrator2.y, KPI.integral) annotation (Line(points={{41,-30},{72, - -30},{72,0.1},{122.1,0.1}}, - color={0,0,127})); + connect(integrator2.y, KPI.integral) annotation (Line(points={{41,-30},{72,-30}, + {72,0.1},{122.1,0.1}}, color={0,0,127})); connect(internalU.u,u) annotation (Line(points={{-42,0},{-118,0}}, color={0,0,127})); - connect(internalU.u,internal_u. y) + connect(internalU.u,y) annotation (Line(points={{-42,0},{-72,0},{-72,-20},{-79,-20}}, color={0,0,127})); annotation (Documentation(info=" From 1ce9d6fbdb1a901bb25672b90e3b0e2809994e7d Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sat, 22 Oct 2022 18:00:44 +0200 Subject: [PATCH 064/131] final rename to IdealValveRadiator and use_openModelica to disable non-working parts in OM --- .../MyOwnHeatingRodEfficiencyStudy/BES.mo | 2 +- BESMod/Examples/UseCaseAachen/BES.mo | 3 +- BESMod/Examples/UseCaseAachenTimeBased/BES.mo | 2 +- BESMod/Examples/UseCaseHOM/BES_HOM.mo | 2 +- .../PartialModelicaConferenceUseCase.mo | 2 +- .../PartialBuildingEnergySystem.mo | 56 ++++++++++--------- .../BaseClasses/PartialFluidSubsystem.mo | 3 + .../Control/BaseClasses/PartialControl.mo | 6 +- .../Building/BaseClasses/PartialDemand.mo | 6 +- .../Demand/DHW/BaseClasses/PartialDHW.mo | 10 ++-- .../BaseClasses/PartialElectricalSystem.mo | 13 +++-- .../BaseClasses/PartialHydraulicSystem.mo | 10 ++-- .../Tests/TestIdealValveRadiatorSystem.mo | 2 +- .../BaseClasses/PartialVentilationSystem.mo | 3 +- 14 files changed, 70 insertions(+), 50 deletions(-) diff --git a/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BES.mo b/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BES.mo index b2b1b771..479561f8 100644 --- a/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BES.mo +++ b/BESMod/Examples/MyOwnHeatingRodEfficiencyStudy/BES.mo @@ -47,7 +47,7 @@ model BES dhwParameters(dTLoadingHC1=10), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParameters), - redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorTransferSystem + redeclare BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator transfer(redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare diff --git a/BESMod/Examples/UseCaseAachen/BES.mo b/BESMod/Examples/UseCaseAachen/BES.mo index 572d1bdf..96809eba 100644 --- a/BESMod/Examples/UseCaseAachen/BES.mo +++ b/BESMod/Examples/UseCaseAachen/BES.mo @@ -1,6 +1,7 @@ within BESMod.Examples.UseCaseAachen; model BES extends Systems.BaseClasses.PartialBuildingEnergySystem( + use_openModelica=true, redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( @@ -58,7 +59,7 @@ model BES dhwParameters(dTLoadingHC1=10), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParameters), - redeclare Systems.Hydraulical.Transfer.RadiatorTransferSystem transfer( + redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare diff --git a/BESMod/Examples/UseCaseAachenTimeBased/BES.mo b/BESMod/Examples/UseCaseAachenTimeBased/BES.mo index 0a114e0b..62b74069 100644 --- a/BESMod/Examples/UseCaseAachenTimeBased/BES.mo +++ b/BESMod/Examples/UseCaseAachenTimeBased/BES.mo @@ -53,7 +53,7 @@ model BES dhwParameters(dTLoadingHC1=10), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParameters), - redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorTransferSystem + redeclare BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator transfer(redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare diff --git a/BESMod/Examples/UseCaseHOM/BES_HOM.mo b/BESMod/Examples/UseCaseHOM/BES_HOM.mo index 83d35964..ab0797be 100644 --- a/BESMod/Examples/UseCaseHOM/BES_HOM.mo +++ b/BESMod/Examples/UseCaseHOM/BES_HOM.mo @@ -71,7 +71,7 @@ model BES_HOM dhwParameters(dTLoadingHC1=10), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParameters), - redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorTransferSystem + redeclare BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator transfer(redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index cbc74319..9eba2293 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -74,7 +74,7 @@ partial model PartialModelicaConferenceUseCase dhwParameters(dTLoadingHC1=10), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParameters), - redeclare Systems.Hydraulical.Transfer.RadiatorTransferSystem transfer( + redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( dTTra_nominal=fill(10, hydraulic.transfer.nParallelDem), f_design=fill(1.2, hydraulic.transfer.nParallelDem), redeclare diff --git a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo index 480e127d..2785829c 100644 --- a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo +++ b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo @@ -1,6 +1,10 @@ within BESMod.Systems.BaseClasses; partial model PartialBuildingEnergySystem "Partial BES" + parameter Boolean use_openModelica=false + "=true to disable features which + are not available in open modelica" annotation(Dialog(tab="Advanced")); + // Replaceable packages replaceable package MediumHyd = IBPSA.Media.Water constrainedby Modelica.Media.Interfaces.PartialMedium annotation ( @@ -39,7 +43,8 @@ partial model PartialBuildingEnergySystem "Partial BES" final nZones=systemParameters.nZones, final TSetZone_nominal=systemParameters.TSetZone_nominal, final use_hydraulic=systemParameters.use_hydraulic, - final use_ventilation=systemParameters.use_ventilation) annotation ( + final use_ventilation=systemParameters.use_ventilation, + final use_openModelica=use_openModelica) annotation ( choicesAllMatching=true, Placement(transformation(extent={{2,2},{76,78}}))); replaceable BESMod.Systems.UserProfiles.BaseClasses.PartialUserProfiles userProfiles constrainedby UserProfiles.BaseClasses.PartialUserProfiles( @@ -74,7 +79,8 @@ partial model PartialBuildingEnergySystem "Partial BES" final hZone=building.hZone, final ABui=building.ABui, final ARoo=building.ARoo, - final hBui=building.hBui)) annotation (Placement( + final hBui=building.hBui), + final use_openModelica=use_openModelica) annotation (Placement( transformation(extent={{-198,40},{-42,136}})), choicesAllMatching=true); replaceable BESMod.Systems.Hydraulical.BaseClasses.PartialHydraulicSystem hydraulic if systemParameters.use_hydraulic constrainedby @@ -103,7 +109,8 @@ partial model PartialBuildingEnergySystem "Partial BES" final QCrit=DHW.QCrit, final TDHWCold_nominal=DHW.TDHWCold_nominal, final QDHW_flow_nominal=DHW.QDHW_flow_nominal, - final VDHWDay=DHW.VDHWDay)) + final VDHWDay=DHW.VDHWDay), + final use_openModelica=use_openModelica) annotation (choicesAllMatching=true, Placement(transformation(extent={{-198, -98},{-42,-2}}))); @@ -125,11 +132,12 @@ partial model PartialBuildingEnergySystem "Partial BES" final hZone=building.hZone, final ABui=building.ABui, final ARoo=building.ARoo, - final hBui=building.hBui)) annotation (choicesAllMatching=true, + final hBui=building.hBui), + final use_openModelica=use_openModelica) annotation (choicesAllMatching=true, Placement(transformation(extent={{122,2},{196,78}}))); // Outputs - BESMod.Systems.Interfaces.SystemOutputs outputs + BESMod.Systems.Interfaces.SystemOutputs outputs if not use_openModelica annotation (Placement(transformation(extent={{252,-30},{318,30}}))); IBPSA.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(final filNam= systemParameters.filNamWea) @@ -137,7 +145,8 @@ partial model PartialBuildingEnergySystem "Partial BES" annotation (Placement(transformation(extent={{-280,40},{-220,100}}))); replaceable Control.BaseClasses.PartialControl control constrainedby - Control.BaseClasses.PartialControl annotation (Placement(transformation( + Control.BaseClasses.PartialControl( + final use_openModelica=use_openModelica) annotation (Placement(transformation( extent={{2,124},{78,198}})), choicesAllMatching=true); Electrical.Interfaces.ExternalElectricalPin electricalGrid annotation ( @@ -153,12 +162,12 @@ protected equation connect(building.weaBus, weaDat.weaBus) annotation (Line( - points={{17.54,78.6909},{24,78.6909},{24,88},{-16,88},{-16,206},{-214,206}, - {-214,70},{-220,70}}, + points={{17.54,78.76},{24,78.76},{24,88},{-16,88},{-16,206},{-214,206},{-214, + 70},{-220,70}}, color={255,204,51}, thickness=0.5)); connect(building.outBusDem, outputs.building) annotation (Line( - points={{75.26,42.7636},{75.26,38},{96,38},{96,0},{285,0}}, + points={{75.26,39.24},{75.26,38},{96,38},{96,0},{285,0}}, color={175,175,175}, thickness=0.5), Text( string="%second", @@ -172,8 +181,8 @@ equation if systemParameters.use_hydraulic then connect(building.buiMeaBus, hydraulic.buiMeaBus) annotation (Line( - points={{39,77.6545},{44,77.6545},{44,88},{-26,88},{-26,10},{-86.7474,10}, - {-86.7474,-2.34286}}, + points={{39,77.62},{44,77.62},{44,88},{-26,88},{-26,10},{-86.7474,10},{ + -86.7474,-2.34286}}, color={255,128,0}, thickness=0.5)); connect(weaDat.weaBus, hydraulic.weaBus) annotation (Line( @@ -190,12 +199,11 @@ equation extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); connect(hydraulic.heatPortRad,building.heatPortRad) annotation (Line( - points={{-42,-50},{-42,-48},{-18,-48},{-18,18},{0,18},{0,22.7273},{2, - 22.7273}}, color={191, + points={{-42,-50},{-42,-48},{-18,-48},{-18,18},{0,18},{0,17.2},{2,17.2}}, + color={191, 0,0})); connect(hydraulic.heatPortCon,building.heatPortCon) annotation (Line( - points={{-42,-23.2571},{-42,-24},{-20,-24},{-20,64.1818},{2,64.1818}}, - color= + points={{-42,-23.2571},{-42,-24},{-20,-24},{-20,62.8},{2,62.8}},color= {191,0,0})); connect(userProfiles.useProBus, hydraulic.useProBus) annotation (Line( points={{-225.167,150.775},{-214,150.775},{-214,16},{-157.358,16},{ @@ -244,10 +252,9 @@ equation if systemParameters.use_ventilation then connect(building.portVent_in, ventilation.portVent_in) annotation (Line( - points={{76,56.5818},{84,56.5818},{84,55.2},{122,55.2}}, - color={0,127,255})); + points={{76,54.44},{84,54.44},{84,55.2},{122,55.2}}, color={0,127,255})); connect(building.portVent_out, ventilation.portVent_out) annotation (Line( - points={{76,29.6364},{84,29.6364},{84,25.56},{122,25.56}}, + points={{76,24.8},{84,24.8},{84,25.56},{122,25.56}}, color={0,127,255})); connect(ventilation.outBusVen, outputs.ventilation) annotation (Line( points={{159,2},{158,2},{158,-26},{244,-26},{244,0},{285,0}}, @@ -267,7 +274,7 @@ equation color={0,127,0}, thickness=0.5)); connect(building.buiMeaBus, ventilation.buiMeaBus) annotation (Line( - points={{39,77.6545},{44,77.6545},{44,88},{177.87,88},{177.87,78.38}}, + points={{39,77.62},{44,77.62},{44,88},{177.87,88},{177.87,78.38}}, color={255,128,0}, thickness=0.5)); connect(control.sigBusVen, ventilation.sigBusVen) annotation (Line( @@ -286,16 +293,15 @@ equation connect(building.internalElectricalPin, electrical.internalElectricalPin[4]) annotation (Line( - points={{64.9,10.2909},{64.9,-26},{112,-26},{112,-140},{-210,-140},{-210, - 118},{-198,118},{-198,118.171}}, + points={{64.9,3.52},{64.9,-26},{112,-26},{112,-140},{-210,-140},{-210,118}, + {-198,118},{-198,118.171}}, color={0,0,0}, thickness=1)); if systemParameters.use_elecHeating then connect(electrical.heatPortCon, building.heatPortCon) annotation (Line(points={{ - -41.0824,92.8},{-30,92.8},{-30,64.1818},{2,64.1818}}, - color={191,0,0})); + -41.0824,92.8},{-30,92.8},{-30,62.8},{2,62.8}}, color={191,0,0})); connect(electrical.heatPortRad, building.heatPortRad) annotation (Line(points={{ - -41.0824,67.4286},{-24,67.4286},{-24,22.7273},{2,22.7273}}, + -41.0824,67.4286},{-24,67.4286},{-24,17.2},{2,17.2}}, color={191,0,0})); end if; connect(control.outBusCtrl, outputs.control) annotation (Line( @@ -312,7 +318,7 @@ equation thickness=0.5)); connect(electrical.buiMeaBus, building.buiMeaBus) annotation (Line( points={{-83.2941,136},{-82,136},{-82,146},{-16,146},{-16,88},{44,88},{44, - 82},{39,82},{39,77.6545}}, + 82},{39,82},{39,77.62}}, color={255,128,0}, thickness=0.5)); connect(electrical.outBusElect, outputs.electrical) annotation (Line( diff --git a/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo b/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo index 490f9fc8..1747ce10 100644 --- a/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo +++ b/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo @@ -2,6 +2,9 @@ within BESMod.Systems.BaseClasses; model PartialFluidSubsystem "Model for a partial subsystem based on the IBPSA fluid core" extends IBPSA.Fluid.Interfaces.LumpedVolumeDeclarations; + parameter Boolean use_openModelica=false + "=true to disable features which + are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Boolean allowFlowReversal=true "= false to simplify equations, assuming, but not enforcing, no flow reversal" diff --git a/BESMod/Systems/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Control/BaseClasses/PartialControl.mo index 68823ca6..2622e89c 100644 --- a/BESMod/Systems/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Control/BaseClasses/PartialControl.mo @@ -1,13 +1,17 @@ within BESMod.Systems.Control.BaseClasses; partial model PartialControl "Model for a partial HEMS control" extends BESMod.Utilities.Icons.ControlIcon; + parameter Boolean use_openModelica=false + "=true to disable features which + are not available in open modelica" annotation(Dialog(tab="Advanced")); Hydraulical.Interfaces.SystemControlBus sigBusHyd annotation (Placement( transformation(extent={{-94,-114},{-64,-88}}), iconTransformation( extent={{-94,-114},{-64,-88}}))); Ventilation.Interfaces.SystemControlBus sigBusVen annotation (Placement( transformation(extent={{64,-114},{96,-86}}), iconTransformation(extent= {{64,-114},{96,-86}}))); - Interfaces.ControlOutputs outBusCtrl annotation (Placement(transformation( + Interfaces.ControlOutputs outBusCtrl if not use_openModelica + annotation (Placement(transformation( extent={{84,-16},{118,16}}), iconTransformation(extent={{84,-16},{118, 16}}))); Electrical.Interfaces.SystemControlBus sigBusEle annotation (Placement( diff --git a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo index c9445fe8..83c56d10 100644 --- a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo +++ b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo @@ -1,7 +1,9 @@ within BESMod.Systems.Demand.Building.BaseClasses; partial model PartialDemand "Partial demand model for HPS" extends BESMod.Utilities.Icons.BuildingIcon; - + parameter Boolean use_openModelica=false + "=true to disable features which + are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nZones(min=1) "Number of zones /rooms"; parameter Modelica.Units.SI.Temperature TSetZone_nominal[nZones]=fill(293.15, nZones) "Nominal room set temerature" @@ -38,7 +40,7 @@ partial model PartialDemand "Partial demand model for HPS" Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPortRad[nZones] "Heat port for radiative heat transfer with room radiation temperature" annotation (Placement(transformation(extent={{-110,-70},{-90,-50}}))); - BESMod.Systems.Interfaces.DemandOutputs outBusDem + BESMod.Systems.Interfaces.DemandOutputs outBusDem if not use_openModelica annotation (Placement(transformation(extent={{88,-12},{108,8}}))); Modelica.Fluid.Interfaces.FluidPort_a portVent_in[nZones]( redeclare final package Medium = MediumZone) diff --git a/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo index 592b3496..dc387679 100644 --- a/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo +++ b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo @@ -19,15 +19,15 @@ partial model PartialDHW "Partial model for domestic hot water (DHW)" parameter Modelica.Units.SI.Time tCrit(displayUnit="h") "Time for critical period. Based on EN 15450" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem", enable=designType <> BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.NoStorage)); parameter Real QCrit "Energy demand in kWh during critical period. Based on EN 15450" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem", enable=designType == BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.PartStorage)); - Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare final package Medium = - Medium) "Inlet for the demand of DHW" annotation (Placement( + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare final package Medium + = Medium) "Inlet for the demand of DHW" annotation (Placement( transformation(extent={{-110,50},{-90,70}}), iconTransformation(extent={{-110,50}, {-90,70}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare final package Medium = - Medium) "Outlet of the demand of DHW" annotation (Placement( + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare final package Medium + = Medium) "Outlet of the demand of DHW" annotation (Placement( transformation(extent={{-110,-70},{-90,-50}}), iconTransformation( extent={{-110,-70},{-90,-50}}))); - BESMod.Systems.Interfaces.DHWOutputs outBusDHW + BESMod.Systems.Interfaces.DHWOutputs outBusDHW if not use_openModelica annotation (Placement(transformation(extent={{90,-10},{110,10}}))); BESMod.Systems.Interfaces.UseProBus useProBus annotation ( diff --git a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo index 0d9f83d1..73ea3336 100644 --- a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo +++ b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo @@ -1,5 +1,8 @@ within BESMod.Systems.Electrical.BaseClasses; partial model PartialElectricalSystem "Partial model for electrical system" + parameter Boolean use_openModelica=false + "=true to disable features which + are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nLoadsExtSubSys(min=1) = 4 "Number of external subsystems which result in electrical load / generation"; parameter Boolean use_elecHeating=true "=false to disable electric heating"; replaceable parameter RecordsCollection.ElectricalSystemBaseDataDefinition @@ -47,6 +50,7 @@ partial model PartialElectricalSystem "Partial model for electrical system" Placement(transformation(extent={{48,124},{92,156}}), iconTransformation( extent={{48,124},{92,156}}))); BESMod.Systems.Interfaces.ElectricalOutputs outBusElect + if not use_openModelica annotation (Placement(transformation(extent={{-22,-160},{24,-120}}), iconTransformation(extent={{-22,-160},{24,-120}}))); Interfaces.ExternalElectricalPin externalElectricalPin1 @@ -98,7 +102,7 @@ equation extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); connect(distribution.OutputDistr, outBusElect.dis) annotation (Line( - points={{6,-100.62},{4,-100.62},{4,-139.9},{1.115,-139.9}}, + points={{6,-100.62},{4,-100.62},{4,-140},{1,-140}}, color={175,175,175}, thickness=0.5), Text( string="%second", @@ -107,7 +111,7 @@ equation horizontalAlignment=TextAlignment.Right)); connect(generation.outBusGen, outBusElect.gen) annotation (Line( - points={{-105,-101.31},{-105,-139.9},{1.115,-139.9}}, + points={{-105,-101.31},{-105,-140},{1,-140}}, color={175,175,175}, thickness=0.5)); connect(distribution.externalElectricalPin, externalElectricalPin1) @@ -148,7 +152,7 @@ equation color={215,215,215}, thickness=0.5)); connect(transfer.transferOutputs, outBusElect.tra) annotation (Line( - points={{106,-101.31},{106,-139.9},{1.115,-139.9}}, + points={{106,-101.31},{106,-140},{1,-140}}, color={175,175,175}, thickness=0.5), Text( string="%second", @@ -164,8 +168,7 @@ equation connect(zeroTraLoad.internalElectricalPin, distribution.internalElectricalPin[1]); end if; connect(control.controlOutputs, outBusElect.ctrl) annotation (Line( - points={{141.4,81.25},{141.4,-24},{142,-24},{142,-130},{1.115,-130},{1.115, - -139.9}}, + points={{141.4,81.25},{141.4,-24},{142,-24},{142,-130},{1,-130},{1,-140}}, color={175,175,175}, thickness=0.5)); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-180,-140}, diff --git a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo index 01f27121..d978e071 100644 --- a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo +++ b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo @@ -165,7 +165,7 @@ partial model PartialHydraulicSystem IBPSA.BoundaryConditions.WeatherData.Bus weaBus "Weather data bus" annotation (Placement(transformation(extent={{-200,56}, {-158,100}}), iconTransformation(extent={{-188,-10},{-168,10}}))); - BESMod.Systems.Interfaces.HydraulicOutputs outBusHyd + BESMod.Systems.Interfaces.HydraulicOutputs outBusHyd if not use_openModelica annotation (Placement(transformation(extent={{-30,-166},{28,-118}}))); Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPortCon[hydraulicSystemParameters.nZones] @@ -228,7 +228,7 @@ equation -22.4},{200,-22.4},{200,0}}, color={191,0,0})); connect(distribution.outBusDist, outBusHyd.dis) annotation (Line( - points={{39,-104},{39,-141.88},{-0.855,-141.88}}, + points={{39,-104},{39,-142},{-1,-142}}, color={135,135,135}, thickness=0.5), Text( string="%second", @@ -236,7 +236,7 @@ equation extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); connect(generation.outBusGen, outBusHyd.gen) annotation (Line( - points={{-82,-104},{-82,-141.88},{-0.855,-141.88}}, + points={{-82,-104},{-82,-142},{-1,-142}}, color={135,135,135}, thickness=0.5), Text( string="%second", @@ -244,7 +244,7 @@ equation extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); connect(transfer.outBusTra, outBusHyd.tra) annotation (Line( - points={{146,-45.44},{146,-68},{214,-68},{214,-141.88},{-0.855,-141.88}}, + points={{146,-45.44},{146,-68},{214,-68},{214,-142},{-1,-142}}, color={135,135,135}, thickness=0.5), Text( string="%second", @@ -252,7 +252,7 @@ equation extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); connect(control.outBusCtrl, outBusHyd.ctrl) annotation (Line( - points={{154,88},{214,88},{214,-141.88},{-0.855,-141.88}}, + points={{154,88},{214,88},{214,-142},{-1,-142}}, color={135,135,135}, thickness=0.5), Text( string="%second", diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo index 62c4a732..9fad932c 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo @@ -2,7 +2,7 @@ within BESMod.Systems.Hydraulical.Transfer.Tests; model TestIdealValveRadiatorSystem extends BESMod.Systems.Hydraulical.Transfer.Tests.PartialTest( redeclare - BESMod.Systems.Hydraulical.Transfer.RadiatorTransferSystem + BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator transfer(redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare diff --git a/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo b/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo index f4848e11..1ddf8ef9 100644 --- a/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo +++ b/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo @@ -90,7 +90,8 @@ partial model PartialVentilationSystem final TOda_nominal=ventilationSystemParameters.TOda_nominal, final QLoss_flow_nominal=distribution.QLoss_flow_nominal)) annotation (choicesAllMatching=true, Placement(transformation(extent={{-26,22},{28,68}}))); - BESMod.Systems.Interfaces.VentilationOutputs outBusVen + BESMod.Systems.Interfaces.VentilationOutputs outBusVen if not + use_openModelica annotation (Placement(transformation(extent={{-10,-110},{10,-90}}))); IBPSA.BoundaryConditions.WeatherData.Bus weaBus "Weather data bus" annotation (Placement(transformation(extent={{88,60}, From 8304015c9c4159a2ad7cc6a45fb58cf242564e41 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sun, 23 Oct 2022 15:33:31 +0200 Subject: [PATCH 065/131] Improve OM coverage. --- BESMod/Examples/UseCaseAachen/BES.mo | 1 - .../PartialBuildingEnergySystem.mo | 32 +-- .../BaseClasses/PartialFluidSubsystem.mo | 2 +- .../Control/BaseClasses/PartialControl.mo | 2 +- .../Building/BaseClasses/PartialDemand.mo | 2 +- .../Demand/Building/BuildingsRoomCase600FF.mo | 4 +- .../Building/HeatDemand/CalcHeaDemHOM.mo | 2 +- .../Demand/Building/TEASERThermalZone.mo | 52 ++--- .../Demand/DHW/BaseClasses/PartialDHW.mo | 8 +- BESMod/Systems/Demand/DHW/DHW.mo | 7 +- .../BaseClasses/PartialElectricalSystem.mo | 14 +- .../Control/BaseClasses/PartialControl.mo | 6 +- .../BaseClasses/PartialDistribution.mo | 6 +- .../Distribution/Tests/BatterySystemSimple.mo | 4 +- .../BaseClasses/PartialGeneration.mo | 7 +- .../Electrical/Generation/PVSystemMultiSub.mo | 10 +- .../Transfer/BaseClasses/PartialTransfer.mo | 8 +- .../BaseClasses/PartialHydraulicSystem.mo | 19 +- .../Control/BaseClasses/PartialControl.mo | 6 +- .../PartialTwoPoint_HPS_Controller.mo | 55 +++--- .../Control/Biv_PI_ConFlow_HPSController.mo | 2 +- .../Components/HeatPumpBusPassThrough.mo | 80 ++++++++ .../Control/Components/package.order | 1 + .../Control/ConstHys_OnOff_HPSControll.mo | 2 +- .../ConstHys_PI_ConOut_HPSController.mo | 2 +- .../Control/ConstHys_P_ConIn_HPSController.mo | 2 +- .../ConstHys_P_ConOut_HPSController.mo | 2 +- .../Control/PartBiv_PI_ConOut_HPS.mo | 2 +- .../BaseClasses/PartialDistribution.mo | 2 +- ...lDistributionTwoStorageParallelDetailed.mo | 35 +--- .../Hydraulical/Distribution/CombiStorage.mo | 7 +- .../DistributionTwoStorageParallel.mo | 14 +- .../Distribution/Tests/TestCombiStorage.mo | 12 -- .../Distribution/Tests/TestDirectLoading.mo | 8 +- .../Distribution/Tests/TestIndirectLoading.mo | 8 +- .../Distribution/Tests/TestOnlyDHW.mo | 12 -- .../BaseClasses/PartialGeneration.mo | 2 +- .../Generation/ElectricalHeater.mo | 6 +- .../Hydraulical/Generation/GasBoiler.mo | 6 +- .../Generation/HeatPumpAndHeatingRod.mo | 182 ++++++++++-------- .../Generation/SolarThermalBivHP.mo | 14 +- .../Generation/SolarThermalBivHPBuiLib.mo | 11 +- .../Hydraulical/Generation/Tests/GasBoiler.mo | 6 + .../Generation/Tests/HeatPumpAndHeatingRod.mo | 29 +-- .../SolarThermalAndHeatPumpAndHeatingRod.mo | 26 +-- .../Transfer/BaseClasses/PartialTransfer.mo | 5 +- .../Transfer/IdealValveRadiator.mo | 33 +--- .../Hydraulical/Transfer/Tests/PartialTest.mo | 6 +- .../Hydraulical/Transfer/UFHTransferSystem.mo | 14 +- BESMod/Systems/Interfaces/UseProBus.mo | 5 + .../UserProfiles/AixLibHighOrderProfiles.mo | 96 ++++----- .../Systems/UserProfiles/Case600Profiles.mo | 34 ++-- BESMod/Systems/UserProfiles/NoUser.mo | 7 +- .../BaseClasses/PartialVentilationSystem.mo | 38 ++-- .../Control/BaseClasses/PartialControl.mo | 5 +- .../BaseClasses/PartialDistribution.mo | 5 +- .../BaseClasses/PartialGeneration.mo | 5 +- .../PartialGetHeatGenerationCurve.mo | 28 +-- ...PICalculator.mo => EnergyKPICalculator.mo} | 20 +- BESMod/Utilities/KPIs/package.order | 2 +- 60 files changed, 511 insertions(+), 512 deletions(-) create mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpBusPassThrough.mo rename BESMod/Utilities/KPIs/{IntegralKPICalculator.mo => EnergyKPICalculator.mo} (72%) diff --git a/BESMod/Examples/UseCaseAachen/BES.mo b/BESMod/Examples/UseCaseAachen/BES.mo index 96809eba..23bc203e 100644 --- a/BESMod/Examples/UseCaseAachen/BES.mo +++ b/BESMod/Examples/UseCaseAachen/BES.mo @@ -1,7 +1,6 @@ within BESMod.Examples.UseCaseAachen; model BES extends Systems.BaseClasses.PartialBuildingEnergySystem( - use_openModelica=true, redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( diff --git a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo index 2785829c..8d69a2c4 100644 --- a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo +++ b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo @@ -1,7 +1,7 @@ within BESMod.Systems.BaseClasses; partial model PartialBuildingEnergySystem "Partial BES" - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); @@ -162,12 +162,12 @@ protected equation connect(building.weaBus, weaDat.weaBus) annotation (Line( - points={{17.54,78.76},{24,78.76},{24,88},{-16,88},{-16,206},{-214,206},{-214, - 70},{-220,70}}, + points={{17.54,78.475},{24,78.475},{24,88},{-16,88},{-16,206},{-214,206}, + {-214,70},{-220,70}}, color={255,204,51}, thickness=0.5)); connect(building.outBusDem, outputs.building) annotation (Line( - points={{75.26,39.24},{75.26,38},{96,38},{96,0},{285,0}}, + points={{75.26,53.775},{75.26,38},{96,38},{96,0},{285,0}}, color={175,175,175}, thickness=0.5), Text( string="%second", @@ -181,8 +181,8 @@ equation if systemParameters.use_hydraulic then connect(building.buiMeaBus, hydraulic.buiMeaBus) annotation (Line( - points={{39,77.62},{44,77.62},{44,88},{-26,88},{-26,10},{-86.7474,10},{ - -86.7474,-2.34286}}, + points={{39,77.7625},{44,77.7625},{44,88},{-26,88},{-26,10},{-86.7474,10}, + {-86.7474,-2.34286}}, color={255,128,0}, thickness=0.5)); connect(weaDat.weaBus, hydraulic.weaBus) annotation (Line( @@ -199,11 +199,11 @@ equation extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); connect(hydraulic.heatPortRad,building.heatPortRad) annotation (Line( - points={{-42,-50},{-42,-48},{-18,-48},{-18,18},{0,18},{0,17.2},{2,17.2}}, + points={{-42,-50},{-42,-48},{-18,-48},{-18,18},{0,18},{0,40},{2,40}}, color={191, 0,0})); connect(hydraulic.heatPortCon,building.heatPortCon) annotation (Line( - points={{-42,-23.2571},{-42,-24},{-20,-24},{-20,62.8},{2,62.8}},color= + points={{-42,-23.2571},{-42,-24},{-20,-24},{-20,68.5},{2,68.5}},color= {191,0,0})); connect(userProfiles.useProBus, hydraulic.useProBus) annotation (Line( points={{-225.167,150.775},{-214,150.775},{-214,16},{-157.358,16},{ @@ -252,9 +252,9 @@ equation if systemParameters.use_ventilation then connect(building.portVent_in, ventilation.portVent_in) annotation (Line( - points={{76,54.44},{84,54.44},{84,55.2},{122,55.2}}, color={0,127,255})); + points={{76,63.275},{84,63.275},{84,55.2},{122,55.2}}, color={0,127,255})); connect(building.portVent_out, ventilation.portVent_out) annotation (Line( - points={{76,24.8},{84,24.8},{84,25.56},{122,25.56}}, + points={{76,44.75},{84,44.75},{84,25.56},{122,25.56}}, color={0,127,255})); connect(ventilation.outBusVen, outputs.ventilation) annotation (Line( points={{159,2},{158,2},{158,-26},{244,-26},{244,0},{285,0}}, @@ -274,7 +274,7 @@ equation color={0,127,0}, thickness=0.5)); connect(building.buiMeaBus, ventilation.buiMeaBus) annotation (Line( - points={{39,77.62},{44,77.62},{44,88},{177.87,88},{177.87,78.38}}, + points={{39,77.7625},{44,77.7625},{44,88},{177.87,88},{177.87,78.38}}, color={255,128,0}, thickness=0.5)); connect(control.sigBusVen, ventilation.sigBusVen) annotation (Line( @@ -293,15 +293,15 @@ equation connect(building.internalElectricalPin, electrical.internalElectricalPin[4]) annotation (Line( - points={{64.9,3.52},{64.9,-26},{112,-26},{112,-140},{-210,-140},{-210,118}, - {-198,118},{-198,118.171}}, + points={{64.9,31.45},{64.9,-26},{112,-26},{112,-140},{-210,-140},{-210, + 118},{-198,118},{-198,118.171}}, color={0,0,0}, thickness=1)); if systemParameters.use_elecHeating then connect(electrical.heatPortCon, building.heatPortCon) annotation (Line(points={{ - -41.0824,92.8},{-30,92.8},{-30,62.8},{2,62.8}}, color={191,0,0})); + -41.0824,92.8},{-30,92.8},{-30,68.5},{2,68.5}}, color={191,0,0})); connect(electrical.heatPortRad, building.heatPortRad) annotation (Line(points={{ - -41.0824,67.4286},{-24,67.4286},{-24,17.2},{2,17.2}}, + -41.0824,67.4286},{-24,67.4286},{-24,40},{2,40}}, color={191,0,0})); end if; connect(control.outBusCtrl, outputs.control) annotation (Line( @@ -318,7 +318,7 @@ equation thickness=0.5)); connect(electrical.buiMeaBus, building.buiMeaBus) annotation (Line( points={{-83.2941,136},{-82,136},{-82,146},{-16,146},{-16,88},{44,88},{44, - 82},{39,82},{39,77.62}}, + 82},{39,82},{39,77.7625}}, color={255,128,0}, thickness=0.5)); connect(electrical.outBusElect, outputs.electrical) annotation (Line( diff --git a/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo b/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo index 1747ce10..959f3ad7 100644 --- a/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo +++ b/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo @@ -2,7 +2,7 @@ within BESMod.Systems.BaseClasses; model PartialFluidSubsystem "Model for a partial subsystem based on the IBPSA fluid core" extends IBPSA.Fluid.Interfaces.LumpedVolumeDeclarations; - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); diff --git a/BESMod/Systems/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Control/BaseClasses/PartialControl.mo index 2622e89c..5b7aee40 100644 --- a/BESMod/Systems/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Control/BaseClasses/PartialControl.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Control.BaseClasses; partial model PartialControl "Model for a partial HEMS control" extends BESMod.Utilities.Icons.ControlIcon; - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); Hydraulical.Interfaces.SystemControlBus sigBusHyd annotation (Placement( diff --git a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo index 83c56d10..bd6512c8 100644 --- a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo +++ b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Demand.Building.BaseClasses; partial model PartialDemand "Partial demand model for HPS" extends BESMod.Utilities.Icons.BuildingIcon; - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nZones(min=1) "Number of zones /rooms"; diff --git a/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo b/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo index 8a326473..85e77a1f 100644 --- a/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo +++ b/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo @@ -230,8 +230,8 @@ equation points={{-3.25,3},{-3.25,2},{-2,2},{-2,44},{-1,44},{-1,50}}, color={191,0,0}, smooth=Smooth.None)); - connect(roo.qGai_flow, useProBus.intGains) annotation (Line(points={{32.8,16.2}, - {50,16.2},{50,84},{51,84},{51,101}}, + connect(roo.qGai_flow, useProBus.intGains) annotation (Line(points={{32.8, + 16.2},{50,16.2},{50,84},{51.135,84},{51.135,101.095}}, color={0,0,127}), Text( string="%second", index=1, diff --git a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo index 50059828..e9fd0197 100644 --- a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo +++ b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Demand.Building.HeatDemand; model CalcHeaDemHOM "Calculate the heat demand for a high order model from AixLib library" - + extends Modelica.Icons.Example; parameter Integer TIR=1 "Thermal Insulation Regulation" annotation (Dialog( group="Construction parameters", compact=true, diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index e0042211..6b0b0020 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -46,18 +46,14 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=180, origin={74,30}))); - BESMod.Utilities.KPIs.IntegralKPICalculator intKPICalTraGain[nZones]( - final unit=fill("W", nZones), - final intUnit=fill("J", nZones), - each final use_inpCon=true) if use_hydraulic and use_verboseEnergyBalance + 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.IntegralKPICalculator intKPICalTraLoss[nZones]( - final unit=fill("W", nZones), - final intUnit=fill("J", nZones), - each final use_inpCon=true) if use_hydraulic and use_verboseEnergyBalance + 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, @@ -68,19 +64,15 @@ model TEASERThermalZone 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.IntegralKPICalculator intKPICal[nZones]( - final unit=fill("W", nZones), - final intUnit=fill("J", nZones), - each final use_inpCon=true) if use_verboseEnergyBalance annotation ( - Placement(transformation( + 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,-110}))); - BESMod.Utilities.KPIs.IntegralKPICalculator intKPICalVentGain[nZones]( - final unit=fill("W", nZones), - final intUnit=fill("J", nZones), - each final use_inpCon=true) if use_ventilation and - use_verboseEnergyBalance annotation (Placement(transformation( + 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}))); @@ -92,11 +84,9 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=180, origin={90,-196}))); - BESMod.Utilities.KPIs.IntegralKPICalculator intKPICalVentLoss[nZones]( - final unit=fill("W", nZones), - final intUnit=fill("J", nZones), - each final use_inpCon=true) if use_ventilation and - use_verboseEnergyBalance annotation (Placement(transformation( + 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}))); @@ -112,11 +102,9 @@ model TEASERThermalZone annotation (Placement(transformation(extent={{-9,-9},{9,9}}, rotation=180, origin={63,-205}))); - BESMod.Utilities.KPIs.IntegralKPICalculator intKPICalTraGain2[nZones]( - final unit=fill("W", nZones), - final intUnit=fill("J", nZones), - each final use_inpCon=true) if use_verboseEnergyBalance annotation ( - Placement(transformation( + 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}))); @@ -126,11 +114,9 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=0, origin={-90,-166}))); - BESMod.Utilities.KPIs.IntegralKPICalculator intKPICalTraLoss2[nZones]( - final unit=fill("W", nZones), - final intUnit=fill("J", nZones), - each final use_inpCon=true) if use_verboseEnergyBalance annotation ( - Placement(transformation( + 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}))); diff --git a/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo index dc387679..d80155da 100644 --- a/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo +++ b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo @@ -19,12 +19,12 @@ partial model PartialDHW "Partial model for domestic hot water (DHW)" parameter Modelica.Units.SI.Time tCrit(displayUnit="h") "Time for critical period. Based on EN 15450" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem", enable=designType <> BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.NoStorage)); parameter Real QCrit "Energy demand in kWh during critical period. Based on EN 15450" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem", enable=designType == BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.PartStorage)); - Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare final package Medium - = Medium) "Inlet for the demand of DHW" annotation (Placement( + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare final package Medium = + Medium) "Inlet for the demand of DHW" annotation (Placement( transformation(extent={{-110,50},{-90,70}}), iconTransformation(extent={{-110,50}, {-90,70}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare final package Medium - = Medium) "Outlet of the demand of DHW" annotation (Placement( + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare final package Medium = + Medium) "Outlet of the demand of DHW" annotation (Placement( transformation(extent={{-110,-70},{-90,-50}}), iconTransformation( extent={{-110,-70},{-90,-50}}))); BESMod.Systems.Interfaces.DHWOutputs outBusDHW if not use_openModelica diff --git a/BESMod/Systems/Demand/DHW/DHW.mo b/BESMod/Systems/Demand/DHW/DHW.mo index fa4d0ea8..c0475dee 100644 --- a/BESMod/Systems/Demand/DHW/DHW.mo +++ b/BESMod/Systems/Demand/DHW/DHW.mo @@ -41,11 +41,8 @@ Modelica.Blocks.Math.UnitConversions.From_degC fromDegC extent={{10,-10},{-10,10}}, rotation=0, origin={30,-10}))); - Utilities.KPIs.IntegralKPICalculator integralKPICalculator( - use_inpCon=false, - unit="W", - intUnit="J", - y=-port_b.m_flow*cp*(TIs.y - TDHWCold_nominal)) + Utilities.KPIs.EnergyKPICalculator integralKPICalculator(use_inpCon=false, y= + -port_b.m_flow*cp*(TIs.y - TDHWCold_nominal)) annotation (Placement(transformation(extent={{60,-60},{80,-40}}))); IBPSA.Fluid.Movers.FlowControlled_m_flow pump( redeclare final package Medium = Medium, diff --git a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo index 73ea3336..1c360e29 100644 --- a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo +++ b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.BaseClasses; partial model PartialElectricalSystem "Partial model for electrical system" - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nLoadsExtSubSys(min=1) = 4 "Number of external subsystems which result in electrical load / generation"; @@ -12,12 +12,14 @@ partial model PartialElectricalSystem "Partial model for electrical system" replaceable Distribution.BaseClasses.PartialDistribution distribution constrainedby Distribution.BaseClasses.PartialDistribution(nSubSys= - nLoadsExtSubSys + 2) + nLoadsExtSubSys + 2, + final use_openModelica=use_openModelica) annotation (choicesAllMatching=true, Placement(transformation(extent={{-40, -102},{52,36}}))); replaceable Generation.BaseClasses.PartialGeneration generation constrainedby - BESMod.Systems.Electrical.Generation.BaseClasses.PartialGeneration + BESMod.Systems.Electrical.Generation.BaseClasses.PartialGeneration( + final use_openModelica=use_openModelica) annotation (choicesAllMatching=true, Placement(transformation(extent={{-148, -102},{-62,36}}))); AixLib.BoundaryConditions.WeatherData.Bus weaBus annotation (Placement( @@ -25,11 +27,13 @@ partial model PartialElectricalSystem "Partial model for electrical system" {{-200,24},{-160,66}}))); replaceable Transfer.BaseClasses.PartialTransfer transfer if use_elecHeating constrainedby Transfer.BaseClasses.PartialTransfer(final nParallelDem= - electricalSystemParameters.nZones) + electricalSystemParameters.nZones, + final use_openModelica=use_openModelica) annotation (choicesAllMatching=true, Placement(transformation(extent={{68,-102}, {144,36}}))); replaceable Control.BaseClasses.PartialControl control constrainedby - BESMod.Systems.Electrical.Control.BaseClasses.PartialControl + BESMod.Systems.Electrical.Control.BaseClasses.PartialControl( + final use_openModelica=use_openModelica) annotation (choicesAllMatching=true, Placement(transformation(extent={{-146, 56},{142,106}}))); Interfaces.InternalElectricalPinIn internalElectricalPin[nLoadsExtSubSys] diff --git a/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo index fac3d2b6..3163a94c 100644 --- a/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo @@ -1,5 +1,8 @@ within BESMod.Systems.Electrical.Control.BaseClasses; partial model PartialControl "Partial electrical control model" + parameter Boolean use_openModelica=true + "=true to disable features which + are not available in open modelica" annotation(Dialog(tab="Advanced")); Interfaces.GenerationControlBus generationControlBus annotation (Placement( transformation(extent={{-182,-118},{-158,-78}}), iconTransformation( @@ -7,7 +10,8 @@ partial model PartialControl "Partial electrical control model" Interfaces.DistributionControlBus distributionControlBus annotation ( Placement(transformation(extent={{0,-118},{22,-80}}), iconTransformation(extent={{0,-118},{22,-80}}))); - Interfaces.ControlOutputs controlOutputs annotation (Placement(transformation( + Interfaces.ControlOutputs controlOutputs if not use_openModelica + annotation (Placement(transformation( extent={{228,-18},{250,20}}), iconTransformation(extent={{228,-18},{ 250,20}}))); Interfaces.TransferControlBus transferControlBus annotation (Placement( diff --git a/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo b/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo index f07c3629..01ad6213 100644 --- a/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo +++ b/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo @@ -1,8 +1,12 @@ within BESMod.Systems.Electrical.Distribution.BaseClasses; partial model PartialDistribution + parameter Boolean use_openModelica=true + "=true to disable features which + are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nSubSys(min=2) "Number of subsystems with electrical load / generation"; - Interfaces.DistributionOutputs OutputDistr annotation (Placement( + Interfaces.DistributionOutputs OutputDistr if not use_openModelica + annotation (Placement( transformation(extent={{-10,-108},{10,-88}}), iconTransformation(extent= {{-10,-108},{10,-88}}))); Interfaces.DistributionControlBus sigBusDistr annotation (Placement( diff --git a/BESMod/Systems/Electrical/Distribution/Tests/BatterySystemSimple.mo b/BESMod/Systems/Electrical/Distribution/Tests/BatterySystemSimple.mo index 3767e502..7ace8a18 100644 --- a/BESMod/Systems/Electrical/Distribution/Tests/BatterySystemSimple.mo +++ b/BESMod/Systems/Electrical/Distribution/Tests/BatterySystemSimple.mo @@ -26,8 +26,10 @@ model BatterySystemSimple offset=2000) annotation (Placement(transformation(extent={{-86,48},{-62,72}}))); Modelica.Blocks.Interfaces.RealOutput SOC + if not batterySystemSimple.use_openModelica annotation (Placement(transformation(extent={{54,-98},{74,-78}}))); Interfaces.DistributionOutputs OutputDistr1 + if not batterySystemSimple.use_openModelica annotation (Placement(transformation(extent={{-6,-70},{14,-50}}))); Modelica.Blocks.Interfaces.RealOutput PGrid "Electrical power" annotation (Placement(transformation(extent={{88,-72},{108,-52}}))); @@ -37,7 +39,7 @@ equation points={{22,-35.26},{22,-60.7},{44.3,-60.7}}, color={0,0,0}, thickness=1)); - connect(batterySystemSimple.OutputDistr, OutputDistr1.SOCBat) annotation ( + connect(batterySystemSimple.OutputDistr, OutputDistr1) annotation ( Line( points={{4,-35.26},{4,-60}}, color={255,204,51}, diff --git a/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo b/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo index 785c4d9b..a2d5196d 100644 --- a/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo +++ b/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo @@ -1,7 +1,9 @@ within BESMod.Systems.Electrical.Generation.BaseClasses; partial model PartialGeneration "Basic model with interfaces for electrical generation package" - + parameter Boolean use_openModelica=true + "=true to disable features which + are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer numGenUnits(min=1) "Number of generation (e.g. PV module) units" annotation(Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem")); parameter Real f_design[numGenUnits]=fill(0.8, numGenUnits) "Over-/undersizing factor relative to maximum capacity, e.g., roof area" @@ -9,7 +11,8 @@ partial model PartialGeneration IBPSA.BoundaryConditions.WeatherData.Bus weaBus annotation (Placement( transformation(extent={{-120,44},{-80,84}}), iconTransformation(extent={{-110,66}, {-90,86}}))); - Interfaces.GenerationOutputs outBusGen annotation (Placement(transformation( + Interfaces.GenerationOutputs outBusGen if not use_openModelica + annotation (Placement(transformation( extent={{-14,-112},{14,-86}}), iconTransformation(extent={{-14,-112}, {14,-86}}))); Interfaces.GenerationControlBus controlBusGen annotation (Placement( diff --git a/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo b/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo index fc7fa081..66237179 100644 --- a/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo +++ b/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo @@ -19,8 +19,9 @@ model PVSystemMultiSub each final groRef=0.2, each final use_ParametersGlaz=false) annotation (Placement(transformation(extent={{-32,-30},{26,28}}))); - Modelica.Blocks.Math.Sum sumOfPower(nin=numGenUnits) - "Sums up DC Output power" annotation ( + Modelica.Blocks.Math.Sum sumOfPower(nin=numGenUnits, + y(unit="W"), + u(each unit="W")) "Sums up DC Output power" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, @@ -54,10 +55,7 @@ model PVSystemMultiSub parameter Modelica.Units.SI.Angle azi[numGenUnits]=fill(0*Modelica.Constants.pi/180,numGenUnits) "Surface's azimut angle (0:South)"; parameter Modelica.Units.SI.Area ARoof(min=0) "Roof area of building" annotation(Dialog(group="Design - Top Down: Parameters are given by the parent system")); - Utilities.KPIs.IntegralKPICalculator intKPICalPElePV( - use_inpCon=true, - unit="W", - intUnit="J") + Utilities.KPIs.EnergyKPICalculator intKPICalPElePV(use_inpCon=true) annotation (Placement(transformation(extent={{60,-60},{80,-40}}))); equation for i in 1:numGenUnits loop diff --git a/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo b/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo index b9ed08d9..b986fc05 100644 --- a/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo +++ b/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo @@ -1,9 +1,13 @@ within BESMod.Systems.Electrical.Transfer.BaseClasses; partial model PartialTransfer "Partial model for transfer subsystems" - parameter Integer nParallelDem(min=1) + parameter Boolean use_openModelica=true + "=true to disable features which + are not available in open modelica" annotation(Dialog(tab="Advanced")); + parameter Integer nParallelDem(min=1) "Number of parallel demand systems of this system"; - Interfaces.TransferOutputs transferOutputs annotation (Placement( + Interfaces.TransferOutputs transferOutputs if not use_openModelica + annotation (Placement( transformation(extent={{-16,-114},{16,-84}}), iconTransformation(extent= {{-16,-114},{16,-84}}))); Interfaces.TransferControlBus transferControlBus annotation (Placement( diff --git a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo index d978e071..64d78396 100644 --- a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo +++ b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo @@ -37,7 +37,8 @@ partial model PartialHydraulicSystem final allowFlowReversal=allowFlowReversal, final show_T=show_T, final rho=rho, - final cp=cp) annotation ( + final cp=cp, + final use_openModelica=use_openModelica) annotation ( choicesAllMatching=true, Placement(transformation(extent={{-140,-104},{-24, 28}}))); replaceable BESMod.Systems.Hydraulical.Control.BaseClasses.PartialControl control @@ -89,7 +90,8 @@ partial model PartialHydraulicSystem final dp_nominal=transfer.dp_nominal, final dTLoss_nominal=transfer.dTLoss_nominal, final f_design=transfer.f_design, - final QLoss_flow_nominal=transfer.QLoss_flow_nominal)) + final QLoss_flow_nominal=transfer.QLoss_flow_nominal), + final use_openModelica=use_openModelica) annotation (choicesAllMatching=true, Placement(transformation(extent={{-132,54}, {154,122}}))); replaceable BESMod.Systems.Hydraulical.Distribution.BaseClasses.PartialDistribution distribution( @@ -130,11 +132,12 @@ partial model PartialHydraulicSystem final TDHWCold_nominal=hydraulicSystemParameters.TDHWCold_nominal, final TDHW_nominal=hydraulicSystemParameters.TDHW_nominal, tCrit=hydraulicSystemParameters.tCrit, - QCrit=hydraulicSystemParameters.QCrit) annotation (choicesAllMatching=true, + QCrit=hydraulicSystemParameters.QCrit, + final use_openModelica=use_openModelica) annotation (choicesAllMatching=true, Placement(transformation(extent={{-12,-104},{90,28}}))); - replaceable BESMod.Systems.Hydraulical.Transfer.BaseClasses.PartialTransfer transfer( - dp_nominal=fill(0, transfer.nParallelDem)) constrainedby + replaceable BESMod.Systems.Hydraulical.Transfer.BaseClasses.PartialTransfer + transfer(dp_nominal=fill(0, transfer.nParallelDem)) constrainedby Transfer.BaseClasses.PartialTransfer( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, @@ -159,9 +162,9 @@ partial model PartialHydraulicSystem final allowFlowReversal=allowFlowReversal, final show_T=show_T, final rho=rho, - final cp=cp) annotation ( - choicesAllMatching=true, Placement(transformation(extent={{112,-44},{180, - 28}}))); + final cp=cp, + final use_openModelica=use_openModelica) annotation (choicesAllMatching=true, Placement(transformation( + extent={{112,-44},{180,28}}))); IBPSA.BoundaryConditions.WeatherData.Bus weaBus "Weather data bus" annotation (Placement(transformation(extent={{-200,56}, {-158,100}}), iconTransformation(extent={{-188,-10},{-168,10}}))); diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo index 84a726c2..7305a0c4 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo @@ -2,7 +2,9 @@ within BESMod.Systems.Hydraulical.Control.BaseClasses; partial model PartialControl "Partial controller for HPS" extends BESMod.Utilities.Icons.ControlIcon; parameter Boolean use_dhw "=false to disable DHW"; - + parameter Boolean use_openModelica=true + "=true to disable features which + are not available in open modelica" annotation(Dialog(tab="Advanced")); BESMod.Systems.Hydraulical.Interfaces.GenerationControlBus sigBusGen @@ -11,7 +13,7 @@ partial model PartialControl "Partial controller for HPS" sigBusDistr annotation (Placement(transformation(extent={{-22,-128},{24,-72}}))); BESMod.Systems.Hydraulical.Interfaces.ControlOutputs - outBusCtrl + outBusCtrl if not use_openModelica annotation (Placement(transformation(extent={{230,-10},{250,10}}))); IBPSA.BoundaryConditions.WeatherData.Bus weaBus "Weather data bus" annotation (Placement(transformation(extent={{-258, diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo index 3e6106bc..ccc098d2 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo @@ -94,11 +94,6 @@ partial model PartialTwoPoint_HPS_Controller extent={{-7,-7},{7,7}}, rotation=0, origin={155,69}))); - Modelica.Blocks.Sources.Constant hp_iceFac(final k=1) annotation (Placement( - transformation( - extent={{-7,-7},{7,7}}, - rotation=0, - origin={-181,-85}))); Modelica.Blocks.Logical.Switch switchHR annotation (Placement(transformation( extent={{-5,-5},{5,5}}, @@ -153,6 +148,11 @@ partial model PartialTwoPoint_HPS_Controller extent={{-10,-10},{10,10}}, rotation=270, origin={-170,-24}))); + Components.HeatPumpBusPassThrough heatPumpBusPassThrough annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-230,-90}))); equation connect(BufferOnOffController.T_Top, sigBusDistr.TStoBufTopMea) annotation ( Line(points={{-126.8,47.9},{-128,47.9},{-128,48},{-130,48},{-130,-86},{4,-86}, @@ -200,38 +200,16 @@ equation connect(TSet_DHW.y, HRactive.u[3]) annotation (Line(points={{-190.8,71.04},{ -96,71.04},{-96,26.1667},{10,26.1667}}, color= {255,0,255})); - connect(securityControl.sigBusHP, sigBusGen.hp_bus) annotation (Line( - points={{192,69.27},{180,69.27},{180,70},{184,70},{184,-54},{-152,-54},{-152, - -99}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(securityControl.modeOut, sigBusGen.hp_bus.modeSet) - annotation (Line(points={{227.333,77.6},{268,77.6},{268,-136},{-152,-136},{ - -152,-99}}, color={255,0,255}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); + connect(securityControl.modeSet, hp_mode.y) annotation (Line(points={{191.867, 77.6},{168,77.6},{168,69},{162.7,69}}, color={255,0,255})); - connect(securityControl.nOut, sigBusGen.hp_bus.nSet) annotation (Line( + connect(securityControl.nOut, sigBusGen.yHeaPumSet) annotation (Line( points={{227.333,84.4},{264,84.4},{264,-132},{-42,-132},{-42,-99},{-152, -99}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(hp_iceFac.y, sigBusGen.hp_bus.iceFacMea) annotation (Line( - points={{-173.3,-85},{-156.65,-85},{-156.65,-99},{-152,-99}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(HP_nSet_Controller.n_Set, securityControl.nSet) annotation (Line( points={{113.5,78},{144,78},{144,84.4},{191.867,84.4}}, color={0,0,127})); connect(BufferOnOffController.HP_On, HP_active.u2) annotation (Line(points={{-108.88, @@ -279,7 +257,7 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(HP_nSet_Controller.IsOn, sigBusGen.hp_bus.onOffMea) annotation (Line( + connect(HP_nSet_Controller.IsOn, sigBusGen.heaPumIsOn) annotation (Line( points={{88,61.2},{88,-58},{-152,-58},{-152,-99}}, color={255,0,255}), Text( string="%second", @@ -372,13 +350,28 @@ equation connect(HP_or_HR_active.u1, HRactive.y) annotation (Line(points={{-170,-12},{ -134,-12},{-134,-6},{-6,-6},{-6,18},{20.75,18},{20.75,25}}, color={ 255,0,255})); - connect(HP_or_HR_active.u2, sigBusGen.hp_bus.onOffMea) annotation (Line( + connect(HP_or_HR_active.u2, sigBusGen.heaPumIsOn) annotation (Line( points={{-178,-12},{-194,-12},{-194,-99},{-152,-99}}, color={255,0,255}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); + connect(heatPumpBusPassThrough.sigBusGen, sigBusGen) annotation (Line( + points={{-220,-90},{-200,-90},{-200,-80},{-180,-80},{-180,-72},{-152,-72}, + {-152,-99}}, + color={255,204,51}, + thickness=0.5), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(heatPumpBusPassThrough.vapourCompressionMachineControlBus, + securityControl.sigBusHP) annotation (Line( + points={{-240.2,-89.8},{-252,-89.8},{-252,-80},{72,-80},{72,-38},{192,-38}, + {192,69.27},{192,69.27}}, + color={255,204,51}, + thickness=0.5)); annotation (Diagram(graphics={ Rectangle( extent={{-240,100},{-50,60}}, diff --git a/BESMod/Systems/Hydraulical/Control/Biv_PI_ConFlow_HPSController.mo b/BESMod/Systems/Hydraulical/Control/Biv_PI_ConFlow_HPSController.mo index 9f143e27..19e771f8 100644 --- a/BESMod/Systems/Hydraulical/Control/Biv_PI_ConFlow_HPSController.mo +++ b/BESMod/Systems/Hydraulical/Control/Biv_PI_ConFlow_HPSController.mo @@ -21,7 +21,7 @@ model Biv_PI_ConFlow_HPSController bivalentControlData.dTHysDHW)); equation - connect(HP_nSet_Controller.T_Meas, sigBusGen.hp_bus.TConInMea) + connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation (Line(points={{97,61.2},{97,-66},{-118,-66},{-118,-99},{-152,-99}}, color={0,0,127}), Text( string="%second", diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpBusPassThrough.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpBusPassThrough.mo new file mode 100644 index 00000000..d6923001 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpBusPassThrough.mo @@ -0,0 +1,80 @@ +within BESMod.Systems.Hydraulical.Control.Components; +model HeatPumpBusPassThrough + Interfaces.GenerationControlBus sigBusGen + annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); + AixLib.Controls.Interfaces.VapourCompressionMachineControlBus + vapourCompressionMachineControlBus + annotation (Placement(transformation(extent={{82,-22},{122,18}}))); + Modelica.Blocks.Routing.RealPassThrough realPassThrough[4] + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + Modelica.Blocks.Routing.BooleanPassThrough booleanPassThrough + annotation (Placement(transformation(extent={{-10,-40},{10,-20}}))); +equation + connect(booleanPassThrough.u, sigBusGen.heaPumIsOn) annotation (Line(points={{ + -12,-30},{-86,-30},{-86,0},{-100,0}}, color={255,0,255}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(booleanPassThrough.y, vapourCompressionMachineControlBus.onOffMea) + annotation (Line(points={{11,-30},{46,-30},{46,-26},{102,-26},{102,-2}}, + color={255,0,255}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(realPassThrough[1].u, sigBusGen.THeaPumIn) annotation (Line(points={{-12, + 0},{-100,0}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(realPassThrough[1].y, vapourCompressionMachineControlBus.TConInMea) + annotation (Line(points={{11,0},{78,0},{78,-2},{102,-2}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(realPassThrough[2].u, sigBusGen.THeaPumOut) annotation (Line(points={ + {-12,0},{-100,0}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(realPassThrough[2].y, vapourCompressionMachineControlBus.TConOutMea) + annotation (Line(points={{11,0},{78,0},{78,-2},{102,-2}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(realPassThrough[3].y, vapourCompressionMachineControlBus.nSet) + annotation (Line(points={{11,0},{78,0},{78,-2},{102,-2}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(realPassThrough[3].u, sigBusGen.yHeaPumSet) annotation (Line(points={{ + -12,0},{-100,0}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(realPassThrough[4].u, sigBusGen.THeaPumEvaIn) annotation (Line( + points={{-12,0},{-100,0}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(realPassThrough[4].y, vapourCompressionMachineControlBus.TEvaInMea) + annotation (Line(points={{11,0},{78,0},{78,-2},{102,-2}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end HeatPumpBusPassThrough; diff --git a/BESMod/Systems/Hydraulical/Control/Components/package.order b/BESMod/Systems/Hydraulical/Control/Components/package.order index b7450076..e507d0b1 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/package.order @@ -4,3 +4,4 @@ ThermostaticValveController Tests OnOffController HeatPumpNSetController +HeatPumpBusPassThrough diff --git a/BESMod/Systems/Hydraulical/Control/ConstHys_OnOff_HPSControll.mo b/BESMod/Systems/Hydraulical/Control/ConstHys_OnOff_HPSControll.mo index 36f56739..67b61ee2 100644 --- a/BESMod/Systems/Hydraulical/Control/ConstHys_OnOff_HPSControll.mo +++ b/BESMod/Systems/Hydraulical/Control/ConstHys_OnOff_HPSControll.mo @@ -18,7 +18,7 @@ model ConstHys_OnOff_HPSControll annotation (Dialog(group="Heat Pumps")); equation - connect(sigBusGen.hp_bus.TConInMea, HP_nSet_Controller.T_Meas) annotation ( + connect(sigBusGen.THeaPumpIn, HP_nSet_Controller.T_Meas) annotation ( Line( points={{-152,-99},{-114,-99},{-114,0},{97,0},{97,61.2}}, color={255,204,51}, diff --git a/BESMod/Systems/Hydraulical/Control/ConstHys_PI_ConOut_HPSController.mo b/BESMod/Systems/Hydraulical/Control/ConstHys_PI_ConOut_HPSController.mo index 177f7ef2..cc4e6128 100644 --- a/BESMod/Systems/Hydraulical/Control/ConstHys_PI_ConOut_HPSController.mo +++ b/BESMod/Systems/Hydraulical/Control/ConstHys_PI_ConOut_HPSController.mo @@ -22,7 +22,7 @@ model ConstHys_PI_ConOut_HPSController addSet_dt_hr=bivalentControlData.addSet_dtHeaRodDHW)); equation - connect(HP_nSet_Controller.T_Meas, sigBusGen.hp_bus.TConOutMea) annotation ( + connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( Line(points={{97,61.2},{97,-64},{-152,-64},{-152,-99}}, color={0,0,127}), Text( string="%second", diff --git a/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConIn_HPSController.mo b/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConIn_HPSController.mo index 78d0ec51..8c779304 100644 --- a/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConIn_HPSController.mo +++ b/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConIn_HPSController.mo @@ -14,7 +14,7 @@ model ConstHys_P_ConIn_HPSController bivalentControlData.dtHeaRodDHW)); equation - connect(HP_nSet_Controller.T_Meas, sigBusGen.hp_bus.TConOutMea) + connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumIn) annotation (Line(points={{97,61.2},{97,-99},{-152,-99}}, color={0,0,127}), Text( string="%second", diff --git a/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConOut_HPSController.mo b/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConOut_HPSController.mo index 92eddad3..4f7f1d1f 100644 --- a/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConOut_HPSController.mo +++ b/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConOut_HPSController.mo @@ -15,7 +15,7 @@ model ConstHys_P_ConOut_HPSController bivalentControlData.dtHeaRodDHW)); equation - connect(HP_nSet_Controller.T_Meas, sigBusGen.hp_bus.TConInMea) + connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation (Line(points={{97,61.2},{97,-99},{-152,-99}}, color={0,0,127}), Text( string="%second", diff --git a/BESMod/Systems/Hydraulical/Control/PartBiv_PI_ConOut_HPS.mo b/BESMod/Systems/Hydraulical/Control/PartBiv_PI_ConOut_HPS.mo index fdeb2d58..9256b2fb 100644 --- a/BESMod/Systems/Hydraulical/Control/PartBiv_PI_ConOut_HPS.mo +++ b/BESMod/Systems/Hydraulical/Control/PartBiv_PI_ConOut_HPS.mo @@ -33,7 +33,7 @@ model PartBiv_PI_ConOut_HPS parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff; equation - connect(HP_nSet_Controller.T_Meas, sigBusGen.hp_bus.TConOutMea) annotation ( + connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( Line(points={{97,61.2},{97,-56},{-152,-56},{-152,-99}}, color={0,0,127}), Text( string="%second", diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistribution.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistribution.mo index 89ac7904..897d33de 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistribution.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistribution.mo @@ -66,7 +66,7 @@ partial model PartialDistribution sigBusDistr annotation (Placement(transformation(extent={{-24,80},{24,122}}))); BESMod.Systems.Hydraulical.Interfaces.DistributionOutputs - outBusDist + outBusDist if not use_openModelica annotation (Placement(transformation(extent={{-10,-110},{10,-90}}))); BESMod.Systems.Electrical.Interfaces.InternalElectricalPinOut internalElectricalPin diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo index 05c207f6..275e0e03 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo @@ -283,17 +283,11 @@ partial model PartialDistributionTwoStorageParallelDetailed redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parameters=threeWayValveParameters) annotation (Placement(transformation(extent={{-84,54},{-64,74}}))); - Utilities.KPIs.IntegralKPICalculator integralKPICalculator3( - use_inpCon=false, - unit="W", - intUnit="J", - y=fixedTemperatureBuf.port.Q_flow) + Utilities.KPIs.EnergyKPICalculator integralKPICalculator3(use_inpCon=false, y + =fixedTemperatureBuf.port.Q_flow) annotation (Placement(transformation(extent={{-40,-108},{-22,-90}}))); - Utilities.KPIs.IntegralKPICalculator integralKPICalculator1( - final use_inpCon=false, - final unit="W", - final intUnit="J", - y=fixedTemperatureDHW.port.Q_flow) + Utilities.KPIs.EnergyKPICalculator integralKPICalculator1(final use_inpCon= + false, y=fixedTemperatureDHW.port.Q_flow) annotation (Placement(transformation(extent={{-40,-140},{-20,-120}}))); IBPSA.Fluid.Sensors.TemperatureTwoPort senTBuiSup( redeclare final package Medium = Medium, @@ -312,28 +306,19 @@ partial model PartialDistributionTwoStorageParallelDetailed BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{30,-108},{50,-88}}))); - Utilities.KPIs.IntegralKPICalculator integralKPICalculator4( - use_inpCon=false, - unit="W", - intUnit="J", - y=QHRStoDHWPre_flow.Q_flow) if dhwParameters.use_hr annotation (Placement( + Utilities.KPIs.EnergyKPICalculator integralKPICalculator4(use_inpCon=false, y + =QHRStoDHWPre_flow.Q_flow) if dhwParameters.use_hr annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={30,-168}))); - Utilities.KPIs.IntegralKPICalculator integralKPICalculator( - use_inpCon=true, - unit="W", - intUnit="J") if use_heatingRodAfterBuffer annotation (Placement( - transformation( + Utilities.KPIs.EnergyKPICalculator integralKPICalculator(use_inpCon=true) + if use_heatingRodAfterBuffer annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={30,-130}))); - Utilities.KPIs.IntegralKPICalculator integralKPICalculator2( - use_inpCon=false, - unit="W", - intUnit="J", - y=QHRStoBufPre_flow1.Q_flow) if bufParameters.use_hr + Utilities.KPIs.EnergyKPICalculator integralKPICalculator2(use_inpCon=false, y + =QHRStoBufPre_flow1.Q_flow) if bufParameters.use_hr annotation (Placement(transformation(extent={{-40,-170},{-20,-150}}))); equation connect(T_stoDHWBot.y, sigBusDistr.TStoDHWBotMea) annotation (Line(points={{-16.4, diff --git a/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo b/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo index 8e314ffc..227ee812 100644 --- a/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo +++ b/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo @@ -109,11 +109,8 @@ model CombiStorage bufferStorage.layer.T) annotation (Placement(transformation(extent={{-42,-122},{-22,-102}}))); - Utilities.KPIs.IntegralKPICalculator integralKPICalculator( - use_inpCon=false, - unit="W", - intUnit="J", - y=fixedTemperatureBuf.port.Q_flow) + Utilities.KPIs.EnergyKPICalculator integralKPICalculator(use_inpCon=false, y= + fixedTemperatureBuf.port.Q_flow) annotation (Placement(transformation(extent={{-80,-120},{-60,-100}}))); BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{30,-108},{50,-88}}))); diff --git a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo index 19b2ea1c..cc32ed1d 100644 --- a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo @@ -134,17 +134,11 @@ model DistributionTwoStorageParallel rotation=0, origin={30,-90}))); - Utilities.KPIs.IntegralKPICalculator integralKPICalculator1( - use_inpCon=false, - unit="W", - intUnit="J", - y=fixedTemperatureBuf.port.Q_flow) + Utilities.KPIs.EnergyKPICalculator integralKPICalculator1(use_inpCon=false, y + =fixedTemperatureBuf.port.Q_flow) annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); - Utilities.KPIs.IntegralKPICalculator integralKPICalculator( - use_inpCon=false, - unit="W", - intUnit="J", - y=fixedTemperatureDHW.port.Q_flow) + Utilities.KPIs.EnergyKPICalculator integralKPICalculator(use_inpCon=false, y= + fixedTemperatureDHW.port.Q_flow) annotation (Placement(transformation(extent={{-80,-100},{-60,-80}}))); BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{34,-110},{54,-90}}))); diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestCombiStorage.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestCombiStorage.mo index a1017e78..d4b972df 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestCombiStorage.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestCombiStorage.mo @@ -11,16 +11,4 @@ model TestCombiStorage dTLoadingHC2=5))); extends Modelica.Icons.Example; - Modelica.Blocks.Sources.BooleanPulse booleanPulse(period=100) annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-68,88}))); -equation - connect(booleanPulse.y, sigBusDistr.dhw_on) annotation (Line(points={{-57,88}, - {-42,88},{-42,81},{-14,81}}, color={255,0,255}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); end TestCombiStorage; diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo index ac3b6ecc..e06098db 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo @@ -22,14 +22,14 @@ model TestDirectLoading heatingRodAftBufParameters)); extends Modelica.Icons.Example; - Modelica.Blocks.Sources.BooleanPulse booleanPulse(period=100) annotation ( + Modelica.Blocks.Sources.Pulse pulse( period=100) annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-68,88}))); + origin={-70,90}))); equation - connect(booleanPulse.y, sigBusDistr.dhw_on) annotation (Line(points={{-57,88}, - {-42,88},{-42,81},{-14,81}}, color={255,0,255}), Text( + connect(pulse.y, sigBusDistr.uThrWayVal) annotation (Line(points={{-59,90},{ + -44,90},{-44,81},{-14,81}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo index e1d70819..608505c4 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo @@ -22,14 +22,14 @@ model TestIndirectLoading heatingRodAftBufParameters)); extends Modelica.Icons.Example; - Modelica.Blocks.Sources.BooleanPulse booleanPulse(period=100) annotation ( + Modelica.Blocks.Sources.Pulse pulse( period=100) annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-68,88}))); + origin={-70,90}))); equation - connect(booleanPulse.y, sigBusDistr.dhw_on) annotation (Line(points={{-57,88}, - {-42,88},{-42,81},{-14,81}}, color={255,0,255}), Text( + connect(pulse.y, sigBusDistr.uThrWayVal) annotation (Line(points={{-59,90},{ + -44,90},{-44,81},{-14,81}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestOnlyDHW.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestOnlyDHW.mo index a43ef031..57e214c2 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestOnlyDHW.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestOnlyDHW.mo @@ -5,16 +5,4 @@ model TestOnlyDHW distribution(nParallelDem=1)); extends Modelica.Icons.Example; - Modelica.Blocks.Sources.BooleanPulse booleanPulse(period=100) annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-68,88}))); -equation - connect(booleanPulse.y, sigBusDistr.dhw_on) annotation (Line(points={{-57,88}, - {-42,88},{-42,81},{-14,81}}, color={255,0,255}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); end TestOnlyDHW; diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialGeneration.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialGeneration.mo index 85c7089a..2580abfe 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialGeneration.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialGeneration.mo @@ -23,7 +23,7 @@ partial model PartialGeneration "Partial generation model for HPS" Placement(transformation(extent={{90,-12},{110,8}}), iconTransformation( extent={{90,30},{110,50}}))); BESMod.Systems.Hydraulical.Interfaces.GenerationOutputs - outBusGen + outBusGen if not use_openModelica annotation (Placement(transformation(extent={{-10,-110},{10,-90}}))); IBPSA.BoundaryConditions.WeatherData.Bus diff --git a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo index 916e541f..41d57edf 100644 --- a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo @@ -82,11 +82,7 @@ model ElectricalHeater "Only heat using a heating rod" rotation=90, origin={62,-74}))); - Utilities.KPIs.IntegralKPICalculator KPIQHR( - use_inpCon=false, - unit="W", - intUnit="J", - y=hea.vol.heatPort.Q_flow) + Utilities.KPIs.EnergyKPICalculator KPIQHR(use_inpCon=false, y=hea.vol.heatPort.Q_flow) annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}))); replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition diff --git a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo index 0ce4e40c..0dbeb19b 100644 --- a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo @@ -25,11 +25,7 @@ model GasBoiler "Just a gas boiler" paramBoiler "Parameters for Boiler" annotation(choicesAllMatching=true); parameter Real etaTempBased[:,2]=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99] "Table matrix for temperature based efficiency"; - Utilities.KPIs.IntegralKPICalculator KPIQHR( - use_inpCon=false, - unit="W", - intUnit="J", - y=boilerNoControl.QflowCalculation.y) + Utilities.KPIs.EnergyKPICalculator KPIQHR(use_inpCon=false, y=boilerNoControl.QflowCalculation.y) annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}))); replaceable parameter BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index 2e5aeb73..ba23b277 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -43,14 +43,14 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" AixLib.Fluid.HeatPumps.HeatPump heatPump( redeclare package Medium_con = Medium, redeclare package Medium_eva = Medium_eva, - final use_rev=false, + final use_rev=true, final use_autoCalc=false, final Q_useNominal=0, final scalingFactor=heatPumpParameters.scalingFactor, final use_refIne=heatPumpParameters.use_refIne, final refIneFre_constant=heatPumpParameters.refIneFre_constant, final nthOrder=1, - final useBusConnectorOnly=true, + final useBusConnectorOnly=false, final mFlow_conNominal=m_flow_nominal[1], final VCon=heatPumpParameters.VCon, final dpCon_nominal=heatPumpParameters.dpCon_nominal, @@ -81,7 +81,7 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" final show_TPort=show_T, redeclare model PerDataMainHP = PerDataMainHP, redeclare model PerDataRevHP = - AixLib.DataBase.Chiller.PerformanceData.LookUpTable2D (final dataTable= + AixLib.DataBase.Chiller.PerformanceData.LookUpTable2D (dataTable= AixLib.DataBase.Chiller.EN14511.Vitocal200AWO201())) annotation (Placement( transformation( @@ -110,20 +110,14 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" Modelica.Blocks.Sources.BooleanConstant AirOrSoil(k=heatPumpParameters.useAirSource) annotation (Placement(transformation( - extent={{-6,-6},{6,6}}, + extent={{-10,-10},{10,10}}, rotation=0, - origin={-164,56}))); + origin={-170,90}))); - Utilities.KPIs.IntegralKPICalculator KPIWel( - use_inpCon=true, - intUnit="J", - unit="W") - annotation (Placement(transformation(extent={{-180,-80},{-160,-60}}))); - Utilities.KPIs.IntegralKPICalculator KPIWHRel( - use_inpCon=true, - unit="W", - intUnit="J") if use_heaRod - annotation (Placement(transformation(extent={{-180,-48},{-160,-28}}))); + Utilities.KPIs.EnergyKPICalculator KPIWel(use_inpCon=true) + annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); + Utilities.KPIs.EnergyKPICalculator KPIWHRel(use_inpCon=true) if use_heaRod + annotation (Placement(transformation(extent={{-140,-48},{-120,-28}}))); IBPSA.Fluid.Movers.SpeedControlled_y pump( redeclare final package Medium = Medium, @@ -170,22 +164,15 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" Modelica.Blocks.Sources.Constant TSoil(k=TSoilConst) annotation (Placement(transformation( - extent={{-6,-6},{6,6}}, + extent={{-10,-10},{10,10}}, rotation=0, - origin={-164,32}))); + origin={-170,50}))); - Utilities.KPIs.IntegralKPICalculator KPIQHP( - use_inpCon=false, - unit="W", - intUnit="J", - y=heatPump.con.QFlow_in) - annotation (Placement(transformation(extent={{-180,-112},{-160,-92}}))); - Utilities.KPIs.IntegralKPICalculator KPIQHR( - use_inpCon=false, - unit="W", - intUnit="J", - y=hea.vol.heatPort.Q_flow) if use_heaRod - annotation (Placement(transformation(extent={{-180,-140},{-160,-120}}))); + Utilities.KPIs.EnergyKPICalculator KPIQHP(use_inpCon=false, y=heatPump.con.QFlow_in) + annotation (Placement(transformation(extent={{-140,-112},{-120,-92}}))); + Utilities.KPIs.EnergyKPICalculator KPIQHR(use_inpCon=false, y=hea.vol.heatPort.Q_flow) + if use_heaRod + annotation (Placement(transformation(extent={{-140,-140},{-120,-120}}))); IBPSA.Fluid.Sources.Boundary_pT bouPumpHP( redeclare package Medium = Medium, @@ -225,13 +212,33 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" calc_singleOnTime=true, calc_totalOnTime=true, calc_numSwi=true) - annotation (Placement(transformation(extent={{-180,-20},{-160,0}}))); + annotation (Placement(transformation(extent={{-140,-20},{-120,0}}))); Utilities.KPIs.DeviceKPICalculator KPIHeaRod1( use_reaInp=true, calc_singleOnTime=true, calc_totalOnTime=true, calc_numSwi=true) - annotation (Placement(transformation(extent={{-140,-120},{-120,-100}}))); + annotation (Placement(transformation(extent={{-100,-120},{-80,-100}}))); + Modelica.Blocks.Sources.BooleanExpression booExpHeaPumIsOn(y=heatPump.greaterThreshold.y) + annotation (Placement(transformation(extent={{-180,-20},{-160,0}}))); + Modelica.Blocks.Sources.RealExpression reaExpPEleHeaPum(y=heatPump.innerCycle.Pel) + annotation (Placement(transformation(extent={{-180,-80},{-160,-60}}))); + Modelica.Blocks.Sources.Constant conIceFac(final k=1) annotation (Placement( + transformation( + extent={{-11,-11},{11,11}}, + rotation=0, + origin={-169,11}))); + Modelica.Blocks.Sources.RealExpression reaExpTHeaPumOut(y=heatPump.innerCycle.Pel) + annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); + Modelica.Blocks.Sources.RealExpression reaExpTHeaPumIn(y=heatPump.innerCycle.Pel) + annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); + Modelica.Blocks.Sources.BooleanConstant conNotRev(final k=true) annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-170,-38}))); + Modelica.Blocks.Sources.RealExpression reaExpTHeaPumIn1(y=heatPump.senT_a2.T) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); protected parameter Modelica.Units.SI.PressureDifference dpHeaRod_nominal=if use_heaRod then heatingRodParameters.dp_nominal else 0; @@ -246,34 +253,19 @@ equation points={{-57.5,-7},{-58,-7},{-58,-22},{-80,-22}}, color={0,127,255}, pattern=LinePattern.Dash)); - connect(sigBusGen.hp_bus, heatPump.sigBus) annotation (Line( - points={{2,98},{-150,98},{-150,-40},{-52.775,-40},{-52.775,-6.78}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - connect(bou_air.T_in, switch2.y) annotation (Line(points={{-102,56},{-113,56}}, color={0,0,127})); connect(switch2.u2, AirOrSoil.y) - annotation (Line(points={{-136,56},{-157.4,56}}, color={255,0,255})); + annotation (Line(points={{-136,56},{-152,56},{-152,90},{-159,90}}, + color={255,0,255})); connect(hea.u, sigBusGen.hr_on) annotation (Line(points={{18.8,89.6},{18.8,74}, {2,74},{2,98}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(KPIWel.u, sigBusGen.hp_bus.PelMea) annotation (Line(points={{-181.8, - -70},{-196,-70},{-196,120},{-22,120},{-22,122},{26,122},{26,98},{2,98}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(hea.Pel, KPIWHRel.u) annotation (Line(points={{55.6,89.6},{58,89.6},{ - 58,114},{-184,114},{-184,-38},{-181.8,-38}}, + connect(hea.Pel, KPIWHRel.u) annotation (Line(points={{55.6,89.6},{98,89.6},{98, + 114},{-144,114},{-144,-38},{-141.8,-38}}, color={0,0,127})); connect(pump.port_a, portGen_in[1]) annotation (Line( points={{26,-68},{100,-68},{100,-2}}, @@ -285,8 +277,8 @@ equation connect(pump.port_b, heatPump.port_a1) annotation (Line( points={{6,-68},{-30.5,-68},{-30.5,-7}}, color={0,127,255})); - connect(TSoil.y, switch2.u3) annotation (Line(points={{-157.4,32},{-146,32}, - {-146,48},{-136,48}}, color={0,0,127})); + connect(TSoil.y, switch2.u3) annotation (Line(points={{-159,50},{-156,50},{-156, + 48},{-136,48}}, color={0,0,127})); connect(heatPump.port_b1, hea.port_a) annotation (Line(points={{-30.5,37},{ -30.5,80},{22,80}}, color={0,127,255})); connect(bouPumpHP.ports[1], pump.port_a) annotation (Line( @@ -317,24 +309,26 @@ equation connect(multiSum.y, realToElecCon.PEleLoa) annotation (Line(points={{122.98,-82},{112,-82}}, color={0,0,127})); if use_heaRod then - connect(multiSum.u[2], hea.Pel) annotation (Line(points={{136,-82},{142,-82}, + connect(multiSum.u[3], hea.Pel) annotation (Line(points={{136,-82},{142,-82}, {142,89.6},{55.6,89.6}},color={0,0,127})); - connect(multiSum.u[1], sigBusGen.hp_bus.PelMea) annotation (Line(points={{136, - -82},{140,-82},{140,96},{72,96},{72,98},{2,98}}, color={0,0,127}), + connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136,-82}, + {144,-82},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(multiSum.u[3], pump.P) annotation (Line(points={{136,-82},{140,-82},{ - 140,-86},{144,-86},{144,-59},{5,-59}}, + connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-82},{144,-82}, + {144,-114},{-14,-114},{-14,-58},{0,-58},{0,-59},{5,-59}}, color={0,0,127})); else connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-82},{144,-82}, {144,-114},{-14,-114},{-14,-58},{0,-58},{0,-59},{5,-59}}, color={0,0,127})); - connect(multiSum.u[1], sigBusGen.hp_bus.PelMea) annotation (Line(points={{136, - -82},{140,-82},{140,96},{72,96},{72,98},{2,98}}, color={0,0,127}), + connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136,-82}, + {144,-82},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, + color={0,0,127}), Text( string="%second", index=1, @@ -353,58 +347,90 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIQHR.KPI, outBusGen.QHR_flow) annotation (Line(points={{-157.8,-130}, - {-146,-130},{-146,-102},{0,-102},{0,-100}}, color={135,135,135}), + connect(KPIQHR.KPI, outBusGen.QHR_flow) annotation (Line(points={{-117.8,-130}, + {-106,-130},{-106,-102},{0,-102},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIQHP.KPI, outBusGen.QHP_flow) annotation (Line(points={{-157.8,-102}, - {-16,-102},{-16,-100},{0,-100}}, color={135,135,135}), Text( + connect(KPIQHP.KPI, outBusGen.QHP_flow) annotation (Line(points={{-117.8,-102}, + {0,-102},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIWel.KPI, outBusGen.PEleHP) annotation (Line(points={{-157.8,-70},{ - -144,-70},{-144,-102},{-14,-102},{-14,-100},{0,-100}}, color={135,135, + connect(KPIWel.KPI, outBusGen.PEleHP) annotation (Line(points={{-117.8,-70},{-104, + -70},{-104,-102},{0,-102},{0,-100}}, color={135,135, 135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIWHRel.KPI, outBusGen.PEleHR) annotation (Line(points={{-157.8,-38}, - {-146,-38},{-146,-102},{0,-102},{0,-100}}, color={135,135,135}), Text( + connect(KPIWHRel.KPI, outBusGen.PEleHR) annotation (Line(points={{-117.8,-38}, + {-106,-38},{-106,-102},{0,-102},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIHeaRod.KPI, outBusGen.heaPum) annotation (Line(points={{-157.8,-10}, - {-146,-10},{-146,-12},{-138,-12},{-138,-100},{0,-100}}, color={135, + connect(KPIHeaRod.KPI, outBusGen.heaPum) annotation (Line(points={{-117.8,-10}, + {-106,-10},{-106,-12},{-98,-12},{-98,-100},{0,-100}}, color={135, 135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIHeaRod.u, sigBusGen.hp_bus.onOffMea) annotation (Line(points={{ - -182.2,-10},{-198,-10},{-198,98},{2,98}}, color={255,0,255}), Text( + connect(KPIHeaRod1.KPI, outBusGen.heaRod) annotation (Line(points={{-77.8,-110}, + {0,-110},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIHeaRod1.KPI, outBusGen.heaRod) annotation (Line(points={{-117.8, - -110},{0,-110},{0,-100}}, color={135,135,135}), Text( + connect(KPIHeaRod1.uRea, sigBusGen.hr_on) annotation (Line(points={{-102.2,-110}, + {-128,-110},{-128,-112},{-150,-112},{-150,98},{2,98}}, color={0, + 0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(booExpHeaPumIsOn.y, KPIHeaRod.u) + annotation (Line(points={{-159,-10},{-142.2,-10}}, color={255,0,255})); + connect(reaExpPEleHeaPum.y, KPIWel.u) + annotation (Line(points={{-159,-70},{-141.8,-70}}, color={0,0,127})); + connect(conIceFac.y, heatPump.iceFac_in) annotation (Line(points={{-156.9,11}, + {-106,11},{-106,-1.72},{-74.6,-1.72}}, color={0,0,127})); + connect(heatPump.nSet, sigBusGen.yHeaPumSet) annotation (Line(points={{-39.5,-10.52}, + {-39.5,-26},{2,-26},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(booExpHeaPumIsOn.y, sigBusGen.heaPumIsOn) annotation (Line(points={{-159, + -10},{-142,-10},{-142,98},{2,98}}, color={255,0,255}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIHeaRod1.uRea, sigBusGen.hr_on) annotation (Line(points={{-142.2, - -110},{-168,-110},{-168,-112},{-190,-112},{-190,98},{2,98}}, color={0, - 0,127}), Text( + connect(reaExpTHeaPumIn.y, sigBusGen.THeaPumIn) annotation (Line(points={{-39, + 70},{2,70},{2,98}}, color={0,0,127}), Text( string="%second", index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(reaExpTHeaPumOut.y, sigBusGen.THeaPumOut) annotation (Line(points={{-39, + 90},{-28,90},{-28,74},{2,74},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(heatPump.modeSet, conNotRev.y) annotation (Line(points={{-48.5,-10.52}, + {-48.5,-38},{-159,-38}}, color={255,0,255})); + connect(reaExpTHeaPumIn1.y, sigBusGen.THeaPumEvaIn) annotation (Line(points={ + {-39,50},{2,50},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); annotation (Line( points={{-52.775,-6.78},{-52.775,33.61},{-56,33.61},{-56,74}}, color={255,204,51}, diff --git a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo index b49b67e3..a5893afd 100644 --- a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo +++ b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHP.mo @@ -80,17 +80,13 @@ model SolarThermalBivHP extent={{-10,-10},{10,10}}, rotation=180, origin={70,-150}))); - Modelica.Blocks.Sources.Constant AirOrSoil1(k=1) - annotation (Placement(transformation( + Modelica.Blocks.Sources.Constant uPumSolTheAlwOn(k=1) annotation (Placement( + transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={50,-170}))); - Utilities.KPIs.IntegralKPICalculator KPIWel1( - use_inpCon=false, - unit="W", - intUnit="J", - y=-solarThermal.heater.port.Q_flow) + Utilities.KPIs.EnergyKPICalculator KPIWel1(use_inpCon=false, y=-solarThermal.heater.port.Q_flow) annotation (Placement(transformation(extent={{-60,-100},{-40,-80}}))); Modelica.Blocks.Sources.RealExpression reaExpSolTheTCol(y=solarThermal.senTCold.T) @@ -123,8 +119,6 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(AirOrSoil1.y, pumpST.y) annotation (Line(points={{39,-170},{10,-170}, - {10,-162}}, color={0,0,127})); connect(reaExpSolTheTCol.y, outBusGen.TSolCol_in) annotation (Line(points={{ -79,-110},{-62,-110},{-62,-126},{0,-126},{0,-100}}, color={0,0,127}), Text( @@ -161,6 +155,8 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); + connect(uPumSolTheAlwOn.y, pumpST.y) + annotation (Line(points={{39,-170},{10,-170},{10,-162}}, color={0,0,127})); annotation (Diagram(coordinateSystem(extent={{-200,-180},{100,100}}), graphics={Rectangle( extent={{100,-180},{-200,-118}}, diff --git a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo index 5fc36e1c..70e7955f 100644 --- a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo +++ b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo @@ -95,11 +95,7 @@ model SolarThermalBivHPBuiLib rotation=0, origin={-188,-160}))); - Utilities.KPIs.IntegralKPICalculator KPIWel1( - use_inpCon=false, - unit="W", - intUnit="J", - y=sum(solCol.vol.heatPort.Q_flow)) + Utilities.KPIs.EnergyKPICalculator KPIWel1(use_inpCon=false, y=sum(solCol.vol.heatPort.Q_flow)) annotation (Placement(transformation(extent={{-60,-120},{-40,-100}}))); Modelica.Blocks.Logical.Switch switch3 annotation (Placement(transformation( @@ -151,9 +147,8 @@ equation connect(switch3.y, pumpST.y) annotation (Line(points={{-147,-172},{-138,-172}, {-138,-170},{-130,-170},{-130,-186},{30,-186},{30,-182}}, color={0,0,127})); - connect(switch3.u1, AirOrSoil1.y) annotation (Line(points={{-170,-164},{-178, - -164},{-178,-160},{-181.4,-160}}, - color={0,0,127})); + connect(switch3.u1, conNotRev.y) annotation (Line(points={{-170,-164},{-178, + -164},{-178,-38},{-159,-38}}, color={0,0,127})); connect(AirOrSoil2.y, switch3.u3) annotation (Line(points={{-183.4,-188},{ -176,-188},{-176,-180},{-170,-180}}, color={0,0,127})); diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo index 5a9edc57..a72d6e25 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo @@ -21,4 +21,10 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); + connect(pulse.y, genControlBus.uPump) annotation (Line(points={{-21,78},{-18, + 78},{-18,74},{10,74}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); end GasBoiler; diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo index bba5d3bb..82cd04f3 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo @@ -20,37 +20,24 @@ model HeatPumpAndHeatingRod extends Modelica.Icons.Example; Modelica.Blocks.Sources.Constant const1(k=0) - annotation (Placement(transformation(extent={{-140,40},{-120,60}}))); - Modelica.Blocks.Sources.BooleanConstant - booleanConstant(k=true) - annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); + annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); Modelica.Blocks.Sources.Pulse pulse(period=1800) - annotation (Placement(transformation(extent={{-100,80},{-80,100}}))); - Modelica.Blocks.Sources.Constant const(k=1) - annotation (Placement(transformation(extent={{-140,80},{-120,100}}))); + annotation (Placement(transformation(extent={{-40,80},{-20,100}}))); equation - connect(const.y, genControlBus.hp_bus.iceFacMea) annotation (Line(points={{ - -119,90},{-119,92},{-104,92},{-104,74},{10,74}}, color={0,0,127}), - Text( + connect(const1.y, genControlBus.hr_on) annotation (Line(points={{-59,50},{10, + 50},{10,74}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(booleanConstant.y, genControlBus.hp_bus.modeSet) annotation (Line( - points={{-79,50},{-52,50},{-52,46},{10,46},{10,74}}, color={255,0,255}), - Text( + connect(pulse.y, genControlBus.yHeaPumSet) annotation (Line(points={{-19,90}, + {-14,90},{-14,98},{10,98},{10,74}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(pulse.y, genControlBus.hp_bus.nSet) annotation (Line(points={{-79,90}, - {-16,90},{-16,74},{10,74}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(const1.y, genControlBus.hr_on) annotation (Line(points={{-119,50},{ - -119,74},{10,74}}, color={0,0,127}), Text( + connect(pulse.y, genControlBus.uPump) annotation (Line(points={{-19,90},{-14, + 90},{-14,98},{10,98},{10,74}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo index 7c45975e..474a8073 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo @@ -24,36 +24,24 @@ model SolarThermalAndHeatPumpAndHeatingRod extends Modelica.Icons.Example; Modelica.Blocks.Sources.Constant const1(k=0) - annotation (Placement(transformation(extent={{-140,40},{-120,60}}))); - Modelica.Blocks.Sources.BooleanConstant - booleanConstant(k=true) annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); Modelica.Blocks.Sources.Pulse pulse(period=1800) - annotation (Placement(transformation(extent={{-100,80},{-80,100}}))); - Modelica.Blocks.Sources.Constant const(k=1) - annotation (Placement(transformation(extent={{-140,80},{-120,100}}))); + annotation (Placement(transformation(extent={{-40,80},{-20,100}}))); equation - connect(const.y, genControlBus.hp_bus.iceFacMea) annotation (Line(points={{-119, - 90},{-119,92},{-104,92},{-104,74},{10,74}}, color={0,0,127}), Text( + connect(const1.y, genControlBus.hr_on) annotation (Line(points={{-79,50},{10, + 50},{10,74}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(booleanConstant.y, genControlBus.hp_bus.modeSet) annotation (Line( - points={{-79,50},{-52,50},{-52,46},{10,46},{10,74}}, color={255,0,255}), - Text( + connect(pulse.y, genControlBus.yHeaPumSet) annotation (Line(points={{-19,90}, + {-14,90},{-14,98},{10,98},{10,74}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(pulse.y, genControlBus.hp_bus.nSet) annotation (Line(points={{-79,90}, - {-16,90},{-16,74},{10,74}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(const1.y, genControlBus.hr_on) annotation (Line(points={{-119,50},{-119, - 74},{10,74}}, color={0,0,127}), Text( + connect(pulse.y, genControlBus.uPump) annotation (Line(points={{-19,90},{-14, + 90},{-14,98},{10,98},{10,74}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, diff --git a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo index 5f700db1..2e5f335e 100644 --- a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo +++ b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo @@ -1,8 +1,7 @@ within BESMod.Systems.Hydraulical.Transfer.BaseClasses; partial model PartialTransfer "Partial transfer model for BES" extends BESMod.Utilities.Icons.TransferIcon; - extends - BESMod.Systems.BaseClasses.PartialFluidSubsystemWithParameters( + extends BESMod.Systems.BaseClasses.PartialFluidSubsystemWithParameters( TSup_nominal=fill(max(TTra_nominal),nParallelSup), dTTra_nominal={if TTra_nominal[i] > 64.9 + 273.15 then 15 elseif TTra_nominal[i] > 44.9 + 273.15 then 10 else 7 for i in 1:nParallelDem}, @@ -53,7 +52,7 @@ partial model PartialTransfer "Partial transfer model for BES" annotation (Placement(transformation(extent={{90,30},{110,50}}), iconTransformation(extent={{90,30},{110,50}}))); BESMod.Systems.Hydraulical.Interfaces.TransferOutputs - outBusTra + outBusTra if not use_openModelica annotation (Placement(transformation(extent={{-10,-114},{10,-94}}))); Interfaces.TransferControlBus traControlBus annotation (Placement(transformation(extent={{-10,90},{10,110}}))); diff --git a/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo index 69a0c311..e029a8cc 100644 --- a/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo +++ b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo @@ -44,19 +44,13 @@ model IdealValveRadiator rotation=270, origin={8,34}))); - replaceable parameter BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters - annotation (choicesAllMatching=true, Placement(transformation(extent={{-100,-98},{-80,-78}}))); - Utilities.KPIs.IntegralKPICalculator intKPICalHeaFlo( - use_inpCon=false, - unit="W", - intUnit="J", - y=sum(-heatPortRad.Q_flow) + sum(-heatPortCon.Q_flow)) + replaceable parameter BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + radParameters annotation ( + choicesAllMatching=true, + Placement(transformation(extent={{-100,-98},{-80,-78}}))); + Utilities.KPIs.EnergyKPICalculator intKPICalHeaFlo(final use_inpCon=false, + final y=sum(-heatPortRad.Q_flow) + sum(-heatPortCon.Q_flow)) annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}))); - Utilities.KPIs.IntegralKPICalculator intKPICal[nParallelDem]( - use_inpCon=true, - unit=fill("", nParallelDem), - intUnit=fill("s", nParallelDem)) - annotation (Placement(transformation(extent={{-40,-110},{-20,-90}}))); IBPSA.Fluid.Movers.FlowControlled_m_flow pumpFix_m_flow[nParallelDem]( redeclare final package Medium = Medium, each final energyDynamics=energyDynamics, @@ -114,13 +108,6 @@ equation {-76,39.5},{-51,39.5}}, color={0,127,255})); end for; - connect(intKPICal.u, traControlBus.opening) annotation (Line(points={{-41.8, - -100},{-48,-100},{-48,-14},{-12,-14},{-12,-8},{24,-8},{24,86},{8,86}, - {8,90},{0,90},{0,100}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); connect(gain.u, traControlBus.opening) annotation (Line(points={{8,46},{8,90}, {0,90},{0,100}}, color={0,0,127}), Text( string="%second", @@ -147,10 +134,10 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(intKPICal.KPI, outBusTra.opening) annotation (Line(points={{-17.8, - -100},{-8,-100},{-8,-104},{0,-104}}, color={135,135,135}), Text( + connect(gain.u, outBusTra.opening) annotation (Line(points={{8,46},{8,52},{22, + 52},{22,-88},{0,-88},{0,-104}}, color={0,0,127}), Text( string="%second", index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); end IdealValveRadiator; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTest.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTest.mo index 703498e5..484cf9cc 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTest.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTest.mo @@ -1,8 +1,7 @@ within BESMod.Systems.Hydraulical.Transfer.Tests; partial model PartialTest extends BESMod.Systems.BaseClasses.PartialBESExample; - replaceable - BESMod.Systems.Hydraulical.Transfer.BaseClasses.PartialTransfer + replaceable BESMod.Systems.Hydraulical.Transfer.BaseClasses.PartialTransfer transfer constrainedby BaseClasses.PartialTransfer( redeclare package Medium = IBPSA.Media.Water, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, @@ -18,7 +17,8 @@ partial model PartialTest AZone={100}, hZone={2.6}, ABui=100, - hBui=2.6) annotation (choicesAllMatching=true, Placement(transformation(extent={{-32,-26},{36,44}}))); + hBui=2.6) annotation (choicesAllMatching=true, Placement(transformation( + extent={{-32,-26},{36,44}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature prescribedTemperature(T( displayUnit="K")) diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index 8d76eeda..f7ce4dc3 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -60,11 +60,7 @@ model UFHTransferSystem constrainedby RecordsCollection.UFHData(nZones=nParallelDem, area=AZone) annotation (choicesAllMatching=true, Placement(transformation(extent={{22,12},{42,32}}))); - Utilities.KPIs.IntegralKPICalculator integralKPICalculator1[nParallelDem]( - unit=fill("", nParallelDem), intUnit=fill("s", nParallelDem)) - annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}))); - Utilities.KPIs.IntegralKPICalculator integralKPICalculator[nParallelDem](unit - =fill("W", nParallelDem), intUnit=fill("J", nParallelDem)) + Utilities.KPIs.EnergyKPICalculator integralKPICalculator[nParallelDem] annotation (Placement(transformation(extent={{-40,-120},{-20,-100}}))); IBPSA.Fluid.Sources.Boundary_pT bouPumpHP[nParallelDem]( redeclare package Medium = Medium, @@ -171,9 +167,6 @@ equation index=1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(gain.y, integralKPICalculator1.u) annotation (Line(points={{-28,61},{ - -28,54},{-46,54},{-46,8},{-60,8},{-60,-70},{-41.8,-70}}, color={0,0, - 127})); connect(heatFlowSensor.Q_flow, integralKPICalculator.u) annotation (Line( points={{-46,-17},{-46,-54},{-54,-54},{-54,-110},{-41.8,-110}}, color={ 0,0,127})); @@ -196,8 +189,9 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(integralKPICalculator1.KPI, outBusTra.opening) annotation (Line( - points={{-17.8,-70},{0,-70},{0,-104}}, color={135,135,135}), Text( + connect(gain.u, outBusTra.opening) annotation (Line(points={{-28,84},{-28,100}, + {-14,100},{-14,54},{-4,54},{-4,22},{-12,22},{-12,-90},{0,-90},{0,-104}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, diff --git a/BESMod/Systems/Interfaces/UseProBus.mo b/BESMod/Systems/Interfaces/UseProBus.mo index f6448419..c74e7cee 100644 --- a/BESMod/Systems/Interfaces/UseProBus.mo +++ b/BESMod/Systems/Interfaces/UseProBus.mo @@ -1,6 +1,11 @@ within BESMod.Systems.Interfaces; expandable connector UseProBus "Data bus with user profiles" extends BESMod.Utilities.Icons.UseProBus; + + // Required for OpenModelica to run. However, does not match for + // each building approach, e.g. HOM from AixLib for multiple zones. + // Real intGains[3]; + annotation ( defaultComponentName = "useProBus", Icon(graphics, diff --git a/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo b/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo index 9f8d8e3f..10aa0346 100644 --- a/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo +++ b/BESMod/Systems/UserProfiles/AixLibHighOrderProfiles.mo @@ -15,108 +15,110 @@ model AixLibHighOrderProfiles "Profiles for high order model in the AixLib" final fileName=fileNameIntGains, columns=2:nZones + 1) "Profiles for internal gains" - annotation (Placement(transformation(extent={{23,23},{-23,-23}}, + annotation (Placement(transformation(extent={{10,10},{-10,-10}}, rotation=180, - origin={-27,1}))); + origin={-30,10}))); Modelica.Blocks.Math.Gain gainIntGains[nZones](each k=gain) "Profiles for internal gains" annotation (Placement(transformation( - extent={{23,23},{-23,-23}}, + extent={{10,10},{-10,-10}}, rotation=180, - origin={45,1}))); + origin={50,10}))); Modelica.Blocks.Sources.CombiTimeTable NaturalVentilation( columns={2,3,4,5,7}, extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, tableOnFile=false, - table=VentilationProfile.Profile) annotation(Placement(transformation(extent={{-88,50}, - {-68,70}}))); + table=VentilationProfile.Profile) annotation(Placement(transformation(extent={{-80,60}, + {-60,80}}))); Modelica.Blocks.Sources.CombiTimeTable TSet( columns={2,3,4,5,6,7}, extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, tableOnFile=false, - table=TSetProfile.Profile) annotation(Placement(transformation(extent={{-88, - -104},{-68,-84}}))); + table=TSetProfile.Profile) annotation(Placement(transformation(extent={{-102, + -100},{-82,-80}}))); Modelica.Blocks.Routing.RealPassThrough realPassThrough[10] - annotation (Placement(transformation(extent={{-48,52},{-32,68}}))); + annotation (Placement(transformation(extent={{-40,60},{-20,80}}))); Modelica.Blocks.Routing.RealPassThrough realPassThrough1 [10] - annotation (Placement(transformation(extent={{-32,-102},{-16,-86}}))); + annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}))); equation - connect(TSet.y[1], realPassThrough1[6].u) annotation (Line(points={{-67,-94},{ - -33.6,-94}}, color={0, + connect(TSet.y[1], realPassThrough1[6].u) annotation (Line(points={{-81,-90}, + {-42,-90}}, color={0, 0,127})); - connect(TSet.y[1], realPassThrough1[1].u) annotation (Line(points={{-67,-94},{ - -33.6,-94}}, color={ + connect(TSet.y[1], realPassThrough1[1].u) annotation (Line(points={{-81,-90}, + {-42,-90}}, color={ 0,0,127})); - connect(TSet.y[2], realPassThrough1[7].u) annotation (Line(points={{-67,-94},{ - -33.6,-94}}, color={0, + connect(TSet.y[2], realPassThrough1[7].u) annotation (Line(points={{-81,-90}, + {-42,-90}}, color={0, 0,127})); - connect(TSet.y[2], realPassThrough1[2].u) annotation (Line(points={{-67,-94},{ - -33.6,-94}}, color={ + connect(TSet.y[2], realPassThrough1[2].u) annotation (Line(points={{-81,-90}, + {-42,-90}}, color={ 0,0,127})); - connect(TSet.y[6], realPassThrough1[3].u) annotation (Line(points={{-67,-94},{ - -33.6,-94}}, color={ + connect(TSet.y[6], realPassThrough1[3].u) annotation (Line(points={{-81,-90}, + {-42,-90}}, color={ 0,0,127})); - connect(TSet.y[6], realPassThrough1[8].u) annotation (Line(points={{-67,-94},{ - -33.6,-94}}, color={ + connect(TSet.y[6], realPassThrough1[8].u) annotation (Line(points={{-81,-90}, + {-42,-90}}, color={ 0,0,127})); - connect(TSet.y[4], realPassThrough1[9].u) annotation (Line(points={{-67,-94},{ - -33.6,-94}}, color={0, + connect(TSet.y[4], realPassThrough1[9].u) annotation (Line(points={{-81,-90}, + {-42,-90}}, color={0, 0,127})); - connect(TSet.y[5], realPassThrough1[4].u) annotation (Line(points={{-67,-94},{ - -33.6,-94}}, color= + connect(TSet.y[5], realPassThrough1[4].u) annotation (Line(points={{-81,-90}, + {-42,-90}}, color= {0,0,127})); - connect(TSet.y[3], realPassThrough1[10].u) annotation (Line(points={{-67,-94}, - {-33.6,-94}}, + connect(TSet.y[3], realPassThrough1[10].u) annotation (Line(points={{-81,-90}, + {-42,-90}}, color={0,0,127})); - connect(TSet.y[3], realPassThrough1[5].u) annotation (Line(points={{-67,-94},{ - -33.6,-94}}, color= + connect(TSet.y[3], realPassThrough1[5].u) annotation (Line(points={{-81,-90}, + {-42,-90}}, color= {0,0,127})); connect(NaturalVentilation.y[1], realPassThrough[1].u) annotation (Line( - points={{-67,60},{-49.6,60}}, color={0,0, + points={{-59,70},{-42,70}}, color={0,0, 127})); connect(NaturalVentilation.y[1], realPassThrough[6].u) annotation (Line( - points={{-67,60},{-49.6,60}}, color={0,0,127})); + points={{-59,70},{-42,70}}, color={0,0,127})); connect(NaturalVentilation.y[2], realPassThrough[2].u) annotation (Line( - points={{-67,60},{-49.6,60}}, color={0,0,127})); - connect(NaturalVentilation.y[2], realPassThrough[7].u) annotation (Line( points={{-67,60},{-49.6,60}}, color={0,0,127})); + points={{-59,70},{-42,70}}, color={0,0,127})); + connect(NaturalVentilation.y[2], realPassThrough[7].u) annotation (Line( points={{-59,70}, + {-42,70}}, color={0,0,127})); connect(NaturalVentilation.y[3], realPassThrough[4].u) annotation (Line( - points={{-67,60},{-49.6,60}}, color={0,0,127})); + points={{-59,70},{-42,70}}, color={0,0,127})); connect(NaturalVentilation.y[3], realPassThrough[9].u) annotation (Line( - points={{-67,60},{-49.6,60}}, color={0,0,127})); + points={{-59,70},{-42,70}}, color={0,0,127})); connect(NaturalVentilation.y[4], realPassThrough[5].u) annotation (Line( - points={{-67,60},{-49.6,60}}, color={0,0,127})); + points={{-59,70},{-42,70}}, color={0,0,127})); connect(NaturalVentilation.y[4], realPassThrough[10].u) annotation (Line( - points={{-67,60},{-49.6,60}}, color={0,0,127})); + points={{-59,70},{-42,70}}, color={0,0,127})); connect(NaturalVentilation.y[5], realPassThrough[3].u) annotation (Line( - points={{-67,60},{-49.6,60}}, color={0,0,127})); + points={{-59,70},{-42,70}}, color={0,0,127})); connect(NaturalVentilation.y[5], realPassThrough[8].u) annotation (Line( - points={{-67,60},{-49.6,60}}, color={0,0,127})); + points={{-59,70},{-42,70}}, color={0,0,127})); - connect(tableInternalGains.y, gainIntGains.u) annotation (Line(points={{-1.7,1}, - {-1.7,0.5},{17.4,0.5},{17.4,1}}, color={0,0,127})); - connect(gainIntGains.y, useProBus.intGains) annotation (Line(points={{70.3,1}, - {79.15,1},{79.15,-1},{115,-1}}, color={0,0,127}), Text( + connect(tableInternalGains.y, gainIntGains.u) annotation (Line(points={{-19,10}, + {38,10}}, color={0,0,127})); + connect(gainIntGains.y, useProBus.intGains) annotation (Line(points={{61,10}, + {61,12},{60,12},{60,10},{88,10},{88,-0.835},{115.175,-0.835}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(realPassThrough.y, useProBus.NaturalVentilation) annotation (Line( - points={{-31.2,60},{114,60},{114,4},{115,4},{115,-1}}, color={0,0,127}), + points={{-19,70},{115,70},{115,-1}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(realPassThrough1.y, useProBus.TZoneSet) annotation (Line(points={{-15.2, - -94},{115,-94},{115,-1}}, color={0,0,127}), Text( + connect(realPassThrough1.y, useProBus.TZoneSet) annotation (Line(points={{-19,-90}, + {115,-90},{115,-1}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, diff --git a/BESMod/Systems/UserProfiles/Case600Profiles.mo b/BESMod/Systems/UserProfiles/Case600Profiles.mo index 494f65ba..13c7e187 100644 --- a/BESMod/Systems/UserProfiles/Case600Profiles.mo +++ b/BESMod/Systems/UserProfiles/Case600Profiles.mo @@ -5,48 +5,50 @@ model Case600Profiles "Case600FF profiles" Modelica.Blocks.Sources.Constant const[nZones](final k= TSetZone_nominal) "Profiles for internal gains" annotation (Placement(transformation( - extent={{23,23},{-23,-23}}, + extent={{10,10},{-10,-10}}, rotation=180, - origin={-87,-45}))); + origin={-90,-70}))); Modelica.Blocks.Sources.Constant qLatGai_flow(k=0) "Latent heat gain" - annotation (Placement(transformation(extent={{-94,8},{-86,16}}))); + annotation (Placement(transformation(extent={{-100,0},{-80,20}}))); Modelica.Blocks.Sources.Constant qConGai_flow(k=80/48) "Convective heat gain" - annotation (Placement(transformation(extent={{-114,36},{-106,44}}))); + annotation (Placement(transformation(extent={{-100,28},{-80,48}}))); Modelica.Blocks.Sources.Constant qRadGai_flow(k=120/48) "Radiative heat gain" - annotation (Placement(transformation(extent={{-102,44},{-94,52}}))); + annotation (Placement(transformation(extent={{-100,60},{-80,80}}))); Modelica.Blocks.Routing.Multiplex3 multiplex3_1 "Multiplex for internal gains" - annotation (Placement(transformation(extent={{-36,24},{-12,48}}))); + annotation (Placement(transformation(extent={{-20,20},{0,40}}))); Modelica.Blocks.Sources.Constant uSha(k=0) "Control signal for the shading device" - annotation (Placement(transformation(extent={{-36,-10},{-14,12}}))); + annotation (Placement(transformation(extent={{-40,-20},{-20,0}}))); equation - connect(const.y, useProBus.TZoneSet) annotation (Line(points={{-61.7,-45},{ - 115,-45},{115,-1}}, color={0,0,127}), Text( + connect(const.y, useProBus.TZoneSet) annotation (Line(points={{-79,-70},{115, + -70},{115,-1}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(qConGai_flow.y,multiplex3_1. u2[1]) annotation (Line( - points={{-105.6,40},{-46,40},{-46,36},{-38.4,36}}, + points={{-79,38},{-34,38},{-34,30},{-22,30}}, color={0,0,127}, smooth=Smooth.None)); connect(qLatGai_flow.y,multiplex3_1. u3[1]) annotation (Line( - points={{-85.6,12},{-38.4,12},{-38.4,27.6}}, + points={{-79,10},{-22,10},{-22,23}}, color={0,0,127}, smooth=Smooth.None)); connect(qRadGai_flow.y,multiplex3_1. u1[1]) annotation (Line( - points={{-93.6,48},{-46,48},{-46,44.4},{-38.4,44.4}}, + points={{-79,70},{-30,70},{-30,37},{-22,37}}, color={0,0,127}, smooth=Smooth.None)); - connect(multiplex3_1.y, useProBus.intGains) annotation (Line(points={{-10.8,36}, - {115,36},{115,-1}}, color={0,0,127}), Text( + connect(multiplex3_1.y, useProBus.intGains) annotation (Line(points={{1,30},{ + 74,30},{74,-0.835},{115.175,-0.835}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(uSha.y, useProBus.uSha) annotation (Line(points={{-12.9,1},{-12.9,-1}, - {115,-1}}, color={0,0,127}), Text( + connect(uSha.y, useProBus.uSha) annotation (Line(points={{-19,-10},{74,-10},{ + 74,-1},{115,-1}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, diff --git a/BESMod/Systems/UserProfiles/NoUser.mo b/BESMod/Systems/UserProfiles/NoUser.mo index 3bd5df2b..505fe7f0 100644 --- a/BESMod/Systems/UserProfiles/NoUser.mo +++ b/BESMod/Systems/UserProfiles/NoUser.mo @@ -10,12 +10,15 @@ model NoUser "No user" rotation=180, origin={-93,-31}))); equation - connect(constZero.y, useProBus.intGains) annotation (Line(points={{25.9,-1},{115, - -1},{115,-1}}, color={0,0,127}), Text( + for i in 1:3 loop + connect(constZero[i].y, useProBus.intGains[i]) annotation (Line(points={{25.9,-1}, + {115.175,-1},{115.175,-0.835}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); + end for; connect(const.y, useProBus.TZoneSet) annotation (Line(points={{-67.7,-31},{74, -31},{74,-1},{115,-1}}, color={0,0,127}), Text( string="%second", diff --git a/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo b/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo index 1ddf8ef9..1d09b092 100644 --- a/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo +++ b/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo @@ -32,7 +32,8 @@ partial model PartialVentilationSystem final show_T=show_T, final rho=rho, final cp=cp, - dpDem_nominal=distribution.dp_nominal) + dpDem_nominal=distribution.dp_nominal, + final use_openModelica=use_openModelica) annotation (choicesAllMatching=true, Placement(transformation(extent={{26,-56}, {80,-2}}))); @@ -59,23 +60,25 @@ partial model PartialVentilationSystem final allowFlowReversal=allowFlowReversal, final show_T=show_T, final rho=rho, - final cp=cp) + final cp=cp, + final use_openModelica=use_openModelica) annotation (choicesAllMatching=true, Placement(transformation(extent={{-60,-52},{-16,0}}))); replaceable Control.BaseClasses.PartialControl control constrainedby - Control.BaseClasses.PartialControl(final generationParameters( - final nParallelDem=generation.nParallelDem, - final nParallelSup=generation.nParallelSup, - final Q_flow_nominal=generation.Q_flow_nominal, - final TOda_nominal=ventilationSystemParameters.TOda_nominal, - final TDem_nominal=generation.TDem_nominal, - final TSup_nominal=generation.TSup_nominal, - final dTTra_nominal=generation.dTTra_nominal, - final m_flow_nominal=generation.m_flow_nominal, - final dp_nominal=generation.dp_nominal, - final dTLoss_nominal=generation.dTLoss_nominal, - final f_design=generation.f_design, - final QLoss_flow_nominal=generation.QLoss_flow_nominal), + Control.BaseClasses.PartialControl( + final generationParameters( + final nParallelDem=generation.nParallelDem, + final nParallelSup=generation.nParallelSup, + final Q_flow_nominal=generation.Q_flow_nominal, + final TOda_nominal=ventilationSystemParameters.TOda_nominal, + final TDem_nominal=generation.TDem_nominal, + final TSup_nominal=generation.TSup_nominal, + final dTTra_nominal=generation.dTTra_nominal, + final m_flow_nominal=generation.m_flow_nominal, + final dp_nominal=generation.dp_nominal, + final dTLoss_nominal=generation.dTLoss_nominal, + final f_design=generation.f_design, + final QLoss_flow_nominal=generation.QLoss_flow_nominal), final distributionParameters( final nParallelDem=distribution.nParallelDem, final nParallelSup=distribution.nParallelSup, @@ -88,8 +91,9 @@ partial model PartialVentilationSystem final dTLoss_nominal=distribution.dTLoss_nominal, final f_design=distribution.f_design, final TOda_nominal=ventilationSystemParameters.TOda_nominal, - final QLoss_flow_nominal=distribution.QLoss_flow_nominal)) - annotation (choicesAllMatching=true, Placement(transformation(extent={{-26,22},{28,68}}))); + final QLoss_flow_nominal=distribution.QLoss_flow_nominal), + final use_openModelica=use_openModelica) annotation (choicesAllMatching= + true, Placement(transformation(extent={{-26,22},{28,68}}))); BESMod.Systems.Interfaces.VentilationOutputs outBusVen if not use_openModelica annotation (Placement(transformation(extent={{-10,-110},{10,-90}}))); diff --git a/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo index eae79b91..632c7fb0 100644 --- a/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo @@ -1,6 +1,9 @@ within BESMod.Systems.Ventilation.Control.BaseClasses; partial model PartialControl extends BESMod.Utilities.Icons.ControlIcon; + parameter Boolean use_openModelica=true + "=true to disable features which + are not available in open modelica" annotation(Dialog(tab="Advanced")); replaceable parameter BESMod.Systems.RecordsCollection.SubsystemControlBaseDataDefinition distributionParameters constrainedby @@ -13,7 +16,7 @@ partial model PartialControl BESMod.Systems.RecordsCollection.SubsystemControlBaseDataDefinition annotation (Placement(transformation(extent={{30,-100},{50,-80}})), choicesAllMatching=true); - Interfaces.ControlOutputs outBusCtrl + Interfaces.ControlOutputs outBusCtrl if not use_openModelica annotation (Placement(transformation(extent={{90,-10},{110,10}}))); Interfaces.GenerationControlBus sigBusGen annotation (Placement(transformation(extent={{50,-110},{70,-90}}))); diff --git a/BESMod/Systems/Ventilation/Distribution/BaseClasses/PartialDistribution.mo b/BESMod/Systems/Ventilation/Distribution/BaseClasses/PartialDistribution.mo index ea27113b..f0673468 100644 --- a/BESMod/Systems/Ventilation/Distribution/BaseClasses/PartialDistribution.mo +++ b/BESMod/Systems/Ventilation/Distribution/BaseClasses/PartialDistribution.mo @@ -3,8 +3,7 @@ partial model PartialDistribution "Base distribution model for ventilation systems" extends BESMod.Utilities.Icons.DistributionIcon; - extends - BESMod.Systems.BaseClasses.PartialFluidSubsystemWithParameters; + extends BESMod.Systems.BaseClasses.PartialFluidSubsystemWithParameters; Modelica.Fluid.Interfaces.FluidPort_a portExh_in[nParallelDem]( redeclare final package Medium = Medium) @@ -28,7 +27,7 @@ partial model PartialDistribution extent={{90,-70},{110,-50}}), iconTransformation(extent={{90,-50},{110, -30}}))); Interfaces.DistributionOutputs - outBusDist + outBusDist if not use_openModelica annotation (Placement(transformation(extent={{-14,-114},{14,-84}}))); Interfaces.DistributionControlBus sigBusDistr annotation (Placement(transformation(extent={{-10,90},{10,110}}))); diff --git a/BESMod/Systems/Ventilation/Generation/BaseClasses/PartialGeneration.mo b/BESMod/Systems/Ventilation/Generation/BaseClasses/PartialGeneration.mo index 723b3e5a..b9c6b1ce 100644 --- a/BESMod/Systems/Ventilation/Generation/BaseClasses/PartialGeneration.mo +++ b/BESMod/Systems/Ventilation/Generation/BaseClasses/PartialGeneration.mo @@ -2,14 +2,13 @@ within BESMod.Systems.Ventilation.Generation.BaseClasses; partial model PartialGeneration "Base model for all ventilation generation systems" extends BESMod.Utilities.Icons.GenerationIcon; - extends - BESMod.Systems.BaseClasses.PartialFluidSubsystemWithParameters; + extends BESMod.Systems.BaseClasses.PartialFluidSubsystemWithParameters; parameter Modelica.Units.SI.PressureDifference dpDem_nominal[nParallelDem] "Nominal pressure loss of resistances in the demand system of the generation" annotation (Dialog(group= "Design - Top Down: Parameters are given by the parent system")); - Interfaces.GenerationOutputs outBusGen + Interfaces.GenerationOutputs outBusGen if not use_openModelica annotation (Placement(transformation(extent={{88,-16},{116,14}}))); Modelica.Fluid.Interfaces.FluidPort_b portVent_out[nParallelDem](redeclare final package Medium = Medium) "Outlet of the demand of Ventilation" diff --git a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo index 53e32410..f20832fd 100644 --- a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo +++ b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo @@ -13,12 +13,8 @@ partial model PartialGetHeatGenerationCurve transformation(extent={{-36,-36},{34,36}}))); Systems.Hydraulical.Interfaces.GenerationControlBus sigBusGen annotation (Placement(transformation(extent={{-72,54},{-52,74}}))); - Modelica.Blocks.Sources.Constant const(k=1) - annotation (Placement(transformation(extent={{-100,50},{-80,70}}))); Modelica.Blocks.Sources.Constant const1(k=0) annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); - Modelica.Blocks.Sources.BooleanConstant booleanConstant(k=true) - annotation (Placement(transformation(extent={{-100,-10},{-80,10}}))); Modelica.Blocks.Sources.Constant const2(k=1) annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); Modelica.Blocks.Sources.Ramp ramp @@ -72,30 +68,12 @@ equation index=-1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(const.y, sigBusGen.hp_bus.iceFacMea) annotation (Line(points={{-79,60}, - {-79,64},{-62,64}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(const1.y, sigBusGen.hr_on) annotation (Line(points={{-79,30},{-62,30}, {-62,64}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(booleanConstant.y, sigBusGen.hp_bus.modeSet) annotation (Line(points={{-79,0}, - {-62,0},{-62,64}}, color={255,0,255}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(const2.y, sigBusGen.hp_bus.nSet) annotation (Line(points={{-79,-30},{ - -62,-30},{-62,64}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(generation.portGen_in, vol.ports[1:1]) annotation (Line(points={{34,14.4}, {62,14.4},{62,20},{83,20}}, color={0,127,255})); connect(heatingCurve.TOda, ramp.y) annotation (Line(points={{-22.2,-71},{-26, @@ -125,6 +103,12 @@ equation annotation (Line(points={{34,28.8},{81,28.8},{81,20}}, color={0,127,255})); connect(heatingCurve.TSet, prescribedTemperature.T) annotation (Line(points={ {3.1,-71},{20.55,-71},{20.55,-70},{38,-70}}, color={0,0,127})); + connect(const2.y, sigBusGen.yHeaPumSet) annotation (Line(points={{-79,-30},{ + -72,-30},{-72,64},{-62,64}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Utilities/KPIs/IntegralKPICalculator.mo b/BESMod/Utilities/KPIs/EnergyKPICalculator.mo similarity index 72% rename from BESMod/Utilities/KPIs/IntegralKPICalculator.mo rename to BESMod/Utilities/KPIs/EnergyKPICalculator.mo index 557ecf54..61cc143d 100644 --- a/BESMod/Utilities/KPIs/IntegralKPICalculator.mo +++ b/BESMod/Utilities/KPIs/EnergyKPICalculator.mo @@ -1,29 +1,27 @@ within BESMod.Utilities.KPIs; -model IntegralKPICalculator "Give integral and value as KPI" +model EnergyKPICalculator "Give integral and value as KPI" extends BaseClasses.KPIIcon; parameter Boolean use_inpCon=true "= false to use an internal variable as input"; - parameter String unit "Unit of signal"; - parameter String intUnit "Unit of integral of signal"; - Modelica.Blocks.Interfaces.RealInput y(unit=unit) if not use_inpCon + Modelica.Blocks.Interfaces.RealInput y(unit="W") if not use_inpCon "Value of Real input"; Modelica.Blocks.Continuous.Integrator integrator2( use_reset=false, y_start=Modelica.Constants.eps, - y(unit=intUnit)) + y(unit="J")) annotation (Placement(transformation(extent={{20,-40},{40,-20}}))); - Modelica.Blocks.Routing.RealPassThrough internalU(y(unit=unit)) + Modelica.Blocks.Routing.RealPassThrough internalU(y(unit="W")) annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-30,0}))); - Modelica.Blocks.Interfaces.RealInput u(unit=unit) if use_inpCon + Modelica.Blocks.Interfaces.RealInput u(unit="W") if use_inpCon "Connector of Real input signal" annotation (Placement(transformation(extent={{-138,-20},{-98,20}}))); - BaseClasses.KPIIntegral KPI + BaseClasses.KPIIntegral KPI(value(unit="W"), integral(unit="J")) annotation (Placement(transformation(extent={{102,-20},{142,20}}), iconTransformation(extent={{102,-20},{142,20}}))); equation @@ -39,11 +37,9 @@ equation {72,0.1},{122.1,0.1}}, color={0,0,127})); connect(internalU.u,u) annotation (Line(points={{-42,0},{-118,0}}, color={0,0,127})); - connect(internalU.u,y) - annotation (Line(points={{-42,0},{-72,0},{-72,-20},{-79,-20}}, - color={0,0,127})); + connect(internalU.u,y); annotation (Documentation(info="

Calculates the integral of the given value and passes the value as well.

Useful to output value and integral directly.

")); -end IntegralKPICalculator; +end EnergyKPICalculator; diff --git a/BESMod/Utilities/KPIs/package.order b/BESMod/Utilities/KPIs/package.order index 8ff98283..2a187e57 100644 --- a/BESMod/Utilities/KPIs/package.order +++ b/BESMod/Utilities/KPIs/package.order @@ -1,5 +1,5 @@ CountTimeDiscomfort ComfortCalculator DeviceKPICalculator -IntegralKPICalculator +EnergyKPICalculator BaseClasses From c46a71e74edf9bf3127541e432f14a3cc42e641c Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 7 Nov 2022 13:38:05 +0100 Subject: [PATCH 066/131] default use_OM=false --- BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo | 2 +- BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo | 2 +- BESMod/Systems/Control/BaseClasses/PartialControl.mo | 2 +- BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo | 2 +- .../Systems/Electrical/BaseClasses/PartialElectricalSystem.mo | 2 +- BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo | 2 +- .../Electrical/Distribution/BaseClasses/PartialDistribution.mo | 2 +- .../Electrical/Generation/BaseClasses/PartialGeneration.mo | 2 +- .../Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo | 2 +- .../Systems/Hydraulical/Control/BaseClasses/PartialControl.mo | 2 +- .../Systems/Ventilation/Control/BaseClasses/PartialControl.mo | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo index 8d69a2c4..8c9622cb 100644 --- a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo +++ b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo @@ -1,7 +1,7 @@ within BESMod.Systems.BaseClasses; partial model PartialBuildingEnergySystem "Partial BES" - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); diff --git a/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo b/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo index 959f3ad7..1747ce10 100644 --- a/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo +++ b/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo @@ -2,7 +2,7 @@ within BESMod.Systems.BaseClasses; model PartialFluidSubsystem "Model for a partial subsystem based on the IBPSA fluid core" extends IBPSA.Fluid.Interfaces.LumpedVolumeDeclarations; - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); diff --git a/BESMod/Systems/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Control/BaseClasses/PartialControl.mo index 5b7aee40..2622e89c 100644 --- a/BESMod/Systems/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Control/BaseClasses/PartialControl.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Control.BaseClasses; partial model PartialControl "Model for a partial HEMS control" extends BESMod.Utilities.Icons.ControlIcon; - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); Hydraulical.Interfaces.SystemControlBus sigBusHyd annotation (Placement( diff --git a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo index bd6512c8..83c56d10 100644 --- a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo +++ b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Demand.Building.BaseClasses; partial model PartialDemand "Partial demand model for HPS" extends BESMod.Utilities.Icons.BuildingIcon; - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nZones(min=1) "Number of zones /rooms"; diff --git a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo index 1c360e29..10c11b34 100644 --- a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo +++ b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.BaseClasses; partial model PartialElectricalSystem "Partial model for electrical system" - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nLoadsExtSubSys(min=1) = 4 "Number of external subsystems which result in electrical load / generation"; diff --git a/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo index 3163a94c..68157d97 100644 --- a/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Control.BaseClasses; partial model PartialControl "Partial electrical control model" - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); Interfaces.GenerationControlBus generationControlBus annotation (Placement( diff --git a/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo b/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo index 01ad6213..88fb6d54 100644 --- a/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo +++ b/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Distribution.BaseClasses; partial model PartialDistribution - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nSubSys(min=2) diff --git a/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo b/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo index a2d5196d..2aaebab1 100644 --- a/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo +++ b/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Electrical.Generation.BaseClasses; partial model PartialGeneration "Basic model with interfaces for electrical generation package" - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer numGenUnits(min=1) "Number of generation (e.g. PV module) units" diff --git a/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo b/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo index b986fc05..4caaeb84 100644 --- a/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo +++ b/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Transfer.BaseClasses; partial model PartialTransfer "Partial model for transfer subsystems" - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nParallelDem(min=1) diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo index 7305a0c4..19191c75 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo @@ -2,7 +2,7 @@ within BESMod.Systems.Hydraulical.Control.BaseClasses; partial model PartialControl "Partial controller for HPS" extends BESMod.Utilities.Icons.ControlIcon; parameter Boolean use_dhw "=false to disable DHW"; - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); diff --git a/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo index 632c7fb0..893befce 100644 --- a/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Ventilation.Control.BaseClasses; partial model PartialControl extends BESMod.Utilities.Icons.ControlIcon; - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); replaceable parameter From f6433fa9aea0c5a68174b46927bfb28c86627132 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 8 Nov 2022 09:16:10 +0100 Subject: [PATCH 067/131] Fix controls --- .../Generation/HeatPumpAndHeatingRod.mo | 4 ++-- .../Transfer/IdealValveRadiator.mo | 24 ++++++++++++------- BESMod/Utilities/KPIs/EnergyKPICalculator.mo | 8 +++---- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index ba23b277..89cf1636 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -228,9 +228,9 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" extent={{-11,-11},{11,11}}, rotation=0, origin={-169,11}))); - Modelica.Blocks.Sources.RealExpression reaExpTHeaPumOut(y=heatPump.innerCycle.Pel) + Modelica.Blocks.Sources.RealExpression reaExpTHeaPumOut(y=heatPump.senT_b1.T) annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); - Modelica.Blocks.Sources.RealExpression reaExpTHeaPumIn(y=heatPump.innerCycle.Pel) + Modelica.Blocks.Sources.RealExpression reaExpTHeaPumIn(y=heatPump.senT_a1.T) annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); Modelica.Blocks.Sources.BooleanConstant conNotRev(final k=true) annotation ( Placement(transformation( diff --git a/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo index e029a8cc..aa6e52c2 100644 --- a/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo +++ b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo @@ -95,6 +95,10 @@ model IdealValveRadiator origin={-66,10}))); BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{30,-106},{50,-86}}))); + Modelica.Blocks.Routing.RealPassThrough reaPasThrOpe[nParallelDem] annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={10,70}))); equation connect(rad.heatPortRad, heatPortRad) annotation (Line(points={{-5.08,-31.2}, {40,-31.2},{40,-40},{100,-40}}, color={191,0,0})); @@ -108,12 +112,6 @@ equation {-76,39.5},{-51,39.5}}, color={0,127,255})); end for; - connect(gain.u, traControlBus.opening) annotation (Line(points={{8,46},{8,90}, - {0,90},{0,100}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); connect(res1.port_b, pumpFix_m_flow.port_a) annotation (Line(points={{-26,39.5}, {-26,38},{-15,38},{-15,20}}, color={0,127,255})); connect(pumpFix_m_flow.port_b, rad.port_a) annotation (Line(points={{-15,-2},{ @@ -134,10 +132,18 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(gain.u, outBusTra.opening) annotation (Line(points={{8,46},{8,52},{22, - 52},{22,-88},{0,-88},{0,-104}}, color={0,0,127}), Text( + connect(reaPasThrOpe.y, outBusTra.opening) annotation (Line(points={{10,59},{ + 10,54},{26,54},{26,-70},{0,-70},{0,-104}}, color={0,0,127}), Text( string="%second", index=1, - extent={{-6,3},{-6,3}}, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(reaPasThrOpe.u, traControlBus.opening) annotation (Line(points={{10, + 82},{10,86},{0,86},{0,100}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); + connect(reaPasThrOpe.y, gain.u) + annotation (Line(points={{10,59},{10,52},{8,52},{8,46}}, color={0,0,127})); end IdealValveRadiator; diff --git a/BESMod/Utilities/KPIs/EnergyKPICalculator.mo b/BESMod/Utilities/KPIs/EnergyKPICalculator.mo index 61cc143d..75cfd5ad 100644 --- a/BESMod/Utilities/KPIs/EnergyKPICalculator.mo +++ b/BESMod/Utilities/KPIs/EnergyKPICalculator.mo @@ -4,21 +4,21 @@ model EnergyKPICalculator "Give integral and value as KPI" parameter Boolean use_inpCon=true "= false to use an internal variable as input"; - Modelica.Blocks.Interfaces.RealInput y(unit="W") if not use_inpCon + Modelica.Blocks.Interfaces.RealInput y(final unit="W") if not use_inpCon "Value of Real input"; Modelica.Blocks.Continuous.Integrator integrator2( use_reset=false, y_start=Modelica.Constants.eps, - y(unit="J")) + y(final unit="J")) annotation (Placement(transformation(extent={{20,-40},{40,-20}}))); - Modelica.Blocks.Routing.RealPassThrough internalU(y(unit="W")) + Modelica.Blocks.Routing.RealPassThrough internalU(y(final unit="W")) annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-30,0}))); - Modelica.Blocks.Interfaces.RealInput u(unit="W") if use_inpCon + Modelica.Blocks.Interfaces.RealInput u(final unit="W") if use_inpCon "Connector of Real input signal" annotation (Placement(transformation(extent={{-138,-20},{-98,20}}))); BaseClasses.KPIIntegral KPI(value(unit="W"), integral(unit="J")) From 7cdbea4a013904b2ca23339f9ce2b1ac8b92df84 Mon Sep 17 00:00:00 2001 From: "philipp.schmitz3" Date: Fri, 20 Jan 2023 16:16:43 +0100 Subject: [PATCH 068/131] Add hydraulic modules based on BDH and Bagarella --- .../SolarThermalSystem/SolarThermalAixLib.mo | 2 -- .../SolarThermalBuildings.mo | 2 -- BESMod/Examples/UseCaseHOM/package.mo | 4 --- BESMod/Examples/package.order | 1 + .../Demand/DHW/BaseClasses/PartialDHW.mo | 8 +++--- BESMod/Systems/Demand/DHW/DHW.mo | 3 +-- .../Electrical/Tests/ElectricalSystem.mo | 1 - .../Control/BaseClasses/package.order | 1 + .../Control/MonovalentGasBoiler.mo | 4 +-- .../Systems/Hydraulical/Control/package.order | 3 +++ .../Hydraulical/Distribution/CombiStorage.mo | 4 +-- .../DistributionTwoStorageParallel.mo | 4 +-- .../Hydraulical/Distribution/package.order | 3 +++ .../RecordsCollection/package.order | 1 + .../Hydraulical/Generation/package.order | 4 +++ .../Hydraulical/Transfer/UFHTransferSystem.mo | 4 +-- .../RecordsCollection/Movers/package.order | 1 + BESMod/Systems/UserProfiles/NoUserHOM.mo | 25 ------------------- BESMod/package.mo | 15 +++++------ 19 files changed, 34 insertions(+), 56 deletions(-) delete mode 100644 BESMod/Examples/UseCaseHOM/package.mo delete mode 100644 BESMod/Systems/UserProfiles/NoUserHOM.mo diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo index bd263cb9..bcbd9c28 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo @@ -9,12 +9,10 @@ model SolarThermalAixLib "Solar thermal collector from AixLib" redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP heatPumpParameters(genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentParallel), - redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR heatingRodParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo index 1ea3ff7c..3aac7e32 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo @@ -10,12 +10,10 @@ model SolarThermalBuildings redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP heatPumpParameters(genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentParallel), - redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR heatingRodParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor diff --git a/BESMod/Examples/UseCaseHOM/package.mo b/BESMod/Examples/UseCaseHOM/package.mo deleted file mode 100644 index c3699964..00000000 --- a/BESMod/Examples/UseCaseHOM/package.mo +++ /dev/null @@ -1,4 +0,0 @@ -within BESMod.Examples; -package UseCaseHOM "Use case of the high order model from AixLib" - extends Modelica.Icons.ExamplesPackage; -end UseCaseHOM; diff --git a/BESMod/Examples/package.order b/BESMod/Examples/package.order index 2852fa83..a8080204 100644 --- a/BESMod/Examples/package.order +++ b/BESMod/Examples/package.order @@ -4,3 +4,4 @@ BAUSimStudy UseCaseHighOrderModel SolarThermalSystem GasBoilerBuildingOnly +BivalentHeatPumpSystems diff --git a/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo index dc387679..d80155da 100644 --- a/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo +++ b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo @@ -19,12 +19,12 @@ partial model PartialDHW "Partial model for domestic hot water (DHW)" parameter Modelica.Units.SI.Time tCrit(displayUnit="h") "Time for critical period. Based on EN 15450" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem", enable=designType <> BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.NoStorage)); parameter Real QCrit "Energy demand in kWh during critical period. Based on EN 15450" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem", enable=designType == BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.PartStorage)); - Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare final package Medium - = Medium) "Inlet for the demand of DHW" annotation (Placement( + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare final package Medium = + Medium) "Inlet for the demand of DHW" annotation (Placement( transformation(extent={{-110,50},{-90,70}}), iconTransformation(extent={{-110,50}, {-90,70}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare final package Medium - = Medium) "Outlet of the demand of DHW" annotation (Placement( + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare final package Medium = + Medium) "Outlet of the demand of DHW" annotation (Placement( transformation(extent={{-110,-70},{-90,-50}}), iconTransformation( extent={{-110,-70},{-90,-50}}))); BESMod.Systems.Interfaces.DHWOutputs outBusDHW if not use_openModelica diff --git a/BESMod/Systems/Demand/DHW/DHW.mo b/BESMod/Systems/Demand/DHW/DHW.mo index 3c164d27..c0475dee 100644 --- a/BESMod/Systems/Demand/DHW/DHW.mo +++ b/BESMod/Systems/Demand/DHW/DHW.mo @@ -8,8 +8,7 @@ model DHW "Standard DHW subsystem" VDHWDay=if use_dhwCalc then V_dhwCalc_day else DHWProfile.VDHWDay, mDHW_flow_nominal=DHWProfile.m_flow_nominal); replaceable parameter Systems.Demand.DHW.RecordsCollection.ProfileM - DHWProfile constrainedby Systems.Demand.DHW.RecordsCollection.PartialDHWTap - annotation (choicesAllMatching=true, Dialog( + DHWProfile constrainedby Systems.Demand.DHW.RecordsCollection.PartialDHWTap annotation (choicesAllMatching=true, Dialog( enable=not use_dhwCalc and use_dhw)); parameter Boolean use_dhwCalc=false "=true to use the tables in DHWCalc. Will slow down the simulation, but represents DHW tapping more in a more realistic way." annotation (Dialog(enable=use_dhw)); diff --git a/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo b/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo index 5f871b5f..30bfe355 100644 --- a/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo +++ b/BESMod/Systems/Electrical/Tests/ElectricalSystem.mo @@ -25,7 +25,6 @@ model ElectricalSystem redeclare Generation.PVSystemMultiSub generation( redeclare model CellTemperature = AixLib.Electrical.PVSystem.BaseClasses.CellTemperatureMountingContactToGround, - redeclare AixLib.DataBase.SolarElectric.SchuecoSPV170SME1 pVParameters, lat=weaDat.lat, lon=weaDat.lon, diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order index 622d4a4b..893b8882 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order @@ -1,3 +1,4 @@ PartialControl SystemWithThermostaticValveControl PartialTwoPoint_HPS_Controller +PartialTwoPoint_HPS_Controller_BivalentBoiler diff --git a/BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo b/BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo index 4770399b..71b20b6d 100644 --- a/BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo @@ -75,8 +75,8 @@ model MonovalentGasBoiler "PI Control of gas boiler" extent={{-10,-10},{10,10}}, rotation=0, origin={-70,-50}))); - Modelica.Blocks.Math.BooleanToReal booToRea(final realTrue=1, final realFalse - =0) if use_dhw "Convert boolean signal to real for valve" annotation ( + Modelica.Blocks.Math.BooleanToReal booToRea(final realTrue=1, final realFalse= + 0) if use_dhw "Convert boolean signal to real for valve" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, diff --git a/BESMod/Systems/Hydraulical/Control/package.order b/BESMod/Systems/Hydraulical/Control/package.order index c096d721..146f99c8 100644 --- a/BESMod/Systems/Hydraulical/Control/package.order +++ b/BESMod/Systems/Hydraulical/Control/package.order @@ -10,3 +10,6 @@ PartBiv_PI_ConOut_HPS Components BaseClasses RecordsCollection +NewControlBivalentSeries +NewControlBivalentSystem3_and_4 +NewControlBivalentParallel diff --git a/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo b/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo index ebd50b35..2a697883 100644 --- a/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo +++ b/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo @@ -7,7 +7,6 @@ model CombiStorage final VStoDHW=parameters.V, final QDHWStoLoss_flow=parameters.QLoss_flow, designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.PartStorage, - dTTraDHW_nominal=parameters.dTLoadingHC1, final m_flow_nominal=mDem_flow_nominal, dTTra_nominal={0}, @@ -128,12 +127,11 @@ equation horizontalAlignment=TextAlignment.Right)); connect(portGen_in[2], bufSto.portHC2In) annotation (Line( points={{-100,82.5},{-66,82.5},{-66,22},{-46,22},{-46,22.5},{-26.3,22.5}}, - color={255,255,0}, thickness=0.5)); + connect(portGen_out[2], bufSto.portHC2Out) annotation (Line( points={{-100,42.5},{-78,42.5},{-78,14},{-52,14},{-52,12.9},{-26.3,12.9}}, - color={255,255,0}, thickness=0.5)); diff --git a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo index 8a47a625..458af552 100644 --- a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo @@ -6,7 +6,7 @@ model DistributionTwoStorageParallel final QDHWStoLoss_flow=dhwParameters.QLoss_flow, designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.PartStorage, final dpDem_nominal={0}, - final dpSup_nominal={2*(threeWayValveParameters.dpValve_nominal + max( + dpSup_nominal={2*(threeWayValveParameters.dpValve_nominal + max( threeWayValveParameters.dp_nominal))}, final dTTraDHW_nominal=dhwParameters.dTLoadingHC1, final dTTra_nominal={bufParameters.dTLoadingHC1}, @@ -14,7 +14,7 @@ model DistributionTwoStorageParallel final TSup_nominal=TDem_nominal .+ dTLoss_nominal .+ dTTra_nominal, dTLoss_nominal=fill(0, nParallelDem), final m_flow_nominal=mDem_flow_nominal, - final nParallelSup=1, + nParallelSup=1, final nParallelDem=1); AixLib.Fluid.Storage.Storage storageDHW( diff --git a/BESMod/Systems/Hydraulical/Distribution/package.order b/BESMod/Systems/Hydraulical/Distribution/package.order index 7ff5d58f..7adf3026 100644 --- a/BESMod/Systems/Hydraulical/Distribution/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/package.order @@ -9,3 +9,6 @@ RecordsCollection Tests BaseClasses Types +BivalentSystem4_DistributionTwoStorageParallel +BivalentSystemBAforSystem3 +BivalentSystemBAandNewTankforSystem3 diff --git a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/package.order b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/package.order index f00bd45b..2b765aac 100644 --- a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/package.order +++ b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/package.order @@ -4,3 +4,4 @@ SolarThermalBaseDataDefinition DefaultSolarThermal HeatPumpBaseDataDefinition DefaultHP +BivalentHeatPumpBaseDataDefinition diff --git a/BESMod/Systems/Hydraulical/Generation/package.order b/BESMod/Systems/Hydraulical/Generation/package.order index 81e4d3a5..f9a63fa0 100644 --- a/BESMod/Systems/Hydraulical/Generation/package.order +++ b/BESMod/Systems/Hydraulical/Generation/package.order @@ -8,3 +8,7 @@ Tests RecordsCollection Types BaseClasses +HeatPumpAndBoilerSerie +HeatPumpAndGasBoilerSerie +HeatPumpAndGasBoilerParallel +OnlyHeatPump diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index c82ffbe4..0c8479b9 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -29,8 +29,8 @@ model UFHTransferSystem origin={9.5,9.5}))); Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemp[nParallelDem]( - each final T=UFHParameters.T_floor) "Fixed floor temperature" annotation - (Placement(transformation( + each final T=UFHParameters.T_floor) "Fixed floor temperature" annotation ( + Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-90,10}))); diff --git a/BESMod/Systems/RecordsCollection/Movers/package.order b/BESMod/Systems/RecordsCollection/Movers/package.order index 254c4935..f11a073c 100644 --- a/BESMod/Systems/RecordsCollection/Movers/package.order +++ b/BESMod/Systems/RecordsCollection/Movers/package.order @@ -1,3 +1,4 @@ AutomaticConfigurationData MoverBaseDataDefinition DefaultMover +DefaultMoverBA diff --git a/BESMod/Systems/UserProfiles/NoUserHOM.mo b/BESMod/Systems/UserProfiles/NoUserHOM.mo deleted file mode 100644 index fb7f9973..00000000 --- a/BESMod/Systems/UserProfiles/NoUserHOM.mo +++ /dev/null @@ -1,25 +0,0 @@ -within BESMod.Systems.UserProfiles; -model NoUserHOM "No user in high order model" - extends BaseClasses.PartialUserProfiles; - - Modelica.Blocks.Sources.Constant constZero[nZones](each k=0) - annotation (Placement(transformation(extent={{-20,-20},{18,18}}))); - Modelica.Blocks.Sources.Constant const[nZones](k=TSetZone_nominal) - "Profiles for internal gains" annotation (Placement(transformation( - extent={{23,23},{-23,-23}}, - rotation=180, - origin={-93,-31}))); -equation - connect(constZero.y, useProBus.intGains) annotation (Line(points={{19.9,-1},{ - 115,-1}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(const.y, useProBus.TZoneSet) annotation (Line(points={{-67.7,-31},{74, - -31},{74,-1},{115,-1}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); -end NoUserHOM; diff --git a/BESMod/package.mo b/BESMod/package.mo index 32d98b3d..68ec6ac8 100644 --- a/BESMod/package.mo +++ b/BESMod/package.mo @@ -3,17 +3,18 @@ package BESMod extends Modelica.Icons.Package; annotation ( - version="0.3.0", + version="0.3.1", uses( BuildingSystems(version="2.0.0-beta"), Modelica(version="4.0.0"), SDF(version="0.4.2"), - AixLib(version="1.3.1"), - IBPSA(version="4.0.0")), - conversion(from( - version="0.2.2", - script="modelica://BESMod/Resources/Scripts/ConvertBESMod_from_0.2.2_to_0.3.0.mos" - )), + AixLib(version="1.3.2"), + IBPSA(version="3.0.0")), + conversion(from( + version="0.2.2", + script="modelica://BESMod/Resources/Scripts/ConvertBESMod_from_0.2.2_to_0.3.0.mos", + to="0.3.0"), from(version="0.3.0", script= + "modelica://BESMod/Resources/Scripts/ConvertFromBESMod_0.3.0.mos")), Icon(graphics={Bitmap(extent={{-100,-100},{100,100}}, fileName="modelica://BESMod/Resources/Images/BESMod_icon.png")})); end BESMod; From f83beafcc3a26b253af4ff5028f9d5302150cdf8 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 30 Jan 2023 16:55:18 +0100 Subject: [PATCH 069/131] revert --- .../PartialBuildingEnergySystem.mo | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo index 6a4ab269..911870ac 100644 --- a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo +++ b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo @@ -162,12 +162,12 @@ protected equation connect(building.weaBus, weaDat.weaBus) annotation (Line( - points={{17.54,78.475},{24,78.475},{24,88},{-16,88},{-16,206},{-214,206}, - {-214,70},{-220,70}}, + points={{17.54,78.76},{24,78.76},{24,88},{-16,88},{-16,206},{-214,206},{ + -214,70},{-220,70}}, color={255,204,51}, thickness=0.5)); connect(building.outBusDem, outputs.building) annotation (Line( - points={{75.26,53.775},{75.26,38},{96,38},{96,0},{285,0}}, + points={{75.26,39.24},{75.26,38},{96,38},{96,0},{285,0}}, color={175,175,175}, thickness=0.5), Text( string="%second", @@ -181,8 +181,8 @@ equation if systemParameters.use_hydraulic then connect(building.buiMeaBus, hydraulic.buiMeaBus) annotation (Line( - points={{39,77.7625},{44,77.7625},{44,88},{-26,88},{-26,10},{-86.7474,10}, - {-86.7474,-2.34286}}, + points={{39,77.62},{44,77.62},{44,88},{-26,88},{-26,10},{-86.7474,10},{ + -86.7474,-2.34286}}, color={255,128,0}, thickness=0.5)); connect(weaDat.weaBus, hydraulic.weaBus) annotation (Line( @@ -199,11 +199,11 @@ equation extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); connect(hydraulic.heatPortRad,building.heatPortRad) annotation (Line( - points={{-42,-50},{-42,-48},{-18,-48},{-18,18},{0,18},{0,40},{2,40}}, - color={191, + points={{-42,-50},{-42,-48},{-18,-48},{-18,18},{0,18},{0,17.2},{2, + 17.2}}, color={191, 0,0})); connect(hydraulic.heatPortCon,building.heatPortCon) annotation (Line( - points={{-42,-23.2571},{-42,-24},{-20,-24},{-20,68.5},{2,68.5}},color= + points={{-42,-23.2571},{-42,-24},{-20,-24},{-20,62.8},{2,62.8}},color= {191,0,0})); connect(userProfiles.useProBus, hydraulic.useProBus) annotation (Line( points={{-225.167,150.775},{-214,150.775},{-214,16},{-157.358,16},{ @@ -252,9 +252,9 @@ equation if systemParameters.use_ventilation then connect(building.portVent_in, ventilation.portVent_in) annotation (Line( - points={{76,63.275},{84,63.275},{84,55.2},{122,55.2}}, color={0,127,255})); + points={{76,54.44},{84,54.44},{84,55.2},{122,55.2}}, color={0,127,255})); connect(building.portVent_out, ventilation.portVent_out) annotation (Line( - points={{76,44.75},{84,44.75},{84,25.56},{122,25.56}}, + points={{76,24.8},{84,24.8},{84,25.56},{122,25.56}}, color={0,127,255})); connect(ventilation.outBusVen, outputs.ventilation) annotation (Line( points={{159,2},{158,2},{158,-26},{244,-26},{244,0},{285,0}}, @@ -274,7 +274,7 @@ equation color={0,127,0}, thickness=0.5)); connect(building.buiMeaBus, ventilation.buiMeaBus) annotation (Line( - points={{39,77.7625},{44,77.7625},{44,88},{177.87,88},{177.87,78.38}}, + points={{39,77.62},{44,77.62},{44,88},{177.87,88},{177.87,78.38}}, color={255,128,0}, thickness=0.5)); connect(control.sigBusVen, ventilation.sigBusVen) annotation (Line( @@ -293,15 +293,15 @@ equation connect(building.internalElectricalPin, electrical.internalElectricalPin[4]) annotation (Line( - points={{64.9,31.45},{64.9,-26},{112,-26},{112,-140},{-210,-140},{-210, - 118},{-198,118},{-198,118.171}}, + points={{64.9,3.52},{64.9,-26},{112,-26},{112,-140},{-210,-140},{-210,118}, + {-198,118},{-198,118.171}}, color={0,0,0}, thickness=1)); if systemParameters.use_elecHeating then connect(electrical.heatPortCon, building.heatPortCon) annotation (Line(points={{ - -41.0824,92.8},{-30,92.8},{-30,68.5},{2,68.5}}, color={191,0,0})); + -41.0824,92.8},{-30,92.8},{-30,62.8},{2,62.8}}, color={191,0,0})); connect(electrical.heatPortRad, building.heatPortRad) annotation (Line(points={{ - -41.0824,67.4286},{-24,67.4286},{-24,40},{2,40}}, + -41.0824,67.4286},{-24,67.4286},{-24,17.2},{2,17.2}}, color={191,0,0})); end if; connect(control.outBusCtrl, outputs.control) annotation (Line( @@ -318,7 +318,7 @@ equation thickness=0.5)); connect(electrical.buiMeaBus, building.buiMeaBus) annotation (Line( points={{-83.2941,136},{-82,136},{-82,146},{-16,146},{-16,88},{44,88},{44, - 82},{39,82},{39,77.7625}}, + 82},{39,82},{39,77.62}}, color={255,128,0}, thickness=0.5)); connect(electrical.outBusElect, outputs.electrical) annotation (Line( @@ -349,4 +349,4 @@ equation -140},{280,200}})), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-280,-140},{280,200}}))); -end PartialBuildingEnergySystem; +end PartialBuildingEnergySystem; \ No newline at end of file From b7b42ab429ccd27446d2b092237dd523ee308478 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 30 Jan 2023 16:55:52 +0100 Subject: [PATCH 070/131] revert --- BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo index 911870ac..19c64040 100644 --- a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo +++ b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo @@ -349,4 +349,4 @@ equation -140},{280,200}})), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-280,-140},{280,200}}))); -end PartialBuildingEnergySystem; \ No newline at end of file +end PartialBuildingEnergySystem; From 3b85fe117c94fbac24eb802d10c47415e6a893d3 Mon Sep 17 00:00:00 2001 From: "Philipp.Schmitz3" Date: Mon, 6 Feb 2023 15:59:06 +0100 Subject: [PATCH 071/131] small improvments and adjusting similar code to main --- BESMod/Examples/BivalentHeatPumpSystems.mo | 448 +++++++++++++ .../PartialSolarThermalHPS.mo | 3 +- BESMod/Examples/UseCaseHOM/BES_HOM.mo | 96 --- BESMod/Examples/UseCaseHOM/HOMSystem.mo | 13 - BESMod/Examples/UseCaseHOM/package.order | 2 - .../Scripts/ConvertFromBESMod_0.3.0.mos | 3 + .../PartialBuildingEnergySystem.mo | 16 +- .../Demand/Building/AixLibHighOrder.mo | 4 +- .../BaseClasses/PartialAixLibHighOrder.mo | 8 +- .../Building/BaseClasses/PartialDemand.mo | 8 +- .../Demand/Building/BuildingsRoomCase600FF.mo | 2 +- .../BaseClasses/PartialAixLibHighOrder.mo | 8 +- .../Demand/Building/TEASERThermalZone.mo | 22 +- BESMod/Systems/Demand/DHW/DHW.mo | 7 +- .../BaseClasses/PartialElectricalSystem.mo | 4 +- .../HeatingRodWithSecurityControl.mo | 4 +- ...lTwoPoint_HPS_Controller_BivalentBoiler.mo | 390 ++++++++++++ .../ThermostaticValvePControlled.mo | 3 +- .../Control/MonovalentGasBoiler.mo | 4 +- .../Control/NewControlBivalentParallel.mo | 250 ++++++++ .../Control/NewControlBivalentSerial.mo | 204 ++++++ ...ControlBivalentSystem_BoilerAfterBuffer.mo | 205 ++++++ .../Systems/Hydraulical/Control/package.order | 4 +- ...lDistributionTwoStorageParallelDetailed.mo | 20 +- ...stributionWithBoilerAfterBuffer_WithDHW.mo | 601 ++++++++++++++++++ ...ibutionWithBoilerAfterBuffer_WithoutDHW.mo | 320 ++++++++++ .../Hydraulical/Distribution/CombiStorage.mo | 13 +- .../Valves/Tests/PressureReliefExample.mo | 2 +- .../Hydraulical/Distribution/package.order | 5 +- .../Hydraulical/Generation/GasBoiler.mo | 11 +- .../Generation/HeatPumpAndBoilerSerie.mo | 315 +++++++++ .../HeatPumpAndGasBoilerParallel.mo | 460 ++++++++++++++ .../Generation/HeatPumpAndGasBoilerSerial.mo | 416 ++++++++++++ .../Generation/HeatPumpAndHeatingRod.mo | 4 +- .../Hydraulical/Generation/OnlyHeatPump.mo | 367 +++++++++++ .../BivalentHeatPumpBaseDataDefinition.mo | 63 ++ .../Hydraulical/Generation/package.order | 2 +- .../Hydraulical/Transfer/UFHTransferSystem.mo | 35 +- .../Movers/DefaultMoverBA.mo | 11 + .../Ventilation/Control/SummerPIDByPass.mo | 4 +- BESMod/Tutorial/MyOwnModule.mo | 4 +- BESMod/Utilities/KPIs/ComfortCalculator.mo | 2 +- BESMod/Utilities/KPIs/DeviceKPICalculator.mo | 12 +- 43 files changed, 4150 insertions(+), 225 deletions(-) create mode 100644 BESMod/Examples/BivalentHeatPumpSystems.mo delete mode 100644 BESMod/Examples/UseCaseHOM/BES_HOM.mo delete mode 100644 BESMod/Examples/UseCaseHOM/HOMSystem.mo delete mode 100644 BESMod/Examples/UseCaseHOM/package.order create mode 100644 BESMod/Resources/Scripts/ConvertFromBESMod_0.3.0.mos create mode 100644 BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo create mode 100644 BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo create mode 100644 BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo create mode 100644 BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo create mode 100644 BESMod/Systems/Hydraulical/Distribution/BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW.mo create mode 100644 BESMod/Systems/Hydraulical/Distribution/BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW.mo create mode 100644 BESMod/Systems/Hydraulical/Generation/HeatPumpAndBoilerSerie.mo create mode 100644 BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo create mode 100644 BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerSerial.mo create mode 100644 BESMod/Systems/Hydraulical/Generation/OnlyHeatPump.mo create mode 100644 BESMod/Systems/Hydraulical/Generation/RecordsCollection/BivalentHeatPumpBaseDataDefinition.mo create mode 100644 BESMod/Systems/RecordsCollection/Movers/DefaultMoverBA.mo diff --git a/BESMod/Examples/BivalentHeatPumpSystems.mo b/BESMod/Examples/BivalentHeatPumpSystems.mo new file mode 100644 index 00000000..d1ed3f4a --- /dev/null +++ b/BESMod/Examples/BivalentHeatPumpSystems.mo @@ -0,0 +1,448 @@ +within BESMod.Examples; +package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" + extends Modelica.Icons.ExamplesPackage; + + record ParametersToChange + extends + Systems.RecordsCollection.ParameterStudy.ParameterStudyBaseDefinition; + // 1. Add parameters like this (WITH Evaluate=false)! + // parameter Modelica.SIunits.Volume V=0.5 annotation(Evaluate=false); + // 2. Overwrite the default parameter in the system simulation + // via the graphical interface, resulting in e.g. + // Distribution.parameters.V = parameterStudy.V + + parameter Modelica.Units.SI.Temperature TCutOff=263.15 "Cut off temperature" + annotation (Evaluate=false); + parameter Modelica.Units.SI.Temperature TBiv=268.15 "Bivalence temperature" + annotation (Evaluate=false); + parameter Real VPerQFlow=23.5 "Litre of storage volume per kilowatt thermal power demand" annotation(Evaluate=false); + parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff=3000 + annotation (Evaluate=false); + parameter Modelica.Units.SI.HeatFlowRate QHP_flow_biv=4000 + annotation (Evaluate=false); + end ParametersToChange; + + record AachenSystem + extends Systems.RecordsCollection.SystemParametersBaseDataDefinition( + use_elecHeating=false, + nZones=1, + filNamWea=Modelica.Utilities.Files.loadResource( + "modelica://BESMod/Resources/WeatherData/TRY2015_507931060546_Jahr_City_Aachen_Normal.mos"), + QBui_flow_nominal={10632.414942943078}, + use_ventilation=false, + THydSup_nominal={328.15}, + TOda_nominal=265.35); + + end AachenSystem; + + model BivalentHeatPumpSystems_Serial + "Bivalent Heat Pump Systems with serial heat generation" + extends Systems.BaseClasses.PartialBuildingEnergySystem( + redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, + redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare + BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( + heaLoadFacGrd=0, heaLoadFacOut=0)), + redeclare BESMod.Systems.Control.NoControl control, + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerSerial + generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover + pumpData, + redeclare package Medium_eva = AixLib.Media.Air, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + heatPumpParameters( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + + TBiv=parameterStudy.TBiv, + scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal + /parameterStudy.QHP_flow_biv, + dpCon_nominal=0, + dpEva_nominal=0, + use_refIne=false, + refIneFre_constant=0), + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR + heatingRodParameters, + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, + + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet"), + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + temperatureSensorData), + redeclare Systems.Hydraulical.Control.NewControlBivalentSerial + control( + redeclare + BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled + thermostaticValveController, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition + thermostaticValveParameters, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl + bivalentControlData(TBiv=parameterStudy.TBiv), + redeclare + Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW + TSet_DHW, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl + safetyControl, + TCutOff=parameterStudy.TCutOff, + QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.heatPumpParameters.scalingFactor, + CheckTCut_Off(threshold=parameterStudy.TCutOff)), + redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel + distribution( + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + bufParameters(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + dhwParameters(dTLoadingHC1=10), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + threeWayValveParameters), + redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + radParameters, redeclare + BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + redeclare Systems.Demand.DHW.DHW DHW( + redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic + calcmFlow), + redeclare Systems.UserProfiles.TEASERProfiles userProfiles, + redeclare UseCaseDesignOptimization.AachenSystem systemParameters( + use_ventilation=true), + redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy, + redeclare final package MediumDHW = AixLib.Media.Water, + redeclare final package MediumZone = AixLib.Media.Air, + redeclare final package MediumHyd = AixLib.Media.Water, + redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + + extends Modelica.Icons.Example; + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); + end BivalentHeatPumpSystems_Serial; + + model BivalentHeatPumpSystems_BoilerAfterBuffer_WithoutDHW + "Bivalent Heat Pump System with boiler integration after buffer tank without DHW support" + extends Systems.BaseClasses.PartialBuildingEnergySystem( + redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, + redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare + BESMod.Systems.Demand.Building.RecordsCollection.RefAachen + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), + redeclare BESMod.Systems.Control.NoControl control, + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Generation.OnlyHeatPump generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover + pumpData, + redeclare package Medium_eva = AixLib.Media.Air, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + heatPumpParameters( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, + scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal + /parameterStudy.QHP_flow_biv, + dpCon_nominal=0, + dpEva_nominal=0, + use_refIne=false, + refIneFre_constant=0), + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR + heatingRodParameters, + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet"), + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + temperatureSensorData), + redeclare + Systems.Hydraulical.Control.NewControlBivalentSystem_BoilerAfterBuffer + control( + redeclare + BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled + thermostaticValveController, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition + thermostaticValveParameters, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl + bivalentControlData(TBiv=parameterStudy.TBiv), + redeclare + Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW + TSet_DHW, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl + safetyControl, + TCutOff=parameterStudy.TCutOff, + QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.heatPumpParameters.scalingFactor, + + CheckTCut_Off(threshold=parameterStudy.TCutOff)), + redeclare + Systems.Hydraulical.Distribution.BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW + distribution( + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + bufParameters(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), + + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + dhwParameters(dTLoadingHC1=10), + redeclare + BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + threeWayValveParameters), + redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + radParameters, redeclare + BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + redeclare Systems.Demand.DHW.DHW DHW( + redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM + DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic + calcmFlow), + redeclare Systems.UserProfiles.TEASERProfiles userProfiles, + redeclare UseCaseDesignOptimization.AachenSystem systemParameters( + use_ventilation=true), + redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy, + redeclare final package MediumDHW = AixLib.Media.Water, + redeclare final package MediumZone = AixLib.Media.Air, + redeclare final package MediumHyd = AixLib.Media.Water, + redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + + extends Modelica.Icons.Example; + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); + end BivalentHeatPumpSystems_BoilerAfterBuffer_WithoutDHW; + + model BivalentHeatPumpSystems_Parallel + "Bivalent Heat Pump System with parallel heat generation" + extends Systems.BaseClasses.PartialBuildingEnergySystem( + redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, + redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare + BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( + heaLoadFacGrd=0, heaLoadFacOut=0)), + redeclare BESMod.Systems.Control.NoControl control, + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerParallel + generation( + use_heaRod=false, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover + pumpData, + redeclare package Medium_eva = AixLib.Media.Air, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + heatPumpParameters( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, + scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal + /parameterStudy.QHP_flow_biv, + dpCon_nominal=0, + dpEva_nominal=0, + use_refIne=false, + refIneFre_constant=0), + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet"), + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + temperatureSensorData, + redeclare + BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + threeWayValveParameters, + threeWayValveWithFlowReturn(redeclare + BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parameters( + m_flow_nominal=2*m_flow_nominal[1], + dp_nominal={heatPumpParameters.dpCon_nominal,boilerNoControl.dp_nominal}, + use_inputFilter=true, + order=1))), + redeclare Systems.Hydraulical.Control.NewControlBivalentParallel + control( + redeclare + BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled + thermostaticValveController, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition + thermostaticValveParameters, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl + bivalentControlData(TBiv=parameterStudy.TBiv), + redeclare + Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW + TSet_DHW, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl + safetyControl, + TCutOff=parameterStudy.TCutOff, + QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.heatPumpParameters.scalingFactor, + CheckTCut_Off(threshold=parameterStudy.TCutOff)), + redeclare + Systems.Hydraulical.Distribution.DistributionTwoStorageParallel + distribution( + nParallelSup=1, + dpSup_nominal={2*(hydraulic.distribution.threeWayValveParameters.dpValve_nominal + + max(hydraulic.distribution.threeWayValveParameters.dp_nominal))}, + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + bufParameters(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + dhwParameters(dTLoadingHC1=10), + redeclare + BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + threeWayValveParameters), + redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + radParameters, redeclare + BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + redeclare Systems.Demand.DHW.DHW DHW( + redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic + calcmFlow), + redeclare Systems.UserProfiles.TEASERProfiles userProfiles, + redeclare UseCaseDesignOptimization.AachenSystem systemParameters( + use_ventilation=true), + redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy(TCutOff= + 262.15, TBiv=276.15), + redeclare final package MediumDHW = AixLib.Media.Water, + redeclare final package MediumZone = AixLib.Media.Air, + redeclare final package MediumHyd = AixLib.Media.Water, + redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + + extends Modelica.Icons.Example; + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); + end BivalentHeatPumpSystems_Parallel; + + model BivalentHeatPumpSystems_BoilerAfterBuffer_WithDHW + "Bivalent Heat Pump System with boiler integration after buffer tank with DHW support" + extends Systems.BaseClasses.PartialBuildingEnergySystem( + redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, + redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare + BESMod.Systems.Demand.Building.RecordsCollection.RefAachen + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), + redeclare BESMod.Systems.Control.NoControl control, + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Generation.OnlyHeatPump generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover + pumpData, + redeclare package Medium_eva = AixLib.Media.Air, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + heatPumpParameters( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, + scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal + /parameterStudy.QHP_flow_biv, + dpCon_nominal=0, + dpEva_nominal=0, + use_refIne=false, + refIneFre_constant=0), + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR + heatingRodParameters, + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet"), + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + temperatureSensorData), + redeclare + Systems.Hydraulical.Control.NewControlBivalentSystem_BoilerAfterBuffer + control( + redeclare + BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled + thermostaticValveController, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition + thermostaticValveParameters, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl + bivalentControlData(TBiv=parameterStudy.TBiv), + redeclare + Systems.Hydraulical.Control.Components.DHWSetControl.AntiLegionellaControl + TSet_DHW(triggerEvery(displayUnit="d") = 259200), + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl + safetyControl, + TCutOff=parameterStudy.TCutOff, + QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.heatPumpParameters.scalingFactor, + + CheckTCut_Off(threshold=parameterStudy.TCutOff)), + redeclare + Systems.Hydraulical.Distribution.BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW + distribution( + designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.FullStorage, + + QDHWStoLoss_flow=1, + VStoDHW(displayUnit="l") = 0.1, + QHRAftBuf_flow_nominal=0, + use_heatingRodAfterBuffer=false, + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + temperatureSensorData, + redeclare + BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + threeWayValveParameters1, + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition + bufParameters, + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition + dhwParameters(dTLoadingHC1=10), + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition + hydParameters), + redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + radParameters, redeclare + BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + redeclare Systems.Demand.DHW.DHW DHW( + redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM + DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic + calcmFlow), + redeclare Systems.UserProfiles.TEASERProfiles userProfiles, + redeclare UseCaseDesignOptimization.AachenSystem systemParameters( + use_ventilation=true), + redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy(TCutOff= + 262.15, TBiv=276.15), + redeclare final package MediumDHW = AixLib.Media.Water, + redeclare final package MediumZone = AixLib.Media.Air, + redeclare final package MediumHyd = AixLib.Media.Water, + redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + + extends Modelica.Icons.Example; + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); + end BivalentHeatPumpSystems_BoilerAfterBuffer_WithDHW; + +end BivalentHeatPumpSystems; diff --git a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo index 0b529084..139c3a2a 100644 --- a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo +++ b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo @@ -56,7 +56,8 @@ partial model PartialSolarThermalHPS replaceable model hydGeneration = BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialGeneration(nParallelDem=2) - constrainedby BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialGeneration + constrainedby + BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialGeneration annotation (choicesAllMatching=true); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, diff --git a/BESMod/Examples/UseCaseHOM/BES_HOM.mo b/BESMod/Examples/UseCaseHOM/BES_HOM.mo deleted file mode 100644 index ab0797be..00000000 --- a/BESMod/Examples/UseCaseHOM/BES_HOM.mo +++ /dev/null @@ -1,96 +0,0 @@ -within BESMod.Examples.UseCaseHOM; -model BES_HOM - extends BESMod.Systems.BaseClasses.PartialBuildingEnergySystem( - redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, - redeclare BESMod.Systems.Demand.Building.AixLibHighOrder building( - useConstVentRate=false, - Latitude=Modelica.Units.Conversions.to_deg(weaDat.lat), - Longitude=Modelica.Units.Conversions.to_deg(weaDat.lon), - TimeCorrection=0, - DiffWeatherDataTime=Modelica.Units.Conversions.to_hour(weaDat.timZon), - redeclare AixLib.DataBase.Walls.Collections.OFD.EnEV2009Heavy wallTypes, - redeclare model WindowModel = - AixLib.ThermalZones.HighOrder.Components.WindowsDoors.WindowSimple, - redeclare AixLib.DataBase.WindowsDoors.Simple.WindowSimple_EnEV2009 - Type_Win, - redeclare model CorrSolarGainWin = - AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.CorGSimple, - redeclare BESMod.Systems.Demand.Building.Components.AixLibHighOrderOFD - aixLiBHighOrderOFD), - redeclare BESMod.Systems.Control.NoControl control, - redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod - generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - redeclare package Medium_eva = AixLib.Media.Air, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - heatPumpParameters( - genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal - /parameterStudy.QHP_flow_biv, - useAirSource=true, - dpCon_nominal=0, - dpEva_nominal=0, - use_refIne=false, - refIneFre_constant=0), - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodParameters, - redeclare model PerDataMainHP = - AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, - refrigerant="Propane", - flowsheet="VIPhaseSeparatorFlowsheet")), - redeclare BESMod.Systems.Hydraulical.Control.ConstHys_OnOff_HPSControll - control( - redeclare - BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - thermostaticValveController, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - thermostaticValveParameters, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl - safetyControl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl - bivalentControlData, - redeclare - BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW - TSet_DHW), - redeclare - BESMod.Systems.Hydraulical.Distribution.DistributionTwoStorageParallel - distribution( - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - bufParameters(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters(dTLoadingHC1=10), - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - threeWayValveParameters), - redeclare BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator - transfer(redeclare - BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), - redeclare BESMod.Systems.Demand.DHW.DHW DHW( - redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic - calcmFlow), - redeclare BESMod.Systems.UserProfiles.AixLibHighOrderProfiles userProfiles, - redeclare HOMSystem systemParameters, - redeclare UseCaseAachen.ParametersToChange parameterStudy, - redeclare final package MediumDHW = AixLib.Media.Water, - redeclare final package MediumZone = AixLib.Media.Air, - redeclare final package MediumHyd = AixLib.Media.Water, - redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); - extends Modelica.Icons.Example; - annotation (experiment( - StopTime=31536000, - Interval=600, - __Dymola_Algorithm="Dassl")); -end BES_HOM; diff --git a/BESMod/Examples/UseCaseHOM/HOMSystem.mo b/BESMod/Examples/UseCaseHOM/HOMSystem.mo deleted file mode 100644 index 67b5a4ff..00000000 --- a/BESMod/Examples/UseCaseHOM/HOMSystem.mo +++ /dev/null @@ -1,13 +0,0 @@ -within BESMod.Examples.UseCaseHOM; -record HOMSystem - extends Systems.RecordsCollection.SystemParametersBaseDataDefinition( - use_elecHeating=false, - nZones=10, - filNamWea=Modelica.Utilities.Files.loadResource( - "modelica://BESMod/Resources/WeatherData/TRY2015_507931060546_Jahr_City_Aachen_Normal.mos"), - use_ventilation=false, - QBui_flow_nominal={1124.867,569.6307,53.59064,679.86365,809.8547,786.87427,552.7661,10,666.1303,635.3303}, - THydSup_nominal=fill(328.15,nZones), - TOda_nominal=265.35); - -end HOMSystem; diff --git a/BESMod/Examples/UseCaseHOM/package.order b/BESMod/Examples/UseCaseHOM/package.order deleted file mode 100644 index 8a68712c..00000000 --- a/BESMod/Examples/UseCaseHOM/package.order +++ /dev/null @@ -1,2 +0,0 @@ -HOMSystem -BES_HOM diff --git a/BESMod/Resources/Scripts/ConvertFromBESMod_0.3.0.mos b/BESMod/Resources/Scripts/ConvertFromBESMod_0.3.0.mos new file mode 100644 index 00000000..e5598707 --- /dev/null +++ b/BESMod/Resources/Scripts/ConvertFromBESMod_0.3.0.mos @@ -0,0 +1,3 @@ +// Generated by conversion of BESMod +convertModifiers("BESMod.Systems.Ventilation.Control.SummerPIDByPass",{"summerByPass.conPIDHeatingCooling.reverseAction"},{"summerByPass.conPIDHeatingCooling.reverseActing=not %summerByPass.conPIDHeatingCooling.reverseAction%"}); +convertModifiers("BESMod.Systems.Ventilation.Control.Components.SummerByPass",{"conPIDHeatingCooling.reverseAction"},{"conPIDHeatingCooling.reverseActing=not %conPIDHeatingCooling.reverseAction%"}); diff --git a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo index 19c64040..cc83418c 100644 --- a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo +++ b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo @@ -82,8 +82,8 @@ partial model PartialBuildingEnergySystem "Partial BES" final hBui=building.hBui), final use_openModelica=use_openModelica) annotation (Placement( transformation(extent={{-198,40},{-42,136}})), choicesAllMatching=true); - replaceable BESMod.Systems.Hydraulical.BaseClasses.PartialHydraulicSystem hydraulic - if systemParameters.use_hydraulic constrainedby + replaceable BESMod.Systems.Hydraulical.BaseClasses.PartialHydraulicSystem hydraulic if + systemParameters.use_hydraulic constrainedby Hydraulical.BaseClasses.PartialHydraulicSystem( redeclare package Medium = MediumHyd, final subsystemDisabled=not systemParameters.use_hydraulic, @@ -153,12 +153,12 @@ partial model PartialBuildingEnergySystem "Partial BES" Placement(transformation(extent={{270,40},{300,76}}), iconTransformation( extent={{270,40},{300,76}}))); protected - BESMod.Utilities.Electrical.ZeroLoad hydraulicZeroElecLoad - if not systemParameters.use_hydraulic "Internal helper"; - BESMod.Utilities.Electrical.ZeroLoad ventilationZeroElecLoad - if not systemParameters.use_ventilation "Internal helper"; - BESMod.Utilities.Electrical.ZeroLoad dhwZeroElecLoad - if not systemParameters.use_dhw "Internal helper"; + BESMod.Utilities.Electrical.ZeroLoad hydraulicZeroElecLoad if + not systemParameters.use_hydraulic "Internal helper"; + BESMod.Utilities.Electrical.ZeroLoad ventilationZeroElecLoad if + not systemParameters.use_ventilation "Internal helper"; + BESMod.Utilities.Electrical.ZeroLoad dhwZeroElecLoad if + not systemParameters.use_dhw "Internal helper"; equation connect(building.weaBus, weaDat.weaBus) annotation (Line( diff --git a/BESMod/Systems/Demand/Building/AixLibHighOrder.mo b/BESMod/Systems/Demand/Building/AixLibHighOrder.mo index 898f42aa..271bf16b 100644 --- a/BESMod/Systems/Demand/Building/AixLibHighOrder.mo +++ b/BESMod/Systems/Demand/Building/AixLibHighOrder.mo @@ -64,8 +64,8 @@ model AixLibHighOrder "High order building model from AixLib library" each WeatherFormat=1) annotation(Placement(transformation(extent={{18,42},{42, 64}}))); - Modelica.Blocks.Sources.Constant constVentRate[nZones](final k=ventRate) - if useConstVentRate annotation (Placement(transformation( + Modelica.Blocks.Sources.Constant constVentRate[nZones](final k=ventRate) if + useConstVentRate annotation (Placement(transformation( extent={{10,-10},{-10,10}}, rotation=180, origin={-90,10}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow InternalGains[nZones] diff --git a/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo b/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo index 55e1d455..1fb4ab6d 100644 --- a/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo +++ b/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo @@ -20,14 +20,14 @@ partial model PartialAixLibHighOrder Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a groundTemp annotation (Placement(transformation(extent={{-10,-110},{10,-90}}))); Modelica.Fluid.Interfaces.FluidPort_a portVent_in[nZones](redeclare final - package Medium = MediumZone) - if use_ventilation + package Medium = MediumZone) if + use_ventilation "Inlet for the demand of ventilation" annotation (Placement(transformation(extent={{90,-76},{110,-56}}), iconTransformation(extent={{90,-74},{110,-54}}))); Modelica.Fluid.Interfaces.FluidPort_b portVent_out[nZones](redeclare final - package Medium = MediumZone) - if use_ventilation + package Medium = MediumZone) if + use_ventilation "Outlet of the demand of Ventilation" annotation (Placement(transformation(extent={{90,-102},{110,-82}}), iconTransformation(extent={{90,-98},{110,-78}}))); diff --git a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo index 83c56d10..7892c474 100644 --- a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo +++ b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo @@ -43,14 +43,14 @@ partial model PartialDemand "Partial demand model for HPS" BESMod.Systems.Interfaces.DemandOutputs outBusDem if not use_openModelica annotation (Placement(transformation(extent={{88,-12},{108,8}}))); Modelica.Fluid.Interfaces.FluidPort_a portVent_in[nZones]( - redeclare final package Medium = MediumZone) - if use_ventilation + redeclare final package Medium = MediumZone) if + use_ventilation "Inlet for the demand of ventilation" annotation (Placement(transformation(extent={{90,28},{110,48}}), iconTransformation(extent={{90,28},{110,48}}))); Modelica.Fluid.Interfaces.FluidPort_b portVent_out[nZones]( - redeclare final package Medium = MediumZone) - if use_ventilation + redeclare final package Medium = MediumZone) if + use_ventilation "Outlet of the demand of Ventilation" annotation (Placement(transformation(extent={{90,-50},{110,-30}}), iconTransformation(extent={{90,-50},{110,-30}}))); diff --git a/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo b/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo index df0221de..a05ba162 100644 --- a/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo +++ b/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo @@ -9,7 +9,7 @@ model BuildingsRoomCase600FF AZone={roo.AFlo}, nZones=1); parameter Modelica.Units.SI.TemperatureDifference dTComfort=2 - "Temperature difference to room set temperature at which the comfort is still acceptable. In EN 16798-1, 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."; + "Temperature difference to room set temperature at which the comfort is still acceptable. 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."; parameter Real natInf = 0.5 "Infiltration rate"; parameter Modelica.Units.SI.Angle S_=Buildings.Types.Azimuth.S diff --git a/BESMod/Systems/Demand/Building/Components/BaseClasses/PartialAixLibHighOrder.mo b/BESMod/Systems/Demand/Building/Components/BaseClasses/PartialAixLibHighOrder.mo index 38ddba99..e3fcfe7f 100644 --- a/BESMod/Systems/Demand/Building/Components/BaseClasses/PartialAixLibHighOrder.mo +++ b/BESMod/Systems/Demand/Building/Components/BaseClasses/PartialAixLibHighOrder.mo @@ -21,14 +21,14 @@ partial model PartialAixLibHighOrder Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a groundTemp annotation (Placement(transformation(extent={{-10,-110},{10,-90}}))); Modelica.Fluid.Interfaces.FluidPort_a portVent_in[nZones](redeclare final - package Medium = MediumZone) - if use_ventilation + package Medium = MediumZone) if + use_ventilation "Inlet for the demand of ventilation" annotation (Placement(transformation(extent={{90,-76},{110,-56}}), iconTransformation(extent={{90,-74},{110,-54}}))); Modelica.Fluid.Interfaces.FluidPort_b portVent_out[nZones](redeclare final - package Medium = MediumZone) - if use_ventilation + package Medium = MediumZone) if + use_ventilation "Outlet of the demand of Ventilation" annotation (Placement(transformation(extent={{90,-102},{110,-82}}), iconTransformation(extent={{90,-98},{110,-78}}))); diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index b88ea7a3..158401e4 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -16,7 +16,7 @@ model TEASERThermalZone parameter Boolean use_verboseEnergyBalance=true "=false to disable the integration of the verbose energy balance"; parameter Modelica.Units.SI.TemperatureDifference dTComfort=2 - "Temperature difference to room set temperature at which the comfort is still acceptable. In EN 16798-1, 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."; + "Temperature difference to room set temperature at which the comfort is still acceptable. 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."; parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state" @@ -91,14 +91,14 @@ model TEASERThermalZone 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 + 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 + 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}))); @@ -121,12 +121,12 @@ model TEASERThermalZone rotation=0, origin={-30,-186}))); Modelica.Blocks.Nonlinear.Limiter limAirExcUp[nZones](each final - uMax=Modelica.Constants.inf, each final uMin=0) - if use_verboseEnergyBalance + 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 + 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] @@ -135,8 +135,8 @@ model TEASERThermalZone nZones] annotation (Placement(transformation(extent={{-86,50},{-66,70}}))); Modelica.Blocks.Math.Add addTra - [nZones] - if use_hydraulic and use_verboseEnergyBalance + [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) diff --git a/BESMod/Systems/Demand/DHW/DHW.mo b/BESMod/Systems/Demand/DHW/DHW.mo index ef55d2d8..3c164d27 100644 --- a/BESMod/Systems/Demand/DHW/DHW.mo +++ b/BESMod/Systems/Demand/DHW/DHW.mo @@ -9,7 +9,7 @@ model DHW "Standard DHW subsystem" mDHW_flow_nominal=DHWProfile.m_flow_nominal); replaceable parameter Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile constrainedby Systems.Demand.DHW.RecordsCollection.PartialDHWTap - "Profile according to EU 812/2013" annotation (choicesAllMatching=true, Dialog( + annotation (choicesAllMatching=true, Dialog( enable=not use_dhwCalc and use_dhw)); parameter Boolean use_dhwCalc=false "=true to use the tables in DHWCalc. Will slow down the simulation, but represents DHW tapping more in a more realistic way." annotation (Dialog(enable=use_dhw)); @@ -24,7 +24,7 @@ model DHW "Standard DHW subsystem" replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpData "Data record for the ideal pump" + pumpData annotation (choicesAllMatching=true, Placement(transformation(extent={{-96,-96},{-84,-84}}))); replaceable TappingProfiles.BaseClasses.PartialDHW calcmFlow constrainedby @@ -32,8 +32,7 @@ model DHW "Standard DHW subsystem" final TCold=TDHWCold_nominal, final dWater=rho, final c_p_water=cp, - final TSetDHW=TDHW_nominal) "Model to simulate how much water is extracted" - annotation (choicesAllMatching=true, + final TSetDHW=TDHW_nominal) annotation (choicesAllMatching=true, Placement(transformation( extent={{-17,18},{17,-18}}, rotation=180, diff --git a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo index 00d02321..a07c596d 100644 --- a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo +++ b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo @@ -57,8 +57,8 @@ partial model PartialElectricalSystem "Partial model for electrical system" BESMod.Systems.Interfaces.BuiMeaBus buiMeaBus annotation ( Placement(transformation(extent={{48,124},{92,156}}), iconTransformation( extent={{48,124},{92,156}}))); - BESMod.Systems.Interfaces.ElectricalOutputs outBusElect - if not use_openModelica + BESMod.Systems.Interfaces.ElectricalOutputs outBusElect if + not use_openModelica annotation (Placement(transformation(extent={{-22,-160},{24,-120}}), iconTransformation(extent={{-22,-160},{24,-120}}))); Interfaces.ExternalElectricalPin externalElectricalPin1 diff --git a/BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo b/BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo index 981ed532..1cb7c5e7 100644 --- a/BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo +++ b/BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo @@ -32,8 +32,8 @@ model HeatingRodWithSecurityControl final y_start=0) if use_countNumSwi "To count on-off cycles" annotation (Placement(transformation(extent={{68,-68},{86,-52}}))); - Modelica.Blocks.Sources.IntegerConstant integerConstant(final k=1) - if use_countNumSwi + Modelica.Blocks.Sources.IntegerConstant integerConstant(final k=1) if + use_countNumSwi annotation (Placement(transformation(extent={{38,-68},{54,-52}}))); Modelica.Blocks.Interfaces.IntegerOutput numSwi if use_countNumSwi "Number of on switches " diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo new file mode 100644 index 00000000..7fd28075 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo @@ -0,0 +1,390 @@ +within BESMod.Systems.Hydraulical.Control.BaseClasses; +partial model PartialTwoPoint_HPS_Controller_BivalentBoiler + "Partial model with replaceable blocks for rule based control of HPS using Boiler" + extends + BESMod.Systems.Hydraulical.Control.BaseClasses.SystemWithThermostaticValveControl; + replaceable + BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController + DHWOnOffContoller annotation (choicesAllMatching=true, Placement( + transformation(extent={{-128,70},{-112,86}}))); + replaceable + BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController + BufferOnOffController annotation (choicesAllMatching=true, Placement( + transformation(extent={{-126,36},{-110,50}}))); + replaceable BESMod.Systems.Hydraulical.Control.RecordsCollection.HeatPumpSafetyControl + safetyControl + annotation (choicesAllMatching=true,Placement(transformation(extent={{200,30},{220,50}}))); + replaceable parameter RecordsCollection.BivalentHeatPumpControlDataDefinition + bivalentControlData constrainedby + RecordsCollection.BivalentHeatPumpControlDataDefinition( + final TOda_nominal=generationParameters.TOda_nominal, + TSup_nominal=generationParameters.TSup_nominal[1], + TSetRoomConst=sum(transferParameters.TDem_nominal)/transferParameters.nParallelDem) + annotation (choicesAllMatching=true, Placement(transformation(extent={{-92,-32},{-70,-10}}))); + replaceable + BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control + TSet_DHW constrainedby + BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control( + final T_DHW=distributionParameters.TDHW_nominal) annotation ( + choicesAllMatching=true, Placement(transformation(extent={{-216,66},{-192, + 90}}))); + BESMod.Systems.Hydraulical.Control.Components.HeatingCurve + heatingCurve( + GraHeaCurve=bivalentControlData.gradientHeatCurve, + THeaThres=bivalentControlData.TSetRoomConst, + dTOffSet_HC=bivalentControlData.dTOffSetHeatCurve) + annotation (Placement(transformation(extent={{-160,20},{-140,40}}))); + Modelica.Blocks.MathBoolean.Or heatDemand_AuxiliarHeater(nu=3) + "heat demand based on buffer temperatures" annotation (Placement( + transformation( + extent={{-5,-5},{5,5}}, + rotation=0, + origin={21,23}))); + Modelica.Blocks.Logical.Or HP_active + annotation (Placement(transformation( + extent={{-5,-5},{5,5}}, + rotation=0, + origin={27,91}))); + replaceable + BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.BaseClasses.PartialHPNSetController + HP_nSet_Controller annotation (choicesAllMatching=true, Placement( + transformation(extent={{82,64},{112,92}}))); + Modelica.Blocks.Logical.Switch switch1 + annotation (Placement(transformation(extent={{-5,-5},{5,5}}, + rotation=0, + origin={63,73}))); + Modelica.Blocks.Sources.Constant const_dT_loading1(k=distributionParameters.dTTra_nominal[1]) + annotation (Placement( + transformation( + extent={{4,-4},{-4,4}}, + rotation=180, + origin={14,58}))); + + Modelica.Blocks.MathBoolean.Or + DHWHysOrLegionella(nu=4) + "Use the HR if the HP reached its limit" annotation (Placement( + transformation( + extent={{-5,-5},{5,5}}, + rotation=0, + origin={-77,69}))); + AixLib.Controls.HeatPump.SafetyControls.SafetyControl securityControl( + final minRunTime=safetyControl.minRunTime, + final minLocTime=safetyControl.minLocTime, + final maxRunPerHou=safetyControl.maxRunPerHou, + final use_opeEnv=safetyControl.use_opeEnv, + final use_opeEnvFroRec=false, + final dataTable=AixLib.DataBase.HeatPump.EN14511.Vitocal200AWO201( + tableUppBou=[-20,50; -10,60; 30,60; 35,55]), + final tableUpp=safetyControl.tableUpp, + final use_minRunTime=safetyControl.use_minRunTime, + final use_minLocTime=safetyControl.use_minLocTime, + final use_runPerHou=safetyControl.use_runPerHou, + final dTHystOperEnv=safetyControl.dT_opeEnv, + final use_deFro=false, + final minIceFac=0, + final use_chiller=false, + final calcPel_deFro=0, + final pre_n_start=safetyControl.pre_n_start_hp, + use_antFre=false) annotation (Placement(transformation( + extent={{-16,-17},{16,17}}, + rotation=0, + origin={210,81}))); + Modelica.Blocks.Sources.BooleanConstant hp_mode(final k=true) annotation ( + Placement(transformation( + extent={{-7,-7},{7,7}}, + rotation=0, + origin={155,69}))); + + Modelica.Blocks.Math.Add add_dT_LoadingBuf + annotation (Placement(transformation(extent={{38,54},{48,64}}))); + Modelica.Blocks.Sources.Constant const_dT_loading2(k=distributionParameters.dTTraDHW_nominal + + bivalentControlData.dTHysDHW/2) annotation (Placement(transformation( + extent={{4,-4},{-4,4}}, + rotation=180, + origin={14,74}))); + Modelica.Blocks.Math.Add add_dT_LoadingDHW + annotation (Placement(transformation(extent={{36,78},{46,88}}))); + + Modelica.Blocks.Math.BooleanToReal booleanToReal annotation (Placement( + transformation( + extent={{-6,-6},{6,6}}, + rotation=270, + origin={-38,-36}))); + Modelica.Blocks.Logical.Not bufOn "buffer is charged" annotation (Placement( + transformation( + extent={{-5,-5},{5,5}}, + rotation=270, + origin={-37,-17}))); + BESMod.Utilities.SupervisoryControl.SupervisoryControl supervisoryControlDHW( + ctrlType=supCtrlTypeDHWSet) + annotation (Placement(transformation(extent={{-182,72},{-170,84}}))); + parameter BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType + supCtrlTypeDHWSet=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local + "Type of supervisory control for DHW Setpoint"; + Modelica.Blocks.Math.MinMax minMax(nu=transferParameters.nParallelDem) + annotation (Placement(transformation(extent={{-202,32},{-182,52}}))); + Modelica.Blocks.Math.BooleanToReal booleanToReal1 "Turn Pump in heat pump on" + annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={-170,-54}))); + Modelica.Blocks.Logical.Or HP_or_HR_active annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={-170,-24}))); + Components.HeatPumpBusPassThrough heatPumpBusPassThrough annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-230,-90}))); +equation + connect(BufferOnOffController.T_Top, sigBusDistr.TStoBufTopMea) annotation ( + Line(points={{-126.8,47.9},{-128,47.9},{-128,48},{-130,48},{-130,-86},{4,-86}, + {4,-100},{1,-100}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(DHWOnOffContoller.T_Top, sigBusDistr.TStoDHWTopMea) annotation (Line( + points={{-128.8,83.6},{-316,83.6},{-316,-166},{1,-166},{1,-100}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(heatingCurve.TSet, BufferOnOffController.T_Set) annotation (Line( + points={{-139,30},{-139,28},{-118,28},{-118,35.3}}, + color={0,0,127})); + + connect(DHWOnOffContoller.T_bot, sigBusDistr.TStoDHWTopMea) annotation (Line( + points={{-128.8,74},{-318,74},{-318,-166},{1,-166},{1,-100}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(HP_active.y, HP_nSet_Controller.HP_On) annotation (Line(points={{32.5, + 91},{70,91},{70,78},{79,78}}, color={255,0,255})); + connect(sigBusDistr, TSet_DHW.sigBusDistr) annotation (Line( + points={{1,-100},{-2,-100},{-2,-152},{-292,-152},{-292,77.88},{-216,77.88}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + + connect(DHWOnOffContoller.Auxilliar_Heater_On, heatDemand_AuxiliarHeater.u[1]) + annotation (Line(points={{-110.88,74},{-92,74},{-92,30},{-94,30},{-94, + 21.8333},{16,21.8333}}, color={255,0,255})); + connect(BufferOnOffController.Auxilliar_Heater_On, heatDemand_AuxiliarHeater.u[ + 2]) annotation (Line(points={{-108.88,39.5},{-108.88,38},{-94,38},{-94,23}, + {16,23}}, color={255,0,255})); + connect(TSet_DHW.y, heatDemand_AuxiliarHeater.u[3]) annotation (Line(points={ + {-190.8,71.04},{-186,71.04},{-186,68},{-178,68},{-178,56},{-92,56},{ + -92,30},{-94,30},{-94,24.1667},{16,24.1667}}, color={255,0,255})); + + connect(securityControl.modeSet, hp_mode.y) annotation (Line(points={{191.867, + 77.6},{168,77.6},{168,69},{162.7,69}}, color={255,0,255})); + connect(securityControl.nOut, sigBusGen.yHeaPumSet) annotation (Line( + points={{227.333,84.4},{264,84.4},{264,-132},{-42,-132},{-42,-99},{-152, + -99}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(HP_nSet_Controller.n_Set, securityControl.nSet) annotation (Line( + points={{113.5,78},{144,78},{144,84.4},{191.867,84.4}}, color={0,0,127})); + connect(BufferOnOffController.HP_On, HP_active.u2) annotation (Line(points={{-108.88, + 47.9},{-78,47.9},{-78,54},{-38,54},{-38,87},{21,87}}, + color={255,0,255})); + connect(DHWOnOffContoller.HP_On, HP_active.u1) annotation (Line(points={{-110.88, + 83.6},{-32,83.6},{-32,91},{21,91}}, color={255,0,255})); + connect(DHWHysOrLegionella.y, switch1.u2) annotation (Line(points={{-71.25,69}, + {-20,69},{-20,73},{57,73}}, color={255,0,255})); + + connect(TSet_DHW.y, DHWHysOrLegionella.u[1]) annotation (Line(points={{-190.8, + 71.04},{-96,71.04},{-96,67.6875},{-82,67.6875}}, color={255,0,255})); + connect(DHWOnOffContoller.Auxilliar_Heater_On, DHWHysOrLegionella.u[2]) + annotation (Line(points={{-110.88,74},{-92,74},{-92,68.5625},{-82,68.5625}}, + color={ + 255,0,255})); + connect(DHWOnOffContoller.HP_On, DHWHysOrLegionella.u[3]) annotation (Line( + points={{-110.88,83.6},{-90,83.6},{-90,69.4375},{-82,69.4375}}, + color={255,0,255})); + connect(TSet_DHW.y, DHWHysOrLegionella.u[4]) annotation (Line(points={{-190.8, + 71.04},{-136.4,71.04},{-136.4,70.3125},{-82,70.3125}}, + color={255,0,255})); + connect(BufferOnOffController.T_bot, sigBusDistr.TStoBufTopMea) annotation ( + Line(points={{-126.8,39.5},{-130,39.5},{-130,-86},{134,-86},{134,-100},{1, + -100}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(HP_nSet_Controller.IsOn, sigBusGen.heaPumIsOn) annotation (Line( + points={{88,61.2},{88,48},{156,48},{156,-54},{-152,-54},{-152,-99}}, + color={255,0,255}), + Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(const_dT_loading2.y,add_dT_LoadingDHW. u2) annotation (Line(points={{18.4,74}, + {24,74},{24,80},{35,80}}, color={0,0,127})); + connect(switch1.y, HP_nSet_Controller.T_Set) annotation (Line(points={{68.5, + 73},{70,73},{70,86.4},{79,86.4}}, color={0,0,127})); + connect(heatingCurve.TSet, add_dT_LoadingBuf.u1) annotation (Line(points={{-139,30}, + {-139,28},{4,28},{4,66},{32,66},{32,62},{37,62}}, + color={0,0,127})); + connect(add_dT_LoadingBuf.y, switch1.u3) annotation (Line(points={{48.5,59},{ + 54,59},{54,69},{57,69}}, color={0,0,127})); + connect(add_dT_LoadingDHW.y, switch1.u1) annotation (Line(points={{46.5,83},{ + 51.25,83},{51.25,77},{57,77}}, color={0,0,127})); + connect(const_dT_loading1.y, add_dT_LoadingBuf.u2) annotation (Line(points={{ + 18.4,58},{26,58},{26,56},{37,56}}, color={0,0,127})); + connect(booleanToReal.y, sigBusDistr.uThrWayVal) annotation (Line(points={{ + -38,-42.6},{-38,-62},{1,-62},{1,-100}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(booleanToReal.u, bufOn.y) annotation (Line(points={{-38,-28.8},{-38, + -26},{-37,-26},{-37,-22.5}}, color={255,0,255})); + connect(bufOn.u, DHWHysOrLegionella.y) annotation (Line(points={{-37,-11},{ + -37,70},{-71.25,70},{-71.25,69}}, color={255,0,255})); + connect(TSet_DHW.TSet_DHW, supervisoryControlDHW.uLoc) annotation (Line( + points={{-190.8,78},{-188,78},{-188,73.2},{-183.2,73.2}}, color={0,0, + 127})); + connect(supervisoryControlDHW.y, DHWOnOffContoller.T_Set) annotation (Line( + points={{-168.8,78},{-150,78},{-150,74},{-122,74},{-122,69.2},{-120,69.2}}, + color={0,0,127})); + connect(supervisoryControlDHW.y, add_dT_LoadingDHW.u1) annotation (Line( + points={{-168.8,78},{-150,78},{-150,76},{-10,76},{-10,86},{35,86}}, + color={0,0,127})); + connect(supervisoryControlDHW.actInt, sigBusHyd.overwriteTSetDHW) annotation ( + Line(points={{-183.2,78},{-186,78},{-186,94},{-28,94},{-28,101}}, color={ + 255,0,255}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(supervisoryControlDHW.uSup, sigBusHyd.TSetDHW) annotation (Line( + points={{-183.2,82.8},{-183.2,92},{-28,92},{-28,101}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + connect(heatingCurve.TOda, weaBus.TDryBul) annotation (Line(points={{-162,30}, + {-236,30},{-236,2},{-237,2}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(BufferOnOffController.T_oda, weaBus.TDryBul) annotation (Line(points={ + {-118,50.84},{-118,58},{-236,58},{-236,30},{-237,30},{-237,2}}, color= + {0,0,127}), Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(DHWOnOffContoller.T_oda, weaBus.TDryBul) annotation (Line(points={{-120, + 86.96},{-192,86.96},{-192,94},{-248,94},{-248,2},{-237,2}}, color={0,0, + 127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(minMax.u, useProBus.TZoneSet) annotation (Line(points={{-202,42},{-206, + 42},{-206,52},{-208,52},{-208,60},{-119,60},{-119,103}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(minMax.yMax, heatingCurve.TSetRoom) + annotation (Line(points={{-181,48},{-150,48},{-150,42}}, color={0,0,127})); + connect(booleanToReal1.u, HP_or_HR_active.y) + annotation (Line(points={{-170,-42},{-170,-35}}, color={255,0,255})); + connect(booleanToReal1.y, sigBusGen.uPump) annotation (Line(points={{-170,-65}, + {-172,-65},{-172,-72},{-152,-72},{-152,-99}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(HP_or_HR_active.u1, heatDemand_AuxiliarHeater.y) annotation (Line( + points={{-170,-12},{-170,-6},{-90,-6},{-90,-2},{32,-2},{32,23},{26.75, + 23}}, color={255,0,255})); + connect(HP_or_HR_active.u2, sigBusGen.heaPumIsOn) annotation (Line( + points={{-178,-12},{-194,-12},{-194,-99},{-152,-99}}, color={255,0,255}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(heatPumpBusPassThrough.sigBusGen, sigBusGen) annotation (Line( + points={{-220,-90},{-200,-90},{-200,-80},{-180,-80},{-180,-72},{-152,-72}, + {-152,-99}}, + color={255,204,51}, + thickness=0.5), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(heatPumpBusPassThrough.vapourCompressionMachineControlBus, + securityControl.sigBusHP) annotation (Line( + points={{-240.2,-89.8},{-252,-89.8},{-252,-80},{72,-80},{72,-38},{192,-38}, + {192,69.27},{192,69.27}}, + color={255,204,51}, + thickness=0.5)); + annotation (Diagram(graphics={ + Rectangle( + extent={{-240,100},{-50,60}}, + lineColor={238,46,47}, + lineThickness=1), + Text( + extent={{-234,94},{-140,128}}, + lineColor={238,46,47}, + lineThickness=1, + textString="DHW Control"), + Rectangle( + extent={{-240,58},{-50,14}}, + lineColor={0,140,72}, + lineThickness=1), + Text( + extent={{-216,-14},{-122,20}}, + lineColor={0,140,72}, + lineThickness=1, + textString="Buffer Control"), + Rectangle( + extent={{0,100},{132,52}}, + lineColor={28,108,200}, + lineThickness=1), + Text( + extent={{4,122},{108,102}}, + lineColor={28,108,200}, + lineThickness=1, + textString="Heat Pump Control"), + Rectangle( + extent={{0,46},{132,-4}}, + lineColor={162,29,33}, + lineThickness=1), + Text( + extent={{14,-4},{118,-24}}, + lineColor={162,29,33}, + lineThickness=1, + textString="Boiler Control"), + Rectangle( + extent={{138,100},{240,52}}, + lineColor={28,108,200}, + lineThickness=1), + Text( + extent={{138,122},{242,102}}, + lineColor={28,108,200}, + lineThickness=1, + textString="Heat Pump Safety")})); +end PartialTwoPoint_HPS_Controller_BivalentBoiler; diff --git a/BESMod/Systems/Hydraulical/Control/Components/ThermostaticValveController/ThermostaticValvePControlled.mo b/BESMod/Systems/Hydraulical/Control/Components/ThermostaticValveController/ThermostaticValvePControlled.mo index 4c700585..17707568 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/ThermostaticValveController/ThermostaticValvePControlled.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/ThermostaticValveController/ThermostaticValvePControlled.mo @@ -10,7 +10,8 @@ model ThermostaticValvePControlled equation for i in 1:nZones loop //Calculating the valve opening depending on the temperature deviation - opening[i] =min(1, max(leakageOpening, (P[i] - (TZoneMea [i] - TZoneSet[i]))*(Kv_setT[i]/Kvs[i])/P[i])); + opening[i] =min(1, max(leakageOpening, (P[i] -TZoneMea [i] -TZoneSet + [i])*(Kv_setT[i]/Kvs[i])/P[i])); end for; annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ Line(points={{-82,-82},{-82,-22},{-82,0},{74,0}}, color={0,0,127}), diff --git a/BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo b/BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo index 71b20b6d..2bc719f1 100644 --- a/BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo @@ -58,8 +58,8 @@ model MonovalentGasBoiler "PI Control of gas boiler" final TBiv=monovalentControlParas.TOda_nominal) annotation (choicesAllMatching=true, Placement(transformation(extent={{-218, -36},{-204,-22}}))); - Modelica.Blocks.Sources.BooleanConstant booleanConstant(k=false) - if not use_dhw annotation (Placement(transformation( + Modelica.Blocks.Sources.BooleanConstant booleanConstant(k=false) if + not use_dhw annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=180, origin={-30,-10}))); diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo new file mode 100644 index 00000000..7a6e697e --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo @@ -0,0 +1,250 @@ +within BESMod.Systems.Hydraulical.Control; +model NewControlBivalentParallel + "Bivalent Parallel Generation Control Class (Part-parallel PI controlled HPS according to condenser outflow)" + extends BaseClasses.PartialTwoPoint_HPS_Controller_BivalentBoiler( + redeclare + BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController + HP_nSet_Controller( + P=bivalentControlData.k, + nMin=bivalentControlData.nMin, + T_I=bivalentControlData.T_I), + redeclare + BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + BufferOnOffController( + Hysteresis=bivalentControlData.dTHysBui, + TCutOff=TCutOff, + TBiv=bivalentControlData.TBiv, + TOda_nominal=bivalentControlData.TOda_nominal, + TRoom=bivalentControlData.TSetRoomConst, + QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), + QHP_flow_cutOff=QHP_flow_cutOff), + redeclare + BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + DHWOnOffContoller( + Hysteresis=bivalentControlData.dTHysDHW, + TCutOff=TCutOff, + TBiv=bivalentControlData.TBiv, + TOda_nominal=bivalentControlData.TOda_nominal, + TRoom=bivalentControlData.TSetRoomConst, + QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), + QHP_flow_cutOff=QHP_flow_cutOff)); + + parameter Modelica.Units.SI.Temperature TCutOff "Cut-off temperature"; + parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff; + + replaceable + Components.HeatPumpNSetController.PI_InverterHeatPumpController + Boiler_uRel_Controller( + P=2, + nMin=0, + T_I=1200, + Ni=0.9) constrainedby + Components.HeatPumpNSetController.PI_InverterHeatPumpController + annotation (choicesAllMatching=true, Placement(transformation(extent={{68,14}, + {98,42}}))); + Modelica.Blocks.Sources.BooleanConstant BooleanConstant(final k=true) + annotation (Placement(transformation( + extent={{-7,-7},{7,7}}, + rotation=0, + origin={43,17}))); + Modelica.Blocks.Sources.RealExpression T_Oda(final y( + unit="K", + displayUnit="degC") = heatingCurve.TOda) + annotation (Placement( + transformation( + extent={{-16,-5},{16,5}}, + rotation=0, + origin={-214,-323}))); + Modelica.Blocks.Sources.RealExpression HP_NSet(final y( + unit="K", + displayUnit="degC") = HP_nSet_Controller.n_Set) + "Compressor Drehzahl für Boiler Steuerung" annotation (Placement( + transformation( + extent={{-16,-5},{16,5}}, + rotation=0, + origin={-234,-379}))); + Modelica.Blocks.Logical.LessThreshold lessThreshold(threshold= + bivalentControlData.TBiv) "checks, if Toda is below Tbiv" + annotation (Placement(transformation(extent={{-164,-336},{-132,-304}}))); + Modelica.Blocks.Logical.And OperationalBoundryCheck + "checks, if hp is allowed to operate regarding operational boundry. If HP_ON = true and IsON=False, then hp is deactivated on purpose. In this case, this signal will be true." + annotation (Placement(transformation(extent={{-158,-464},{-138,-444}}))); + Modelica.Blocks.Logical.Not not1 + annotation (Placement(transformation(extent={{-224,-450},{-204,-430}}))); + Modelica.Blocks.Sources.BooleanExpression HP_IsON1(y=HP_nSet_Controller.IsOn) + annotation (Placement(transformation(extent={{-282,-448},{-262,-428}}))); + Modelica.Blocks.Sources.BooleanExpression HP_HP_ON(y=HP_nSet_Controller.HP_On) + annotation (Placement(transformation(extent={{-284,-480},{-264,-460}}))); + Modelica.Blocks.Logical.Or or1 + "hp outside operational boundary or high utilization (high compressor rotational speed)" + annotation (Placement(transformation(extent={{-90,-424},{-70,-404}}))); + Modelica.Blocks.MathBoolean.And CheckBoilerConditions(nu=3) + "if all 3 conditions are met, turn on boiler" + annotation (Placement(transformation(extent={{-4,-486},{22,-460}}))); + Modelica.Blocks.Logical.Or or2 + "if Toda is smaller than TCutOff, activate Boiler" + annotation (Placement(transformation(extent={{180,-460},{200,-440}}))); + Modelica.Blocks.Logical.LessThreshold CheckTCut_Off(threshold= + bivalentControlData.TCutOff) "checks if Toda is below TCutOff" + annotation (Placement(transformation(extent={{62,-388},{94,-356}}))); + Modelica.Blocks.Sources.RealExpression T_Oda1(final y( + unit="K", + displayUnit="degC") = heatingCurve.TOda) + "Außtentemperatur für Boiler Steuerung" annotation (Placement( + transformation( + extent={{-16,-5},{16,5}}, + rotation=0, + origin={0,-373}))); + Modelica.Blocks.Logical.Switch BoilerSwitch + "checks if Boiler is allowed to turn on, if not set Gas to 0" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-66,-208}))); + Modelica.Blocks.Sources.Constant constZero2(k=0) + annotation (Placement(transformation(extent={{-8,-248},{-28,-228}}))); + Modelica.Blocks.Logical.Switch thermalDesinfection + "use Boiler to desinfect DHW tank" annotation (Placement(transformation( + extent={{5,-5},{-5,5}}, + rotation=0, + origin={-123,-179}))); + Modelica.Blocks.Sources.Constant constOne(final k=1) + "maximum Boiler usage for thermal desinfection" annotation (Placement( + transformation( + extent={{-5,-5},{5,5}}, + rotation=180, + origin={-87,-175}))); + Modelica.Blocks.Sources.Constant const3(k=0.5) "WP und Boiler" + annotation (Placement(transformation(extent={{-800,-38},{-780,-18}}))); + Modelica.Blocks.Logical.Switch ThrWayVal1 + "to decide position of three way vlave in generation class" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-708,-70}))); + Modelica.Blocks.Sources.Constant const2(k=1) "nur WP" + annotation (Placement(transformation(extent={{-800,-100},{-780,-80}}))); + Modelica.Blocks.Logical.Switch ThrWayVal2 + "to decide position of three way vlave in generation class" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-634,-104}))); + Modelica.Blocks.Sources.Constant const1(k=0) "nur Boiler falls TCutOff" + annotation (Placement(transformation(extent={{-682,-32},{-662,-12}}))); + Modelica.Blocks.Logical.Switch ThrWayVal3 + "to decide position of three way vlave in generation class" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-520,-104}))); + Modelica.Blocks.Sources.Constant const4(k=0.5) "WP und Boiler" + annotation (Placement(transformation(extent={{-596,-76},{-576,-56}}))); + Modelica.Blocks.Logical.Hysteresis HysteresisBoilerControl(uLow=0.85, uHigh= + 0.9) + "Hysteresis in boiler Control to check for HP Compressor utilization" + annotation (Placement(transformation(extent={{-192,-408},{-172,-388}}))); +equation + connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( + Line(points={{97,61.2},{97,56},{98,56},{98,50},{138,50},{138,-36},{-152, + -36},{-152,-99}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + + connect(switch1.y, Boiler_uRel_Controller.T_Set) annotation (Line(points={{68.5,73}, + {68.5,72},{72,72},{72,48},{58,48},{58,36.4},{65,36.4}}, + color={0,0,127})); + connect(BooleanConstant.y, Boiler_uRel_Controller.HP_On) annotation (Line( + points={{50.7,17},{50.7,4},{56,4},{56,28},{65,28}}, + color={255,0,255})); + connect(BooleanConstant.y, Boiler_uRel_Controller.IsOn) annotation (Line( + points={{50.7,17},{50.7,4},{74,4},{74,11.2}}, color={255,0,255})); + connect(Boiler_uRel_Controller.T_Meas, sigBusGen.TBoilerOut) annotation (Line( + points={{83,11.2},{82,11.2},{82,-60},{-150,-60},{-150,-68},{-152,-68},{ + -152,-99}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(T_Oda.y,lessThreshold. u) annotation (Line(points={{-196.4,-323},{ + -196.4,-320},{-167.2,-320}}, + color={0,0,127})); + connect(not1.y, OperationalBoundryCheck.u1) annotation (Line(points={{-203, + -440},{-160,-440},{-160,-454}}, color={255,0,255})); + connect(HP_IsON1.y,not1. u) annotation (Line(points={{-261,-438},{-244,-438}, + {-244,-440},{-226,-440}}, + color={255,0,255})); + connect(HP_HP_ON.y, OperationalBoundryCheck.u2) annotation (Line(points={{-263, + -470},{-220,-470},{-220,-462},{-160,-462}}, color={255,0,255})); + connect(OperationalBoundryCheck.y, or1.u2) annotation (Line(points={{-137,-454}, + {-137,-422},{-92,-422}}, color={255,0,255})); + connect(lessThreshold.y, CheckBoilerConditions.u[1]) annotation (Line(points={{-130.4, + -320},{-20,-320},{-20,-466.933},{-4,-466.933}}, color={255,0,255})); + connect(or1.y, CheckBoilerConditions.u[2]) annotation (Line(points={{-69,-414}, + {-52,-414},{-52,-416},{-32,-416},{-32,-473},{-4,-473}}, color={255,0,255})); + connect(CheckBoilerConditions.y, or2.u2) annotation (Line(points={{23.95,-473}, + {23.95,-472},{178,-472},{178,-458}}, color={255,0,255})); + connect(T_Oda1.y,CheckTCut_Off. u) annotation (Line(points={{17.6,-373},{37, + -373},{37,-372},{58.8,-372}}, color={0,0,127})); + connect(CheckTCut_Off.y, or2.u1) annotation (Line(points={{95.6,-372},{136,-372}, + {136,-450},{178,-450}}, color={255,0,255})); + connect(heatDemand_AuxiliarHeater.y, CheckBoilerConditions.u[3]) annotation ( + Line(points={{26.75,23},{26.75,-196},{26,-196},{26,-479.067},{-4,-479.067}}, + color={255,0,255})); + connect(constZero2.y, BoilerSwitch.u3) annotation (Line(points={{-29,-238},{-58, + -238},{-58,-220}}, color={0,0,127})); + connect(or2.y, BoilerSwitch.u2) annotation (Line(points={{201,-450},{201,-280}, + {-66,-280},{-66,-220}}, color={255,0,255})); + connect(Boiler_uRel_Controller.n_Set, BoilerSwitch.u1) annotation (Line( + points={{99.5,28},{104,28},{104,-46},{-42,-46},{-42,-100},{-74,-100},{ + -74,-220}}, color={0,0,127})); + connect(BoilerSwitch.y, thermalDesinfection.u3) annotation (Line(points={{-66, + -197},{-66,-183},{-117,-183}}, color={0,0,127})); + connect(TSet_DHW.y, thermalDesinfection.u2) annotation (Line(points={{-190.8,71.04}, + {-190.8,-150},{-108,-150},{-108,-179},{-117,-179}}, color={255,0,255})); + connect(constOne.y, thermalDesinfection.u1) + annotation (Line(points={{-92.5,-175},{-117,-175}}, color={0,0,127})); + connect(const3.y, ThrWayVal1.u1) annotation (Line(points={{-779,-28},{-750,-28}, + {-750,-62},{-720,-62}}, color={0,0,127})); + connect(const2.y, ThrWayVal1.u3) annotation (Line(points={{-779,-90},{-750,-90}, + {-750,-78},{-720,-78}}, color={0,0,127})); + connect(ThrWayVal1.y, ThrWayVal2.u3) annotation (Line(points={{-697,-70},{-672, + -70},{-672,-112},{-646,-112}}, color={0,0,127})); + connect(const1.y, ThrWayVal2.u1) annotation (Line(points={{-661,-22},{-661,-59}, + {-646,-59},{-646,-96}}, color={0,0,127})); + connect(CheckBoilerConditions.y, ThrWayVal1.u2) annotation (Line(points={{23.95, + -473},{23.95,-352},{-922,-352},{-922,-70},{-720,-70}}, color={255,0,255})); + connect(CheckTCut_Off.y, ThrWayVal2.u2) annotation (Line(points={{95.6,-372}, + {116,-372},{116,-290},{-686,-290},{-686,-104},{-646,-104}}, color={ + 255,0,255})); + connect(ThrWayVal2.y, ThrWayVal3.u3) annotation (Line(points={{-623,-104},{-578, + -104},{-578,-112},{-532,-112}}, color={0,0,127})); + connect(const4.y, ThrWayVal3.u1) annotation (Line(points={{-575,-66},{-560,-66}, + {-560,-96},{-532,-96}}, color={0,0,127})); + connect(TSet_DHW.y, ThrWayVal3.u2) annotation (Line(points={{-190.8,71.04},{-190.8, + 188},{-550,188},{-550,-104},{-532,-104}}, color={255,0,255})); + connect(HP_NSet.y, HysteresisBoilerControl.u) annotation (Line(points={{ + -216.4,-379},{-204,-379},{-204,-398},{-194,-398}}, color={0,0,127})); + connect(HysteresisBoilerControl.y, or1.u1) annotation (Line(points={{-171, + -398},{-132,-398},{-132,-414},{-92,-414}}, color={255,0,255})); + connect(ThrWayVal3.y, sigBusGen.uThrWayValGen) annotation (Line(points={{-509, + -104},{-370,-104},{-370,-128},{-142,-128},{-142,-99},{-152,-99}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(thermalDesinfection.y, sigBusGen.yBoiler) annotation (Line(points={{-128.5, + -179},{-152,-179},{-152,-99}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + annotation (Icon(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end NewControlBivalentParallel; diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo new file mode 100644 index 00000000..108adb53 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo @@ -0,0 +1,204 @@ +within BESMod.Systems.Hydraulical.Control; +model NewControlBivalentSerial + "Bivalent Serial Control Class (Part-parallel PI controlled HPS according to condenser outflow)" + extends BaseClasses.PartialTwoPoint_HPS_Controller_BivalentBoiler( + redeclare + BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController + HP_nSet_Controller( + P=bivalentControlData.k, + nMin=bivalentControlData.nMin, + T_I=bivalentControlData.T_I), + redeclare + BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + BufferOnOffController( + Hysteresis=bivalentControlData.dTHysBui, + TCutOff=TCutOff, + TBiv=bivalentControlData.TBiv, + TOda_nominal=bivalentControlData.TOda_nominal, + TRoom=bivalentControlData.TSetRoomConst, + QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), + QHP_flow_cutOff=QHP_flow_cutOff), + redeclare + BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + DHWOnOffContoller( + Hysteresis=bivalentControlData.dTHysDHW, + TCutOff=TCutOff, + TBiv=bivalentControlData.TBiv, + TOda_nominal=bivalentControlData.TOda_nominal, + TRoom=bivalentControlData.TSetRoomConst, + QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), + QHP_flow_cutOff=QHP_flow_cutOff)); + + parameter Modelica.Units.SI.Temperature TCutOff "Cut-off temperature"; + parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff; + + replaceable + Components.HeatPumpNSetController.PI_InverterHeatPumpController + Boiler_uRel_Controller( + P=2, + nMin=0, + T_I=1200, + Ni=0.9) constrainedby + Components.HeatPumpNSetController.PI_InverterHeatPumpController + annotation (choicesAllMatching=true, Placement(transformation(extent={{80,10}, + {110,38}}))); + Modelica.Blocks.Sources.BooleanConstant TestBoilerZustand1(final k=true) + annotation (Placement(transformation( + extent={{-7,-7},{7,7}}, + rotation=0, + origin={43,5}))); + Modelica.Blocks.Sources.RealExpression T_Oda(final y( + unit="K", + displayUnit="degC") = heatingCurve.TOda) + "Außtentemperatur für Boiler Steuerung" annotation (Placement( + transformation( + extent={{-16,-5},{16,5}}, + rotation=0, + origin={-214,-323}))); + Modelica.Blocks.Sources.RealExpression HP_NSet(final y( + unit="K", + displayUnit="degC") = HP_nSet_Controller.n_Set) + "Compressor Drehzahl für Boiler Steuerung" annotation (Placement( + transformation( + extent={{-16,-5},{16,5}}, + rotation=0, + origin={-234,-379}))); + Modelica.Blocks.Logical.LessThreshold lessThreshold(threshold= + bivalentControlData.TBiv) "checks if Toda is smaller than TBiv" + annotation (Placement(transformation(extent={{-164,-336},{-132,-304}}))); + Modelica.Blocks.Logical.Or or1 + "hp outside operational boundary or high utilization (high compressor rotational speed)" + annotation (Placement(transformation(extent={{-90,-424},{-70,-404}}))); + Modelica.Blocks.MathBoolean.And CheckBoilerConditions(nu=3) + "if all 3 conditions are met, turn on boiler" + annotation (Placement(transformation(extent={{-4,-486},{22,-460}}))); + Modelica.Blocks.Logical.Or or2 + "if Toda is smaller than TCutOff, activate Boiler" + annotation (Placement(transformation(extent={{180,-460},{200,-440}}))); + Modelica.Blocks.Logical.LessThreshold CheckTCut_Off(threshold= + bivalentControlData.TCutOff) "checks if Toda is below TCutOff" + annotation (Placement(transformation(extent={{62,-388},{94,-356}}))); + Modelica.Blocks.Sources.RealExpression T_Oda1(final y( + unit="K", + displayUnit="degC") = heatingCurve.TOda) + "Außtentemperatur für Boiler Steuerung" annotation (Placement( + transformation( + extent={{-16,-5},{16,5}}, + rotation=0, + origin={0,-373}))); + Modelica.Blocks.Logical.Switch BoilerSwitch + "checks if Boiler is allowed to turn on, if not set Gas to 0" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-66,-208}))); + Modelica.Blocks.Sources.Constant ConstZero2(k=0) + annotation (Placement(transformation(extent={{-8,-248},{-28,-228}}))); + Modelica.Blocks.Logical.Switch thermalDesinfection + "use Boiler to desinfect DHW tank" annotation (Placement(transformation( + extent={{5,-5},{-5,5}}, + rotation=0, + origin={-123,-179}))); + Modelica.Blocks.Sources.Constant constOne(final k=1) + "maximum Boiler usage for thermal desinfection" annotation (Placement( + transformation( + extent={{-5,-5},{5,5}}, + rotation=180, + origin={-87,-175}))); + Modelica.Blocks.Logical.And OperationalBoundryCheck + "checks, if hp is allowed to operate regarding operational boundry. If HP_ON = true and IsON=False, then hp is deactivated on purpose. In this case, this signal will be true." + annotation (Placement(transformation(extent={{-216,-476},{-196,-456}}))); + Modelica.Blocks.Logical.Not not2 + annotation (Placement(transformation(extent={{-282,-462},{-262,-442}}))); + Modelica.Blocks.Sources.BooleanExpression HP_IsON2(y=HP_nSet_Controller.IsOn) + annotation (Placement(transformation(extent={{-340,-460},{-320,-440}}))); + Modelica.Blocks.Sources.BooleanExpression HP_HP_ON1(y=HP_nSet_Controller.HP_On) + annotation (Placement(transformation(extent={{-342,-492},{-322,-472}}))); + Modelica.Blocks.Logical.Hysteresis HysteresisBoilerControl(uLow=0.85, uHigh= + 0.9) + "Hysteresis in boiler Control to check for HP Compressor utilization" + annotation (Placement(transformation(extent={{-166,-386},{-146,-366}}))); +equation + connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( + Line(points={{97,61.2},{97,20},{98,20},{98,-22},{-152,-22},{-152,-99}}, + color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + + connect(switch1.y, Boiler_uRel_Controller.T_Set) annotation (Line(points={{68.5,73}, + {68.5,72},{72,72},{72,38},{70,38},{70,32.4},{77,32.4}}, + color={0,0,127})); + connect(TestBoilerZustand1.y, Boiler_uRel_Controller.HP_On) annotation (Line( + points={{50.7,5},{50.7,4},{54,4},{54,6},{70,6},{70,24},{77,24}}, + color={255,0,255})); + connect(TestBoilerZustand1.y, Boiler_uRel_Controller.IsOn) annotation (Line( + points={{50.7,5},{50.7,4},{54,4},{54,6},{74,6},{74,0},{86,0},{86,7.2}}, + color={255,0,255})); + connect(Boiler_uRel_Controller.T_Meas, sigBusGen.TBoilerOut) annotation (Line( + points={{95,7.2},{96,7.2},{96,-74},{-148,-74},{-148,-82},{-152,-82},{ + -152,-99}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(T_Oda.y,lessThreshold. u) annotation (Line(points={{-196.4,-323},{ + -196.4,-320},{-167.2,-320}}, + color={0,0,127})); + connect(lessThreshold.y, CheckBoilerConditions.u[1]) annotation (Line(points={{-130.4, + -320},{-20,-320},{-20,-476.033},{-4,-476.033}}, color={255,0, + 255})); + connect(or1.y, CheckBoilerConditions.u[2]) annotation (Line(points={{-69,-414}, + {-52,-414},{-52,-416},{-32,-416},{-32,-473},{-4,-473}}, color={255,0, + 255})); + connect(CheckBoilerConditions.y, or2.u2) annotation (Line(points={{23.95,-473}, + {23.95,-472},{178,-472},{178,-458}}, color={255,0,255})); + connect(T_Oda1.y,CheckTCut_Off. u) annotation (Line(points={{17.6,-373},{37, + -373},{37,-372},{58.8,-372}}, color={0,0,127})); + connect(CheckTCut_Off.y, or2.u1) annotation (Line(points={{95.6,-372},{136,-372}, + {136,-450},{178,-450}}, color={255,0,255})); + connect(ConstZero2.y, BoilerSwitch.u3) annotation (Line(points={{-29,-238},{-58, + -238},{-58,-220}}, color={0,0,127})); + connect(or2.y, BoilerSwitch.u2) annotation (Line(points={{201,-450},{201,-280}, + {-66,-280},{-66,-220}}, color={255,0,255})); + connect(Boiler_uRel_Controller.n_Set, BoilerSwitch.u1) annotation (Line( + points={{111.5,24},{116,24},{116,-58},{-74,-58},{-74,-220}}, color={0,0, + 127})); + connect(BoilerSwitch.y, thermalDesinfection.u3) annotation (Line(points={{-66, + -197},{-66,-183},{-117,-183}}, color={0,0,127})); + connect(TSet_DHW.y, thermalDesinfection.u2) annotation (Line(points={{-190.8, + 71.04},{-190.8,-150},{-108,-150},{-108,-179},{-117,-179}}, color={255, + 0,255})); + connect(constOne.y, thermalDesinfection.u1) + annotation (Line(points={{-92.5,-175},{-117,-175}}, color={0,0,127})); + connect(CheckBoilerConditions.u[3], heatDemand_AuxiliarHeater.y) annotation ( + Line(points={{-4,-469.967},{-32,-469.967},{-32,-172},{26.75,-172},{26.75, + 23}}, color={255,0,255})); + connect(not2.y,OperationalBoundryCheck. u1) annotation (Line(points={{-261, + -452},{-218,-452},{-218,-466}}, color={255,0,255})); + connect(HP_IsON2.y,not2. u) annotation (Line(points={{-319,-450},{-302,-450}, + {-302,-452},{-284,-452}}, + color={255,0,255})); + connect(HP_HP_ON1.y, OperationalBoundryCheck.u2) annotation (Line(points={{ + -321,-482},{-278,-482},{-278,-474},{-218,-474}}, color={255,0,255})); + connect(OperationalBoundryCheck.y, or1.u2) annotation (Line(points={{-195, + -466},{-195,-422},{-92,-422}}, + color={255,0,255})); + connect(thermalDesinfection.y, sigBusGen.yBoiler) annotation (Line(points={{ + -128.5,-179},{-152,-179},{-152,-99}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(HP_NSet.y, HysteresisBoilerControl.u) annotation (Line(points={{ + -216.4,-379},{-192.2,-379},{-192.2,-376},{-168,-376}}, color={0,0,127})); + connect(HysteresisBoilerControl.y, or1.u1) annotation (Line(points={{-145, + -376},{-130,-376},{-130,-406},{-92,-406},{-92,-414}}, color={255,0, + 255})); + annotation (Icon(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end NewControlBivalentSerial; diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo new file mode 100644 index 00000000..0c569f83 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo @@ -0,0 +1,205 @@ +within BESMod.Systems.Hydraulical.Control; +model NewControlBivalentSystem_BoilerAfterBuffer + "intended use for bivalent systems with boiler after buffer (Part-parallel PI controlled HPS according to condenser outflow)" + extends BaseClasses.PartialTwoPoint_HPS_Controller_BivalentBoiler( + redeclare + BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController + HP_nSet_Controller( + P=bivalentControlData.k, + nMin=bivalentControlData.nMin, + T_I=bivalentControlData.T_I), + redeclare + BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + BufferOnOffController( + Hysteresis=bivalentControlData.dTHysBui, + TCutOff=TCutOff, + TBiv=bivalentControlData.TBiv, + TOda_nominal=bivalentControlData.TOda_nominal, + TRoom=bivalentControlData.TSetRoomConst, + QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), + QHP_flow_cutOff=QHP_flow_cutOff), + redeclare + BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + DHWOnOffContoller( + Hysteresis=bivalentControlData.dTHysDHW, + TCutOff=TCutOff, + TBiv=bivalentControlData.TBiv, + TOda_nominal=bivalentControlData.TOda_nominal, + TRoom=bivalentControlData.TSetRoomConst, + QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), + QHP_flow_cutOff=QHP_flow_cutOff)); + + parameter Modelica.Units.SI.Temperature TCutOff "Cut-off temperature"; + parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff; + + replaceable + Components.HeatPumpNSetController.PI_InverterHeatPumpController + Boiler_uRel_Controller( + P=2, + nMin=0, + T_I=1200, + Ni=0.9) constrainedby + Components.HeatPumpNSetController.PI_InverterHeatPumpController + annotation (choicesAllMatching=true, Placement(transformation(extent={{74,12}, + {104,40}}))); + Modelica.Blocks.Sources.BooleanConstant TestBoilerZustand1(final k=true) + annotation (Placement(transformation( + extent={{-7,-7},{7,7}}, + rotation=0, + origin={51,7}))); + Modelica.Blocks.Sources.RealExpression T_Oda(final y( + unit="K", + displayUnit="degC") = heatingCurve.TOda) + "Außtentemperatur für Boiler Steuerung" annotation (Placement( + transformation( + extent={{-16,-5},{16,5}}, + rotation=0, + origin={-214,-323}))); + Modelica.Blocks.Sources.RealExpression HP_NSet(final y( + unit="K", + displayUnit="degC") = HP_nSet_Controller.n_Set) + "Compressor Drehzahl für Boiler Steuerung" annotation (Placement( + transformation( + extent={{-16,-5},{16,5}}, + rotation=0, + origin={-234,-379}))); + Modelica.Blocks.Logical.LessThreshold lessThreshold(threshold= + bivalentControlData.TBiv) "checks, if Toda is below Tbiv" + annotation (Placement(transformation(extent={{-164,-336},{-132,-304}}))); + Modelica.Blocks.Logical.Or or1 + "entweder WP im Sperrmodus oder voll ausgelastet" + annotation (Placement(transformation(extent={{-90,-424},{-70,-404}}))); + Modelica.Blocks.MathBoolean.And CheckBoilerConditions(nu=3) + "if all 3 conditions are met, turn on boiler" + annotation (Placement(transformation(extent={{-4,-486},{22,-460}}))); + Modelica.Blocks.Logical.Or or2 + "if Toda is smaller than TCutOff, activate Boiler" + annotation (Placement(transformation(extent={{180,-460},{200,-440}}))); + Modelica.Blocks.Logical.LessThreshold CheckTCut_Off(threshold= + bivalentControlData.TCutOff) "checks if Toda is below TCutOff" + annotation (Placement(transformation(extent={{62,-388},{94,-356}}))); + Modelica.Blocks.Sources.RealExpression T_Oda1(final y( + unit="K", + displayUnit="degC") = heatingCurve.TOda) + "Außtentemperatur für Boiler Steuerung" annotation (Placement( + transformation( + extent={{-16,-5},{16,5}}, + rotation=0, + origin={0,-373}))); + Modelica.Blocks.Logical.Switch BoilerSwitch + "checks if Boiler is allowed to turn on, if not set Gas to 0" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={-66,-208}))); + Modelica.Blocks.Sources.Constant constZero2(k=0) + annotation (Placement(transformation(extent={{-8,-248},{-28,-228}}))); + Modelica.Blocks.Logical.Switch thermalDesinfection + "use Boiler to desinfect DHW tank" annotation (Placement(transformation( + extent={{5,-5},{-5,5}}, + rotation=0, + origin={-123,-179}))); + Modelica.Blocks.Sources.Constant constOne(final k=1) + "maximum Boiler usage for thermal desinfection" annotation (Placement( + transformation( + extent={{-5,-5},{5,5}}, + rotation=180, + origin={-87,-175}))); + Modelica.Blocks.Logical.And OperationalBoundryCheck + "checks, if hp is allowed to operate regarding operational boundry. If HP_ON = true and IsON=False, then hp is deactivated on purpose. In this case, this signal will be true." + annotation (Placement(transformation(extent={{-146,-480},{-126,-460}}))); + Modelica.Blocks.Logical.Not not2 + annotation (Placement(transformation(extent={{-212,-466},{-192,-446}}))); + Modelica.Blocks.Sources.BooleanExpression HP_IsON2(y=HP_nSet_Controller.IsOn) + annotation (Placement(transformation(extent={{-270,-464},{-250,-444}}))); + Modelica.Blocks.Sources.BooleanExpression HP_HP_ON1(y=HP_nSet_Controller.HP_On) + annotation (Placement(transformation(extent={{-272,-496},{-252,-476}}))); + Modelica.Blocks.Logical.Hysteresis HysteresisBoilerControl(uLow=0.85, uHigh= + 0.9) + "Hysteresis in boiler Control to check for HP Compressor utilization" + annotation (Placement(transformation(extent={{-152,-394},{-132,-374}}))); +equation + connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( + Line(points={{97,61.2},{97,50},{146,50},{146,-36},{-152,-36},{-152,-99}}, + color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + + connect(switch1.y, Boiler_uRel_Controller.T_Set) annotation (Line(points={{68.5,73}, + {68.5,72},{72,72},{72,46},{64,46},{64,34.4},{71,34.4}}, + color={0,0,127})); + connect(TestBoilerZustand1.y, Boiler_uRel_Controller.HP_On) annotation (Line( + points={{58.7,7},{58.7,6},{64,6},{64,26},{71,26}}, + color={255,0,255})); + connect(TestBoilerZustand1.y, Boiler_uRel_Controller.IsOn) annotation (Line( + points={{58.7,7},{58.7,6},{72,6},{72,2},{80,2},{80,9.2}}, + color={255,0,255})); + connect(T_Oda.y,lessThreshold. u) annotation (Line(points={{-196.4,-323},{ + -196.4,-320},{-167.2,-320}}, + color={0,0,127})); + connect(lessThreshold.y, CheckBoilerConditions.u[1]) annotation (Line(points={{-130.4, + -320},{-20,-320},{-20,-466.933},{-4,-466.933}}, color={255,0, + 255})); + connect(or1.y, CheckBoilerConditions.u[2]) annotation (Line(points={{-69,-414}, + {-52,-414},{-52,-416},{-32,-416},{-32,-473},{-4,-473}}, color={255,0, + 255})); + connect(CheckBoilerConditions.y, or2.u2) annotation (Line(points={{23.95,-473}, + {23.95,-472},{178,-472},{178,-458}}, color={255,0,255})); + connect(T_Oda1.y,CheckTCut_Off. u) annotation (Line(points={{17.6,-373},{37, + -373},{37,-372},{58.8,-372}}, color={0,0,127})); + connect(CheckTCut_Off.y, or2.u1) annotation (Line(points={{95.6,-372},{136,-372}, + {136,-450},{178,-450}}, color={255,0,255})); + connect(constZero2.y, BoilerSwitch.u3) annotation (Line(points={{-29,-238},{-58, + -238},{-58,-220}}, color={0,0,127})); + connect(or2.y, BoilerSwitch.u2) annotation (Line(points={{201,-450},{201,-280}, + {-66,-280},{-66,-220}}, color={255,0,255})); + connect(Boiler_uRel_Controller.n_Set, BoilerSwitch.u1) annotation (Line( + points={{105.5,26},{110,26},{110,-58},{-42,-58},{-42,-100},{-74,-100},{ + -74,-220}}, color={0,0,127})); + connect(BoilerSwitch.y, thermalDesinfection.u3) annotation (Line(points={{-66, + -197},{-66,-183},{-117,-183}}, color={0,0,127})); + connect(TSet_DHW.y, thermalDesinfection.u2) annotation (Line(points={{-190.8, + 71.04},{-190.8,-150},{-108,-150},{-108,-179},{-117,-179}}, color={255, + 0,255})); + connect(constOne.y, thermalDesinfection.u1) + annotation (Line(points={{-92.5,-175},{-117,-175}}, color={0,0,127})); + connect(Boiler_uRel_Controller.T_Meas, sigBusDistr.TBoilerOutDistribution) + annotation (Line(points={{89,9.2},{88,9.2},{88,-60},{1,-60},{1,-100}}, + color={0,0, + 127}), Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(CheckBoilerConditions.u[3], heatDemand_AuxiliarHeater.y) annotation ( + Line(points={{-4,-479.067},{-28,-479.067},{-28,6},{40,6},{40,20},{26.75, + 20},{26.75,23}}, color={255,0,255})); + connect(not2.y,OperationalBoundryCheck. u1) annotation (Line(points={{-191, + -456},{-148,-456},{-148,-470}}, color={255,0,255})); + connect(HP_IsON2.y,not2. u) annotation (Line(points={{-249,-454},{-232,-454}, + {-232,-456},{-214,-456}}, + color={255,0,255})); + connect(HP_HP_ON1.y, OperationalBoundryCheck.u2) annotation (Line(points={{ + -251,-486},{-208,-486},{-208,-478},{-148,-478}}, color={255,0,255})); + connect(OperationalBoundryCheck.y, or1.u2) annotation (Line(points={{-125, + -470},{-125,-422},{-92,-422}}, + color={255,0,255})); + connect(thermalDesinfection.y, sigBusDistr.yBoilerDistribution) annotation ( + Line(points={{-128.5,-179},{-154,-179},{-154,-150},{1,-150},{1,-100}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(HP_NSet.y, HysteresisBoilerControl.u) annotation (Line(points={{ + -216.4,-379},{-185.2,-379},{-185.2,-384},{-154,-384}}, color={0,0,127})); + connect(HysteresisBoilerControl.y, or1.u1) annotation (Line(points={{-131, + -384},{-116,-384},{-116,-414},{-92,-414},{-92,-414}}, color={255,0, + 255})); + annotation (Icon(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end NewControlBivalentSystem_BoilerAfterBuffer; diff --git a/BESMod/Systems/Hydraulical/Control/package.order b/BESMod/Systems/Hydraulical/Control/package.order index 146f99c8..aadfbe51 100644 --- a/BESMod/Systems/Hydraulical/Control/package.order +++ b/BESMod/Systems/Hydraulical/Control/package.order @@ -10,6 +10,6 @@ PartBiv_PI_ConOut_HPS Components BaseClasses RecordsCollection -NewControlBivalentSeries -NewControlBivalentSystem3_and_4 +NewControlBivalentSerial +NewControlBivalentSystem_BoilerAfterBuffer NewControlBivalentParallel diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo index 65609710..42c7c4e2 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo @@ -93,8 +93,8 @@ partial model PartialDistributionTwoStorageParallelDetailed redeclare final AixLib.DataBase.Pipes.Copper.Copper_10x0_6 pipeHC2) annotation(Dialog(group="Component data"), choicesAllMatching=true, Placement(transformation(extent={{20,-62},{34,-48}}))); - replaceable parameter Generation.RecordsCollection.HeatingRodBaseDataDefinition heatingRodAftBufParameters - if use_heatingRodAfterBuffer + replaceable parameter Generation.RecordsCollection.HeatingRodBaseDataDefinition heatingRodAftBufParameters if + use_heatingRodAfterBuffer "Parameters for heating rod after buffer storage" annotation (Dialog(group="Component data", enable=use_heatingRodAfterBuffer), choicesAllMatching=true, Placement(transformation( @@ -254,8 +254,8 @@ partial model PartialDistributionTwoStorageParallelDetailed origin={50,90}))); AixLib.Fluid.Interfaces.PassThroughMedium pasThrHeaRodBuf(redeclare package - Medium = Medium, allowFlowReversal=allowFlowReversal) - if not use_heatingRodAfterBuffer + Medium = Medium, allowFlowReversal=allowFlowReversal) if + not use_heatingRodAfterBuffer annotation (Placement(transformation(extent={{40,54},{60,74}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow QHRStoDHWPre_flow(final @@ -264,8 +264,8 @@ partial model PartialDistributionTwoStorageParallelDetailed extent={{-10,-10},{10,10}}, rotation=0, origin={-70,-50}))); - Modelica.Blocks.Math.Gain gain(k=dhwParameters.QHR_flow_nominal) - if dhwParameters.use_hr + Modelica.Blocks.Math.Gain gain(k=dhwParameters.QHR_flow_nominal) if + dhwParameters.use_hr annotation (Placement(transformation(extent={{-112,-60},{-92,-40}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow QHRStoBufPre_flow(final T_ref=293.15, final alpha=0) if bufParameters.use_hr annotation ( @@ -273,8 +273,8 @@ partial model PartialDistributionTwoStorageParallelDetailed extent={{-10,-10},{10,10}}, rotation=0, origin={-70,30}))); - Modelica.Blocks.Math.Gain gainHRBuf(k=bufParameters.QHR_flow_nominal) - if bufParameters.use_hr + Modelica.Blocks.Math.Gain gainHRBuf(k=bufParameters.QHR_flow_nominal) if + bufParameters.use_hr annotation (Placement(transformation(extent={{-100,0},{-80,20}}))); Components.Valves.ThreeWayValveWithFlowReturn threeWayValveWithFlowReturn( @@ -317,8 +317,8 @@ partial model PartialDistributionTwoStorageParallelDetailed extent={{-10,-10},{10,10}}, rotation=180, origin={30,-170}))); - Utilities.KPIs.EnergyKPICalculator eneKPICalAftBufHeaRod(use_inpCon=true) - if use_heatingRodAfterBuffer annotation (Placement(transformation( + Utilities.KPIs.EnergyKPICalculator eneKPICalAftBufHeaRod(use_inpCon=true) if + use_heatingRodAfterBuffer annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={30,-130}))); diff --git a/BESMod/Systems/Hydraulical/Distribution/BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW.mo b/BESMod/Systems/Hydraulical/Distribution/BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW.mo new file mode 100644 index 00000000..6b02ffff --- /dev/null +++ b/BESMod/Systems/Hydraulical/Distribution/BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW.mo @@ -0,0 +1,601 @@ +within BESMod.Systems.Hydraulical.Distribution; +model BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW + "bivalent system with boiler after buffer and with dhw support" + extends + BESMod.Systems.Hydraulical.Distribution.BaseClasses.PartialDistribution( + final dpDem_nominal={0}, + final dpSup_nominal={2*(threeWayValveParameters1.dpValve_nominal + max( + threeWayValveParameters1.dp_nominal))}, + final dTTraDHW_nominal=dhwParameters.dTLoadingHC1, + final dTTra_nominal={bufParameters.dTLoadingHC1}, + final m_flow_nominal=mDem_flow_nominal, + final TSup_nominal=TDem_nominal .+ dTLoss_nominal .+ dTTra_nominal, + final nParallelSup=1, + final nParallelDem=1); + + parameter Modelica.Units.SI.Power Q_nom=boiNoCtrl.paramBoiler.Q_nom + "Nominal heating power"; + + parameter Modelica.Units.SI.Volume V=boiNoCtrl.paramBoiler.volume "Volume"; + + parameter Real mSup2_flow_nominal= 10; + + parameter Modelica.Units.SI.PressureDifference dpBufHCSto_nominal=0 + "Nominal pressure difference in buffer storage heating coil"; + final parameter Modelica.Units.SI.PressureDifference dpDHWHCSto_nominal=sum( + storageDHW.heatingCoil1.pipe.res.dp_nominal) + "Nominal pressure difference in DHW storage heating coil"; + parameter Modelica.Units.SI.HeatFlowRate QHRAftBuf_flow_nominal + "Nominal heat flow rate of heating rod after DHW storage" + annotation (Dialog(enable=use_heatingRodAfterBuffer)); + parameter Boolean use_heatingRodAfterBuffer "=false to disable the Boiler after the buffer storage"; + parameter Integer discretizationStepsDWHStoHR=0 + "Number of steps to dicretize. =0 modulating, =1 resembels an on-off controller. =2 would sample 0, 0.5 and 1"; + parameter Integer discretizationStepsBufStoHR=0 + "Number of steps to dicretize. =0 modulating, =1 resembels an on-off controller. =2 would sample 0, 0.5 and 1"; + replaceable parameter + BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition + temperatureSensorData + annotation (choicesAllMatching=true, Placement(transformation(extent={{126,116}, + {144,130}}))); + replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve threeWayValveParameters1 + constrainedby BESMod.Systems.RecordsCollection.Valves.ThreeWayValve( + final dp_nominal={dpBufHCSto_nominal,dpDHWHCSto_nominal}, + final m_flow_nominal=mSup_flow_nominal[1], + final fraK=1, + use_inputFilter=false) annotation (choicesAllMatching=true, Placement( + transformation(extent={{-182,110},{-162,130}}))); + +replaceable + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition + bufParameters(discretizationStepsHR=2) + constrainedby + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( + final Q_flow_nominal=Q_flow_nominal[1]*f_design[1], + final rho=rho, + final c_p=cp, + final TAmb=TAmb, + T_m=TSup_nominal[1], + final QHC1_flow_nominal=Q_flow_nominal[1]*f_design[1], + final mHC1_flow_nominal=mSup_flow_nominal[1], + redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, + final use_HC2=storageBuf.useHeatingCoil2, + final use_HC1=storageBuf.useHeatingCoil1, + final dTLoadingHC1=0, + final dTLoadingHC2=9999999, + final fHeiHC2=1, + final fDiaHC2=1, + final QHC2_flow_nominal=9999999, + final mHC2_flow_nominal=9999999, + redeclare final AixLib.DataBase.Pipes.Copper.Copper_10x0_6 pipeHC2) + annotation (choicesAllMatching=true, Placement(transformation(extent={{18,26}, + {32,40}}))); + + replaceable + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition + dhwParameters(redeclare final AixLib.DataBase.Pipes.Copper.Copper_28x1 + pipeHC1, redeclare final AixLib.DataBase.Pipes.Copper.Copper_28x1 pipeHC2) + constrainedby + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( + final rho=rho, + final c_p=cp, + final TAmb=TAmb, + final use_HC1=storageDHW.useHeatingCoil1, + final QHC1_flow_nominal=Q_flow_nominal[1]*f_design[1], + final V=VDHWDay, + final Q_flow_nominal=QDHW_flow_nominal, + final VPerQ_flow=0, + T_m=TDHW_nominal, + final mHC1_flow_nominal=mSup_flow_nominal[1], + redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, + final use_HC2=storageDHW.useHeatingCoil2, + final dTLoadingHC2=5, + final fHeiHC2=1, + final fDiaHC2=1, + final mHC2_flow_nominal=pumpBoiler.m_flow_nominal, + final QHC2_flow_nominal=boiNoCtrl.paramBoiler.Q_nom, + redeclare final AixLib.DataBase.Pipes.Copper.Copper_10x0_6 pipeHC2) + annotation (choicesAllMatching=true, Placement(transformation(extent={{20,-62}, + {34,-48}}))); + + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperatureBuf(final T=bufParameters.TAmb) annotation (Placement(transformation( + extent={{-12,-12},{12,12}}, + rotation=0, + origin={-82,2}))); + Modelica.Blocks.Sources.RealExpression T_stoDHWTop(final y(unit="K", displayUnit="degC")=storageDHW.layer[ + dhwParameters.nLayer].T) annotation (Placement(transformation( + extent={{-17,-6},{17,6}}, + rotation=0, + origin={-33,70}))); + Modelica.Blocks.Sources.RealExpression T_stoBufTop(final y(unit="K", displayUnit="degC")=storageBuf.layer[ + bufParameters.nLayer].T) annotation (Placement(transformation( + extent={{-16,-5},{16,5}}, + rotation=0, + origin={-34,87}))); + Modelica.Blocks.Sources.RealExpression T_stoBufBot(final y(unit="K", displayUnit="degC")=storageBuf.layer[1].T) + annotation (Placement(transformation( + extent={{-16,-5},{16,5}}, + rotation=0, + origin={-34,79}))); + Modelica.Blocks.Sources.RealExpression T_stoDHWBot(final y(unit="K", displayUnit="degC")=storageDHW.layer[1].T) + annotation (Placement(transformation( + extent={{-16,-5},{16,5}}, + rotation=0, + origin={-34,95}))); + + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperatureDHW(final T=dhwParameters.TAmb) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-72,-88}))); + + AixLib.Fluid.Storage.BufferStorage storageBuf( + redeclare final package Medium = Medium, + final energyDynamics=energyDynamics, + final p_start=p_start, + final mSenFac=1, + redeclare package MediumHC1 = MediumGen, + redeclare package MediumHC2 = MediumGen, + final m1_flow_nominal=mSup_flow_nominal[1], + final m2_flow_nominal=m_flow_nominal[1], + final mHC1_flow_nominal=bufParameters.mHC1_flow_nominal, + final mHC2_flow_nominal=bufParameters.mHC2_flow_nominal, + useHeatingCoil1=false, + final useHeatingCoil2=false, + final useHeatingRod=bufParameters.use_hr, + final TStart=T_start, + redeclare final BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.bufferData + data( + final hTank=bufParameters.h, + hHC1Low=0, + hHR=bufParameters.nLayerHR/bufParameters.nLayer*bufParameters.h, + final dTank=bufParameters.d, + final sWall=bufParameters.sIns/2, + final sIns=bufParameters.sIns/2, + final lambdaWall=bufParameters.lambda_ins, + final lambdaIns=bufParameters.lambda_ins, + final rhoIns=373000, + final cIns=1000, + pipeHC1=bufParameters.pipeHC1, + pipeHC2=bufParameters.pipeHC2, + lengthHC1=bufParameters.lengthHC1, + lengthHC2=bufParameters.lengthHC2), + final n=bufParameters.nLayer, + final hConIn=bufParameters.hConIn, + final hConOut=bufParameters.hConOut, + final hConHC1=bufParameters.hConHC1, + final hConHC2=bufParameters.hConHC2, + upToDownHC1=true, + upToDownHC2=true, + final TStartWall=T_start, + final TStartIns=T_start, + redeclare model HeatTransfer = + AixLib.Fluid.Storage.BaseClasses.HeatTransferBuoyancyWetter, + final allowFlowReversal_layers=allowFlowReversal, + final allowFlowReversal_HC1=allowFlowReversal, + final allowFlowReversal_HC2=allowFlowReversal) + annotation (Placement(transformation(extent={{-36,14},{0,58}}))); + + AixLib.Fluid.Storage.BufferStorage storageDHW( + redeclare final package Medium = MediumDHW, + final energyDynamics=energyDynamics, + final p_start=p_start, + final mSenFac=1, + redeclare final package MediumHC1 = MediumGen, + redeclare final package MediumHC2 = MediumGen, + final m1_flow_nominal=mSup_flow_nominal[1], + final m2_flow_nominal=mDHW_flow_nominal, + final mHC1_flow_nominal=dhwParameters.mHC1_flow_nominal, + final mHC2_flow_nominal=dhwParameters.mHC2_flow_nominal, + final useHeatingCoil1=true, + final useHeatingCoil2=true, + final useHeatingRod=dhwParameters.use_hr, + final TStart=T_start, + redeclare final BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.bufferData + data( + final hTank=dhwParameters.h, + hHC1Low=0, + hHR=dhwParameters.nLayerHR/dhwParameters.nLayer*dhwParameters.h, + final dTank=dhwParameters.d, + final sWall=dhwParameters.sIns/2, + final sIns=dhwParameters.sIns/2, + final lambdaWall=dhwParameters.lambda_ins, + final lambdaIns=dhwParameters.lambda_ins, + final rhoIns=373000, + final cIns=1000, + pipeHC1=dhwParameters.pipeHC1, + pipeHC2=dhwParameters.pipeHC2, + lengthHC1=dhwParameters.lengthHC1, + lengthHC2=dhwParameters.lengthHC2), + final n=dhwParameters.nLayer, + final hConIn=dhwParameters.hConIn, + final hConOut=dhwParameters.hConOut, + final hConHC1=dhwParameters.hConHC1, + final hConHC2=dhwParameters.hConHC2, + final upToDownHC1=true, + final upToDownHC2=true, + final TStartWall=T_start, + final TStartIns=T_start, + redeclare model HeatTransfer = + AixLib.Fluid.Storage.BaseClasses.HeatTransferBuoyancyWetter, + final allowFlowReversal_layers=allowFlowReversal, + final allowFlowReversal_HC1=allowFlowReversal, + final allowFlowReversal_HC2=allowFlowReversal) + annotation (Placement(transformation(extent={{-36,-74},{0,-28}}))); + + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow QHRStoDHWPre_flow(final + T_ref=293.15, final alpha=0) if dhwParameters.use_hr annotation ( + Placement(transformation( + extent={{-7,-7},{7,7}}, + rotation=0, + origin={-69,-51}))); + Modelica.Blocks.Math.Gain gain(k=dhwParameters.QHR_flow_nominal) if + dhwParameters.use_hr + annotation (Placement(transformation(extent={{-102,-60},{-86,-42}}))); + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow QHRStoBufPre_flow1(final + T_ref=293.15, final alpha=0) if bufParameters.use_hr annotation ( + Placement(transformation( + extent={{-7,-7},{7,7}}, + rotation=0, + origin={-47,35}))); + Modelica.Blocks.Math.Gain gainHRBuf(k=bufParameters.QHR_flow_nominal) if + bufParameters.use_hr + annotation (Placement(transformation(extent={{-80,18},{-64,36}}))); + + BESMod.Systems.Hydraulical.Distribution.Components.Valves.ThreeWayValveWithFlowReturn + threeWayValveWithFlowReturn( + redeclare package Medium = MediumGen, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final X_start=X_start, + final C_start=C_start, + final C_nominal=C_nominal, + final mSenFac=mSenFac, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parameters=threeWayValveParameters1) + annotation (Placement(transformation(extent={{-84,54},{-64,74}}))); + + IBPSA.Fluid.Sensors.TemperatureTwoPort senTBuiSup( + redeclare final package Medium = Medium, + final allowFlowReversal=allowFlowReversal, + m_flow_nominal=m_flow_nominal[1], + tau=temperatureSensorData.tau, + initType=temperatureSensorData.initType, + T_start=T_start, + final transferHeat=temperatureSensorData.transferHeat, + TAmb=temperatureSensorData.TAmb, + tauHeaTra=temperatureSensorData.tauHeaTra) + "Temperature at supply for building" annotation (Placement(transformation( + extent={{5,6},{-5,-6}}, + rotation=180, + origin={87,76}))); + + BESMod.Utilities.Electrical.ZeroLoad zeroLoad + annotation (Placement(transformation(extent={{30,-108},{50,-88}}))); + AixLib.Fluid.BoilerCHP.BoilerNoControl boiNoCtrl( + redeclare package Medium = AixLib.Media.Water, + final allowFlowReversal=true, + final m_flow_nominal=m_flow_nominal[1], + final m_flow_small=1E-4*abs(m_flow_nominal[1]), + final show_T=show_T, + final initType=Modelica.Blocks.Types.Init.NoInit, + final transferHeat=false, + final rho_default=rho, + final p_start=p_start, + final T_start=T_start, + final etaLoadBased= boiNoCtrl.paramBoiler.eta, + final G=0.003*Q_nom/50, + final C=1.5*Q_nom, + final Q_nom=boiNoCtrl.paramBoiler.Q_nom, + final V=boiNoCtrl.paramBoiler.volume, + final etaTempBased=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99], + final paramBoiler=AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_15kW()) + annotation (Placement(transformation(extent={{26,84},{48,112}}))); + BESMod.Systems.Hydraulical.Distribution.Components.Valves.ThreeWayValveWithFlowReturn + threeWayValveWithFlowReturn2( + redeclare package Medium = MediumGen, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final X_start=X_start, + final C_start=C_start, + final C_nominal=C_nominal, + final mSenFac=mSenFac, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parameters(m_flow_nominal=m_flow_nominal[1], dp_nominal={0, sum(storageDHW.heatingCoil2.pipe.res.dp_nominal)})) + annotation (Placement(transformation(extent={{38,48},{58,68}}))); + AixLib.Fluid.Storage.BufferStorage HydraulischeWeiche( + redeclare final package Medium = Medium, + final energyDynamics=energyDynamics, + final p_start=p_start, + final mSenFac=1, + redeclare package MediumHC1 = IBPSA.Media.Water, + redeclare package MediumHC2 = IBPSA.Media.Water, + final m1_flow_nominal=m_flow_nominal[1], + final m2_flow_nominal=m_flow_nominal[1], + final mHC1_flow_nominal=bufParameters.mHC1_flow_nominal, + final mHC2_flow_nominal=bufParameters.mHC2_flow_nominal, + useHeatingCoil1=false, + final useHeatingCoil2=false, + final useHeatingRod=false, + final TStart=T_start, + redeclare final + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.bufferData + data( + final hTank=hydParameters.h, + hHC1Low=0, + hHR=hydParameters.nLayerHR/hydParameters.nLayer*bufParameters.h, + final dTank=hydParameters.d, + final sWall=hydParameters.sIns/2, + final sIns=hydParameters.sIns/2, + final lambdaWall=hydParameters.lambda_ins, + final lambdaIns=hydParameters.lambda_ins, + final rhoIns=373000, + final cIns=1000, + pipeHC1=hydParameters.pipeHC1, + pipeHC2=hydParameters.pipeHC2, + lengthHC1=hydParameters.lengthHC1, + lengthHC2=hydParameters.lengthHC2), + final n=hydParameters.nLayer, + final hConIn=hydParameters.hConIn, + final hConOut=hydParameters.hConOut, + final hConHC1=bufParameters.hConHC1, + final hConHC2=bufParameters.hConHC2, + upToDownHC1=true, + upToDownHC2=true, + final TStartWall=T_start, + final TStartIns=T_start, + redeclare model HeatTransfer = + AixLib.Fluid.Storage.BaseClasses.HeatTransferBuoyancyWetter, + final allowFlowReversal_layers=allowFlowReversal, + final allowFlowReversal_HC1=allowFlowReversal, + final allowFlowReversal_HC2=allowFlowReversal) + "Hydraulische Weiche falls Radiator Ventil zu ist und Boiler eingeschaltet wird, (damit System nicht überhitzt)" + annotation (Placement(transformation(extent={{66,58},{78,74}}))); +replaceable + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition + hydParameters constrainedby + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( + final Q_flow_nominal=Q_flow_nominal[1]*f_design[1], + final rho=rho, + final c_p=cp, + final TAmb=TAmb, + T_m=TSup_nominal[1], + final QHC1_flow_nominal=Q_flow_nominal[1]*f_design[1], + final mHC1_flow_nominal=mSup_flow_nominal[1], + redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, + final use_HC2=storageBuf.useHeatingCoil2, + final use_HC1=storageBuf.useHeatingCoil1, + final dTLoadingHC2=9999999, + final dTLoadingHC1=9999999, + final fHeiHC2=1, + final fDiaHC2=1, + final QHC2_flow_nominal=9999999, + final mHC2_flow_nominal=9999999, + redeclare final AixLib.DataBase.Pipes.Copper.Copper_10x0_6 pipeHC2) + annotation (choicesAllMatching=true, Placement(transformation(extent={{134,26}, + {148,40}}))); + IBPSA.Fluid.Movers.SpeedControlled_y pumpBoiler( + redeclare final package Medium = Medium, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final allowFlowReversal=false, + final show_T=show_T, + redeclare + BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( + final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final m_flow_nominal=m_flow_nominal[1], + final dp_nominal=boiNoCtrl.dp_nominal + 2*(threeWayValveWithFlowReturn2.parameters.dpValve_nominal + + threeWayValveWithFlowReturn2.parameters.dp_nominal[1] + + threeWayValveWithFlowReturn2.parameters.dpFixed_nominal[1]), + final rho=rho, + final V_flowCurve=pumpData.V_flowCurve, + final dpCurve=pumpData.dpCurve), + final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final addPowerToMedium=pumpData.addPowerToMedium, + final tau=pumpData.tau, + final use_inputFilter=pumpData.use_inputFilter, + final riseTime=pumpData.riseTimeInpFilter, + final init=Modelica.Blocks.Types.Init.InitialOutput, + final y_start=1) annotation (Placement(transformation( + extent={{5,5},{-5,-5}}, + rotation=180, + origin={9,65}))); + Modelica.Blocks.Sources.Constant const4(k=1) + annotation (Placement(transformation(extent={{4,84},{10,90}}))); + parameter + BESMod.Systems.RecordsCollection.Movers.DefaultMover + pumpData annotation (Dialog(group="Component data"), + choicesAllMatching=true, Placement(transformation(extent={{52,152},{74,174}}))); + parameter BESMod.Systems.RecordsCollection.Movers.DefaultMover defaultMoverBA + annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{-64,158},{-30,180}}))); + Utilities.KPIs.EnergyKPICalculator KPIBoi(use_inpCon=true) + annotation (Placement(transformation(extent={{108,164},{128,184}}))); + + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemBuf(final T= + bufParameters.TAmb) "Constant ambient temperature of storage"; + + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemDHW(final T= + dhwParameters.TAmb) "Constant ambient temperature of storage"; + + Utilities.KPIs.EnergyKPICalculator eneKPICalBuf(use_inpCon=false, y=fixTemBuf.port.Q_flow) + annotation (Placement(transformation(extent={{-204,-156},{-184,-136}}))); + Utilities.KPIs.EnergyKPICalculator eneKPICalDHW(use_inpCon=false, y=fixTemDHW.port.Q_flow) + annotation (Placement(transformation(extent={{-204,-196},{-184,-176}}))); +equation + connect(T_stoDHWBot.y, sigBusDistr.TStoDHWBotMea) annotation (Line(points={{-16.4, + 95},{2.5,95},{2.5,101},{0,101}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(T_stoDHWTop.y, sigBusDistr.TStoDHWTopMea) annotation (Line(points={{-14.3, + 70},{-2,70},{-2,101},{0,101}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(T_stoBufBot.y, sigBusDistr.TStoBufBotMea) annotation (Line(points={{-16.4, + 79},{0,79},{0,101}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(T_stoBufTop.y, sigBusDistr.TStoBufTopMea) annotation (Line(points={{-16.4, + 87},{0,87},{0,101}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(fixedTemperatureDHW.port, storageDHW.heatportOutside) annotation ( + Line(points={{-62,-88},{14,-88},{14,-49.62},{-0.45,-49.62}},color={191,0,0})); + connect(storageBuf.heatportOutside, fixedTemperatureBuf.port) annotation ( + Line(points={{-0.45,37.32},{12,37.32},{12,2},{-70,2}},color={191,0,0})); + connect(portDHW_in, storageDHW.fluidportBottom2) annotation (Line(points={{100, + -82},{-12,-82},{-12,-74.23},{-12.825,-74.23}}, color={0,127,255})); + connect(storageDHW.heatingRod, QHRStoDHWPre_flow.port) annotation (Line( + points={{-36,-51},{-62,-51}}, + color={191,0,0}, + pattern=LinePattern.Dash)); + connect(QHRStoDHWPre_flow.Q_flow, gain.y) annotation (Line( + points={{-76,-51},{-85.2,-51}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(QHRStoBufPre_flow1.Q_flow, gainHRBuf.y) annotation (Line( + points={{-54,35},{-58,35},{-58,27},{-63.2,27}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(QHRStoBufPre_flow1.port, storageBuf.heatingRod) annotation (Line( + points={{-40,35},{-40,36},{-36,36}}, + color={191,0,0}, + pattern=LinePattern.Dash)); + connect(portGen_in[1], threeWayValveWithFlowReturn.portGen_a) annotation ( + Line(points={{-100,80},{-92,80},{-92,68.4},{-84,68.4}}, color={0,127,255})); + connect(portGen_out[1], threeWayValveWithFlowReturn.portGen_b) annotation ( + Line(points={{-100,40},{-96,40},{-96,38},{-92,38},{-92,60},{-84,60},{-84,60.4}}, + color={0,127,255})); + connect(threeWayValveWithFlowReturn.portDHW_b, storageDHW.portHC1In) + annotation (Line(points={{-64,60.4},{-60,60.4},{-60,60},{-46,60},{-46,-37.89}, + {-36.45,-37.89}}, color={0,127,255})); + connect(storageDHW.portHC1Out, threeWayValveWithFlowReturn.portDHW_a) + annotation (Line(points={{-36.225,-45.02},{-52,-45.02},{-52,56.4},{-64,56.4}}, + color={0,127,255})); + connect(threeWayValveWithFlowReturn.uBuf, sigBusDistr.uThrWayVal) annotation ( + Line(points={{-74,76},{-74,101},{0,101}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + connect(senTBuiSup.T, sigBusDistr.TBuiSupMea) annotation (Line(points={{87,82.6}, + {86,82.6},{86,96},{32,96},{32,94},{28,94},{28,92},{0,92},{0,101}}, + color={0,0, + 127}), Text( + string="%second", + index=1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( + Line( + points={{50,-98},{70,-98}}, + color={0,0,0}, + thickness=1)); + connect(storageDHW.fluidportTop2, portDHW_out) annotation (Line(points={{-12.375, + -27.77},{-12.375,-20},{100,-20},{100,-22}}, color={0,127,255})); + connect(storageBuf.fluidportTop1, threeWayValveWithFlowReturn.portBui_b) + annotation (Line(points={{-24.3,58.22},{-52,58.22},{-52,62},{-56,62},{-56,72}, + {-64,72}}, color={0,127,255})); + connect(storageBuf.fluidportBottom1, threeWayValveWithFlowReturn.portBui_a) + annotation (Line(points={{-24.075,13.56},{-24.075,6},{-42,6},{-42,68},{-64,68}}, + color={0,127,255})); + connect(threeWayValveWithFlowReturn2.portGen_b, storageBuf.fluidportBottom2) + annotation (Line(points={{38,54.4},{10,54.4},{10,4},{-12.825,4},{-12.825, + 13.78}}, color={0,127,255})); + connect(threeWayValveWithFlowReturn2.portDHW_b, storageDHW.portHC2In) + annotation (Line(points={{58,54.4},{60,54.4},{60,-18},{-48,-18},{-48,-56.75}, + {-36.225,-56.75}}, color={0,127,255})); + connect(threeWayValveWithFlowReturn2.portDHW_a, storageDHW.portHC2Out) + annotation (Line(points={{58,50.4},{64,50.4},{64,-84},{-38,-84},{-38,-78},{ + -40,-78},{-40,-64.11},{-36.225,-64.11}}, + color={0,127,255})); + connect(threeWayValveWithFlowReturn2.portBui_a, HydraulischeWeiche.fluidportBottom1) + annotation (Line(points={{58,62},{64,62},{64,54},{69.975,54},{69.975,57.84}}, + color={0,127,255})); + connect(threeWayValveWithFlowReturn2.portBui_b, HydraulischeWeiche.fluidportTop1) + annotation (Line(points={{58,66},{64,66},{64,78},{69.9,78},{69.9,74.08}}, + color={0,127,255})); + connect(storageBuf.fluidportTop2, pumpBoiler.port_a) annotation (Line(points={{-12.375, + 58.22},{-12.375,65},{4,65}}, color={0,127,255})); + connect(pumpBoiler.port_b, boiNoCtrl.port_a) + annotation (Line(points={{14,65},{26,65},{26,98}}, color={0,127,255})); + connect(const4.y, pumpBoiler.y) annotation (Line(points={{10.3,87},{10.3,80}, + {9,80},{9,71}}, color={0,0,127})); + connect(boiNoCtrl.port_b, threeWayValveWithFlowReturn2.portGen_a) annotation ( + Line(points={{48,98},{54,98},{54,68},{32,68},{32,62.4},{38,62.4}}, color={ + 0,127,255})); + connect(threeWayValveWithFlowReturn2.uBuf, sigBusDistr.uThrWayVal) + annotation (Line(points={{48,70},{50,70},{50,120},{0,120},{0,101}}, color={ + 0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(portBui_in[1], HydraulischeWeiche.fluidportBottom2) annotation (Line( + points={{100,40},{73.725,40},{73.725,57.92}}, color={0,127,255})); + connect(senTBuiSup.port_b, portBui_out[1]) annotation (Line(points={{92,76},{ + 96,76},{96,80},{100,80}}, color={0,127,255})); + connect(senTBuiSup.port_a, HydraulischeWeiche.fluidportTop2) annotation (Line( + points={{82,76},{73.875,76},{73.875,74.08}}, color={0,127,255})); + connect(gain.u, sigBusDistr.uHRStoDHW) annotation (Line(points={{-103.6,-51},{ + -138,-51},{-138,120},{0,120},{0,101}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(gainHRBuf.u, sigBusDistr.uHRAftBuf) annotation (Line(points={{-81.6,27}, + {-118,27},{-118,101},{0,101}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(boiNoCtrl.T_out, sigBusDistr.TBoilerOutDistribution) annotation (Line( + points={{44.92,102.48},{68,102.48},{68,140},{0,140},{0,101}}, color={0, + 0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(boiNoCtrl.thermalPower, KPIBoi.u) annotation (Line(points={{44.92, + 109.76},{44.92,108},{106.2,108},{106.2,174}}, color={0,0,127})); + connect(sigBusDistr.yBoilerDistribution, boiNoCtrl.u_rel) annotation (Line( + points={{0,101},{0,136},{30,136},{30,118},{29.3,118},{29.3,107.8}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(eneKPICalDHW.KPI, outBusDist.QDHWLos_flow) annotation (Line(points={{-181.8, + -186},{0,-186},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(eneKPICalBuf.KPI, outBusDist.QBufLos_flow) annotation (Line(points={{-181.8, + -146},{0,-146},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIBoi.KPI, outBusDist.QBoi_Distribution_flow) annotation (Line( + points={{130.2,174},{176,174},{176,-156},{0,-156},{0,-100}}, color={135, + 135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); +end BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW; diff --git a/BESMod/Systems/Hydraulical/Distribution/BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW.mo b/BESMod/Systems/Hydraulical/Distribution/BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW.mo new file mode 100644 index 00000000..b3377c34 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Distribution/BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW.mo @@ -0,0 +1,320 @@ +within BESMod.Systems.Hydraulical.Distribution; +model BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW + "bivalent system with boiler after buffer and without dhw support" + extends BaseClasses.PartialDistribution( + final VStoDHW=dhwParameters.V, + final QDHWStoLoss_flow=dhwParameters.QLoss_flow, + designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.PartStorage, + final dpDem_nominal={0}, + final dpSup_nominal={2*(threeWayValveParameters.dpValve_nominal + max( + threeWayValveParameters.dp_nominal))}, + final dTTraDHW_nominal=dhwParameters.dTLoadingHC1, + final dTTra_nominal={bufParameters.dTLoadingHC1}, + final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, + final TSup_nominal=TDem_nominal .+ dTLoss_nominal .+ dTTra_nominal, + dTLoss_nominal=fill(0, nParallelDem), + final m_flow_nominal=mDem_flow_nominal, + final nParallelSup=1, + final nParallelDem=1); + + parameter Modelica.Units.SI.Power Q_nom=boiNoCtrl.paramBoiler.Q_nom + "Nominal heating power"; + + parameter Modelica.Units.SI.Volume V=boiNoCtrl.paramBoiler.volume "Volume"; + + AixLib.Fluid.Storage.Storage storageDHW( + redeclare final package Medium = MediumDHW, + final n=dhwParameters.nLayer, + final d=dhwParameters.d, + final h=dhwParameters.h, + final lambda_ins=dhwParameters.lambda_ins, + final s_ins=dhwParameters.sIns, + final hConIn=dhwParameters.hConIn, + final hConOut=dhwParameters.hConOut, + final k_HE=dhwParameters.k_HE, + final A_HE=dhwParameters.A_HE, + final V_HE=dhwParameters.V_HE, + final beta=dhwParameters.beta, + final kappa=dhwParameters.kappa, + final m_flow_nominal_layer=mDHW_flow_nominal, + final m_flow_nominal_HE=mSup_flow_nominal[1], + final energyDynamics=energyDynamics, + final T_start=TDHW_nominal, + final p_start=p_start, + final m_flow_small_layer=1E-4*abs(storageDHW.m_flow_nominal_layer), + final m_flow_small_layer_HE=1E-4*abs(storageDHW.m_flow_nominal_HE)) + "The DHW storage (TWWS) for domestic hot water demand" + annotation (Placement(transformation(extent={{66,-70},{32,-32}}))); + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemBuf(final T= + bufParameters.TAmb) "Constant ambient temperature of storage" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={50,10}))); + AixLib.Fluid.Storage.Storage storageBuf( + redeclare package Medium = Medium, + final n=bufParameters.nLayer, + final d=bufParameters.d, + final h=bufParameters.h, + final lambda_ins=bufParameters.lambda_ins, + final s_ins=bufParameters.sIns, + final hConIn=bufParameters.hConIn, + final hConOut=bufParameters.hConOut, + final k_HE=bufParameters.k_HE, + final A_HE=bufParameters.A_HE, + final V_HE=bufParameters.V_HE, + final beta=bufParameters.beta, + final kappa=bufParameters.kappa, + final m_flow_nominal_layer=m_flow_nominal[1], + final m_flow_nominal_HE=mSup_flow_nominal[1], + final energyDynamics=energyDynamics, + final T_start=T_start, + final p_start=p_start, + final m_flow_small_layer=1E-4*abs(storageBuf.m_flow_nominal_layer), + final m_flow_small_layer_HE=1E-4*abs(storageBuf.m_flow_nominal_HE)) + "The buffer storage (PS) for the building" + annotation (Placement(transformation(extent={{66,40},{32,76}}))); + Components.Valves.ThreeWayValveWithFlowReturn + threeWayValveWithFlowReturn( + redeclare package Medium = MediumGen, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final X_start=X_start, + final C_start=C_start, + final C_nominal=C_nominal, + final mSenFac=mSenFac, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parameters=threeWayValveParameters) + annotation (Placement(transformation(extent={{-60,40},{-20,80}}))); + Modelica.Blocks.Sources.RealExpression T_stoDHWTop(final y(unit="K", displayUnit="degC")=storageDHW.layer[ + dhwParameters.nLayer].T) annotation (Placement(transformation( + extent={{-5,-3},{5,3}}, + rotation=180, + origin={37,87}))); + Modelica.Blocks.Sources.RealExpression T_stoBufTop(final y(unit="K", displayUnit="degC")=storageBuf.layer[ + bufParameters.nLayer].T) annotation (Placement(transformation( + extent={{-5,-2},{5,2}}, + rotation=180, + origin={23,92}))); + Modelica.Blocks.Sources.RealExpression T_stoBufBot(final y(unit="K", displayUnit="degC")=storageBuf.layer[1].T) + annotation (Placement(transformation( + extent={{-5,-3},{5,3}}, + rotation=180, + origin={23,87}))); + Modelica.Blocks.Sources.RealExpression T_stoDHWBot(final y(unit="K", displayUnit="degC")=storageDHW.layer[1].T) + annotation (Placement(transformation( + extent={{-5,-3},{5,3}}, + rotation=180, + origin={37,99}))); + + replaceable parameter + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.SimpleStorageBaseDataDefinition + bufParameters constrainedby + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.SimpleStorageBaseDataDefinition( + final Q_flow_nominal=Q_flow_nominal[1]*f_design[1], + final rho=rho, + final c_p=cp, + final TAmb=TAmb, + final T_m=TDem_nominal[1], + final QHC1_flow_nominal=Q_flow_nominal[1], + final mHC1_flow_nominal=mSup_flow_nominal[1], + redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1) annotation ( + choicesAllMatching=true, Placement(transformation(extent={{84,56},{98,70}}))); + replaceable parameter + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.SimpleStorageBaseDataDefinition + dhwParameters constrainedby + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.SimpleStorageBaseDataDefinition( + final rho=rho, + final c_p=cp, + final TAmb=TAmb, + final QHC1_flow_nominal=QDHW_flow_nominal, + final V=if designType == Types.DHWDesignType.FullStorage then VDHWDay * fFullSto else VDHWDay, + final Q_flow_nominal=0, + final VPerQ_flow=0, + final T_m=TDHW_nominal, + final mHC1_flow_nominal=mSup_flow_nominal[1], + redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1) annotation ( + choicesAllMatching=true, Placement(transformation(extent={{82,-58},{98,-42}}))); + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemDHW(final T= + dhwParameters.TAmb) "Constant ambient temperature of storage" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={30,-90}))); + + Utilities.KPIs.EnergyKPICalculator eneKPICalBuf(use_inpCon=false, y=fixTemBuf.port.Q_flow) + annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); + Utilities.KPIs.EnergyKPICalculator eneKPICalDHW(use_inpCon=false, y=fixTemDHW.port.Q_flow) + annotation (Placement(transformation(extent={{-80,-100},{-60,-80}}))); + BESMod.Utilities.Electrical.ZeroLoad zeroLoad + annotation (Placement(transformation(extent={{34,-110},{54,-90}}))); + replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve + threeWayValveParameters constrainedby + BESMod.Systems.RecordsCollection.Valves.ThreeWayValve( + final dp_nominal={resBui.dp_nominal, resDHW.dp_nominal}, + final m_flow_nominal=mSup_flow_nominal[1], + final fraK=1, + use_inputFilter=false) annotation (Placement( + transformation(extent={{-60,2},{-40,22}})), choicesAllMatching=true); + IBPSA.Fluid.FixedResistances.PressureDrop resBui( + redeclare final package Medium = MediumGen, + final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=mSup_flow_nominal[1], + final show_T=show_T, + final from_dp=false, + final dp_nominal=1000, + final linearized=false, + final deltaM=0.3) + "Assume some pressure loss to avoid division by zero error." + annotation (Placement(transformation(extent={{0,60},{20,80}}))); + IBPSA.Fluid.FixedResistances.PressureDrop resDHW( + redeclare final package Medium = MediumGen, + final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=mSup_flow_nominal[1], + final show_T=show_T, + final from_dp=false, + final dp_nominal=1000, + final linearized=false, + final deltaM=0.3) + "Assume some pressure loss to avoid division by zero error." + annotation (Placement(transformation(extent={{0,-40},{20,-20}}))); + IBPSA.Fluid.Sources.Boundary_pT bouPumBuf( + redeclare package Medium = Medium, + final p=p_start, + final T=T_start, + final nPorts=1) + "Pressure reference for transfer circuit as generation circuit reference is not connected (indirect loading)" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={10,10}))); + AixLib.Fluid.BoilerCHP.BoilerNoControl boiNoCtrl( + redeclare package Medium = AixLib.Media.Water, + final allowFlowReversal=true, + final m_flow_nominal=m_flow_nominal[1], + final m_flow_small=1E-4*abs(m_flow_nominal[1]), + final show_T=show_T, + final initType=Modelica.Blocks.Types.Init.NoInit, + final transferHeat=false, + final rho_default=rho, + final p_start=p_start, + final T_start=T_start, + final etaLoadBased= boiNoCtrl.paramBoiler.eta, + final G=0.003*Q_nom/50, + final C=1.5*Q_nom, + final Q_nom=boiNoCtrl.paramBoiler.Q_nom, + final V=boiNoCtrl.paramBoiler.volume, + final etaTempBased=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99], + final paramBoiler=AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_15kW()) + annotation (Placement(transformation(extent={{60,84},{82,108}}))); + Utilities.KPIs.EnergyKPICalculator KPIBoi(use_inpCon=true) + annotation (Placement(transformation(extent={{102,150},{122,170}}))); +equation + connect(fixTemBuf.port, storageBuf.heatPort) annotation (Line(points={{60,10}, + {80,10},{80,58},{62.6,58}}, color={191,0,0})); + connect(storageBuf.port_a_consumer, portBui_in[1]) annotation (Line(points={{49,40}, + {100,40}}, color={0,127,255})); + connect(storageDHW.port_b_consumer, portDHW_out) annotation (Line(points={{49,-32}, + {48,-32},{48,-22},{100,-22}}, color={0,127,255})); + connect(portDHW_in, storageDHW.port_a_consumer) annotation (Line(points={{100,-82}, + {48,-82},{48,-70},{49,-70}}, color={0,127,255})); + connect(fixTemDHW.port, storageDHW.heatPort) annotation (Line(points={{40,-90}, + {70,-90},{70,-51},{62.6,-51}}, color={191,0,0})); + connect(T_stoDHWBot.y, sigBusDistr.TStoDHWBotMea) annotation (Line(points={{31.5, + 99},{0,99},{0,101}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(T_stoDHWTop.y, sigBusDistr.TStoDHWTopMea) annotation (Line(points={{31.5, + 87},{28,87},{28,101},{0,101}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(T_stoBufBot.y, sigBusDistr.TStoBufBotMea) annotation (Line(points={{17.5, + 87},{0,87},{0,101}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(T_stoBufTop.y, sigBusDistr.TStoBufTopMea) annotation (Line(points={{17.5, + 92},{0,92},{0,101}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( + Line( + points={{54,-100},{54,-98},{70,-98}}, + color={0,0,0}, + thickness=1)); + connect(storageBuf.port_b_heatGenerator, threeWayValveWithFlowReturn.portBui_a) + annotation (Line(points={{34.72,43.6},{34.72,42},{-12,42},{-12,68},{-20,68}}, + color={0,127,255})); + connect(storageDHW.port_b_heatGenerator, threeWayValveWithFlowReturn.portDHW_a) + annotation (Line(points={{34.72,-66.2},{-20,-66.2},{-20,44.8}}, color={0,127, + 255})); + connect(threeWayValveWithFlowReturn.portGen_b, portGen_out[1]) annotation ( + Line(points={{-60,52.8},{-84,52.8},{-84,40},{-100,40}}, color={0,127,255})); + connect(portGen_in[1], threeWayValveWithFlowReturn.portGen_a) annotation ( + Line(points={{-100,80},{-66,80},{-66,68.8},{-60,68.8}}, color={0,127,255})); + connect(threeWayValveWithFlowReturn.uBuf, sigBusDistr.uThrWayVal) annotation ( + Line(points={{-40,84},{-40,98},{4,98},{4,100},{0,100},{0,101}}, color={0,0, + 127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(threeWayValveWithFlowReturn.portBui_b, resBui.port_a) + annotation (Line(points={{-20,76},{-10,76},{-10,70},{0,70}}, + color={0,127,255})); + connect(storageBuf.port_a_heatGenerator, resBui.port_b) annotation (Line( + points={{34.72,73.84},{34.72,70},{20,70}}, color={0,127,255})); + connect(threeWayValveWithFlowReturn.portDHW_b, resDHW.port_a) annotation ( + Line(points={{-20,52.8},{-14,52.8},{-14,-30},{0,-30}}, color={0,127,255})); + connect(storageDHW.port_a_heatGenerator, resDHW.port_b) annotation (Line( + points={{34.72,-34.28},{34,-34.28},{34,-30},{20,-30}}, + color={0,127,255})); + connect(eneKPICalDHW.KPI, outBusDist.QDHWLos_flow) annotation (Line(points={{ + -57.8,-90},{0,-90},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(eneKPICalBuf.KPI, outBusDist.QBufLos_flow) annotation (Line(points={{ + -57.8,-50},{0,-50},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(bouPumBuf.ports[1], storageBuf.port_a_consumer) annotation (Line( + points={{10,20},{10,32},{49,32},{49,40}}, color={0,127,255})); + connect(storageBuf.port_b_consumer, boiNoCtrl.port_a) annotation (Line(points= + {{49,76},{48,76},{48,96},{60,96}}, color={0,127,255})); + connect(boiNoCtrl.port_b, portBui_out[1]) + annotation (Line(points={{82,96},{100,96},{100,80}}, color={0,127,255})); + connect(boiNoCtrl.T_out, sigBusDistr.TBoilerOutDistribution) annotation (Line( + points={{78.92,99.84},{92,99.84},{92,128},{0,128},{0,101}}, color={0,0, + 127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(boiNoCtrl.u_rel, sigBusDistr.yBoilerDistribution) annotation (Line( + points={{63.3,104.4},{48,104.4},{48,120},{0,120},{0,101}}, color={0,0, + 127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(boiNoCtrl.thermalPower, KPIBoi.u) annotation (Line(points={{78.92, + 106.08},{100.2,106.08},{100.2,160}}, color={0,0,127})); + connect(KPIBoi.KPI, outBusDist.QBoi_Distribution_flow) annotation (Line( + points={{124.2,160},{170,160},{170,158},{178,158},{178,-148},{0,-148},{ + 0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); +end BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW; diff --git a/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo b/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo index 2a697883..f5ab2b97 100644 --- a/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo +++ b/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo @@ -84,13 +84,13 @@ model CombiStorage final allowFlowReversal_HC1=allowFlowReversal, final allowFlowReversal_HC2=allowFlowReversal) annotation (Placement(transformation(extent={{-26,0},{22,60}}))); - Modelica.Blocks.Sources.Constant conDHWHeaRodOn(k=parameters.QHR_flow_nominal) - if parameters.use_hr annotation (Placement(transformation( + Modelica.Blocks.Sources.Constant conDHWHeaRodOn(k=parameters.QHR_flow_nominal) if + parameters.use_hr annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={-54,-82}))); - Modelica.Blocks.Sources.Constant conDHWHeaRodOff(final k=0) - if parameters.use_hr annotation (Placement(transformation( + Modelica.Blocks.Sources.Constant conDHWHeaRodOff(final k=0) if + parameters.use_hr annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={-90,-82}))); @@ -100,8 +100,8 @@ model CombiStorage rotation=90, origin={-70,-48}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow - prescribedHeatFlow - if parameters.use_hr annotation (Placement(transformation( + prescribedHeatFlow if + parameters.use_hr annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={-70,-18}))); @@ -129,7 +129,6 @@ equation points={{-100,82.5},{-66,82.5},{-66,22},{-46,22},{-46,22.5},{-26.3,22.5}}, color={255,255,0}, thickness=0.5)); - connect(portGen_out[2], bufSto.portHC2Out) annotation (Line( points={{-100,42.5},{-78,42.5},{-78,14},{-52,14},{-52,12.9},{-26.3,12.9}}, color={255,255,0}, diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo index d62ab72c..cd498acf 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo @@ -9,7 +9,7 @@ model PressureReliefExample dpFullOpen_nominal=dp_nominal*1.4, dpThreshold_nominal=dp_nominal*1.1, use_inputFilter=false, - dpValve_nominal=dp_nominal) if use_relVal + dpValve_nominal=dp_nominal) if use_relVal annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, diff --git a/BESMod/Systems/Hydraulical/Distribution/package.order b/BESMod/Systems/Hydraulical/Distribution/package.order index 7adf3026..c660fe88 100644 --- a/BESMod/Systems/Hydraulical/Distribution/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/package.order @@ -9,6 +9,5 @@ RecordsCollection Tests BaseClasses Types -BivalentSystem4_DistributionTwoStorageParallel -BivalentSystemBAforSystem3 -BivalentSystemBAandNewTankforSystem3 +BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW +BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW diff --git a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo index 8c175fd2..6cb53b7d 100644 --- a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo @@ -1,9 +1,7 @@ within BESMod.Systems.Hydraulical.Generation; model GasBoiler "Just a gas boiler" - extends BaseClasses.PartialGeneration( - dTTra_nominal=fill(20, nParallelDem), - dp_nominal={boilerNoControl.dp_nominal}, - final nParallelDem=1); + extends BaseClasses.PartialGeneration(dp_nominal={boilerNoControl.dp_nominal}, + final nParallelDem=1); replaceable parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition paramBoiler "Parameters for Boiler" annotation(Dialog(group="Component data"), choicesAllMatching=true); @@ -148,9 +146,4 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - annotation (Documentation(info=" -

Bottom-up parameters

-


The value for dTTra_nominal is based on EN 303-1:2017, which requires a temperature spread between 10 and 20 K.

-

20 K is used for most applications, as for example stated in the datasheet of the Vitocrossal Typ CU3A.

-")); end GasBoiler; diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndBoilerSerie.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndBoilerSerie.mo new file mode 100644 index 00000000..312e8e2d --- /dev/null +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndBoilerSerie.mo @@ -0,0 +1,315 @@ +within BESMod.Systems.Hydraulical.Generation; +model HeatPumpAndBoilerSerie "Bivalent heat pump Serienschaltung aktuell" + extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialGeneration( + m_flow_nominal=(Q_flow_nominal .* f_design ./ dTTra_nominal ./ 4184), + final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, + final dTLoss_nominal=fill(0, nParallelDem), + dTTra_nominal={if TDem_nominal[i] > 273.15 + 55 then 10 elseif TDem_nominal[ + i] > 44.9 + 273.15 then 8 else 5 for i in 1:nParallelDem}, + dp_nominal={heatPump.dpCon_nominal + boilerNoControl.dp_nominal}, + final nParallelDem=1); + parameter Boolean use_pressure=false "=true to use a pump which works on pressure difference"; + parameter Boolean use_heaRod=false "=false to disable the heating rod"; + replaceable model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=heatPumpParameters.QPri_flow_nominal, + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet") + annotation (__Dymola_choicesAllMatching=true); + + parameter Modelica.Media.Interfaces.Types.Temperature TSoilConst=273.15 + 10 + "Constant soil temperature for ground source heat pumps"; + replaceable package Medium_eva = Modelica.Media.Interfaces.PartialMedium constrainedby + Modelica.Media.Interfaces.PartialMedium annotation ( + __Dymola_choicesAllMatching=true); + replaceable parameter + RecordsCollection.BivalentHeatPumpBaseDataDefinition + heatPumpParameters( + QGen_flow_nominal=sum(systemParameters.QBui_flow_nominal), + THeaTresh=373.15, + scalingFactor=hydraulic.generation.heatPumpParameters.QGenBiv_flow_nominal/ + 5000, + mEva_flow_nominal=1, + useAirSource=true, + use_refIne=false, + redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + TempSensorData) constrainedby + BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentParallel) + annotation (choicesAllMatching=true, Placement( + transformation(extent={{-490,-218},{-438,-176}}))); + + AixLib.Fluid.HeatPumps.HeatPump heatPump( + redeclare package Medium_con = IBPSA.Media.Water, + redeclare package Medium_eva = IBPSA.Media.Air, + final use_rev=false, + final use_autoCalc=false, + final Q_useNominal=0, + final scalingFactor=heatPumpParameters.scalingFactor, + final use_refIne=heatPumpParameters.use_refIne, + final refIneFre_constant=heatPumpParameters.refIneFre_constant, + final nthOrder=1, + final useBusConnectorOnly=true, + final mFlow_conNominal=m_flow_nominal[1], + final VCon=heatPumpParameters.VCon, + final dpCon_nominal=heatPumpParameters.dpCon_nominal, + final use_conCap=false, + final CCon=0, + final GConOut=0, + final GConIns=0, + final mFlow_evaNominal=heatPumpParameters.mEva_flow_nominal, + final VEva=heatPumpParameters.VEva, + final dpEva_nominal=heatPumpParameters.dpEva_nominal, + final use_evaCap=false, + final CEva=0, + final GEvaOut=0, + final GEvaIns=0, + final tauSenT=heatPumpParameters.TempSensorData.tau, + final transferHeat=true, + final allowFlowReversalEva=allowFlowReversal, + final allowFlowReversalCon=allowFlowReversal, + final tauHeaTraEva=heatPumpParameters.TempSensorData.tauHeaTra, + final TAmbEva_nominal=heatPumpParameters.TempSensorData.TAmb, + final tauHeaTraCon=heatPumpParameters.TempSensorData.tauHeaTra, + final TAmbCon_nominal=heatPumpParameters.TempSensorData.TAmb, + initType=Modelica.Blocks.Types.Init.NoInit, + final pCon_start=p_start, + final TCon_start=T_start, + final pEva_start=Medium_eva.p_default, + final TEva_start=Medium_eva.T_default, + final energyDynamics=energyDynamics, + final show_TPort=show_T, + redeclare model PerDataMainHP = + PerDataMainHP, + redeclare model PerDataRevHP = + AixLib.DataBase.Chiller.PerformanceData.LookUpTable2D (final dataTable= + AixLib.DataBase.Chiller.EN14511.Vitocal200AWO201())) + annotation (Placement( + transformation( + extent={{40.5,-48.5},{-40.5,48.5}}, + rotation=270, + origin={-378.5,-152.5}))); + + IBPSA.Fluid.Sources.Boundary_ph bou_sinkAir(final nPorts=1, redeclare package + Medium = IBPSA.Media.Air) annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={-422,-238}))); + IBPSA.Fluid.Sources.MassFlowSource_T bou_air( + final m_flow=heatPumpParameters.mEva_flow_nominal, + final use_T_in=true, + redeclare package Medium = IBPSA.Media.Air, + final use_m_flow_in=false, + final nPorts=1) + annotation (Placement(transformation(extent={{-426,-74},{-406,-54}}))); + + Modelica.Blocks.Logical.Switch switch2 annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-458,-12}))); + Modelica.Blocks.Sources.BooleanConstant + AirOrSoil(k=heatPumpParameters.useAirSource) + annotation (Placement(transformation( + extent={{-6,-6},{6,6}}, + rotation=0, + origin={-496,-14}))); + + Modelica.Blocks.Sources.Constant TSoil(k=TSoilConst) + annotation (Placement(transformation( + extent={{-6,-6},{6,6}}, + rotation=0, + origin={-496,-36}))); + + IBPSA.Fluid.Movers.SpeedControlled_y pumpGeneration( + redeclare final package Medium = Medium, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final allowFlowReversal=allowFlowReversal, + final show_T=show_T, + redeclare + BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( + final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final m_flow_nominal=m_flow_nominal[1], + final dp_nominal=dpDem_nominal[1] + heatPumpParameters.dpCon_nominal + + boilerNoControl.dp_nominal, + final rho=rho, + final V_flowCurve=pumpData.V_flowCurve, + final dpCurve=pumpData.dpCurve), + final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final addPowerToMedium=pumpData.addPowerToMedium, + final tau=pumpData.tau, + final use_inputFilter=pumpData.use_inputFilter, + final riseTime=pumpData.riseTimeInpFilter, + final init=Modelica.Blocks.Types.Init.InitialOutput, + final y_start=1) annotation (Placement(transformation( + extent={{-17,17},{17,-17}}, + rotation=180, + origin={-205,-189}))); + AixLib.Fluid.BoilerCHP.BoilerNoControl boilerNoControl( + redeclare package Medium = AixLib.Media.Water, + final allowFlowReversal=true, + final m_flow_nominal=m_flow_nominal[1], + final m_flow_small=1E-4*abs(m_flow_nominal[1]), + final show_T=show_T, + final initType=Modelica.Blocks.Types.Init.NoInit, + final transferHeat=false, + final rho_default=rho, + final p_start=p_start, + final T_start=T_start, + paramBoiler=AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_15kW()) + annotation (Placement(transformation(extent={{-298,-36},{-216,52}}))); + replaceable parameter + BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition + pumpData( + V_flowCurve={0,0.99,1,1.01}, + dpCurve={1.01,1,0.99,0}, + speed_rpm_nominal=100, + addPowerToMedium=false, + use_inputFilter=false, + riseTimeInpFilter=10, + tau=1) annotation (choicesAllMatching=true, Placement(transformation(extent={{-546, + -162},{-478,-100}}))); + IBPSA.Fluid.Sources.Boundary_pT bouPumpHP( + redeclare package Medium = IBPSA.Media.Water, + final p=p_start, + final T=T_start, + final nPorts=1) annotation (Placement(transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={-172,-96}))); + BESMod.Utilities.Electrical.ZeroLoad zeroLoad + annotation (Placement(transformation(extent={{26,-166},{46,-146}}))); + Modelica.Blocks.Sources.Constant const4(k=1) + annotation (Placement(transformation(extent={{-228,-136},{-208,-116}}))); + BESMod.Systems.Hydraulical.Interfaces.GenerationOutputs + outBusGen1 + annotation (Placement(transformation(extent={{-486,-316},{-466,-296}}))); + Utilities.KPIs.EnergyKPICalculator KPIWel(use_inpCon=true) + annotation (Placement(transformation(extent={{-568,-300},{-548,-280}}))); + Utilities.KPIs.EnergyKPICalculator KPIQHP(use_inpCon=false, y=heatPump.con.QFlow_in) + annotation (Placement(transformation(extent={{-568,-328},{-548,-308}}))); + Utilities.KPIs.EnergyKPICalculator KPIWel2(use_inpCon=true) + annotation (Placement(transformation(extent={{-570,-362},{-550,-342}}))); + replaceable parameter + BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition + temperatureSensorData annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{-58,-264},{36,-206}}))); +protected + parameter Modelica.Units.SI.PressureDifference dpHeaRod_nominal=0; + +equation + + connect(bou_air.ports[1], heatPump.port_a2) annotation (Line( + points={{-406,-64},{-396,-64},{-396,-96},{-402.75,-96},{-402.75,-112}}, + color={0,127,255}, + pattern=LinePattern.Dash)); + connect(heatPump.port_b2, bou_sinkAir.ports[1]) annotation (Line( + points={{-402.75,-193},{-400,-193},{-400,-238},{-412,-238}}, + color={0,127,255}, + pattern=LinePattern.Dash)); + connect(sigBusGen.hp_bus, heatPump.sigBus) annotation (Line( + points={{2,98},{-312,98},{-312,-204},{-394.262,-204},{-394.262,-192.595}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + + connect(bou_air.T_in, switch2.y) + annotation (Line(points={{-428,-60},{-436,-60},{-436,-12},{-447,-12}}, + color={0,0,127})); + connect(sigBusGen.hp_bus.TOdaMea, switch2.u1) annotation (Line( + points={{2,98},{-472,98},{-472,104},{-504,104},{-504,-4},{-470,-4}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(switch2.u2, AirOrSoil.y) + annotation (Line(points={{-470,-12},{-479.7,-12},{-479.7,-14},{-489.4,-14}}, + color={255,0,255})); + + connect(TSoil.y, switch2.u3) annotation (Line(points={{-489.4,-36},{-480,-36}, + {-480,-20},{-470,-20}}, + color={0,0,127})); + + connect(pumpGeneration.port_a, bouPumpHP.ports[1]) annotation (Line(points={{-188, + -189},{-188,-166},{-172,-166},{-172,-106}}, + color={0,127,255})); + connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( + Line( + points={{46,-156},{72,-156},{72,-100}}, + color={0,0,0}, + thickness=1)); + connect(const4.y, pumpGeneration.y) annotation (Line(points={{-207,-126},{ + -196,-126},{-196,-156},{-205,-156},{-205,-168.6}}, + color={0,0,127})); + connect(pumpGeneration.y_actual, sigBusGen.PumpSpeed) annotation (Line(points={{-223.7, + -177.1},{-232,-177.1},{-232,-48},{-172,-48},{-172,98},{2,98}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(heatPump.port_b1, boilerNoControl.port_a) annotation (Line(points={{ + -354.25,-112},{-352,-112},{-352,-96},{-308,-96},{-308,8},{-298,8}}, + color={0,127,255})); + connect(portGen_in[1], pumpGeneration.port_a) annotation (Line(points={{100, + -2},{8,-2},{8,-4},{-96,-4},{-96,-189},{-188,-189}}, color={0,127,255})); + connect(pumpGeneration.port_b, heatPump.port_a1) annotation (Line(points={{ + -222,-189},{-308,-189},{-308,-204},{-354.25,-204},{-354.25,-193}}, + color={0,127,255})); + connect(boilerNoControl.port_b, portGen_out[1]) annotation (Line(points={{ + -216,8},{80,8},{80,80},{100,80}}, color={0,127,255})); + connect(boilerNoControl.T_out, sigBusGen.TBoilerOut) annotation (Line(points={ + {-227.48,22.08},{2,22.08},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(boilerNoControl.u_rel, sigBusGen.BoilerON) annotation (Line(points={{ + -285.7,38.8},{-356,38.8},{-356,136},{2,136},{2,98}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(KPIWel.KPI, outBusGen1.PEleHP) annotation (Line(points={{-545.8,-290}, + {-476,-290},{-476,-306}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIWel.u, sigBusGen.hp_bus.PelMea) annotation (Line(points={{-569.8, + -290},{-592,-290},{-592,180},{2,180},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(outBusGen1.QHP_flow, KPIQHP.KPI) annotation (Line( + points={{-476,-306},{-476,-292},{-528,-292},{-528,-318},{-545.8,-318}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIWel2.KPI, outBusGen1.QBoi_flow) annotation (Line(points={{-547.8, + -352},{-508,-352},{-508,-354},{-476,-354},{-476,-306}}, color={135, + 135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(boilerNoControl.thermalPower, KPIWel2.u) annotation (Line(points={{ + -227.48,44.96},{-192,44.96},{-192,68},{-660,68},{-660,-352},{-571.8, + -352}}, color={0,0,127})); + annotation (Diagram(coordinateSystem(extent={{-560,-300},{240,120}})), Icon( + coordinateSystem(extent={{-560,-300},{240,120}}))); +end HeatPumpAndBoilerSerie; diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo new file mode 100644 index 00000000..1ff2d03d --- /dev/null +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo @@ -0,0 +1,460 @@ +within BESMod.Systems.Hydraulical.Generation; +model HeatPumpAndGasBoilerParallel + "Bivalent heat pump System parallel inspired by Bagarella" + extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialGeneration( + final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, + final dTLoss_nominal=fill(0, nParallelDem), + dTTra_nominal={if TDem_nominal[i] > 273.15 + 55 then 10 elseif TDem_nominal[ + i] > 44.9 + 273.15 then 8 else 5 for i in 1:nParallelDem}, + dp_nominal={0.5*heatPump.dpCon_nominal + 0.5*boiNoCtrl.dp_nominal}, + nParallelDem=1); + + parameter Modelica.Units.SI.Power Q_nom=boiNoCtrl.paramBoiler.Q_nom + "Nominal heating power"; + + parameter Modelica.Units.SI.Volume V=boiNoCtrl.paramBoiler.volume "Volume"; + + + parameter Boolean use_airSource=true + "Turn false to use water as temperature source." + annotation(Dialog(group="Component choices")); + + parameter Boolean use_heaRod=false "=false to disable the heating rod" + annotation(Dialog(group="Component choices")); + replaceable model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D + constrainedby + AixLib.DataBase.HeatPump.PerformanceData.BaseClasses.PartialPerformanceData + annotation (Dialog(group="Component data"), __Dymola_choicesAllMatching=true); + parameter Modelica.Media.Interfaces.Types.Temperature TSoilConst=273.15 + 10 + "Constant soil temperature for ground source heat pumps" + annotation(Dialog(group="Component choices", enable=use_airSource)); + + replaceable package Medium_eva = Modelica.Media.Interfaces.PartialMedium constrainedby + Modelica.Media.Interfaces.PartialMedium annotation (Dialog(group="Component choices"), + choices( + choice(redeclare package Medium = IBPSA.Media.Air "Moist air"), + choice(redeclare package Medium = IBPSA.Media.Water "Water"), + choice(redeclare package Medium = + IBPSA.Media.Antifreeze.PropyleneGlycolWater ( + property_T=293.15, + X_a=0.40) + "Propylene glycol water, 40% mass fraction"))); + replaceable parameter + BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition + heatPumpParameters constrainedby + BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition( + final QGen_flow_nominal=Q_flow_nominal[1], + final TOda_nominal=TOda_nominal) + annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement( + transformation(extent={{-98,14},{-82,28}}))); + + + replaceable parameter + BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition + pumpData annotation (Dialog(group="Component data"), + choicesAllMatching=true, Placement(transformation(extent={{68,-36},{82,-24}}))); + replaceable parameter + BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition + temperatureSensorData + annotation (Dialog(group="Component data"), choicesAllMatching=true, + Placement(transformation(extent={{60,10},{80,30}}))); + + AixLib.Fluid.HeatPumps.HeatPump heatPump( + redeclare package Medium_con = Medium, + redeclare package Medium_eva = Medium_eva, + final use_rev=true, + final use_autoCalc=false, + final Q_useNominal=0, + final scalingFactor=heatPumpParameters.scalingFactor, + final use_refIne=heatPumpParameters.use_refIne, + final refIneFre_constant=heatPumpParameters.refIneFre_constant, + final nthOrder=1, + final useBusConnectorOnly=false, + final mFlow_conNominal=m_flow_nominal[1], + final VCon=heatPumpParameters.VCon, + final dpCon_nominal=heatPumpParameters.dpCon_nominal, + final use_conCap=false, + final CCon=0, + final GConOut=0, + final GConIns=0, + final mFlow_evaNominal=heatPumpParameters.mEva_flow_nominal, + final VEva=heatPumpParameters.VEva, + final dpEva_nominal=heatPumpParameters.dpEva_nominal, + final use_evaCap=false, + final CEva=0, + final GEvaOut=0, + final GEvaIns=0, + final tauSenT=temperatureSensorData.tau, + final transferHeat=true, + final allowFlowReversalEva=allowFlowReversal, + final allowFlowReversalCon=allowFlowReversal, + final tauHeaTraEva=temperatureSensorData.tauHeaTra, + final TAmbEva_nominal=temperatureSensorData.TAmb, + final tauHeaTraCon=temperatureSensorData.tauHeaTra, + final TAmbCon_nominal=temperatureSensorData.TAmb, + final pCon_start=p_start, + final TCon_start=T_start, + final pEva_start=Medium_eva.p_default, + final TEva_start=Medium_eva.T_default, + final energyDynamics=energyDynamics, + final show_TPort=show_T, + redeclare model PerDataMainHP = PerDataMainHP, + redeclare model PerDataRevHP = + AixLib.DataBase.Chiller.PerformanceData.LookUpTable2D (dataTable= + AixLib.DataBase.Chiller.EN14511.Vitocal200AWO201())) + annotation (Placement( + transformation( + extent={{22,-27},{-22,27}}, + rotation=270, + origin={-42,13}))); + + IBPSA.Fluid.Sources.Boundary_ph bou_sinkAir(final nPorts=1, redeclare package + Medium = Medium_eva) annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={-90,-10}))); + IBPSA.Fluid.Sources.MassFlowSource_T bou_air( + final m_flow=heatPumpParameters.mEva_flow_nominal, + final use_T_in=true, + redeclare package Medium = Medium_eva, + final use_m_flow_in=false, + final nPorts=1) + annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); + + Modelica.Blocks.Logical.Switch switch2 annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-130,50}))); + Modelica.Blocks.Sources.BooleanConstant AirOrSoil(final k=use_airSource) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-170,90}))); + + Utilities.KPIs.EnergyKPICalculator KPIWel(use_inpCon=true) + annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); + + IBPSA.Fluid.Movers.SpeedControlled_y pump( + redeclare final package Medium = Medium, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final allowFlowReversal=allowFlowReversal, + final show_T=show_T, + redeclare + BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData + per( + final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final m_flow_nominal=m_flow_nominal[1], + final dp_nominal=dpDem_nominal[1] + dp_nominal[1], + final rho=rho, + final V_flowCurve=pumpData.V_flowCurve, + final dpCurve=pumpData.dpCurve), + final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final addPowerToMedium=pumpData.addPowerToMedium, + final tau=pumpData.tau, + final use_inputFilter=pumpData.use_inputFilter, + final riseTime=pumpData.riseTimeInpFilter, + final init=Modelica.Blocks.Types.Init.InitialOutput, + final y_start=1) annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=180, + origin={10,-70}))); + + Modelica.Blocks.Sources.Constant TSoil(k=TSoilConst) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-170,50}))); + + Utilities.KPIs.EnergyKPICalculator KPIQHP(use_inpCon=false, y=heatPump.con.QFlow_in) + annotation (Placement(transformation(extent={{-140,-112},{-120,-92}}))); + + IBPSA.Fluid.Sources.Boundary_pT bouPum( + redeclare package Medium = Medium, + final p=p_start, + final T=T_start, + final nPorts=1) "Pressure boundary for pump" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={50,-86}))); + + IBPSA.Fluid.Sensors.TemperatureTwoPort senTGenOut( + redeclare final package Medium = Medium, + final allowFlowReversal=allowFlowReversal, + m_flow_nominal=m_flow_nominal[1], + tau=temperatureSensorData.tau, + initType=temperatureSensorData.initType, + T_start=T_start, + final transferHeat=temperatureSensorData.transferHeat, + TAmb=temperatureSensorData.TAmb, + tauHeaTra=temperatureSensorData.tauHeaTra) + "Temperature at supply (generation outlet)" + annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={70,80}))); + BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={100,-78}))); + Modelica.Blocks.Math.MultiSum multiSum(nu=2) annotation (Placement( + transformation( + extent={{-6,-6},{6,6}}, + rotation=180, + origin={130,-82}))); + Modelica.Blocks.Sources.BooleanExpression booExpHeaPumIsOn(y=heatPump.greaterThreshold.y) + annotation (Placement(transformation(extent={{-180,-20},{-160,0}}))); + Modelica.Blocks.Sources.RealExpression reaExpPEleHeaPum(y=heatPump.innerCycle.Pel) + annotation (Placement(transformation(extent={{-180,-80},{-160,-60}}))); + Modelica.Blocks.Sources.Constant conIceFac(final k=1) annotation (Placement( + transformation( + extent={{-11,-11},{11,11}}, + rotation=0, + origin={-169,11}))); + Modelica.Blocks.Sources.RealExpression reaExpTHeaPumOut(y=heatPump.senT_b1.T) + annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); + Modelica.Blocks.Sources.RealExpression reaExpTHeaPumIn(y=heatPump.senT_a1.T) + annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); + Modelica.Blocks.Sources.BooleanConstant conNotRev(final k=true) annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-170,-38}))); + Modelica.Blocks.Sources.RealExpression reaExpTEvaIn(y=heatPump.senT_a2.T) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + + + + AixLib.Fluid.BoilerCHP.BoilerNoControl boiNoCtrl( + redeclare package Medium = AixLib.Media.Water, + final allowFlowReversal=true, + final m_flow_nominal=m_flow_nominal[1], + final m_flow_small=1E-4*abs(m_flow_nominal[1]), + final show_T=show_T, + final initType=Modelica.Blocks.Types.Init.NoInit, + final transferHeat=false, + final rho_default=rho, + final p_start=p_start, + final T_start=T_start, + final etaLoadBased= boiNoCtrl.paramBoiler.eta, + final G=0.003*Q_nom/50, + final C=1.5*Q_nom, + final Q_nom=boiNoCtrl.paramBoiler.Q_nom, + final V=boiNoCtrl.paramBoiler.volume, + final etaTempBased=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99], + final paramBoiler=AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_15kW()) + annotation (Placement(transformation(extent={{10,-2},{48,36}}))); + + + + + + Distribution.Components.Valves.ThreeWayValveWithFlowReturn + threeWayValveWithFlowReturn( + redeclare package Medium = Medium, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final X_start=X_start, + final C_start=C_start, + final C_nominal=C_nominal, + final mSenFac=mSenFac, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parameters=threeWayValveParameters) + annotation (Placement(transformation(extent={{-20,-88},{-46,-62}}))); + replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve + threeWayValveParameters(from_dp=true) constrainedby + BESMod.Systems.RecordsCollection.Valves.ThreeWayValve( + final dp_nominal={heatPumpParameters.dpCon_nominal,boiNoCtrl.dp_nominal}, + final m_flow_nominal=2*m_flow_nominal[1], + final fraK=1, + use_inputFilter=false) annotation (Placement(transformation(extent={{-242,-70}, + {-222,-50}})), choicesAllMatching=true); + + + Utilities.KPIs.EnergyKPICalculator KPIBoi(use_inpCon=true) + annotation (Placement(transformation(extent={{-140,-142},{-120,-122}}))); +equation + + connect(bou_air.ports[1], heatPump.port_a2) annotation (Line( + points={{-80,50},{-74,50},{-74,42},{-55.5,42},{-55.5,35}}, + color={0,127,255})); + connect(heatPump.port_b2, bou_sinkAir.ports[1]) annotation (Line( + points={{-55.5,-9},{-56,-9},{-56,-10},{-80,-10}}, + color={0,127,255})); + connect(bou_air.T_in, switch2.y) + annotation (Line(points={{-102,54},{-108,54},{-108,50},{-119,50}}, + color={0,0,127})); + connect(switch2.u2, AirOrSoil.y) + annotation (Line(points={{-142,50},{-152,50},{-152,90},{-159,90}}, + color={255,0,255})); + + connect(TSoil.y, switch2.u3) annotation (Line(points={{-159,50},{-156,50},{-156, + 42},{-142,42}}, color={0,0,127})); + connect(bouPum.ports[1], pump.port_a) + annotation (Line(points={{50,-76},{50,-70},{20,-70}}, color={0,127,255})); + connect(senTGenOut.T, sigBusGen.THeaRodMea) annotation (Line(points={{70,91},{ + 70,96},{26,96},{26,74},{2,74},{2,98}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + + connect(realToElecCon.internalElectricalPin, internalElectricalPin) + annotation (Line( + points={{89.8,-78.2},{72,-78.2},{72,-100}}, + color={0,0,0}, + thickness=1)); + connect(multiSum.y, realToElecCon.PEleLoa) + annotation (Line(points={{122.98,-82},{112,-82}}, color={0,0,127})); + if use_heaRod then + connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, + -84.1},{144,-84.1},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, + color={0,0,127}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-79.9},{144, + -79.9},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, + color={0,0,127})); + else + connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-79.9},{144, + -79.9},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, + color={0,0,127})); + connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, + -84.1},{144,-84.1},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, + color={0,0,127}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + end if; + connect(switch2.u1, weaBus.TDryBul) annotation (Line(points={{-142,58},{-144,58}, + {-144,80},{-101,80}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(pump.y, sigBusGen.uPump) annotation (Line(points={{10,-58},{24,-58},{24, + -22},{2,-22},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIQHP.KPI, outBusGen.QHP_flow) annotation (Line(points={{-117.8,-102}, + {0,-102},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIWel.KPI, outBusGen.PEleHP) annotation (Line(points={{-117.8,-70},{-104, + -70},{-104,-102},{0,-102},{0,-100}}, color={135,135, + 135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(reaExpPEleHeaPum.y, KPIWel.u) + annotation (Line(points={{-159,-70},{-141.8,-70}}, color={0,0,127})); + connect(conIceFac.y, heatPump.iceFac_in) annotation (Line(points={{-156.9,11}, + {-106,11},{-106,-3.72},{-72.6,-3.72}}, color={0,0,127})); + connect(heatPump.nSet, sigBusGen.yHeaPumSet) annotation (Line(points={{-37.5,-12.52}, + {-37.5,-26},{2,-26},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(booExpHeaPumIsOn.y, sigBusGen.heaPumIsOn) annotation (Line(points={{-159, + -10},{-150,-10},{-150,98},{2,98}}, color={255,0,255}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(reaExpTHeaPumIn.y, sigBusGen.THeaPumIn) annotation (Line(points={{-39, + 70},{2,70},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(reaExpTHeaPumOut.y, sigBusGen.THeaPumOut) annotation (Line(points={{-39, + 90},{-28,90},{-28,74},{2,74},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(heatPump.modeSet, conNotRev.y) annotation (Line(points={{-46.5,-12.52}, + {-46.5,-38},{-159,-38}}, color={255,0,255})); + connect(reaExpTEvaIn.y, sigBusGen.THeaPumEvaIn) annotation (Line(points={{-39, + 50},{2,50},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(boiNoCtrl.T_out, sigBusGen.TBoilerOut) annotation (Line(points={{ + 42.68,23.08},{42.68,22},{52,22},{52,72},{2,72},{2,98}}, color={0,0, + 127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(pump.port_b, threeWayValveWithFlowReturn.portGen_a) annotation (Line( + points={{1.77636e-15,-70},{-14,-70},{-14,-69.28},{-20,-69.28}}, color={0, + 127,255})); + connect(threeWayValveWithFlowReturn.portBui_b, heatPump.port_a1) annotation ( + Line(points={{-46,-64.6},{-54,-64.6},{-54,-64},{-60,-64},{-60,-44},{-28.5, + -44},{-28.5,-9}}, color={0,127,255})); + connect(heatPump.port_b1, threeWayValveWithFlowReturn.portBui_a) annotation ( + Line(points={{-28.5,35},{-28.5,46},{-20,46},{-20,-46},{-52,-46},{-52,-69.8}, + {-46,-69.8}}, color={0,127,255})); + connect(threeWayValveWithFlowReturn.portDHW_a, boiNoCtrl.port_b) annotation ( + Line(points={{-46,-84.88},{-56,-84.88},{-56,-86},{-62,-86},{-62,-110},{48, + -110},{48,17}}, color={0,127,255})); + connect(threeWayValveWithFlowReturn.portDHW_b, boiNoCtrl.port_a) annotation ( + Line(points={{-46,-79.68},{-62,-79.68},{-62,-80},{-72,-80},{-72,-120},{-6, + -120},{-6,-44},{10,-44},{10,17}}, color={0,127,255})); + connect(threeWayValveWithFlowReturn.portGen_b, senTGenOut.port_a) annotation ( + Line(points={{-20,-79.68},{2,-79.68},{2,-82},{28,-82},{28,-120},{148,-120}, + {148,52},{38,52},{38,80},{60,80}}, color={0,127,255})); + connect(senTGenOut.port_b, portGen_out[1]) + annotation (Line(points={{80,80},{100,80}}, color={0,127,255})); + connect(pump.port_a, portGen_in[1]) annotation (Line(points={{20,-70},{56,-70}, + {56,-68},{100,-68},{100,-2}}, color={0,127,255})); + connect(sigBusGen.uThrWayValGen, threeWayValveWithFlowReturn.uBuf) + annotation (Line( + points={{2,98},{4,98},{4,-54},{-33,-54},{-33,-59.4}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + connect(boiNoCtrl.u_rel, sigBusGen.yBoiler) annotation (Line(points={{15.7, + 30.3},{2,30.3},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(boiNoCtrl.thermalPower, KPIBoi.u) annotation (Line(points={{42.68, + 32.96},{178,32.96},{178,-174},{-174,-174},{-174,-132},{-141.8,-132}}, + color={0,0,127})); + connect(KPIBoi.KPI, outBusGen.QBoi_flow) annotation (Line(points={{-117.8, + -132},{0,-132},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + annotation (Line( + points={{-52.775,-6.78},{-52.775,33.61},{-56,33.61},{-56,74}}, + color={255,204,51}, + thickness=0.5), + Diagram(coordinateSystem(extent={{-180,-140},{100,100}}))); +end HeatPumpAndGasBoilerParallel; diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerSerial.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerSerial.mo new file mode 100644 index 00000000..b06a23b5 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerSerial.mo @@ -0,0 +1,416 @@ +within BESMod.Systems.Hydraulical.Generation; +model HeatPumpAndGasBoilerSerial "serial arrangement of heatpump and boiler" + extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialGeneration( + final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, + final dTLoss_nominal=fill(0, nParallelDem), + dTTra_nominal={if TDem_nominal[i] > 273.15 + 55 then 10 elseif TDem_nominal[ + i] > 44.9 + 273.15 then 8 else 5 for i in 1:nParallelDem}, + dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal}, + nParallelDem=1); + + parameter Modelica.Units.SI.Power Q_nom=boiNoCtrl.paramBoiler.Q_nom + "Nominal heating power"; + + parameter Modelica.Units.SI.Volume V=boiNoCtrl.paramBoiler.volume "Volume"; + + parameter Boolean use_airSource=true + "Turn false to use water as temperature source." + annotation(Dialog(group="Component choices")); + + parameter Boolean use_heaRod=true "=false to disable the heating rod" + annotation(Dialog(group="Component choices")); + replaceable model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D + constrainedby + AixLib.DataBase.HeatPump.PerformanceData.BaseClasses.PartialPerformanceData + annotation (Dialog(group="Component data"), __Dymola_choicesAllMatching=true); + parameter Modelica.Media.Interfaces.Types.Temperature TSoilConst=273.15 + 10 + "Constant soil temperature for ground source heat pumps" + annotation(Dialog(group="Component choices", enable=use_airSource)); + + replaceable package Medium_eva = Modelica.Media.Interfaces.PartialMedium constrainedby + Modelica.Media.Interfaces.PartialMedium annotation (Dialog(group="Component choices"), + choices( + choice(redeclare package Medium = IBPSA.Media.Air "Moist air"), + choice(redeclare package Medium = IBPSA.Media.Water "Water"), + choice(redeclare package Medium = + IBPSA.Media.Antifreeze.PropyleneGlycolWater ( + property_T=293.15, + X_a=0.40) + "Propylene glycol water, 40% mass fraction"))); + replaceable parameter + BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition + heatPumpParameters constrainedby + BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition( + final QGen_flow_nominal=Q_flow_nominal[1], + final TOda_nominal=TOda_nominal) + annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement( + transformation(extent={{-98,14},{-82,28}}))); + replaceable parameter + BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatingRodBaseDataDefinition + heatingRodParameters annotation (Dialog(group="Component data"), + choicesAllMatching=true, Placement( + transformation(extent={{64,44},{76,56}}))); + + replaceable parameter + BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition + pumpData annotation (Dialog(group="Component data"), + choicesAllMatching=true, Placement(transformation(extent={{42,-56}, + {56,-44}}))); + replaceable parameter + BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition + temperatureSensorData + annotation (Dialog(group="Component data"), choicesAllMatching=true, + Placement(transformation(extent={{60,10},{80,30}}))); + + AixLib.Fluid.HeatPumps.HeatPump heatPump( + redeclare package Medium_con = Medium, + redeclare package Medium_eva = Medium_eva, + final use_rev=true, + final use_autoCalc=false, + final Q_useNominal=0, + final scalingFactor=heatPumpParameters.scalingFactor, + final use_refIne=heatPumpParameters.use_refIne, + final refIneFre_constant=heatPumpParameters.refIneFre_constant, + final nthOrder=1, + final useBusConnectorOnly=false, + final mFlow_conNominal=m_flow_nominal[1], + final VCon=heatPumpParameters.VCon, + final dpCon_nominal=heatPumpParameters.dpCon_nominal, + final use_conCap=false, + final CCon=0, + final GConOut=0, + final GConIns=0, + final mFlow_evaNominal=heatPumpParameters.mEva_flow_nominal, + final VEva=heatPumpParameters.VEva, + final dpEva_nominal=heatPumpParameters.dpEva_nominal, + final use_evaCap=false, + final CEva=0, + final GEvaOut=0, + final GEvaIns=0, + final tauSenT=temperatureSensorData.tau, + final transferHeat=true, + final allowFlowReversalEva=allowFlowReversal, + final allowFlowReversalCon=allowFlowReversal, + final tauHeaTraEva=temperatureSensorData.tauHeaTra, + final TAmbEva_nominal=temperatureSensorData.TAmb, + final tauHeaTraCon=temperatureSensorData.tauHeaTra, + final TAmbCon_nominal=temperatureSensorData.TAmb, + final pCon_start=p_start, + final TCon_start=T_start, + final pEva_start=Medium_eva.p_default, + final TEva_start=Medium_eva.T_default, + final energyDynamics=energyDynamics, + final show_TPort=show_T, + redeclare model PerDataMainHP = PerDataMainHP, + redeclare model PerDataRevHP = + AixLib.DataBase.Chiller.PerformanceData.LookUpTable2D (dataTable= + AixLib.DataBase.Chiller.EN14511.Vitocal200AWO201())) + annotation (Placement( + transformation( + extent={{22,-27},{-22,27}}, + rotation=270, + origin={-44,15}))); + + IBPSA.Fluid.Sources.Boundary_ph bou_sinkAir(final nPorts=1, redeclare package + Medium = Medium_eva) annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={-90,-10}))); + IBPSA.Fluid.Sources.MassFlowSource_T bou_air( + final m_flow=heatPumpParameters.mEva_flow_nominal, + final use_T_in=true, + redeclare package Medium = Medium_eva, + final use_m_flow_in=false, + final nPorts=1) + annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); + + Modelica.Blocks.Logical.Switch switch2 annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-130,50}))); + Modelica.Blocks.Sources.BooleanConstant AirOrSoil(final k=use_airSource) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-170,90}))); + + Utilities.KPIs.EnergyKPICalculator KPIWel(use_inpCon=true) + annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); + + IBPSA.Fluid.Movers.SpeedControlled_y pump( + redeclare final package Medium = Medium, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final allowFlowReversal=allowFlowReversal, + final show_T=show_T, + redeclare + BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData + per( + final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final m_flow_nominal=m_flow_nominal[1], + final dp_nominal=dpDem_nominal[1] + dp_nominal[1], + final rho=rho, + final V_flowCurve=pumpData.V_flowCurve, + final dpCurve=pumpData.dpCurve), + final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final addPowerToMedium=pumpData.addPowerToMedium, + final tau=pumpData.tau, + final use_inputFilter=pumpData.use_inputFilter, + final riseTime=pumpData.riseTimeInpFilter, + final init=Modelica.Blocks.Types.Init.InitialOutput, + final y_start=1) annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=180, + origin={10,-70}))); + + Modelica.Blocks.Sources.Constant TSoil(k=TSoilConst) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-170,50}))); + + Utilities.KPIs.EnergyKPICalculator KPIQHP(use_inpCon=false, y=heatPump.con.QFlow_in) + annotation (Placement(transformation(extent={{-140,-112},{-120,-92}}))); + + IBPSA.Fluid.Sources.Boundary_pT bouPum( + redeclare package Medium = Medium, + final p=p_start, + final T=T_start, + final nPorts=1) "Pressure boundary for pump" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={50,-86}))); + + IBPSA.Fluid.Sensors.TemperatureTwoPort senTGenOut( + redeclare final package Medium = Medium, + final allowFlowReversal=allowFlowReversal, + m_flow_nominal=m_flow_nominal[1], + tau=temperatureSensorData.tau, + initType=temperatureSensorData.initType, + T_start=T_start, + final transferHeat=temperatureSensorData.transferHeat, + TAmb=temperatureSensorData.TAmb, + tauHeaTra=temperatureSensorData.tauHeaTra) + "Temperature at supply (generation outlet)" + annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={70,80}))); + BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={100,-78}))); + Modelica.Blocks.Math.MultiSum multiSum(nu=2) annotation (Placement( + transformation( + extent={{-6,-6},{6,6}}, + rotation=180, + origin={130,-82}))); + Modelica.Blocks.Sources.BooleanExpression booExpHeaPumIsOn(y=heatPump.greaterThreshold.y) + annotation (Placement(transformation(extent={{-180,-20},{-160,0}}))); + Modelica.Blocks.Sources.RealExpression reaExpPEleHeaPum(y=heatPump.innerCycle.Pel) + annotation (Placement(transformation(extent={{-180,-80},{-160,-60}}))); + Modelica.Blocks.Sources.Constant conIceFac(final k=1) annotation (Placement( + transformation( + extent={{-11,-11},{11,11}}, + rotation=0, + origin={-169,11}))); + Modelica.Blocks.Sources.RealExpression reaExpTHeaPumOut(y=heatPump.senT_b1.T) + annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); + Modelica.Blocks.Sources.RealExpression reaExpTHeaPumIn(y=heatPump.senT_a1.T) + annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); + Modelica.Blocks.Sources.BooleanConstant conNotRev(final k=true) annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-170,-38}))); + Modelica.Blocks.Sources.RealExpression reaExpTEvaIn(y=heatPump.senT_a2.T) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + AixLib.Fluid.BoilerCHP.BoilerNoControl boiNoCtrl( + redeclare package Medium = AixLib.Media.Water, + final allowFlowReversal=true, + final m_flow_nominal=m_flow_nominal[1], + final m_flow_small=1E-4*abs(m_flow_nominal[1]), + final show_T=show_T, + final initType=Modelica.Blocks.Types.Init.NoInit, + final transferHeat=false, + final rho_default=rho, + final p_start=p_start, + final T_start=T_start, + final etaLoadBased= boiNoCtrl.paramBoiler.eta, + final G=0.003*Q_nom/50, + final C=1.5*Q_nom, + final Q_nom=boiNoCtrl.paramBoiler.Q_nom, + final V=boiNoCtrl.paramBoiler.volume, + final etaTempBased=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99], + final paramBoiler=AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_15kW()) + annotation (Placement(transformation(extent={{8,34},{46,72}}))); + Utilities.KPIs.EnergyKPICalculator KPIBoi(use_inpCon=true) + annotation (Placement(transformation(extent={{-136,-138},{-116,-118}}))); +protected + parameter Modelica.Units.SI.PressureDifference dpHeaRod_nominal=if use_heaRod + then heatingRodParameters.dp_nominal else 0; + +equation + + connect(bou_air.ports[1], heatPump.port_a2) annotation (Line( + points={{-80,50},{-74,50},{-74,42},{-57.5,42},{-57.5,37}}, + color={0,127,255})); + connect(heatPump.port_b2, bou_sinkAir.ports[1]) annotation (Line( + points={{-57.5,-7},{-56,-7},{-56,-10},{-80,-10}}, + color={0,127,255})); + connect(bou_air.T_in, switch2.y) + annotation (Line(points={{-102,54},{-108,54},{-108,50},{-119,50}}, + color={0,0,127})); + connect(switch2.u2, AirOrSoil.y) + annotation (Line(points={{-142,50},{-152,50},{-152,90},{-159,90}}, + color={255,0,255})); + connect(pump.port_a, portGen_in[1]) annotation (Line( + points={{20,-70},{100,-70},{100,-2}}, + color={0,127,255})); + + connect(pump.port_b, heatPump.port_a1) annotation (Line( + points={{1.77636e-15,-70},{-30.5,-70},{-30.5,-7}}, + color={0,127,255})); + connect(TSoil.y, switch2.u3) annotation (Line(points={{-159,50},{-156,50},{-156, + 42},{-142,42}}, color={0,0,127})); + connect(bouPum.ports[1], pump.port_a) + annotation (Line(points={{50,-76},{50,-70},{20,-70}}, color={0,127,255})); + connect(senTGenOut.T, sigBusGen.THeaRodMea) annotation (Line(points={{70,91},{ + 70,96},{26,96},{26,74},{2,74},{2,98}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + connect(senTGenOut.port_b, portGen_out[1]) + annotation (Line(points={{80,80},{100,80}}, color={0,127,255})); + + connect(realToElecCon.internalElectricalPin, internalElectricalPin) + annotation (Line( + points={{89.8,-78.2},{72,-78.2},{72,-100}}, + color={0,0,0}, + thickness=1)); + connect(multiSum.y, realToElecCon.PEleLoa) + annotation (Line(points={{122.98,-82},{112,-82}}, color={0,0,127})); + if use_heaRod then + connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, + -84.1},{144,-84.1},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, + color={0,0,127}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-79.9},{144, + -79.9},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, + color={0,0,127})); + else + connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-79.9},{144, + -79.9},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, + color={0,0,127})); + connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, + -84.1},{144,-84.1},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, + color={0,0,127}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + end if; + connect(switch2.u1, weaBus.TDryBul) annotation (Line(points={{-142,58},{-144,58}, + {-144,80},{-101,80}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(pump.y, sigBusGen.uPump) annotation (Line(points={{10,-58},{24,-58},{24, + -22},{2,-22},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIQHP.KPI, outBusGen.QHP_flow) annotation (Line(points={{-117.8,-102}, + {0,-102},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIWel.KPI, outBusGen.PEleHP) annotation (Line(points={{-117.8,-70},{-104, + -70},{-104,-102},{0,-102},{0,-100}}, color={135,135, + 135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(reaExpPEleHeaPum.y, KPIWel.u) + annotation (Line(points={{-159,-70},{-141.8,-70}}, color={0,0,127})); + connect(conIceFac.y, heatPump.iceFac_in) annotation (Line(points={{-156.9,11}, + {-106,11},{-106,-1.72},{-74.6,-1.72}}, color={0,0,127})); + connect(heatPump.nSet, sigBusGen.yHeaPumSet) annotation (Line(points={{-39.5,-10.52}, + {-39.5,-26},{2,-26},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(booExpHeaPumIsOn.y, sigBusGen.heaPumIsOn) annotation (Line(points={{-159, + -10},{-142,-10},{-142,98},{2,98}}, color={255,0,255}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(reaExpTHeaPumIn.y, sigBusGen.THeaPumIn) annotation (Line(points={{-39, + 70},{2,70},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(reaExpTHeaPumOut.y, sigBusGen.THeaPumOut) annotation (Line(points={{-39, + 90},{-28,90},{-28,74},{2,74},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(heatPump.modeSet, conNotRev.y) annotation (Line(points={{-48.5,-10.52}, + {-48.5,-38},{-159,-38}}, color={255,0,255})); + connect(reaExpTEvaIn.y, sigBusGen.THeaPumEvaIn) annotation (Line(points={{-39, + 50},{2,50},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(heatPump.port_b1, boiNoCtrl.port_a) annotation (Line(points={{-30.5, + 37},{-30.5,53},{8,53}}, color={0,127,255})); + connect(boiNoCtrl.port_b, senTGenOut.port_a) + annotation (Line(points={{46,53},{46,80},{60,80}}, color={0,127,255})); + connect(boiNoCtrl.T_out, sigBusGen.TBoilerOut) annotation (Line(points={{ + 40.68,59.08},{56,59.08},{56,98},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(boiNoCtrl.thermalPower, KPIBoi.u) annotation (Line(points={{40.68, + 68.96},{196,68.96},{196,-220},{-210,-220},{-210,-128},{-137.8,-128}}, + color={0,0,127})); + connect(KPIBoi.KPI, outBusGen.QBoi_flow) annotation (Line(points={{-113.8, + -128},{0,-128},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(boiNoCtrl.u_rel, sigBusGen.yBoiler) annotation (Line(points={{13.7, + 66.3},{2,66.3},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + annotation (Line( + points={{-52.775,-6.78},{-52.775,33.61},{-56,33.61},{-56,74}}, + color={255,204,51}, + thickness=0.5), + Diagram(coordinateSystem(extent={{-180,-140},{100,100}}))); +end HeatPumpAndGasBoilerSerial; diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index 0271e035..dec9b048 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -192,8 +192,8 @@ model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" Utilities.KPIs.EnergyKPICalculator KPIQHP(use_inpCon=false, y=heatPump.con.QFlow_in) annotation (Placement(transformation(extent={{-140,-112},{-120,-92}}))); - Utilities.KPIs.EnergyKPICalculator KPIQHR(use_inpCon=false, y=hea.vol.heatPort.Q_flow) - if use_heaRod + Utilities.KPIs.EnergyKPICalculator KPIQHR(use_inpCon=false, y=hea.vol.heatPort.Q_flow) if + use_heaRod annotation (Placement(transformation(extent={{-140,-140},{-120,-120}}))); IBPSA.Fluid.Sources.Boundary_pT bouPum( diff --git a/BESMod/Systems/Hydraulical/Generation/OnlyHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/OnlyHeatPump.mo new file mode 100644 index 00000000..98864726 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Generation/OnlyHeatPump.mo @@ -0,0 +1,367 @@ +within BESMod.Systems.Hydraulical.Generation; +model OnlyHeatPump "only heat pump System" + extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialGeneration( + final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, + final dTLoss_nominal=fill(0, nParallelDem), + dTTra_nominal={if TDem_nominal[i] > 273.15 + 55 then 10 elseif TDem_nominal[ + i] > 44.9 + 273.15 then 8 else 5 for i in 1:nParallelDem}, + dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal}, + nParallelDem=1); + + parameter Boolean use_airSource=true + "Turn false to use water as temperature source." + annotation(Dialog(group="Component choices")); + + parameter Boolean use_heaRod=true "=false to disable the heating rod" + annotation(Dialog(group="Component choices")); + replaceable model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D + constrainedby + AixLib.DataBase.HeatPump.PerformanceData.BaseClasses.PartialPerformanceData + annotation (Dialog(group="Component data"), __Dymola_choicesAllMatching=true); + parameter Modelica.Media.Interfaces.Types.Temperature TSoilConst=273.15 + 10 + "Constant soil temperature for ground source heat pumps" + annotation(Dialog(group="Component choices", enable=use_airSource)); + + replaceable package Medium_eva = Modelica.Media.Interfaces.PartialMedium constrainedby + Modelica.Media.Interfaces.PartialMedium annotation (Dialog(group="Component choices"), + choices( + choice(redeclare package Medium = IBPSA.Media.Air "Moist air"), + choice(redeclare package Medium = IBPSA.Media.Water "Water"), + choice(redeclare package Medium = + IBPSA.Media.Antifreeze.PropyleneGlycolWater ( + property_T=293.15, + X_a=0.40) + "Propylene glycol water, 40% mass fraction"))); + replaceable parameter + BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition + heatPumpParameters constrainedby + BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition( + final QGen_flow_nominal=Q_flow_nominal[1], + final TOda_nominal=TOda_nominal) + annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement( + transformation(extent={{-98,14},{-82,28}}))); + replaceable parameter + BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatingRodBaseDataDefinition + heatingRodParameters annotation (Dialog(group="Component data"), + choicesAllMatching=true, Placement( + transformation(extent={{64,44},{76,56}}))); + + replaceable parameter + BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition + pumpData annotation (Dialog(group="Component data"), + choicesAllMatching=true, Placement(transformation(extent={{42,-56}, + {56,-44}}))); + replaceable parameter + BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition + temperatureSensorData + annotation (Dialog(group="Component data"), choicesAllMatching=true, + Placement(transformation(extent={{60,10},{80,30}}))); + + AixLib.Fluid.HeatPumps.HeatPump heatPump( + redeclare package Medium_con = Medium, + redeclare package Medium_eva = Medium_eva, + final use_rev=true, + final use_autoCalc=false, + final Q_useNominal=0, + final scalingFactor=heatPumpParameters.scalingFactor, + final use_refIne=heatPumpParameters.use_refIne, + final refIneFre_constant=heatPumpParameters.refIneFre_constant, + final nthOrder=1, + final useBusConnectorOnly=false, + final mFlow_conNominal=m_flow_nominal[1], + final VCon=heatPumpParameters.VCon, + final dpCon_nominal=heatPumpParameters.dpCon_nominal, + final use_conCap=false, + final CCon=0, + final GConOut=0, + final GConIns=0, + final mFlow_evaNominal=heatPumpParameters.mEva_flow_nominal, + final VEva=heatPumpParameters.VEva, + final dpEva_nominal=heatPumpParameters.dpEva_nominal, + final use_evaCap=false, + final CEva=0, + final GEvaOut=0, + final GEvaIns=0, + final tauSenT=temperatureSensorData.tau, + final transferHeat=true, + final allowFlowReversalEva=allowFlowReversal, + final allowFlowReversalCon=allowFlowReversal, + final tauHeaTraEva=temperatureSensorData.tauHeaTra, + final TAmbEva_nominal=temperatureSensorData.TAmb, + final tauHeaTraCon=temperatureSensorData.tauHeaTra, + final TAmbCon_nominal=temperatureSensorData.TAmb, + final pCon_start=p_start, + final TCon_start=T_start, + final pEva_start=Medium_eva.p_default, + final TEva_start=Medium_eva.T_default, + final energyDynamics=energyDynamics, + final show_TPort=show_T, + redeclare model PerDataMainHP = PerDataMainHP, + redeclare model PerDataRevHP = + AixLib.DataBase.Chiller.PerformanceData.LookUpTable2D (dataTable= + AixLib.DataBase.Chiller.EN14511.Vitocal200AWO201())) + annotation (Placement( + transformation( + extent={{22,-27},{-22,27}}, + rotation=270, + origin={-44,15}))); + + IBPSA.Fluid.Sources.Boundary_ph bou_sinkAir(final nPorts=1, redeclare package + Medium = Medium_eva) annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={-90,-10}))); + IBPSA.Fluid.Sources.MassFlowSource_T bou_air( + final m_flow=heatPumpParameters.mEva_flow_nominal, + final use_T_in=true, + redeclare package Medium = Medium_eva, + final use_m_flow_in=false, + final nPorts=1) + annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); + + Modelica.Blocks.Logical.Switch switch2 annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-130,50}))); + Modelica.Blocks.Sources.BooleanConstant AirOrSoil(final k=use_airSource) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-170,90}))); + + Utilities.KPIs.EnergyKPICalculator KPIWel(use_inpCon=true) + annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); + + IBPSA.Fluid.Movers.SpeedControlled_y pump( + redeclare final package Medium = Medium, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final allowFlowReversal=allowFlowReversal, + final show_T=show_T, + redeclare + BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData + per( + final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final m_flow_nominal=m_flow_nominal[1], + final dp_nominal=dpDem_nominal[1] + dp_nominal[1], + final rho=rho, + final V_flowCurve=pumpData.V_flowCurve, + final dpCurve=pumpData.dpCurve), + final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final addPowerToMedium=pumpData.addPowerToMedium, + final tau=pumpData.tau, + final use_inputFilter=pumpData.use_inputFilter, + final riseTime=pumpData.riseTimeInpFilter, + final init=Modelica.Blocks.Types.Init.InitialOutput, + final y_start=1) annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=180, + origin={10,-70}))); + + Modelica.Blocks.Sources.Constant TSoil(k=TSoilConst) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-170,50}))); + + Utilities.KPIs.EnergyKPICalculator KPIQHP(use_inpCon=false, y=heatPump.con.QFlow_in) + annotation (Placement(transformation(extent={{-140,-112},{-120,-92}}))); + + IBPSA.Fluid.Sources.Boundary_pT bouPum( + redeclare package Medium = Medium, + final p=p_start, + final T=T_start, + final nPorts=1) "Pressure boundary for pump" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={50,-86}))); + + IBPSA.Fluid.Sensors.TemperatureTwoPort senTGenOut( + redeclare final package Medium = Medium, + final allowFlowReversal=allowFlowReversal, + m_flow_nominal=m_flow_nominal[1], + tau=temperatureSensorData.tau, + initType=temperatureSensorData.initType, + T_start=T_start, + final transferHeat=temperatureSensorData.transferHeat, + TAmb=temperatureSensorData.TAmb, + tauHeaTra=temperatureSensorData.tauHeaTra) + "Temperature at supply (generation outlet)" + annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={70,80}))); + BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={100,-78}))); + Modelica.Blocks.Math.MultiSum multiSum(nu=2) annotation (Placement( + transformation( + extent={{-6,-6},{6,6}}, + rotation=180, + origin={130,-82}))); + Modelica.Blocks.Sources.BooleanExpression booExpHeaPumIsOn(y=heatPump.greaterThreshold.y) + annotation (Placement(transformation(extent={{-180,-20},{-160,0}}))); + Modelica.Blocks.Sources.RealExpression reaExpPEleHeaPum(y=heatPump.innerCycle.Pel) + annotation (Placement(transformation(extent={{-180,-80},{-160,-60}}))); + Modelica.Blocks.Sources.Constant conIceFac(final k=1) annotation (Placement( + transformation( + extent={{-11,-11},{11,11}}, + rotation=0, + origin={-169,11}))); + Modelica.Blocks.Sources.RealExpression reaExpTHeaPumOut(y=heatPump.senT_b1.T) + annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); + Modelica.Blocks.Sources.RealExpression reaExpTHeaPumIn(y=heatPump.senT_a1.T) + annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); + Modelica.Blocks.Sources.BooleanConstant conNotRev(final k=true) annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-170,-38}))); + Modelica.Blocks.Sources.RealExpression reaExpTEvaIn(y=heatPump.senT_a2.T) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); +protected + parameter Modelica.Units.SI.PressureDifference dpHeaRod_nominal=if use_heaRod + then heatingRodParameters.dp_nominal else 0; + +equation + + connect(bou_air.ports[1], heatPump.port_a2) annotation (Line( + points={{-80,50},{-74,50},{-74,42},{-57.5,42},{-57.5,37}}, + color={0,127,255})); + connect(heatPump.port_b2, bou_sinkAir.ports[1]) annotation (Line( + points={{-57.5,-7},{-56,-7},{-56,-10},{-80,-10}}, + color={0,127,255})); + connect(bou_air.T_in, switch2.y) + annotation (Line(points={{-102,54},{-108,54},{-108,50},{-119,50}}, + color={0,0,127})); + connect(switch2.u2, AirOrSoil.y) + annotation (Line(points={{-142,50},{-152,50},{-152,90},{-159,90}}, + color={255,0,255})); + connect(pump.port_a, portGen_in[1]) annotation (Line( + points={{20,-70},{100,-70},{100,-2}}, + color={0,127,255})); + + connect(pump.port_b, heatPump.port_a1) annotation (Line( + points={{1.77636e-15,-70},{-30.5,-70},{-30.5,-7}}, + color={0,127,255})); + connect(TSoil.y, switch2.u3) annotation (Line(points={{-159,50},{-156,50},{-156, + 42},{-142,42}}, color={0,0,127})); + connect(bouPum.ports[1], pump.port_a) + annotation (Line(points={{50,-76},{50,-70},{20,-70}}, color={0,127,255})); + connect(senTGenOut.T, sigBusGen.THeaRodMea) annotation (Line(points={{70,91},{ + 70,96},{26,96},{26,74},{2,74},{2,98}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + connect(senTGenOut.port_b, portGen_out[1]) + annotation (Line(points={{80,80},{100,80}}, color={0,127,255})); + + connect(realToElecCon.internalElectricalPin, internalElectricalPin) + annotation (Line( + points={{89.8,-78.2},{72,-78.2},{72,-100}}, + color={0,0,0}, + thickness=1)); + connect(multiSum.y, realToElecCon.PEleLoa) + annotation (Line(points={{122.98,-82},{112,-82}}, color={0,0,127})); + if use_heaRod then + connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, + -84.1},{144,-84.1},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, + color={0,0,127}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-79.9},{144, + -79.9},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, + color={0,0,127})); + else + connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-79.9},{144, + -79.9},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, + color={0,0,127})); + connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, + -84.1},{144,-84.1},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, + color={0,0,127}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + end if; + connect(switch2.u1, weaBus.TDryBul) annotation (Line(points={{-142,58},{-144,58}, + {-144,80},{-101,80}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(pump.y, sigBusGen.uPump) annotation (Line(points={{10,-58},{24,-58},{24, + -22},{2,-22},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIQHP.KPI, outBusGen.QHP_flow) annotation (Line(points={{-117.8,-102}, + {0,-102},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIWel.KPI, outBusGen.PEleHP) annotation (Line(points={{-117.8,-70},{-104, + -70},{-104,-102},{0,-102},{0,-100}}, color={135,135, + 135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(reaExpPEleHeaPum.y, KPIWel.u) + annotation (Line(points={{-159,-70},{-141.8,-70}}, color={0,0,127})); + connect(conIceFac.y, heatPump.iceFac_in) annotation (Line(points={{-156.9,11}, + {-106,11},{-106,-1.72},{-74.6,-1.72}}, color={0,0,127})); + connect(heatPump.nSet, sigBusGen.yHeaPumSet) annotation (Line(points={{-39.5,-10.52}, + {-39.5,-26},{2,-26},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(booExpHeaPumIsOn.y, sigBusGen.heaPumIsOn) annotation (Line(points={{-159, + -10},{-142,-10},{-142,98},{2,98}}, color={255,0,255}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(reaExpTHeaPumIn.y, sigBusGen.THeaPumIn) annotation (Line(points={{-39, + 70},{2,70},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(reaExpTHeaPumOut.y, sigBusGen.THeaPumOut) annotation (Line(points={{-39, + 90},{-28,90},{-28,74},{2,74},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(heatPump.modeSet, conNotRev.y) annotation (Line(points={{-48.5,-10.52}, + {-48.5,-38},{-159,-38}}, color={255,0,255})); + connect(reaExpTEvaIn.y, sigBusGen.THeaPumEvaIn) annotation (Line(points={{-39, + 50},{2,50},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(heatPump.port_b1, senTGenOut.port_a) annotation (Line(points={{-30.5, + 37},{-30.5,60},{46,60},{46,80},{60,80}}, color={0,127,255})); + annotation (Line( + points={{-52.775,-6.78},{-52.775,33.61},{-56,33.61},{-56,74}}, + color={255,204,51}, + thickness=0.5), + Diagram(coordinateSystem(extent={{-180,-140},{100,100}}))); +end OnlyHeatPump; diff --git a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/BivalentHeatPumpBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/BivalentHeatPumpBaseDataDefinition.mo new file mode 100644 index 00000000..075a2345 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/BivalentHeatPumpBaseDataDefinition.mo @@ -0,0 +1,63 @@ +within BESMod.Systems.Hydraulical.Generation.RecordsCollection; +partial record BivalentHeatPumpBaseDataDefinition + "Record Collection for bivalent Heat Pump Systems" + extends Modelica.Icons.Record; + + parameter Modelica.Units.SI.HeatFlowRate QGen_flow_nominal + "Nominal heating load at outdoor air temperature" + annotation (Dialog(group="Design")); + + // Temperature Levels + parameter Modelica.Units.SI.Temperature TOda_nominal + "Nominal outdoor air temperature" annotation (Dialog(group="Design")); + parameter Modelica.Units.SI.Temperature THeaTresh "Heating treshhold" + annotation (Dialog(group="Design")); + parameter + BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign + genDesTyp "Type of generation system design" annotation (Dialog( + group="Design")); + parameter Modelica.Units.SI.HeatFlowRate QPri_flow_nominal=if genDesTyp == + Systems.Hydraulical.Generation.Types.GenerationDesign.Monovalent then + QGen_flow_nominal else QGenBiv_flow_nominal + "Nominal heat flow rate of primary generation component (e.g. heat pump)" + annotation (Dialog(group="Design")); + parameter Modelica.Units.SI.HeatFlowRate QSec_flow_nominal=if genDesTyp == + Systems.Hydraulical.Generation.Types.GenerationDesign.Monovalent then 0 + elseif genDesTyp == Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentAlternativ + then QGen_flow_nominal elseif genDesTyp == Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentParallel + then QGen_flow_nominal - QGenBiv_flow_nominal else QGen_flow_nominal + "Nominal heat flow rate of secondary generation component (e.g. auxilliar heater)" + annotation (Dialog(group="Design")); + parameter Modelica.Units.SI.Temperature TBiv=TOda_nominal + "Nominal bivalence temperature. = TOda_nominal for monovalent systems." + annotation (Dialog(enable=genDesTyp <> Systems.Hydraulical.Generation.Types.GenerationDesign.Monovalent, + group="Design")); + + parameter Modelica.Units.SI.HeatFlowRate QGenBiv_flow_nominal= + QGen_flow_nominal*(TBiv - THeaTresh)/(TOda_nominal - THeaTresh) + "Nominal heat flow rate at bivalence temperature" + annotation (Dialog(group="Design")); + + // Generation: Heat Pump + parameter Real scalingFactor=1 "Scaling-factor of vapour compression machine"; + parameter Modelica.Units.SI.MassFlowRate mEva_flow_nominal=1 + "Mass flow rate through evaporator"; + parameter Modelica.Units.SI.Volume VEva=0.004 + "Manual input of the evaporator volume (if not automatically calculated)"; + parameter Modelica.Units.SI.Volume VCon=0.001 + "Manual input of the condenser volume"; + parameter Boolean useAirSource=true "Turn false to use water as temperature source."; + parameter Modelica.Units.SI.PressureDifference dpCon_nominal=1000 + "Pressure difference"; + parameter Modelica.Units.SI.PressureDifference dpEva_nominal=1000 + "Pressure difference"; + parameter Boolean use_refIne=false + "Consider the inertia of the refrigerant cycle"; + parameter Modelica.Units.SI.Frequency refIneFre_constant=0 + "Cut off frequency for inertia of refrigerant cycle"; + + replaceable parameter BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition TempSensorData "Temperature Sensor Data" annotation(choicesAllMatching=true); + annotation (Icon(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, + coordinateSystem(preserveAspectRatio=false))); +end BivalentHeatPumpBaseDataDefinition; diff --git a/BESMod/Systems/Hydraulical/Generation/package.order b/BESMod/Systems/Hydraulical/Generation/package.order index f9a63fa0..300dbd60 100644 --- a/BESMod/Systems/Hydraulical/Generation/package.order +++ b/BESMod/Systems/Hydraulical/Generation/package.order @@ -9,6 +9,6 @@ RecordsCollection Types BaseClasses HeatPumpAndBoilerSerie -HeatPumpAndGasBoilerSerie +HeatPumpAndGasBoilerSerial HeatPumpAndGasBoilerParallel OnlyHeatPump diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index d96bb048..0c8479b9 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -2,16 +2,6 @@ within BESMod.Systems.Hydraulical.Transfer; model UFHTransferSystem extends BaseClasses.PartialTransfer(final nParallelSup=1, final dp_nominal=fill(0, nParallelDem)); - replaceable parameter BESMod.Systems.Hydraulical.Transfer.RecordsCollection.UFHData UFHParameters - constrainedby RecordsCollection.UFHData(nZones=nParallelDem, area=AZone) - annotation (Dialog(group="Component data"), - choicesAllMatching=true, Placement(transformation(extent={{78,78}, - {98,98}}))); - replaceable parameter - BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpData annotation (choicesAllMatching=true, - Dialog(group="Component data"), Placement(transformation(extent={{-98,78}, - {-78,98}}))); IBPSA.Fluid.FixedResistances.PressureDrop res[nParallelDem]( redeclare package Medium = Medium, each final dp_nominal=1, @@ -60,6 +50,12 @@ model UFHTransferSystem extent={{-10,-10},{10,10}}, rotation=0, origin={-64,4}))); + + replaceable parameter BESMod.Systems.Hydraulical.Transfer.RecordsCollection.UFHData UFHParameters + constrainedby RecordsCollection.UFHData(nZones=nParallelDem, area=AZone) + annotation (choicesAllMatching=true, Placement(transformation(extent={{78,78}, + {98,98}}))); + Utilities.KPIs.EnergyKPICalculator integralKPICalculator[nParallelDem] annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}))); IBPSA.Fluid.Movers.FlowControlled_m_flow pumpFix_m_flow[nParallelDem]( @@ -93,12 +89,12 @@ model UFHTransferSystem extent={{-10,-10},{10,10}}, rotation=0, origin={-30,50}))); - + replaceable parameter + BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition + pumpData annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,78}, + {-78,98}}))); BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{32,-108},{52,-88}}))); - Modelica.Blocks.Routing.RealPassThrough reaPasThrOpe[nParallelDem] - "Opening KPI" - annotation (Placement(transformation(extent={{20,80},{40,100}}))); protected parameter BESMod.Systems.Hydraulical.Components.UFH.ActiveWallBaseDataDefinition @@ -178,14 +174,9 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(reaPasThrOpe.u, traControlBus.opening) annotation (Line(points={{18, - 90},{18,86},{0,86},{0,100}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); - connect(reaPasThrOpe.y, outBusTra.opening) annotation (Line(points={{41,90},{ - 46,90},{46,-84},{0,-84},{0,-104}}, color={0,0,127}), Text( + connect(gain.u, outBusTra.opening) annotation (Line(points={{-30,92},{-30,100}, + {-14,100},{-14,-2},{-12,-2},{-12,-90},{0,-90},{0,-104}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, diff --git a/BESMod/Systems/RecordsCollection/Movers/DefaultMoverBA.mo b/BESMod/Systems/RecordsCollection/Movers/DefaultMoverBA.mo new file mode 100644 index 00000000..8d3f0431 --- /dev/null +++ b/BESMod/Systems/RecordsCollection/Movers/DefaultMoverBA.mo @@ -0,0 +1,11 @@ +within BESMod.Systems.RecordsCollection.Movers; +record DefaultMoverBA + extends BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition( + tau=1, + riseTimeInpFilter=30, + use_inputFilter=false, + addPowerToMedium=false, + speed_rpm_nominal=1500, + dpCurve={1.02,1.01,1,0.99,0}, + V_flowCurve={0,0.99,1,1.01,1.02}); +end DefaultMoverBA; diff --git a/BESMod/Systems/Ventilation/Control/SummerPIDByPass.mo b/BESMod/Systems/Ventilation/Control/SummerPIDByPass.mo index 6fdafbb5..61b03579 100644 --- a/BESMod/Systems/Ventilation/Control/SummerPIDByPass.mo +++ b/BESMod/Systems/Ventilation/Control/SummerPIDByPass.mo @@ -3,8 +3,8 @@ model SummerPIDByPass "Bypass the HEX in summer" extends BaseClasses.PartialControl; parameter Boolean use_bypass = true "=false to disable the bypass"; - Components.SummerByPass summerByPass - if use_bypass + Components.SummerByPass summerByPass if + use_bypass annotation (Placement(transformation(extent={{-30,-14},{22,36}}))); Modelica.Blocks.Sources.Constant constZero(k=0) if not use_bypass "Bypass is not used" diff --git a/BESMod/Tutorial/MyOwnModule.mo b/BESMod/Tutorial/MyOwnModule.mo index 6b7cf6f6..f49d92ab 100644 --- a/BESMod/Tutorial/MyOwnModule.mo +++ b/BESMod/Tutorial/MyOwnModule.mo @@ -18,8 +18,8 @@ model MyOwnModule "My module can do this and that" startTime=myComponentParameters.startTime) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); Modelica.Blocks.Nonlinear.Limiter - limiter(final uMax=yMax, final uMin=-yMax) - if use_lim + limiter(final uMax=yMax, final uMin=-yMax) if + use_lim annotation (Placement(transformation(extent={{6,4},{26,24}}))); Modelica.Blocks.Interfaces.RealOutput y "Output signal connector" annotation (Placement(transformation(extent={{100,-10},{120,10}}))); diff --git a/BESMod/Utilities/KPIs/ComfortCalculator.mo b/BESMod/Utilities/KPIs/ComfortCalculator.mo index ff98e3d7..c36bb13d 100644 --- a/BESMod/Utilities/KPIs/ComfortCalculator.mo +++ b/BESMod/Utilities/KPIs/ComfortCalculator.mo @@ -40,6 +40,6 @@ equation annotation (Line(points={{-5,-6},{0,-6},{0,-4},{6,-4}}, color={0,0,127})); annotation ( Documentation(info=" -

Calculate the comfort during either heating or cooling period. Based on EN 16798-1, which defines a 2 K bandwith around a set temperature of 22 °C.

+

Calculate the comfort during either heating or cooling period. Based on EN 15251, which defines a 2 K bandwith around a set temperature of 22 °C.

")); end ComfortCalculator; diff --git a/BESMod/Utilities/KPIs/DeviceKPICalculator.mo b/BESMod/Utilities/KPIs/DeviceKPICalculator.mo index 9540df25..3c3aee65 100644 --- a/BESMod/Utilities/KPIs/DeviceKPICalculator.mo +++ b/BESMod/Utilities/KPIs/DeviceKPICalculator.mo @@ -26,20 +26,20 @@ model DeviceKPICalculator "KPI useful for the analysis of a device" annotation (Placement(transformation(extent={{-42,10},{-22,30}}))); Modelica.Blocks.Sources.Constant const1(k=0) if calc_singleOnTime annotation (Placement(transformation(extent={{-42,-30},{-22,-10}}))); - Modelica.Blocks.Continuous.Integrator integrator3(use_reset=true, y(unit="s")) - if calc_singleOnTime + Modelica.Blocks.Continuous.Integrator integrator3(use_reset=true, y(unit="s")) if + calc_singleOnTime annotation (Placement(transformation(extent={{26,-40},{46,-20}}))); Modelica.Blocks.Logical.Not not1 if calc_singleOnTime annotation (Placement(transformation(extent={{-34,-60},{-14,-40}}))); - Modelica.Blocks.Sources.IntegerConstant integerConstant(final k=1) - if calc_numSwi + Modelica.Blocks.Sources.IntegerConstant integerConstant(final k=1) if + calc_numSwi annotation (Placement(transformation(extent={{-34,60},{-14,80}}))); Modelica.Blocks.MathInteger.TriggeredAdd triggeredAdd(final use_reset=false, final y_start=0) if calc_numSwi "To count on-off cycles" annotation (Placement(transformation(extent={{6,60},{26,80}}))); - Modelica.Blocks.Continuous.Integrator integrator1(y(unit="s")) - if calc_totalOnTime + Modelica.Blocks.Continuous.Integrator integrator1(y(unit="s")) if + calc_totalOnTime annotation (Placement(transformation(extent={{26,20},{46,40}}))); BaseClasses.KPIDevice KPI annotation (Placement(transformation(extent={{102,-20},{142,20}}), From 1f60926e843011f7193e4f898d6eaf56b6a667ef Mon Sep 17 00:00:00 2001 From: "Philipp.Schmitz3" Date: Tue, 7 Feb 2023 14:14:55 +0100 Subject: [PATCH 072/131] file cleanup --- .../Generation/HeatPumpAndBoilerSerie.mo | 315 ------------------ .../Hydraulical/Generation/package.order | 1 - 2 files changed, 316 deletions(-) delete mode 100644 BESMod/Systems/Hydraulical/Generation/HeatPumpAndBoilerSerie.mo diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndBoilerSerie.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndBoilerSerie.mo deleted file mode 100644 index 312e8e2d..00000000 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndBoilerSerie.mo +++ /dev/null @@ -1,315 +0,0 @@ -within BESMod.Systems.Hydraulical.Generation; -model HeatPumpAndBoilerSerie "Bivalent heat pump Serienschaltung aktuell" - extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialGeneration( - m_flow_nominal=(Q_flow_nominal .* f_design ./ dTTra_nominal ./ 4184), - final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, - final dTLoss_nominal=fill(0, nParallelDem), - dTTra_nominal={if TDem_nominal[i] > 273.15 + 55 then 10 elseif TDem_nominal[ - i] > 44.9 + 273.15 then 8 else 5 for i in 1:nParallelDem}, - dp_nominal={heatPump.dpCon_nominal + boilerNoControl.dp_nominal}, - final nParallelDem=1); - parameter Boolean use_pressure=false "=true to use a pump which works on pressure difference"; - parameter Boolean use_heaRod=false "=false to disable the heating rod"; - replaceable model PerDataMainHP = - AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=heatPumpParameters.QPri_flow_nominal, - refrigerant="Propane", - flowsheet="VIPhaseSeparatorFlowsheet") - annotation (__Dymola_choicesAllMatching=true); - - parameter Modelica.Media.Interfaces.Types.Temperature TSoilConst=273.15 + 10 - "Constant soil temperature for ground source heat pumps"; - replaceable package Medium_eva = Modelica.Media.Interfaces.PartialMedium constrainedby - Modelica.Media.Interfaces.PartialMedium annotation ( - __Dymola_choicesAllMatching=true); - replaceable parameter - RecordsCollection.BivalentHeatPumpBaseDataDefinition - heatPumpParameters( - QGen_flow_nominal=sum(systemParameters.QBui_flow_nominal), - THeaTresh=373.15, - scalingFactor=hydraulic.generation.heatPumpParameters.QGenBiv_flow_nominal/ - 5000, - mEva_flow_nominal=1, - useAirSource=true, - use_refIne=false, - redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - TempSensorData) constrainedby - BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition( - genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentParallel) - annotation (choicesAllMatching=true, Placement( - transformation(extent={{-490,-218},{-438,-176}}))); - - AixLib.Fluid.HeatPumps.HeatPump heatPump( - redeclare package Medium_con = IBPSA.Media.Water, - redeclare package Medium_eva = IBPSA.Media.Air, - final use_rev=false, - final use_autoCalc=false, - final Q_useNominal=0, - final scalingFactor=heatPumpParameters.scalingFactor, - final use_refIne=heatPumpParameters.use_refIne, - final refIneFre_constant=heatPumpParameters.refIneFre_constant, - final nthOrder=1, - final useBusConnectorOnly=true, - final mFlow_conNominal=m_flow_nominal[1], - final VCon=heatPumpParameters.VCon, - final dpCon_nominal=heatPumpParameters.dpCon_nominal, - final use_conCap=false, - final CCon=0, - final GConOut=0, - final GConIns=0, - final mFlow_evaNominal=heatPumpParameters.mEva_flow_nominal, - final VEva=heatPumpParameters.VEva, - final dpEva_nominal=heatPumpParameters.dpEva_nominal, - final use_evaCap=false, - final CEva=0, - final GEvaOut=0, - final GEvaIns=0, - final tauSenT=heatPumpParameters.TempSensorData.tau, - final transferHeat=true, - final allowFlowReversalEva=allowFlowReversal, - final allowFlowReversalCon=allowFlowReversal, - final tauHeaTraEva=heatPumpParameters.TempSensorData.tauHeaTra, - final TAmbEva_nominal=heatPumpParameters.TempSensorData.TAmb, - final tauHeaTraCon=heatPumpParameters.TempSensorData.tauHeaTra, - final TAmbCon_nominal=heatPumpParameters.TempSensorData.TAmb, - initType=Modelica.Blocks.Types.Init.NoInit, - final pCon_start=p_start, - final TCon_start=T_start, - final pEva_start=Medium_eva.p_default, - final TEva_start=Medium_eva.T_default, - final energyDynamics=energyDynamics, - final show_TPort=show_T, - redeclare model PerDataMainHP = - PerDataMainHP, - redeclare model PerDataRevHP = - AixLib.DataBase.Chiller.PerformanceData.LookUpTable2D (final dataTable= - AixLib.DataBase.Chiller.EN14511.Vitocal200AWO201())) - annotation (Placement( - transformation( - extent={{40.5,-48.5},{-40.5,48.5}}, - rotation=270, - origin={-378.5,-152.5}))); - - IBPSA.Fluid.Sources.Boundary_ph bou_sinkAir(final nPorts=1, redeclare package - Medium = IBPSA.Media.Air) annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={-422,-238}))); - IBPSA.Fluid.Sources.MassFlowSource_T bou_air( - final m_flow=heatPumpParameters.mEva_flow_nominal, - final use_T_in=true, - redeclare package Medium = IBPSA.Media.Air, - final use_m_flow_in=false, - final nPorts=1) - annotation (Placement(transformation(extent={{-426,-74},{-406,-54}}))); - - Modelica.Blocks.Logical.Switch switch2 annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-458,-12}))); - Modelica.Blocks.Sources.BooleanConstant - AirOrSoil(k=heatPumpParameters.useAirSource) - annotation (Placement(transformation( - extent={{-6,-6},{6,6}}, - rotation=0, - origin={-496,-14}))); - - Modelica.Blocks.Sources.Constant TSoil(k=TSoilConst) - annotation (Placement(transformation( - extent={{-6,-6},{6,6}}, - rotation=0, - origin={-496,-36}))); - - IBPSA.Fluid.Movers.SpeedControlled_y pumpGeneration( - redeclare final package Medium = Medium, - final energyDynamics=energyDynamics, - final p_start=p_start, - final T_start=T_start, - final allowFlowReversal=allowFlowReversal, - final show_T=show_T, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final speed_rpm_nominal=pumpData.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal[1], - final dp_nominal=dpDem_nominal[1] + heatPumpParameters.dpCon_nominal + - boilerNoControl.dp_nominal, - final rho=rho, - final V_flowCurve=pumpData.V_flowCurve, - final dpCurve=pumpData.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final addPowerToMedium=pumpData.addPowerToMedium, - final tau=pumpData.tau, - final use_inputFilter=pumpData.use_inputFilter, - final riseTime=pumpData.riseTimeInpFilter, - final init=Modelica.Blocks.Types.Init.InitialOutput, - final y_start=1) annotation (Placement(transformation( - extent={{-17,17},{17,-17}}, - rotation=180, - origin={-205,-189}))); - AixLib.Fluid.BoilerCHP.BoilerNoControl boilerNoControl( - redeclare package Medium = AixLib.Media.Water, - final allowFlowReversal=true, - final m_flow_nominal=m_flow_nominal[1], - final m_flow_small=1E-4*abs(m_flow_nominal[1]), - final show_T=show_T, - final initType=Modelica.Blocks.Types.Init.NoInit, - final transferHeat=false, - final rho_default=rho, - final p_start=p_start, - final T_start=T_start, - paramBoiler=AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_15kW()) - annotation (Placement(transformation(extent={{-298,-36},{-216,52}}))); - replaceable parameter - BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpData( - V_flowCurve={0,0.99,1,1.01}, - dpCurve={1.01,1,0.99,0}, - speed_rpm_nominal=100, - addPowerToMedium=false, - use_inputFilter=false, - riseTimeInpFilter=10, - tau=1) annotation (choicesAllMatching=true, Placement(transformation(extent={{-546, - -162},{-478,-100}}))); - IBPSA.Fluid.Sources.Boundary_pT bouPumpHP( - redeclare package Medium = IBPSA.Media.Water, - final p=p_start, - final T=T_start, - final nPorts=1) annotation (Placement(transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={-172,-96}))); - BESMod.Utilities.Electrical.ZeroLoad zeroLoad - annotation (Placement(transformation(extent={{26,-166},{46,-146}}))); - Modelica.Blocks.Sources.Constant const4(k=1) - annotation (Placement(transformation(extent={{-228,-136},{-208,-116}}))); - BESMod.Systems.Hydraulical.Interfaces.GenerationOutputs - outBusGen1 - annotation (Placement(transformation(extent={{-486,-316},{-466,-296}}))); - Utilities.KPIs.EnergyKPICalculator KPIWel(use_inpCon=true) - annotation (Placement(transformation(extent={{-568,-300},{-548,-280}}))); - Utilities.KPIs.EnergyKPICalculator KPIQHP(use_inpCon=false, y=heatPump.con.QFlow_in) - annotation (Placement(transformation(extent={{-568,-328},{-548,-308}}))); - Utilities.KPIs.EnergyKPICalculator KPIWel2(use_inpCon=true) - annotation (Placement(transformation(extent={{-570,-362},{-550,-342}}))); - replaceable parameter - BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition - temperatureSensorData annotation ( - Dialog(group="Component data"), - choicesAllMatching=true, - Placement(transformation(extent={{-58,-264},{36,-206}}))); -protected - parameter Modelica.Units.SI.PressureDifference dpHeaRod_nominal=0; - -equation - - connect(bou_air.ports[1], heatPump.port_a2) annotation (Line( - points={{-406,-64},{-396,-64},{-396,-96},{-402.75,-96},{-402.75,-112}}, - color={0,127,255}, - pattern=LinePattern.Dash)); - connect(heatPump.port_b2, bou_sinkAir.ports[1]) annotation (Line( - points={{-402.75,-193},{-400,-193},{-400,-238},{-412,-238}}, - color={0,127,255}, - pattern=LinePattern.Dash)); - connect(sigBusGen.hp_bus, heatPump.sigBus) annotation (Line( - points={{2,98},{-312,98},{-312,-204},{-394.262,-204},{-394.262,-192.595}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - - connect(bou_air.T_in, switch2.y) - annotation (Line(points={{-428,-60},{-436,-60},{-436,-12},{-447,-12}}, - color={0,0,127})); - connect(sigBusGen.hp_bus.TOdaMea, switch2.u1) annotation (Line( - points={{2,98},{-472,98},{-472,104},{-504,104},{-504,-4},{-470,-4}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(switch2.u2, AirOrSoil.y) - annotation (Line(points={{-470,-12},{-479.7,-12},{-479.7,-14},{-489.4,-14}}, - color={255,0,255})); - - connect(TSoil.y, switch2.u3) annotation (Line(points={{-489.4,-36},{-480,-36}, - {-480,-20},{-470,-20}}, - color={0,0,127})); - - connect(pumpGeneration.port_a, bouPumpHP.ports[1]) annotation (Line(points={{-188, - -189},{-188,-166},{-172,-166},{-172,-106}}, - color={0,127,255})); - connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( - Line( - points={{46,-156},{72,-156},{72,-100}}, - color={0,0,0}, - thickness=1)); - connect(const4.y, pumpGeneration.y) annotation (Line(points={{-207,-126},{ - -196,-126},{-196,-156},{-205,-156},{-205,-168.6}}, - color={0,0,127})); - connect(pumpGeneration.y_actual, sigBusGen.PumpSpeed) annotation (Line(points={{-223.7, - -177.1},{-232,-177.1},{-232,-48},{-172,-48},{-172,98},{2,98}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(heatPump.port_b1, boilerNoControl.port_a) annotation (Line(points={{ - -354.25,-112},{-352,-112},{-352,-96},{-308,-96},{-308,8},{-298,8}}, - color={0,127,255})); - connect(portGen_in[1], pumpGeneration.port_a) annotation (Line(points={{100, - -2},{8,-2},{8,-4},{-96,-4},{-96,-189},{-188,-189}}, color={0,127,255})); - connect(pumpGeneration.port_b, heatPump.port_a1) annotation (Line(points={{ - -222,-189},{-308,-189},{-308,-204},{-354.25,-204},{-354.25,-193}}, - color={0,127,255})); - connect(boilerNoControl.port_b, portGen_out[1]) annotation (Line(points={{ - -216,8},{80,8},{80,80},{100,80}}, color={0,127,255})); - connect(boilerNoControl.T_out, sigBusGen.TBoilerOut) annotation (Line(points={ - {-227.48,22.08},{2,22.08},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(boilerNoControl.u_rel, sigBusGen.BoilerON) annotation (Line(points={{ - -285.7,38.8},{-356,38.8},{-356,136},{2,136},{2,98}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(KPIWel.KPI, outBusGen1.PEleHP) annotation (Line(points={{-545.8,-290}, - {-476,-290},{-476,-306}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(KPIWel.u, sigBusGen.hp_bus.PelMea) annotation (Line(points={{-569.8, - -290},{-592,-290},{-592,180},{2,180},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(outBusGen1.QHP_flow, KPIQHP.KPI) annotation (Line( - points={{-476,-306},{-476,-292},{-528,-292},{-528,-318},{-545.8,-318}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(KPIWel2.KPI, outBusGen1.QBoi_flow) annotation (Line(points={{-547.8, - -352},{-508,-352},{-508,-354},{-476,-354},{-476,-306}}, color={135, - 135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(boilerNoControl.thermalPower, KPIWel2.u) annotation (Line(points={{ - -227.48,44.96},{-192,44.96},{-192,68},{-660,68},{-660,-352},{-571.8, - -352}}, color={0,0,127})); - annotation (Diagram(coordinateSystem(extent={{-560,-300},{240,120}})), Icon( - coordinateSystem(extent={{-560,-300},{240,120}}))); -end HeatPumpAndBoilerSerie; diff --git a/BESMod/Systems/Hydraulical/Generation/package.order b/BESMod/Systems/Hydraulical/Generation/package.order index 300dbd60..7d7a73c5 100644 --- a/BESMod/Systems/Hydraulical/Generation/package.order +++ b/BESMod/Systems/Hydraulical/Generation/package.order @@ -8,7 +8,6 @@ Tests RecordsCollection Types BaseClasses -HeatPumpAndBoilerSerie HeatPumpAndGasBoilerSerial HeatPumpAndGasBoilerParallel OnlyHeatPump From e930bfab164ec5be80a2be1557f784947cc359bb Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Thu, 3 Aug 2023 17:17:54 +0200 Subject: [PATCH 073/131] Start work on inheritance and renaming wrong names --- BESMod/Examples/BAUSimStudy/PartialCase.mo | 35 +- BESMod/Examples/GasBoilerBuildingOnly.mo | 8 +- ...eatPumpSystems.mo => HeatPumpAndBoiler.mo} | 148 +++--- .../PartialSolarThermalHPS.mo | 4 +- .../SolarThermalSystem/SolarThermalAixLib.mo | 16 +- .../SolarThermalBuildings.mo | 13 +- .../Examples/UseCaseDesignOptimization/BES.mo | 27 +- .../Examples/UseCaseHighOrderModel/BES_HOM.mo | 19 +- .../PartialModelicaConferenceUseCase.mo | 29 +- BESMod/Examples/package.order | 2 +- .../ConvertBESMod_from_0.3.1_to_0.3.2.mos | 24 + .../Scripts/ConvertFromBESMod_0.3.0.mos | 3 - BESMod/Systems/Demand/DHW/DHW.mo | 16 +- .../BaseClasses/PartialDistribution.mo | 8 +- ...lDistributionTwoStorageParallelDetailed.mo | 32 +- .../Hydraulical/Distribution/CombiStorage.mo | 12 +- .../Valves/Tests/PressureReliefExample.mo | 10 +- .../SimpleStorage/DefaultStorage.mo | 2 +- .../Distribution/Tests/TestDirectLoading.mo | 2 +- .../Distribution/Tests/TestIndirectLoading.mo | 2 +- ...WithDHW.mo => TwoStoragesBoilerWithDHW.mo} | 59 +-- ...tDHW.mo => TwoStoragesBoilerWithoutDHW.mo} | 50 +- .../Hydraulical/Distribution/package.order | 4 +- .../BaseClasses/PartialGeneration.mo | 4 +- .../PartialHeatPump.mo} | 219 +++++---- .../PartialHeatPumpAndGasBoiler.mo | 74 +++ .../Generation/BaseClasses/package.order | 2 + ...mo => DetailedSolarThermalWithHeatPump.mo} | 60 +-- .../Generation/ElectricalHeater.mo | 24 +- .../Hydraulical/Generation/GasBoiler.mo | 28 +- .../Hydraulical/Generation/HeatPump.mo | 10 + .../HeatPumpAndGasBoilerParallel.mo | 463 +---------------- .../Generation/HeatPumpAndGasBoilerSerial.mo | 411 +--------------- .../Generation/HeatPumpAndHeatingRod.mo | 465 ++---------------- .../SimpleSolarThermalWithHeatPump.mo | 168 +++++++ .../Generation/SolarThermalBivHPAixLib.mo | 168 ------- .../Generation/Tests/ElectricalHeater.mo | 4 +- .../Hydraulical/Generation/Tests/GasBoiler.mo | 4 +- .../Hydraulical/Generation/Tests/HeatPump.mo | 33 ++ .../Generation/Tests/HeatPumpAndHeatingRod.mo | 18 +- ...ThermalAndHeatPumpAndHeatingRodDetailed.mo | 45 ++ ...rThermalAndHeatPumpAndHeatingRodSimple.mo} | 29 +- .../Generation/Tests/package.order | 4 +- .../Hydraulical/Generation/package.order | 10 +- .../Transfer/IdealValveRadiator.mo | 12 +- .../Transfer/RadiatorPressureBased.mo | 16 +- .../Tests/TestIdealValveRadiatorSystem.mo | 2 +- .../Transfer/Tests/TestPressureBasedSystem.mo | 2 +- .../TestPressureBasedSystemWithReliefValve.mo | 2 +- .../Transfer/Tests/TestUnderfloorHeating.mo | 2 +- .../Hydraulical/Transfer/UFHTransferSystem.mo | 12 +- .../Movers/DefaultMoverBA.mo | 11 - .../RecordsCollection/Movers/package.order | 1 - .../HeatGeneration/GetHeatPumpCurveVCLib.mo | 12 +- BESMod/package.mo | 21 +- 55 files changed, 929 insertions(+), 1932 deletions(-) rename BESMod/Examples/{BivalentHeatPumpSystems.mo => HeatPumpAndBoiler.mo} (85%) create mode 100644 BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos delete mode 100644 BESMod/Resources/Scripts/ConvertFromBESMod_0.3.0.mos rename BESMod/Systems/Hydraulical/Distribution/{BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW.mo => TwoStoragesBoilerWithDHW.mo} (95%) rename BESMod/Systems/Hydraulical/Distribution/{BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW.mo => TwoStoragesBoilerWithoutDHW.mo} (91%) rename BESMod/Systems/Hydraulical/Generation/{OnlyHeatPump.mo => BaseClasses/PartialHeatPump.mo} (69%) create mode 100644 BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo rename BESMod/Systems/Hydraulical/Generation/{SolarThermalBivHPBuiLib.mo => DetailedSolarThermalWithHeatPump.mo} (78%) create mode 100644 BESMod/Systems/Hydraulical/Generation/HeatPump.mo create mode 100644 BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo delete mode 100644 BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPAixLib.mo create mode 100644 BESMod/Systems/Hydraulical/Generation/Tests/HeatPump.mo create mode 100644 BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodDetailed.mo rename BESMod/Systems/Hydraulical/Generation/Tests/{SolarThermalAndHeatPumpAndHeatingRod.mo => SolarThermalAndHeatPumpAndHeatingRodSimple.mo} (72%) delete mode 100644 BESMod/Systems/RecordsCollection/Movers/DefaultMoverBA.mo diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index b1122a8f..adab7e6b 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -2,22 +2,23 @@ within BESMod.Examples.BAUSimStudy; partial model PartialCase extends Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, - redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare - BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( - heaLoadFacGrd=0, heaLoadFacOut=0), - hBui=sum(building.zoneParam.VAir)^(1/3), - ABui=sum(building.zoneParam.VAir)^(2/3)), + redeclare Systems.Demand.Building.TEASERThermalZone building( + redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0), + hBui=sum(building.zoneParam.VAir)^(1/3), + ABui=sum(building.zoneParam.VAir)^(2/3)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - heatPumpParameters( + parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=TBiv, - scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal /5000, dpCon_nominal=0, dpEva_nominal=0, @@ -25,15 +26,16 @@ partial model PartialCase refIneFre_constant=0), redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodParameters, + parHeaRod, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData), + parTemSen), redeclare Systems.Hydraulical.Control.ConstHys_PI_ConOut_HPSController control( redeclare @@ -58,14 +60,12 @@ partial model PartialCase use_heatingRodAfterBuffer=false, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData, + parTemSen, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParameters, redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - bufParameters( - use_QLos=true, - T_m=338.15), + bufParameters(use_QLos=true, T_m=338.15), redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage dhwParameters( @@ -83,10 +83,11 @@ partial model PartialCase redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData transferDataBaseDefinition, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), + redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), redeclare Systems.UserProfiles.TEASERProfiles userProfiles, diff --git a/BESMod/Examples/GasBoilerBuildingOnly.mo b/BESMod/Examples/GasBoilerBuildingOnly.mo index 3b5a9c0d..18c6e527 100644 --- a/BESMod/Examples/GasBoilerBuildingOnly.mo +++ b/BESMod/Examples/GasBoilerBuildingOnly.mo @@ -16,8 +16,8 @@ model GasBoilerBuildingOnly paramBoiler, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData), + parTemSen, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum), redeclare BESMod.Systems.Hydraulical.Control.MonovalentGasBoiler control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled @@ -38,12 +38,12 @@ model GasBoilerBuildingOnly redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData transferDataBaseDefinition, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters)), redeclare BESMod.Systems.Demand.DHW.DHW DHW( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.PassThrough calcmFlow), redeclare BESMod.Systems.UserProfiles.TEASERProfiles userProfiles, diff --git a/BESMod/Examples/BivalentHeatPumpSystems.mo b/BESMod/Examples/HeatPumpAndBoiler.mo similarity index 85% rename from BESMod/Examples/BivalentHeatPumpSystems.mo rename to BESMod/Examples/HeatPumpAndBoiler.mo index d1ed3f4a..80e234fa 100644 --- a/BESMod/Examples/BivalentHeatPumpSystems.mo +++ b/BESMod/Examples/HeatPumpAndBoiler.mo @@ -1,10 +1,9 @@ within BESMod.Examples; -package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" +package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" extends Modelica.Icons.ExamplesPackage; record ParametersToChange - extends - Systems.RecordsCollection.ParameterStudy.ParameterStudyBaseDefinition; + extends Systems.RecordsCollection.ParameterStudy.ParameterStudyBaseDefinition; // 1. Add parameters like this (WITH Evaluate=false)! // parameter Modelica.SIunits.Volume V=0.5 annotation(Evaluate=false); // 2. Overwrite the default parameter in the system simulation @@ -35,8 +34,7 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" end AachenSystem; - model BivalentHeatPumpSystems_Serial - "Bivalent Heat Pump Systems with serial heat generation" + model Serial "Bivalent Heat Pump Systems with serial heat generation" extends Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare @@ -46,16 +44,15 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerSerial generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - heatPumpParameters( + parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal /parameterStudy.QHP_flow_biv, dpCon_nominal=0, dpEva_nominal=0, @@ -63,18 +60,17 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" refIneFre_constant=0), redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodParameters, + parHeaRod, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData), - redeclare Systems.Hydraulical.Control.NewControlBivalentSerial - control( + parTemSen), + redeclare Systems.Hydraulical.Control.NewControlBivalentSerial control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled thermostaticValveController, @@ -91,7 +87,8 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl safetyControl, TCutOff=parameterStudy.TCutOff, - QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.heatPumpParameters.scalingFactor, + QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, + CheckTCut_Off(threshold=parameterStudy.TCutOff)), redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( @@ -107,10 +104,11 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), redeclare Systems.UserProfiles.TEASERProfiles userProfiles, @@ -128,27 +126,27 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" StopTime=31536000, Interval=600, __Dymola_Algorithm="Dassl")); - end BivalentHeatPumpSystems_Serial; + end Serial; - model BivalentHeatPumpSystems_BoilerAfterBuffer_WithoutDHW + model BoilerAfterBufferWithoutDHW "Bivalent Heat Pump System with boiler integration after buffer tank without DHW support" extends Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare - BESMod.Systems.Demand.Building.RecordsCollection.RefAachen - oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), + BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( + heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.OnlyHeatPump generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData, + redeclare Systems.Hydraulical.Generation.HeatPump generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - heatPumpParameters( + parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal /parameterStudy.QHP_flow_biv, dpCon_nominal=0, dpEva_nominal=0, @@ -156,15 +154,16 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" refIneFre_constant=0), redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodParameters, + parHeaRod, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData), + parTemSen), redeclare Systems.Hydraulical.Control.NewControlBivalentSystem_BoilerAfterBuffer control( @@ -184,31 +183,28 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl safetyControl, TCutOff=parameterStudy.TCutOff, - QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.heatPumpParameters.scalingFactor, + QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, CheckTCut_Off(threshold=parameterStudy.TCutOff)), - redeclare - Systems.Hydraulical.Distribution.BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW + redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithoutDHW distribution( redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage bufParameters(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), - redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage dhwParameters(dTLoadingHC1=10), - redeclare - BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParameters), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.DHW DHW( - redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM - DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), redeclare Systems.UserProfiles.TEASERProfiles userProfiles, @@ -226,10 +222,9 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" StopTime=31536000, Interval=600, __Dymola_Algorithm="Dassl")); - end BivalentHeatPumpSystems_BoilerAfterBuffer_WithoutDHW; + end BoilerAfterBufferWithoutDHW; - model BivalentHeatPumpSystems_Parallel - "Bivalent Heat Pump System with parallel heat generation" + model Parallel "Bivalent Heat Pump System with parallel heat generation" extends Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare @@ -241,14 +236,14 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" generation( use_heaRod=false, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData, + parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - heatPumpParameters( + parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal /parameterStudy.QHP_flow_biv, dpCon_nominal=0, dpEva_nominal=0, @@ -256,12 +251,12 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" refIneFre_constant=0), redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData, + parTemSen, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParameters, @@ -269,7 +264,7 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parameters( m_flow_nominal=2*m_flow_nominal[1], - dp_nominal={heatPumpParameters.dpCon_nominal,boilerNoControl.dp_nominal}, + dp_nominal={parHeaPum.dpCon_nominal,boilerNoControl.dp_nominal}, use_inputFilter=true, order=1))), redeclare Systems.Hydraulical.Control.NewControlBivalentParallel @@ -290,7 +285,7 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl safetyControl, TCutOff=parameterStudy.TCutOff, - QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.heatPumpParameters.scalingFactor, + QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, CheckTCut_Off(threshold=parameterStudy.TCutOff)), redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel @@ -311,10 +306,10 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), redeclare Systems.UserProfiles.TEASERProfiles userProfiles, @@ -333,27 +328,27 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" StopTime=31536000, Interval=600, __Dymola_Algorithm="Dassl")); - end BivalentHeatPumpSystems_Parallel; + end Parallel; - model BivalentHeatPumpSystems_BoilerAfterBuffer_WithDHW + model BoilerAfterBufferWithDHW "Bivalent Heat Pump System with boiler integration after buffer tank with DHW support" extends Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare - BESMod.Systems.Demand.Building.RecordsCollection.RefAachen - oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), + BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( + heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.OnlyHeatPump generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData, + redeclare Systems.Hydraulical.Generation.HeatPump generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - heatPumpParameters( + parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal /parameterStudy.QHP_flow_biv, dpCon_nominal=0, dpEva_nominal=0, @@ -361,15 +356,16 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" refIneFre_constant=0), redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodParameters, + parHeaRod, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData), + parTemSen), redeclare Systems.Hydraulical.Control.NewControlBivalentSystem_BoilerAfterBuffer control( @@ -389,11 +385,10 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl safetyControl, TCutOff=parameterStudy.TCutOff, - QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.heatPumpParameters.scalingFactor, + QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, CheckTCut_Off(threshold=parameterStudy.TCutOff)), - redeclare - Systems.Hydraulical.Distribution.BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW + redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithDHW distribution( designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.FullStorage, @@ -403,9 +398,8 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" use_heatingRodAfterBuffer=false, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData, - redeclare - BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parTemSen, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParameters1, redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition @@ -420,18 +414,18 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.DHW DHW( - redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM - DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), redeclare Systems.UserProfiles.TEASERProfiles userProfiles, redeclare UseCaseDesignOptimization.AachenSystem systemParameters( use_ventilation=true), - redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy(TCutOff= - 262.15, TBiv=276.15), + redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy( + TCutOff=262.15, TBiv=276.15), redeclare final package MediumDHW = AixLib.Media.Water, redeclare final package MediumZone = AixLib.Media.Air, redeclare final package MediumHyd = AixLib.Media.Water, @@ -443,6 +437,6 @@ package BivalentHeatPumpSystems "Bivalent Heat Pump System with Gas Boiler" StopTime=31536000, Interval=600, __Dymola_Algorithm="Dassl")); - end BivalentHeatPumpSystems_BoilerAfterBuffer_WithDHW; + end BoilerAfterBufferWithDHW; -end BivalentHeatPumpSystems; +end HeatPumpAndBoiler; diff --git a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo index 86312ef4..863fb51e 100644 --- a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo +++ b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo @@ -42,10 +42,10 @@ partial model PartialSolarThermalHPS redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData transferDataBaseDefinition, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), redeclare SolarThermalSystemParameters systemParameters, redeclare SolarThermalDesignOptimization parameterStudy( diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo index be054921..84c9e650 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo @@ -2,32 +2,30 @@ within BESMod.Examples.SolarThermalSystem; model SolarThermalAixLib "Solar thermal collector from AixLib" extends BESMod.Examples.SolarThermalSystem.PartialSolarThermalHPS(redeclare model hydGeneration = - BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib ( + BESMod.Systems.Hydraulical.Generation.SimpleSolarThermalWithHeatPump ( use_heaRod=false, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap (refrigerant= "Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - heatPumpParameters(genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.Monovalent), + parHeaPum(genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.Monovalent), redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodParameters, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - + parHeaRod, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData, - redeclare BESMod.Examples.SolarThermalSystem.SolarCollector - solarThermalParas( + parTemSen, + redeclare BESMod.Examples.SolarThermalSystem.SolarCollector parSolThe( final A=parameterStudy.A, final eta_zero=parameterStudy.eta_zero, final c1=parameterStudy.c1, final c2=parameterStudy.c2), redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpSTData)); + parPumSolThe)); extends Modelica.Icons.Example; diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo index 425073ee..98720b1c 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo @@ -3,24 +3,23 @@ model SolarThermalBuildings "HPS which is supported by a solar thermal collector" extends BESMod.Examples.SolarThermalSystem.PartialSolarThermalHPS(redeclare model hydGeneration = - BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib ( + BESMod.Systems.Hydraulical.Generation.DetailedSolarThermalWithHeatPump ( use_heaRod=false, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap (refrigerant= "Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - heatPumpParameters(genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.Monovalent), + parHeaPum(genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.Monovalent), redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodParameters, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, - + parHeaRod, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData, + parTemSen, redeclare BESMod.Examples.SolarThermalSystem.SolarCollector solarThermalParas( final A=parameterStudy.A, @@ -28,7 +27,7 @@ model SolarThermalBuildings final c1=parameterStudy.c1, final c2=parameterStudy.c2), redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpSTData)); + parPumSolThe)); extends Modelica.Icons.Example; diff --git a/BESMod/Examples/UseCaseDesignOptimization/BES.mo b/BESMod/Examples/UseCaseDesignOptimization/BES.mo index e521924a..7f87aa9c 100644 --- a/BESMod/Examples/UseCaseDesignOptimization/BES.mo +++ b/BESMod/Examples/UseCaseDesignOptimization/BES.mo @@ -8,14 +8,15 @@ model BES redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - heatPumpParameters( + parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal /parameterStudy.QHP_flow_biv, dpCon_nominal=0, dpEva_nominal=0, @@ -23,15 +24,16 @@ model BES refIneFre_constant=0), redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodParameters, + parHeaRod, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData), + parTemSen), redeclare Systems.Hydraulical.Control.PartBiv_PI_ConOut_HPS control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled @@ -49,7 +51,8 @@ model BES BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl safetyControl, TCutOff=parameterStudy.TCutOff, - QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.heatPumpParameters.scalingFactor), + QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor), + redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( redeclare @@ -58,21 +61,21 @@ model BES VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.B), + redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters( - dTLoadingHC1=10, - energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.A), + dhwParameters(dTLoadingHC1=10, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.A), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParameters), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), redeclare Systems.UserProfiles.TEASERProfiles userProfiles, diff --git a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo index ab469a64..78a41cb3 100644 --- a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo +++ b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo @@ -13,20 +13,22 @@ model BES_HOM Type_Win, redeclare model CorrSolarGainWin = AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.CorGSimple, + redeclare BESMod.Systems.Demand.Building.Components.AixLibHighOrderOFD HOMBuiEnv), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( redeclare BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - heatPumpParameters( + parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.heatPumpParameters.QPri_flow_nominal + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal /parameterStudy.QHP_flow_biv, dpCon_nominal=0, dpEva_nominal=0, @@ -34,15 +36,16 @@ model BES_HOM refIneFre_constant=0), redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodParameters, + parHeaRod, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.heatPumpParameters.QPri_flow_nominal, + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData), + parTemSen), redeclare BESMod.Systems.Hydraulical.Control.ConstHys_OnOff_HPSControll control( redeclare @@ -75,10 +78,10 @@ model BES_HOM redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare BESMod.Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), redeclare BESMod.Systems.UserProfiles.AixLibHighOrderProfiles userProfiles( diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index d74e1439..d8011799 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -3,22 +3,22 @@ partial model PartialModelicaConferenceUseCase "Partial model to be extended to replace single subsystems" extends Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.ElectricalSystem electrical( - redeclare Systems.Electrical.Distribution.BatterySystemSimple - distribution(redeclare + redeclare Systems.Electrical.Distribution.BatterySystemSimple distribution( + redeclare BuildingSystems.Technologies.ElectricalStorages.Data.LithiumIon.LithiumIonTeslaPowerwall1 batteryParameters), - redeclare BESMod.Systems.Electrical.Generation.PVSystemMultiSub - generation( + redeclare BESMod.Systems.Electrical.Generation.PVSystemMultiSub generation( redeclare model CellTemperature = AixLib.Electrical.PVSystem.BaseClasses.CellTemperatureMountingContactToGround, + redeclare AixLib.DataBase.SolarElectric.SchuecoSPV170SME1 pVParameters, lat=weaDat.lat, lon=weaDat.lon, alt=weaDat.alt, timZon=3600, ARoo=building.ARoo/2), - redeclare BESMod.Systems.Electrical.Transfer.NoElectricalTransfer - transfer, + redeclare BESMod.Systems.Electrical.Transfer.NoElectricalTransfer transfer, + redeclare BESMod.Systems.Electrical.Control.NoControl control), redeclare BESMod.Systems.Control.DHWSuperheating control(TSetDHW= systemParameters.TSetDHW), @@ -26,12 +26,13 @@ partial model PartialModelicaConferenceUseCase energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( dTTra_nominal={10}, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - heatPumpParameters( + parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=271.15, scalingFactor=scalingFactorHP, dpCon_nominal=0, @@ -40,13 +41,13 @@ partial model PartialModelicaConferenceUseCase refIneFre_constant=0), redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodParameters, + parHeaRod, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D (dataTable= AixLib.DataBase.HeatPump.EN255.Vitocal350AWI114()), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData), + parTemSen), redeclare BESMod.Systems.Hydraulical.Control.ConstHys_PI_ConOut_HPSController control( @@ -66,6 +67,7 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW TSet_DHW, supCtrlTypeDHWSet=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal), + redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( redeclare @@ -82,13 +84,14 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)), + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), + redeclare Systems.Demand.DHW.DHW DHW( energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare final BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, final use_dhwCalc=false, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), redeclare BESMod.Examples.UseCaseModelicaConferencePaper.BESModSystemParas @@ -122,7 +125,7 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.Ventilation.Control.SummerPIDByPass control( use_bypass=false))); - parameter Real scalingFactorHP=hydraulic.generation.heatPumpParameters.QPri_flow_nominal + parameter Real scalingFactorHP=hydraulic.generation.parHeaPum.QPri_flow_nominal /13000 "May be overwritten to avoid warnings and thus a fail in the CI"; diff --git a/BESMod/Examples/package.order b/BESMod/Examples/package.order index a8080204..79ee0b5d 100644 --- a/BESMod/Examples/package.order +++ b/BESMod/Examples/package.order @@ -4,4 +4,4 @@ BAUSimStudy UseCaseHighOrderModel SolarThermalSystem GasBoilerBuildingOnly -BivalentHeatPumpSystems +HeatPumpAndBoiler diff --git a/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos b/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos new file mode 100644 index 00000000..24427ab2 --- /dev/null +++ b/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos @@ -0,0 +1,24 @@ +clear + +convertClear(); + +// Bus connectors +convertElement("BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod", "heatPumpParameters", "parHeaPum"); +convertElement("BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod", "heatingRodParameters", "parHeaRod"); +convertElement("BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod", "temperatureSensorData", "parTemSen"); +convertElement("BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod", "pumpData", "parPum"); + +convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib", "heatPumpParameters", "parHeaPum"); +convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib", "heatingRodParameters", "parHeaRod"); +convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib", "temperatureSensorData", "parTemSen"); +convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib", "pumpData", "parPum"); + +convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib", "heatPumpParameters", "parHeaPum"); +convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib", "heatingRodParameters", "parHeaRod"); +convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib", "temperatureSensorData", "parTemSen"); +convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib", "pumpData", "parPum"); + +convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "temperatureSensorData", "parTemSen"); +convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "temperatureSensorData", "parTemSen"); + +convertClass \ No newline at end of file diff --git a/BESMod/Resources/Scripts/ConvertFromBESMod_0.3.0.mos b/BESMod/Resources/Scripts/ConvertFromBESMod_0.3.0.mos deleted file mode 100644 index e5598707..00000000 --- a/BESMod/Resources/Scripts/ConvertFromBESMod_0.3.0.mos +++ /dev/null @@ -1,3 +0,0 @@ -// Generated by conversion of BESMod -convertModifiers("BESMod.Systems.Ventilation.Control.SummerPIDByPass",{"summerByPass.conPIDHeatingCooling.reverseAction"},{"summerByPass.conPIDHeatingCooling.reverseActing=not %summerByPass.conPIDHeatingCooling.reverseAction%"}); -convertModifiers("BESMod.Systems.Ventilation.Control.Components.SummerByPass",{"conPIDHeatingCooling.reverseAction"},{"conPIDHeatingCooling.reverseActing=not %conPIDHeatingCooling.reverseAction%"}); diff --git a/BESMod/Systems/Demand/DHW/DHW.mo b/BESMod/Systems/Demand/DHW/DHW.mo index 3c164d27..369f6898 100644 --- a/BESMod/Systems/Demand/DHW/DHW.mo +++ b/BESMod/Systems/Demand/DHW/DHW.mo @@ -24,7 +24,7 @@ model DHW "Standard DHW subsystem" replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpData + parPum annotation (choicesAllMatching=true, Placement(transformation(extent={{-96,-96},{-84,-84}}))); replaceable TappingProfiles.BaseClasses.PartialDHW calcmFlow constrainedby @@ -57,18 +57,18 @@ Modelica.Blocks.Math.UnitConversions.From_degC fromDegC redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final speed_rpm_nominal=parPum.speed_rpm_nominal, final m_flow_nominal=mDHW_flow_nominal, final dp_nominal(displayUnit="Pa") = 100, final rho=rho, - final V_flowCurve=pumpData.V_flowCurve, - final dpCurve=pumpData.dpCurve), + final V_flowCurve=parPum.V_flowCurve, + final dpCurve=parPum.dpCurve), final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final addPowerToMedium=pumpData.addPowerToMedium, + final addPowerToMedium=parPum.addPowerToMedium, final nominalValuesDefineDefaultPressureCurve=false, - final tau=pumpData.tau, - final use_inputFilter=pumpData.use_inputFilter, - final riseTime=pumpData.riseTimeInpFilter, + final tau=parPum.tau, + final use_inputFilter=parPum.use_inputFilter, + final riseTime=parPum.riseTimeInpFilter, final dp_nominal=100) annotation (Placement(transformation( extent={{-9.5,9.5},{9.5,-9.5}}, rotation=180, diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistribution.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistribution.mo index 897d33de..bbf6fb95 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistribution.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistribution.mo @@ -34,8 +34,8 @@ partial model PartialDistribution annotation (Dialog(group= "Design - Bottom Up: Parameters are defined by the subsystem")); - Modelica.Fluid.Interfaces.FluidPort_a portGen_in[nParallelSup](redeclare - final package Medium = MediumGen) "Inlet from the generation" annotation ( + Modelica.Fluid.Interfaces.FluidPort_a portGen_in[nParallelSup](redeclare final + package Medium = MediumGen) "Inlet from the generation" annotation ( Placement(transformation(extent={{-110,70},{-90,90}}), iconTransformation( extent={{-110,70},{-90,90}}))); Modelica.Fluid.Interfaces.FluidPort_b portGen_out[nParallelSup](redeclare @@ -47,8 +47,8 @@ partial model PartialDistribution Medium) "Outlet for the distribution to the building" annotation (Placement(transformation(extent={{90,70},{110,90}}), iconTransformation(extent={{90,70},{110,90}}))); - Modelica.Fluid.Interfaces.FluidPort_a portBui_in[nParallelDem](redeclare - final package Medium = + Modelica.Fluid.Interfaces.FluidPort_a portBui_in[nParallelDem](redeclare final + package Medium = Medium) "Inlet for the distribution from the building" annotation (Placement(transformation(extent={{90,30},{110,50}}), iconTransformation(extent={{90,30},{110,50}}))); diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo index 42c7c4e2..1d1d5289 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo @@ -31,7 +31,7 @@ partial model PartialDistributionTwoStorageParallelDetailed replaceable parameter BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition - temperatureSensorData + parTemSen annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement(transformation(extent={{42,-12}, {58,4}}))); @@ -93,8 +93,8 @@ partial model PartialDistributionTwoStorageParallelDetailed redeclare final AixLib.DataBase.Pipes.Copper.Copper_10x0_6 pipeHC2) annotation(Dialog(group="Component data"), choicesAllMatching=true, Placement(transformation(extent={{20,-62},{34,-48}}))); - replaceable parameter Generation.RecordsCollection.HeatingRodBaseDataDefinition heatingRodAftBufParameters if - use_heatingRodAfterBuffer + replaceable parameter Generation.RecordsCollection.HeatingRodBaseDataDefinition heatingRodAftBufParameters + if use_heatingRodAfterBuffer "Parameters for heating rod after buffer storage" annotation (Dialog(group="Component data", enable=use_heatingRodAfterBuffer), choicesAllMatching=true, Placement(transformation( @@ -254,8 +254,8 @@ partial model PartialDistributionTwoStorageParallelDetailed origin={50,90}))); AixLib.Fluid.Interfaces.PassThroughMedium pasThrHeaRodBuf(redeclare package - Medium = Medium, allowFlowReversal=allowFlowReversal) if - not use_heatingRodAfterBuffer + Medium = Medium, allowFlowReversal=allowFlowReversal) + if not use_heatingRodAfterBuffer annotation (Placement(transformation(extent={{40,54},{60,74}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow QHRStoDHWPre_flow(final @@ -264,8 +264,8 @@ partial model PartialDistributionTwoStorageParallelDetailed extent={{-10,-10},{10,10}}, rotation=0, origin={-70,-50}))); - Modelica.Blocks.Math.Gain gain(k=dhwParameters.QHR_flow_nominal) if - dhwParameters.use_hr + Modelica.Blocks.Math.Gain gain(k=dhwParameters.QHR_flow_nominal) + if dhwParameters.use_hr annotation (Placement(transformation(extent={{-112,-60},{-92,-40}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow QHRStoBufPre_flow(final T_ref=293.15, final alpha=0) if bufParameters.use_hr annotation ( @@ -273,8 +273,8 @@ partial model PartialDistributionTwoStorageParallelDetailed extent={{-10,-10},{10,10}}, rotation=0, origin={-70,30}))); - Modelica.Blocks.Math.Gain gainHRBuf(k=bufParameters.QHR_flow_nominal) if - bufParameters.use_hr + Modelica.Blocks.Math.Gain gainHRBuf(k=bufParameters.QHR_flow_nominal) + if bufParameters.use_hr annotation (Placement(transformation(extent={{-100,0},{-80,20}}))); Components.Valves.ThreeWayValveWithFlowReturn threeWayValveWithFlowReturn( @@ -298,12 +298,12 @@ partial model PartialDistributionTwoStorageParallelDetailed redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal, m_flow_nominal=m_flow_nominal[1], - tau=temperatureSensorData.tau, - initType=temperatureSensorData.initType, + tau=parTemSen.tau, + initType=parTemSen.initType, T_start=T_start, - final transferHeat=temperatureSensorData.transferHeat, - TAmb=temperatureSensorData.TAmb, - tauHeaTra=temperatureSensorData.tauHeaTra) + final transferHeat=parTemSen.transferHeat, + TAmb=parTemSen.TAmb, + tauHeaTra=parTemSen.tauHeaTra) "Temperature at supply for building" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=180, @@ -317,8 +317,8 @@ partial model PartialDistributionTwoStorageParallelDetailed extent={{-10,-10},{10,10}}, rotation=180, origin={30,-170}))); - Utilities.KPIs.EnergyKPICalculator eneKPICalAftBufHeaRod(use_inpCon=true) if - use_heatingRodAfterBuffer annotation (Placement(transformation( + Utilities.KPIs.EnergyKPICalculator eneKPICalAftBufHeaRod(use_inpCon=true) + if use_heatingRodAfterBuffer annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={30,-130}))); diff --git a/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo b/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo index f5ab2b97..1ad90c2b 100644 --- a/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo +++ b/BESMod/Systems/Hydraulical/Distribution/CombiStorage.mo @@ -84,13 +84,13 @@ model CombiStorage final allowFlowReversal_HC1=allowFlowReversal, final allowFlowReversal_HC2=allowFlowReversal) annotation (Placement(transformation(extent={{-26,0},{22,60}}))); - Modelica.Blocks.Sources.Constant conDHWHeaRodOn(k=parameters.QHR_flow_nominal) if - parameters.use_hr annotation (Placement(transformation( + Modelica.Blocks.Sources.Constant conDHWHeaRodOn(k=parameters.QHR_flow_nominal) + if parameters.use_hr annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={-54,-82}))); - Modelica.Blocks.Sources.Constant conDHWHeaRodOff(final k=0) if - parameters.use_hr annotation (Placement(transformation( + Modelica.Blocks.Sources.Constant conDHWHeaRodOff(final k=0) + if parameters.use_hr annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={-90,-82}))); @@ -100,8 +100,8 @@ model CombiStorage rotation=90, origin={-70,-48}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow - prescribedHeatFlow if - parameters.use_hr annotation (Placement(transformation( + prescribedHeatFlow + if parameters.use_hr annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, origin={-70,-18}))); diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo index cd498acf..683b4956 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo @@ -9,7 +9,7 @@ model PressureReliefExample dpFullOpen_nominal=dp_nominal*1.4, dpThreshold_nominal=dp_nominal*1.1, use_inputFilter=false, - dpValve_nominal=dp_nominal) if use_relVal + dpValve_nominal=dp_nominal) if use_relVal annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, @@ -37,12 +37,12 @@ model PressureReliefExample redeclare package Medium = Medium, redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final speed_rpm_nominal=parPum.speed_rpm_nominal, final m_flow_nominal=m_flow_nominal, final dp_nominal=dp_nominal, final rho(displayUnit="kg/m3") = 1000, - final V_flowCurve=pumpData.V_flowCurve, - final dpCurve=pumpData.dpCurve), + final V_flowCurve=parPum.V_flowCurve, + final dpCurve=parPum.dpCurve), final inputType=IBPSA.Fluid.Types.InputType.Continuous, final use_inputFilter=false, final y_start=1) annotation (Placement( @@ -52,7 +52,7 @@ model PressureReliefExample origin={-50,30}))); replaceable parameter BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData(V_flowCurve={0.000422526,0.28816252,0.580972823,0.868712818, + parPum(V_flowCurve={0.000422526,0.28816252,0.580972823,0.868712818, 0.94983775,1.086736074,1.190677393,1.396024878,1.499966198}, dpCurve={ 1.587002096,1.526205451,1.375262055,1.161425577,1.07966457,0.857442348, 0.645702306,0.224318658,0}) diff --git a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/SimpleStorage/DefaultStorage.mo b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/SimpleStorage/DefaultStorage.mo index c8387316..d4c0df9d 100644 --- a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/SimpleStorage/DefaultStorage.mo +++ b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/SimpleStorage/DefaultStorage.mo @@ -2,6 +2,6 @@ within BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage; record DefaultStorage "Default storage data" extends SimpleStorageBaseDataDefinition( energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.B, - kappa=0.4, + kappa=0.4, beta=350e-6); end DefaultStorage; diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo index e06098db..7fe752cb 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo @@ -7,7 +7,7 @@ model TestDirectLoading use_heatingRodAfterBuffer=false, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData, + parTemSen, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParameters, diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo index f0ca5fbe..84cdc022 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo @@ -7,7 +7,7 @@ model TestIndirectLoading use_heatingRodAfterBuffer=false, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData, + parTemSen, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve threeWayValveParameters, diff --git a/BESMod/Systems/Hydraulical/Distribution/BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW.mo b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo similarity index 95% rename from BESMod/Systems/Hydraulical/Distribution/BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW.mo rename to BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo index 6b02ffff..b3f9bda0 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW.mo +++ b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo @@ -1,8 +1,7 @@ within BESMod.Systems.Hydraulical.Distribution; -model BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW - "bivalent system with boiler after buffer and with dhw support" - extends - BESMod.Systems.Hydraulical.Distribution.BaseClasses.PartialDistribution( +model TwoStoragesBoilerWithDHW + "Two storages with a boiler after buffer and with DHW support" + extends BESMod.Systems.Hydraulical.Distribution.BaseClasses.PartialDistribution( final dpDem_nominal={0}, final dpSup_nominal={2*(threeWayValveParameters1.dpValve_nominal + max( threeWayValveParameters1.dp_nominal))}, @@ -35,7 +34,7 @@ model BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW "Number of steps to dicretize. =0 modulating, =1 resembels an on-off controller. =2 would sample 0, 0.5 and 1"; replaceable parameter BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition - temperatureSensorData + parTemSen annotation (choicesAllMatching=true, Placement(transformation(extent={{126,116}, {144,130}}))); replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve threeWayValveParameters1 @@ -228,8 +227,8 @@ replaceable extent={{-7,-7},{7,7}}, rotation=0, origin={-69,-51}))); - Modelica.Blocks.Math.Gain gain(k=dhwParameters.QHR_flow_nominal) if - dhwParameters.use_hr + Modelica.Blocks.Math.Gain gain(k=dhwParameters.QHR_flow_nominal) +if dhwParameters.use_hr annotation (Placement(transformation(extent={{-102,-60},{-86,-42}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow QHRStoBufPre_flow1(final T_ref=293.15, final alpha=0) if bufParameters.use_hr annotation ( @@ -237,8 +236,8 @@ replaceable extent={{-7,-7},{7,7}}, rotation=0, origin={-47,35}))); - Modelica.Blocks.Math.Gain gainHRBuf(k=bufParameters.QHR_flow_nominal) if - bufParameters.use_hr + Modelica.Blocks.Math.Gain gainHRBuf(k=bufParameters.QHR_flow_nominal) +if bufParameters.use_hr annotation (Placement(transformation(extent={{-80,18},{-64,36}}))); BESMod.Systems.Hydraulical.Distribution.Components.Valves.ThreeWayValveWithFlowReturn @@ -259,12 +258,12 @@ replaceable redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal, m_flow_nominal=m_flow_nominal[1], - tau=temperatureSensorData.tau, - initType=temperatureSensorData.initType, + tau=parTemSen.tau, + initType=parTemSen.initType, T_start=T_start, - final transferHeat=temperatureSensorData.transferHeat, - TAmb=temperatureSensorData.TAmb, - tauHeaTra=temperatureSensorData.tauHeaTra) + final transferHeat=parTemSen.transferHeat, + TAmb=parTemSen.TAmb, + tauHeaTra=parTemSen.tauHeaTra) "Temperature at supply for building" annotation (Placement(transformation( extent={{5,6},{-5,-6}}, rotation=180, @@ -384,19 +383,19 @@ replaceable final show_T=show_T, redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final speed_rpm_nominal=parPum.speed_rpm_nominal, final m_flow_nominal=m_flow_nominal[1], final dp_nominal=boiNoCtrl.dp_nominal + 2*(threeWayValveWithFlowReturn2.parameters.dpValve_nominal + threeWayValveWithFlowReturn2.parameters.dp_nominal[1] + threeWayValveWithFlowReturn2.parameters.dpFixed_nominal[1]), final rho=rho, - final V_flowCurve=pumpData.V_flowCurve, - final dpCurve=pumpData.dpCurve), + final V_flowCurve=parPum.V_flowCurve, + final dpCurve=parPum.dpCurve), final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final addPowerToMedium=pumpData.addPowerToMedium, - final tau=pumpData.tau, - final use_inputFilter=pumpData.use_inputFilter, - final riseTime=pumpData.riseTimeInpFilter, + final addPowerToMedium=parPum.addPowerToMedium, + final tau=parPum.tau, + final use_inputFilter=parPum.use_inputFilter, + final riseTime=parPum.riseTimeInpFilter, final init=Modelica.Blocks.Types.Init.InitialOutput, final y_start=1) annotation (Placement(transformation( extent={{5,5},{-5,-5}}, @@ -406,7 +405,7 @@ replaceable annotation (Placement(transformation(extent={{4,84},{10,90}}))); parameter BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData annotation (Dialog(group="Component data"), + parPum annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement(transformation(extent={{52,152},{74,174}}))); parameter BESMod.Systems.RecordsCollection.Movers.DefaultMover defaultMoverBA annotation ( @@ -423,9 +422,9 @@ replaceable dhwParameters.TAmb) "Constant ambient temperature of storage"; Utilities.KPIs.EnergyKPICalculator eneKPICalBuf(use_inpCon=false, y=fixTemBuf.port.Q_flow) - annotation (Placement(transformation(extent={{-204,-156},{-184,-136}}))); + annotation (Placement(transformation(extent={{-42,-118},{-22,-98}}))); Utilities.KPIs.EnergyKPICalculator eneKPICalDHW(use_inpCon=false, y=fixTemDHW.port.Q_flow) - annotation (Placement(transformation(extent={{-204,-196},{-184,-176}}))); + annotation (Placement(transformation(extent={{-42,-158},{-22,-138}}))); equation connect(T_stoDHWBot.y, sigBusDistr.TStoDHWBotMea) annotation (Line(points={{-16.4, 95},{2.5,95},{2.5,101},{0,101}}, color={0,0,127}), Text( @@ -579,14 +578,16 @@ equation index=-1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(eneKPICalDHW.KPI, outBusDist.QDHWLos_flow) annotation (Line(points={{-181.8, - -186},{0,-186},{0,-100}}, color={135,135,135}), Text( + connect(eneKPICalDHW.KPI, outBusDist.QDHWLos_flow) annotation (Line(points={{-19.8, + -148},{-19.8,-120},{-14,-120},{-14,-86},{0,-86},{0,-100}}, + color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(eneKPICalBuf.KPI, outBusDist.QBufLos_flow) annotation (Line(points={{-181.8, - -146},{0,-146},{0,-100}}, color={135,135,135}), Text( + connect(eneKPICalBuf.KPI, outBusDist.QBufLos_flow) annotation (Line(points={{-19.8, + -108},{-18,-108},{-18,-86},{0,-86},{0,-100}}, + color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, @@ -598,4 +599,4 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); -end BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW; +end TwoStoragesBoilerWithDHW; diff --git a/BESMod/Systems/Hydraulical/Distribution/BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW.mo b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithoutDHW.mo similarity index 91% rename from BESMod/Systems/Hydraulical/Distribution/BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW.mo rename to BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithoutDHW.mo index b3377c34..a016f50e 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW.mo +++ b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithoutDHW.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Distribution; -model BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW - "bivalent system with boiler after buffer and without dhw support" +model TwoStoragesBoilerWithoutDHW + "Two storages with a boiler after the buffer but without DHW support" extends BaseClasses.PartialDistribution( final VStoDHW=dhwParameters.V, final QDHWStoLoss_flow=dhwParameters.QLoss_flow, @@ -17,11 +17,9 @@ model BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW final nParallelSup=1, final nParallelDem=1); - parameter Modelica.Units.SI.Power Q_nom=boiNoCtrl.paramBoiler.Q_nom - "Nominal heating power"; - - parameter Modelica.Units.SI.Volume V=boiNoCtrl.paramBoiler.volume "Volume"; - + parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition + parBoi=AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_15kW() + "Parameters for Boiler"; AixLib.Fluid.Storage.Storage storageDHW( redeclare final package Medium = MediumDHW, final n=dhwParameters.nLayer, @@ -199,16 +197,16 @@ model BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW final rho_default=rho, final p_start=p_start, final T_start=T_start, - final etaLoadBased= boiNoCtrl.paramBoiler.eta, - final G=0.003*Q_nom/50, - final C=1.5*Q_nom, - final Q_nom=boiNoCtrl.paramBoiler.Q_nom, - final V=boiNoCtrl.paramBoiler.volume, + final etaLoadBased=parBoi.eta, + final G=0.003*parBoi.Q_nom/50, + final C=1.5*parBoi.Q_nom, + final Q_nom=parBoi.Q_nom, + final V=parBoi.volume, final etaTempBased=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99], - final paramBoiler=AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_15kW()) - annotation (Placement(transformation(extent={{60,84},{82,108}}))); + final paramBoiler=parBoi) + annotation (Placement(transformation(extent={{60,80},{80,100}}))); Utilities.KPIs.EnergyKPICalculator KPIBoi(use_inpCon=true) - annotation (Placement(transformation(extent={{102,150},{122,170}}))); + annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); equation connect(fixTemBuf.port, storageBuf.heatPort) annotation (Line(points={{60,10}, {80,10},{80,58},{62.6,58}}, color={191,0,0})); @@ -290,31 +288,31 @@ equation horizontalAlignment=TextAlignment.Left)); connect(bouPumBuf.ports[1], storageBuf.port_a_consumer) annotation (Line( points={{10,20},{10,32},{49,32},{49,40}}, color={0,127,255})); - connect(storageBuf.port_b_consumer, boiNoCtrl.port_a) annotation (Line(points= - {{49,76},{48,76},{48,96},{60,96}}, color={0,127,255})); + connect(storageBuf.port_b_consumer, boiNoCtrl.port_a) annotation (Line(points={{49,76}, + {48,76},{48,90},{60,90}}, color={0,127,255})); connect(boiNoCtrl.port_b, portBui_out[1]) - annotation (Line(points={{82,96},{100,96},{100,80}}, color={0,127,255})); + annotation (Line(points={{80,90},{100,90},{100,80}}, color={0,127,255})); connect(boiNoCtrl.T_out, sigBusDistr.TBoilerOutDistribution) annotation (Line( - points={{78.92,99.84},{92,99.84},{92,128},{0,128},{0,101}}, color={0,0, + points={{77.2,93.2},{92,93.2},{92,128},{0,128},{0,101}}, color={0,0, 127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(boiNoCtrl.u_rel, sigBusDistr.yBoilerDistribution) annotation (Line( - points={{63.3,104.4},{48,104.4},{48,120},{0,120},{0,101}}, color={0,0, + points={{63,97},{50,97},{50,100},{0,100},{0,101}}, color={0,0, 127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(boiNoCtrl.thermalPower, KPIBoi.u) annotation (Line(points={{78.92, - 106.08},{100.2,106.08},{100.2,160}}, color={0,0,127})); - connect(KPIBoi.KPI, outBusDist.QBoi_Distribution_flow) annotation (Line( - points={{124.2,160},{170,160},{170,158},{178,158},{178,-148},{0,-148},{ - 0,-100}}, color={135,135,135}), Text( + connect(boiNoCtrl.thermalPower, KPIBoi.u) annotation (Line(points={{77.2,98.4},{ + 76,98.4},{76,120},{-108,120},{-108,-30},{-101.8,-30}}, + color={0,0,127})); + connect(KPIBoi.KPI, outBusDist.QBoi_flow) annotation (Line(points={{-77.8,-30},{ + -16,-30},{-16,-48},{0,-48},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); -end BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW; +end TwoStoragesBoilerWithoutDHW; diff --git a/BESMod/Systems/Hydraulical/Distribution/package.order b/BESMod/Systems/Hydraulical/Distribution/package.order index c660fe88..4d91ce14 100644 --- a/BESMod/Systems/Hydraulical/Distribution/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/package.order @@ -4,10 +4,10 @@ DistributionTwoStorageParallel DHWOnly TwoStoDetailedDirectLoading TwoStoDetailedIndirectLoading +TwoStoragesBoilerWithoutDHW +TwoStoragesBoilerWithDHW Components RecordsCollection Tests BaseClasses Types -BivalentSystemDistributionWithBoilerAfterBuffer_WithoutDHW -BivalentSystemDistributionWithBoilerAfterBuffer_WithDHW diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialGeneration.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialGeneration.mo index 2580abfe..f994265d 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialGeneration.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialGeneration.mo @@ -18,8 +18,8 @@ partial model PartialGeneration "Partial generation model for HPS" final package Medium = Medium) "Outlet of the generation" annotation ( Placement(transformation(extent={{90,70},{110,90}}), iconTransformation( extent={{90,70},{110,90}}))); - Modelica.Fluid.Interfaces.FluidPort_a portGen_in[nParallelDem](redeclare - final package Medium = Medium) "Inlet to the generation" annotation ( + Modelica.Fluid.Interfaces.FluidPort_a portGen_in[nParallelDem](redeclare final + package Medium = Medium) "Inlet to the generation" annotation ( Placement(transformation(extent={{90,-12},{110,8}}), iconTransformation( extent={{90,30},{110,50}}))); BESMod.Systems.Hydraulical.Interfaces.GenerationOutputs diff --git a/BESMod/Systems/Hydraulical/Generation/OnlyHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo similarity index 69% rename from BESMod/Systems/Hydraulical/Generation/OnlyHeatPump.mo rename to BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo index 98864726..cecafe90 100644 --- a/BESMod/Systems/Hydraulical/Generation/OnlyHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo @@ -1,11 +1,11 @@ -within BESMod.Systems.Hydraulical.Generation; -model OnlyHeatPump "only heat pump System" +within BESMod.Systems.Hydraulical.Generation.BaseClasses; +model PartialHeatPump "Generation with only the heat pump" extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialGeneration( final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, final dTLoss_nominal=fill(0, nParallelDem), dTTra_nominal={if TDem_nominal[i] > 273.15 + 55 then 10 elseif TDem_nominal[ i] > 44.9 + 273.15 then 8 else 5 for i in 1:nParallelDem}, - dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal}, + dp_nominal={heatPump.dpCon_nominal}, nParallelDem=1); parameter Boolean use_airSource=true @@ -23,7 +23,7 @@ model OnlyHeatPump "only heat pump System" "Constant soil temperature for ground source heat pumps" annotation(Dialog(group="Component choices", enable=use_airSource)); - replaceable package Medium_eva = Modelica.Media.Interfaces.PartialMedium constrainedby + replaceable package Medium_eva = IBPSA.Media.Air constrainedby Modelica.Media.Interfaces.PartialMedium annotation (Dialog(group="Component choices"), choices( choice(redeclare package Medium = IBPSA.Media.Air "Moist air"), @@ -35,28 +35,27 @@ model OnlyHeatPump "only heat pump System" "Propylene glycol water, 40% mass fraction"))); replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition - heatPumpParameters constrainedby + parHeaPum constrainedby BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition( - final QGen_flow_nominal=Q_flow_nominal[1], - final TOda_nominal=TOda_nominal) - annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement( - transformation(extent={{-98,14},{-82,28}}))); - replaceable parameter - BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatingRodBaseDataDefinition - heatingRodParameters annotation (Dialog(group="Component data"), - choicesAllMatching=true, Placement( - transformation(extent={{64,44},{76,56}}))); + final QGen_flow_nominal=Q_flow_nominal[1], final TOda_nominal=TOda_nominal) + "Heat pump parameters" annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{-98,22},{-82,36}}))); replaceable parameter - BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpData annotation (Dialog(group="Component data"), - choicesAllMatching=true, Placement(transformation(extent={{42,-56}, - {56,-44}}))); + BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition parPum + "Parameters for pump" annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{42,-56},{56,-44}}))); replaceable parameter BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition - temperatureSensorData - annotation (Dialog(group="Component data"), choicesAllMatching=true, - Placement(transformation(extent={{60,10},{80,30}}))); + parTemSen "Parameters for temperature sensors" + annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{62,104},{76,118}}))); AixLib.Fluid.HeatPumps.HeatPump heatPump( redeclare package Medium_con = Medium, @@ -64,33 +63,33 @@ model OnlyHeatPump "only heat pump System" final use_rev=true, final use_autoCalc=false, final Q_useNominal=0, - final scalingFactor=heatPumpParameters.scalingFactor, - final use_refIne=heatPumpParameters.use_refIne, - final refIneFre_constant=heatPumpParameters.refIneFre_constant, + final scalingFactor=parHeaPum.scalingFactor, + final use_refIne=parHeaPum.use_refIne, + final refIneFre_constant=parHeaPum.refIneFre_constant, final nthOrder=1, final useBusConnectorOnly=false, final mFlow_conNominal=m_flow_nominal[1], - final VCon=heatPumpParameters.VCon, - final dpCon_nominal=heatPumpParameters.dpCon_nominal, + final VCon=parHeaPum.VCon, + final dpCon_nominal=parHeaPum.dpCon_nominal, final use_conCap=false, final CCon=0, final GConOut=0, final GConIns=0, - final mFlow_evaNominal=heatPumpParameters.mEva_flow_nominal, - final VEva=heatPumpParameters.VEva, - final dpEva_nominal=heatPumpParameters.dpEva_nominal, + final mFlow_evaNominal=parHeaPum.mEva_flow_nominal, + final VEva=parHeaPum.VEva, + final dpEva_nominal=parHeaPum.dpEva_nominal, final use_evaCap=false, final CEva=0, final GEvaOut=0, final GEvaIns=0, - final tauSenT=temperatureSensorData.tau, + final tauSenT=parTemSen.tau, final transferHeat=true, final allowFlowReversalEva=allowFlowReversal, final allowFlowReversalCon=allowFlowReversal, - final tauHeaTraEva=temperatureSensorData.tauHeaTra, - final TAmbEva_nominal=temperatureSensorData.TAmb, - final tauHeaTraCon=temperatureSensorData.tauHeaTra, - final TAmbCon_nominal=temperatureSensorData.TAmb, + final tauHeaTraEva=parTemSen.tauHeaTra, + final TAmbEva_nominal=parTemSen.TAmb, + final tauHeaTraCon=parTemSen.tauHeaTra, + final TAmbCon_nominal=parTemSen.TAmb, final pCon_start=p_start, final TCon_start=T_start, final pEva_start=Medium_eva.p_default, @@ -100,9 +99,8 @@ model OnlyHeatPump "only heat pump System" redeclare model PerDataMainHP = PerDataMainHP, redeclare model PerDataRevHP = AixLib.DataBase.Chiller.PerformanceData.LookUpTable2D (dataTable= - AixLib.DataBase.Chiller.EN14511.Vitocal200AWO201())) - annotation (Placement( - transformation( + AixLib.DataBase.Chiller.EN14511.Vitocal200AWO201())) annotation ( + Placement(transformation( extent={{22,-27},{-22,27}}, rotation=270, origin={-44,15}))); @@ -113,15 +111,16 @@ model OnlyHeatPump "only heat pump System" extent={{10,-10},{-10,10}}, rotation=180, origin={-90,-10}))); - IBPSA.Fluid.Sources.MassFlowSource_T bou_air( - final m_flow=heatPumpParameters.mEva_flow_nominal, + IBPSA.Fluid.Sources.MassFlowSource_T bouEva( + final m_flow=parHeaPum.mEva_flow_nominal, final use_T_in=true, redeclare package Medium = Medium_eva, final use_m_flow_in=false, - final nPorts=1) + final nPorts=1) "Evaporator boundary" annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); - Modelica.Blocks.Logical.Switch switch2 annotation (Placement(transformation( + Modelica.Blocks.Logical.Switch switch "Switch between air and soil temperature" + annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-130,50}))); @@ -132,7 +131,7 @@ model OnlyHeatPump "only heat pump System" origin={-170,90}))); Utilities.KPIs.EnergyKPICalculator KPIWel(use_inpCon=true) - annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); + annotation (Placement(transformation(extent={{-140,-40},{-120,-20}}))); IBPSA.Fluid.Movers.SpeedControlled_y pump( redeclare final package Medium = Medium, @@ -141,22 +140,21 @@ model OnlyHeatPump "only heat pump System" final T_start=T_start, final allowFlowReversal=allowFlowReversal, final show_T=show_T, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData + redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final speed_rpm_nominal=parPum.speed_rpm_nominal, final m_flow_nominal=m_flow_nominal[1], final dp_nominal=dpDem_nominal[1] + dp_nominal[1], final rho=rho, - final V_flowCurve=pumpData.V_flowCurve, - final dpCurve=pumpData.dpCurve), + final V_flowCurve=parPum.V_flowCurve, + final dpCurve=parPum.dpCurve), final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final addPowerToMedium=pumpData.addPowerToMedium, - final tau=pumpData.tau, - final use_inputFilter=pumpData.use_inputFilter, - final riseTime=pumpData.riseTimeInpFilter, + final addPowerToMedium=parPum.addPowerToMedium, + final tau=parPum.tau, + final use_inputFilter=parPum.use_inputFilter, + final riseTime=parPum.riseTimeInpFilter, final init=Modelica.Blocks.Types.Init.InitialOutput, - final y_start=1) annotation (Placement(transformation( + final y_start=1) annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=180, origin={10,-70}))); @@ -168,7 +166,7 @@ model OnlyHeatPump "only heat pump System" origin={-170,50}))); Utilities.KPIs.EnergyKPICalculator KPIQHP(use_inpCon=false, y=heatPump.con.QFlow_in) - annotation (Placement(transformation(extent={{-140,-112},{-120,-92}}))); + annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); IBPSA.Fluid.Sources.Boundary_pT bouPum( redeclare package Medium = Medium, @@ -184,14 +182,13 @@ model OnlyHeatPump "only heat pump System" redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal, m_flow_nominal=m_flow_nominal[1], - tau=temperatureSensorData.tau, - initType=temperatureSensorData.initType, + tau=parTemSen.tau, + initType=parTemSen.initType, T_start=T_start, - final transferHeat=temperatureSensorData.transferHeat, - TAmb=temperatureSensorData.TAmb, - tauHeaTra=temperatureSensorData.tauHeaTra) - "Temperature at supply (generation outlet)" - annotation (Placement(transformation( + final transferHeat=parTemSen.transferHeat, + TAmb=parTemSen.TAmb, + tauHeaTra=parTemSen.tauHeaTra) "Temperature at supply (generation outlet)" + annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=180, origin={70,80}))); @@ -208,6 +205,7 @@ model OnlyHeatPump "only heat pump System" Modelica.Blocks.Sources.BooleanExpression booExpHeaPumIsOn(y=heatPump.greaterThreshold.y) annotation (Placement(transformation(extent={{-180,-20},{-160,0}}))); Modelica.Blocks.Sources.RealExpression reaExpPEleHeaPum(y=heatPump.innerCycle.Pel) + "Electrical power consumption of heat pump" annotation (Placement(transformation(extent={{-180,-80},{-160,-60}}))); Modelica.Blocks.Sources.Constant conIceFac(final k=1) annotation (Placement( transformation( @@ -225,42 +223,31 @@ model OnlyHeatPump "only heat pump System" origin={-170,-38}))); Modelica.Blocks.Sources.RealExpression reaExpTEvaIn(y=heatPump.senT_a2.T) annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); -protected - parameter Modelica.Units.SI.PressureDifference dpHeaRod_nominal=if use_heaRod - then heatingRodParameters.dp_nominal else 0; - + Utilities.KPIs.DeviceKPICalculator KPIHeaPum( + use_reaInp=false, + calc_singleOnTime=true, + calc_totalOnTime=true, + calc_numSwi=true) "Heat pump KPIs" + annotation (Placement(transformation(extent={{-120,-60},{-100,-40}}))); equation - connect(bou_air.ports[1], heatPump.port_a2) annotation (Line( - points={{-80,50},{-74,50},{-74,42},{-57.5,42},{-57.5,37}}, - color={0,127,255})); + connect(bouEva.ports[1], heatPump.port_a2) annotation (Line(points={{-80,50},{-74, + 50},{-74,42},{-57.5,42},{-57.5,37}}, color={0,127,255})); connect(heatPump.port_b2, bou_sinkAir.ports[1]) annotation (Line( points={{-57.5,-7},{-56,-7},{-56,-10},{-80,-10}}, color={0,127,255})); - connect(bou_air.T_in, switch2.y) - annotation (Line(points={{-102,54},{-108,54},{-108,50},{-119,50}}, - color={0,0,127})); - connect(switch2.u2, AirOrSoil.y) - annotation (Line(points={{-142,50},{-152,50},{-152,90},{-159,90}}, - color={255,0,255})); + connect(bouEva.T_in, switch.y) annotation (Line(points={{-102,54},{-108,54},{-108, + 50},{-119,50}}, color={0,0,127})); + connect(switch.u2, AirOrSoil.y) annotation (Line(points={{-142,50},{-152,50},{-152, + 90},{-159,90}}, color={255,0,255})); connect(pump.port_a, portGen_in[1]) annotation (Line( points={{20,-70},{100,-70},{100,-2}}, color={0,127,255})); - connect(pump.port_b, heatPump.port_a1) annotation (Line( - points={{1.77636e-15,-70},{-30.5,-70},{-30.5,-7}}, - color={0,127,255})); - connect(TSoil.y, switch2.u3) annotation (Line(points={{-159,50},{-156,50},{-156, - 42},{-142,42}}, color={0,0,127})); + connect(TSoil.y, switch.u3) annotation (Line(points={{-159,50},{-156,50},{-156, + 42},{-142,42}}, color={0,0,127})); connect(bouPum.ports[1], pump.port_a) annotation (Line(points={{50,-76},{50,-70},{20,-70}}, color={0,127,255})); - connect(senTGenOut.T, sigBusGen.THeaRodMea) annotation (Line(points={{70,91},{ - 70,96},{26,96},{26,74},{2,74},{2,98}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); connect(senTGenOut.port_b, portGen_out[1]) annotation (Line(points={{80,80},{100,80}}, color={0,127,255})); @@ -273,22 +260,22 @@ equation annotation (Line(points={{122.98,-82},{112,-82}}, color={0,0,127})); if use_heaRod then connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, - -84.1},{144,-84.1},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, + -80.95},{144,-80.95},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-79.9},{144, - -79.9},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, + connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-83.05},{144, + -83.05},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, color={0,0,127})); else - connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-79.9},{144, - -79.9},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, + connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-83.05},{144, + -83.05},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, color={0,0,127})); connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, - -84.1},{144,-84.1},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, + -80.95},{144,-80.95},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, color={0,0,127}), Text( string="%second", @@ -296,7 +283,7 @@ equation extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); end if; - connect(switch2.u1, weaBus.TDryBul) annotation (Line(points={{-142,58},{-144,58}, + connect(switch.u1, weaBus.TDryBul) annotation (Line(points={{-142,58},{-144,58}, {-144,80},{-101,80}}, color={0,0,127}), Text( string="%second", index=1, @@ -308,21 +295,9 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIQHP.KPI, outBusGen.QHP_flow) annotation (Line(points={{-117.8,-102}, - {0,-102},{0,-100}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(KPIWel.KPI, outBusGen.PEleHP) annotation (Line(points={{-117.8,-70},{-104, - -70},{-104,-102},{0,-102},{0,-100}}, color={135,135, - 135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(reaExpPEleHeaPum.y, KPIWel.u) - annotation (Line(points={{-159,-70},{-141.8,-70}}, color={0,0,127})); + annotation (Line(points={{-159,-70},{-148,-70},{-148,-30},{-141.8,-30}}, + color={0,0,127})); connect(conIceFac.y, heatPump.iceFac_in) annotation (Line(points={{-156.9,11}, {-106,11},{-106,-1.72},{-74.6,-1.72}}, color={0,0,127})); connect(heatPump.nSet, sigBusGen.yHeaPumSet) annotation (Line(points={{-39.5,-10.52}, @@ -357,11 +332,37 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(heatPump.port_b1, senTGenOut.port_a) annotation (Line(points={{-30.5, - 37},{-30.5,60},{46,60},{46,80},{60,80}}, color={0,127,255})); + connect(senTGenOut.T, sigBusGen.TGenOutMea) annotation (Line(points={{70,91},{ + 70,98},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + connect(KPIQHP.KPI, outBusGen.QHeaPum_flow) annotation (Line(points={{-117.8, + -70},{-114,-70},{-114,-122},{0,-122},{0,-100}}, color={135,135,135}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIWel.KPI, outBusGen.PEleHeaPum) annotation (Line(points={{-117.8,-30}, + {0,-30},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIHeaPum.u, booExpHeaPumIsOn.y) annotation (Line(points={{-122.2,-50}, + {-134,-50},{-134,-48},{-154,-48},{-154,-10},{-159,-10}}, color={255,0, + 255})); + connect(KPIHeaPum.KPI, outBusGen.heaPum) annotation (Line(points={{-97.8,-50},{ + 0,-50},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); annotation (Line( points={{-52.775,-6.78},{-52.775,33.61},{-56,33.61},{-56,74}}, color={255,204,51}, thickness=0.5), Diagram(coordinateSystem(extent={{-180,-140},{100,100}}))); -end OnlyHeatPump; +end PartialHeatPump; diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo new file mode 100644 index 00000000..fe62eeee --- /dev/null +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo @@ -0,0 +1,74 @@ +within BESMod.Systems.Hydraulical.Generation.BaseClasses; +model PartialHeatPumpAndGasBoiler "Partial heat pump and boiler" + extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialHeatPump( + dp_nominal={heatPump.dpCon_nominal + boi.dp_nominal}); + + replaceable parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition + parBoi + "Parameters for Boiler" + annotation(Placement(transformation(extent={{22,62},{38,78}})), + choicesAllMatching=true, Dialog(group="Component choices")); + + AixLib.Fluid.BoilerCHP.BoilerNoControl boi( + redeclare package Medium = Medium, + final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=m_flow_nominal[1], + final m_flow_small=1E-4*abs(m_flow_nominal[1]), + final show_T=show_T, + final tau=parTemSen.tau, + final initType=parTemSen.initType, + final transferHeat=parTemSen.transferHeat, + final TAmb=parTemSen.TAmb, + final tauHeaTra=parTemSen.tauHeaTra, + final rho_default=rho, + final p_start=p_start, + final T_start=T_start, + final etaLoadBased=parBoi.eta, + final G=0.003*parBoi.Q_nom/50, + final C=1.5*parBoi.Q_nom, + final Q_nom=parBoi.Q_nom, + final V=parBoi.volume, + final etaTempBased=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99], + final paramBoiler=parBoi) "Boiler with external control" + annotation (Placement(transformation(extent={{20,40},{40,60}}))); + + Utilities.KPIs.EnergyKPICalculator KPIBoi(use_inpCon=false, y=boi.thermalPower) + annotation (Placement(transformation(extent={{-140,-110},{-120,-90}}))); + + Utilities.KPIs.EnergyKPICalculator KPIBoiFue(use_inpCon=false, y=boi.fuelPower) + "Fuel consumption" + annotation (Placement(transformation(extent={{-140,-140},{-120,-120}}))); + + +equation + + connect(boi.T_out, sigBusGen.TBoiOut) annotation (Line(points={{37.2,53.2},{42,53.2}, + {42,78},{2,78},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(boi.u_rel, sigBusGen.yBoi) annotation (Line(points={{23,57},{2,57},{2,98}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(KPIBoiFue.KPI, outBusGen.PBoiFue) annotation (Line(points={{-117.8,-130}, + {0,-130},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(KPIBoi.KPI, outBusGen.QBoi_flow) annotation (Line(points={{-117.8,-100}, + {-108,-100},{-108,-118},{0,-118},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + annotation (Line( + points={{-52.775,-6.78},{-52.775,33.61},{-56,33.61},{-56,74}}, + color={255,204,51}, + thickness=0.5), + Diagram(coordinateSystem(extent={{-180,-140},{100,100}}))); +end PartialHeatPumpAndGasBoiler; diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Generation/BaseClasses/package.order index 55380d56..7673a28b 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/package.order @@ -1 +1,3 @@ PartialGeneration +PartialHeatPump +PartialHeatPumpAndGasBoiler diff --git a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo b/BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo similarity index 78% rename from BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo rename to BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo index f6f224d2..c30e85fa 100644 --- a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPBuiLib.mo +++ b/BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Generation; -model SolarThermalBivHPBuiLib - "Solar thermal assistet monoenergetic heat pump with heating rod using Buildings ST model" +model DetailedSolarThermalWithHeatPump + "Detailed solar thermal model with monoenergetic heat pump" extends HeatPumpAndHeatingRod( m_flow_nominal={Q_flow_nominal[1]*f_design[1]/dTTra_nominal[1]/4184, solarThermalParas.m_flow_nominal}, @@ -15,10 +15,11 @@ model SolarThermalBivHPBuiLib annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement(transformation(extent={{-86,-62}, {-66,-42}}))); replaceable parameter - BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpSTData - annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement(transformation(extent={{-80, - -158},{-66,-144}}))); + BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition parPumSolThe + "Parameters for solar thermal pump" annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{-80,-158},{-66,-144}}))); Buildings.Fluid.SolarCollectors.EN12975 solCol( redeclare final package Medium = Medium, final allowFlowReversal=true, @@ -56,27 +57,28 @@ model SolarThermalBivHPBuiLib rotation=180, origin={-30,-170}))); - IBPSA.Fluid.Movers.SpeedControlled_y pumpST( + IBPSA.Fluid.Movers.SpeedControlled_y pumpSolThe( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final allowFlowReversal=allowFlowReversal, final show_T=show_T, - redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final speed_rpm_nominal=pumpSTData.speed_rpm_nominal, + redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData + per( + final speed_rpm_nominal=parPumSolThe.speed_rpm_nominal, final m_flow_nominal=solarThermalParas.m_flow_nominal, - final dp_nominal=dpST_nominal+ dpDem_nominal[2], + final dp_nominal=dpST_nominal + dpDem_nominal[2], final rho=rho, - final V_flowCurve=pumpSTData.V_flowCurve, - final dpCurve=pumpSTData.dpCurve), + final V_flowCurve=parPumSolThe.V_flowCurve, + final dpCurve=parPumSolThe.dpCurve), final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final addPowerToMedium=pumpSTData.addPowerToMedium, - final tau=pumpSTData.tau, - final use_inputFilter=pumpSTData.use_inputFilter, - final riseTime=pumpSTData.riseTimeInpFilter, + final addPowerToMedium=parPumSolThe.addPowerToMedium, + final tau=parPumSolThe.tau, + final use_inputFilter=parPumSolThe.use_inputFilter, + final riseTime=parPumSolThe.riseTimeInpFilter, final init=Modelica.Blocks.Types.Init.InitialOutput, - final y_start=1) annotation (Placement(transformation( + final y_start=1) "Solar thermal pump" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={30,-170}))); @@ -118,18 +120,17 @@ protected "Pressure drop at nominal mass flow rate"; equation - connect(pumpST.port_a, bou.ports[1]) annotation (Line(points={{40,-170},{60, - -170}}, color={0,127,255})); - connect(pumpST.port_b, solCol.port_a) annotation (Line(points={{20,-170},{-20, - -170}}, color={0,127,255})); + connect(pumpSolThe.port_a, bou.ports[1]) + annotation (Line(points={{40,-170},{60,-170}}, color={0,127,255})); + connect(pumpSolThe.port_b, solCol.port_a) + annotation (Line(points={{20,-170},{-20,-170}}, color={0,127,255})); connect(solCol.port_b, portGen_out[2]) annotation (Line(points={{-40,-170},{ -40,-124},{-232,-124},{-232,126},{116,126},{116,78},{106,78},{106, 82.5},{100,82.5}}, color={0,127,255})); - connect(portGen_in[2], pumpST.port_a) annotation (Line(points={{100,0.5},{102, - 0.5},{102,-156},{44,-156},{44,-170},{40,-170}}, - color={0,127,255})); - connect(pumpST.P, outBusGen.PelPumpST) annotation (Line(points={{19,-179},{0, - -179},{0,-100}}, color={0,0,127}), Text( + connect(portGen_in[2], pumpSolThe.port_a) annotation (Line(points={{100,0.5},{ + 102,0.5},{102,-156},{44,-156},{44,-170},{40,-170}}, color={0,127,255})); + connect(pumpSolThe.P, outBusGen.PelPumpST) annotation (Line(points={{19,-179},{ + 0,-179},{0,-100}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, @@ -144,9 +145,8 @@ equation index=-1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(switch3.y, pumpST.y) annotation (Line(points={{-147,-170},{-130,-170}, - {-130,-186},{30,-186},{30,-182}}, - color={0,0,127})); + connect(switch3.y, pumpSolThe.y) annotation (Line(points={{-147,-170},{-130,-170}, + {-130,-186},{30,-186},{30,-182}}, color={0,0,127})); connect(AirOrSoil2.y, switch3.u3) annotation (Line(points={{-179,-190},{-179, -186},{-170,-186},{-170,-178}}, color={0,0,127})); @@ -169,4 +169,4 @@ equation extent={{94,-198},{-218,-136}}, lineColor={0,0,0}, lineThickness=1)})); -end SolarThermalBivHPBuiLib; +end DetailedSolarThermalWithHeatPump; diff --git a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo index 54e34e46..b0fc17f0 100644 --- a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo @@ -24,19 +24,19 @@ model ElectricalHeater "Only heat using a heating rod" final m_flow_nominal=m_flow_nominal[1], final m_flow_small=1E-4*abs(m_flow_nominal[1]), final show_T=show_T, - final dp_nominal=heatingRodParameters.dp_nominal, + final dp_nominal=parHeaRod.dp_nominal, final tau=30, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final Q_flow_nominal=Q_flow_nominal[1], - final V=heatingRodParameters.V_hr, - final eta=heatingRodParameters.eta_hr) + final V=parHeaRod.V_hr, + final eta=parHeaRod.eta_hr) annotation (Placement(transformation(extent={{-16,-16},{16,16}}, rotation=90, origin={-32,10}))); replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatingRodBaseDataDefinition - heatingRodParameters + parHeaRod annotation (choicesAllMatching=true, Placement(transformation(extent={{-62,-42}, {-50,-30}}))); @@ -56,17 +56,17 @@ model ElectricalHeater "Only heat using a heating rod" redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final speed_rpm_nominal=parPum.speed_rpm_nominal, final m_flow_nominal=m_flow_nominal[1], final dp_nominal=dpDem_nominal[1] + dp_nominal[1], final rho=rho, - final V_flowCurve=pumpData.V_flowCurve, - final dpCurve=pumpData.dpCurve), + final V_flowCurve=parPum.V_flowCurve, + final dpCurve=parPum.dpCurve), final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final addPowerToMedium=pumpData.addPowerToMedium, - final tau=pumpData.tau, - final use_inputFilter=pumpData.use_inputFilter, - final riseTime=pumpData.riseTimeInpFilter, + final addPowerToMedium=parPum.addPowerToMedium, + final tau=parPum.tau, + final use_inputFilter=parPum.use_inputFilter, + final riseTime=parPum.riseTimeInpFilter, final init=Modelica.Blocks.Types.Init.InitialOutput, final y_start=1) annotation (Placement(transformation( extent={{-10,10},{10,-10}}, @@ -86,7 +86,7 @@ model ElectricalHeater "Only heat using a heating rod" annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}))); replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpData annotation (choicesAllMatching=true, Placement(transformation(extent={{14,-64}, + parPum annotation (choicesAllMatching=true, Placement(transformation(extent={{14,-64}, {28,-52}}))); BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) annotation (Placement(transformation(extent={{32,-108},{52,-88}}))); diff --git a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo index 6cb53b7d..5e7e6e7e 100644 --- a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo @@ -10,12 +10,12 @@ model GasBoiler "Just a gas boiler" annotation(Dialog(group="Component data")); replaceable parameter BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition - temperatureSensorData + parTemSen annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement(transformation(extent={{-98,-16},{-78,4}}))); replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpData annotation (Dialog(group="Component data"), + parPum annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement(transformation(extent={{54,-80}, {68,-68}}))); AixLib.Fluid.BoilerCHP.BoilerNoControl boilerNoControl( @@ -24,11 +24,11 @@ model GasBoiler "Just a gas boiler" final m_flow_nominal=m_flow_nominal[1], final m_flow_small=1E-4*abs(m_flow_nominal[1]), final show_T=show_T, - final tau=temperatureSensorData.tau, - final initType=temperatureSensorData.initType, - final transferHeat=temperatureSensorData.transferHeat, - final TAmb=temperatureSensorData.TAmb, - final tauHeaTra=temperatureSensorData.tauHeaTra, + final tau=parTemSen.tau, + final initType=parTemSen.initType, + final transferHeat=parTemSen.transferHeat, + final TAmb=parTemSen.TAmb, + final tauHeaTra=parTemSen.tauHeaTra, final rho_default=rho, final p_start=p_start, final T_start=T_start, @@ -50,17 +50,17 @@ model GasBoiler "Just a gas boiler" redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final speed_rpm_nominal=parPum.speed_rpm_nominal, final m_flow_nominal=m_flow_nominal[1], final dp_nominal=dpDem_nominal[1] + dp_nominal[1], final rho=rho, - final V_flowCurve=pumpData.V_flowCurve, - final dpCurve=pumpData.dpCurve), + final V_flowCurve=parPum.V_flowCurve, + final dpCurve=parPum.dpCurve), final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final addPowerToMedium=pumpData.addPowerToMedium, - final tau=pumpData.tau, - final use_inputFilter=pumpData.use_inputFilter, - final riseTime=pumpData.riseTimeInpFilter, + final addPowerToMedium=parPum.addPowerToMedium, + final tau=parPum.tau, + final use_inputFilter=parPum.use_inputFilter, + final riseTime=parPum.riseTimeInpFilter, final init=Modelica.Blocks.Types.Init.InitialOutput, final y_start=1) annotation (Placement(transformation( extent={{-10,10},{10,-10}}, diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPump.mo b/BESMod/Systems/Hydraulical/Generation/HeatPump.mo new file mode 100644 index 00000000..345cffe0 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Generation/HeatPump.mo @@ -0,0 +1,10 @@ +within BESMod.Systems.Hydraulical.Generation; +model HeatPump "Monovalent heat pump" + extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialHeatPump; + +equation + connect(senTGenOut.port_a, heatPump.port_b1) annotation (Line(points={{60,80},{ + 32,80},{32,44},{-30.5,44},{-30.5,37}}, color={0,127,255})); + connect(heatPump.port_a1, pump.port_b) annotation (Line(points={{-30.5,-7},{ + -30.5,-70},{1.77636e-15,-70}}, color={0,127,255})); +end HeatPump; diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo index 1ff2d03d..dd5e60a4 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo @@ -1,261 +1,8 @@ within BESMod.Systems.Hydraulical.Generation; model HeatPumpAndGasBoilerParallel - "Bivalent heat pump System parallel inspired by Bagarella" - extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialGeneration( - final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, - final dTLoss_nominal=fill(0, nParallelDem), - dTTra_nominal={if TDem_nominal[i] > 273.15 + 55 then 10 elseif TDem_nominal[ - i] > 44.9 + 273.15 then 8 else 5 for i in 1:nParallelDem}, - dp_nominal={0.5*heatPump.dpCon_nominal + 0.5*boiNoCtrl.dp_nominal}, - nParallelDem=1); - - parameter Modelica.Units.SI.Power Q_nom=boiNoCtrl.paramBoiler.Q_nom - "Nominal heating power"; - - parameter Modelica.Units.SI.Volume V=boiNoCtrl.paramBoiler.volume "Volume"; - - - parameter Boolean use_airSource=true - "Turn false to use water as temperature source." - annotation(Dialog(group="Component choices")); - - parameter Boolean use_heaRod=false "=false to disable the heating rod" - annotation(Dialog(group="Component choices")); - replaceable model PerDataMainHP = - AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D - constrainedby - AixLib.DataBase.HeatPump.PerformanceData.BaseClasses.PartialPerformanceData - annotation (Dialog(group="Component data"), __Dymola_choicesAllMatching=true); - parameter Modelica.Media.Interfaces.Types.Temperature TSoilConst=273.15 + 10 - "Constant soil temperature for ground source heat pumps" - annotation(Dialog(group="Component choices", enable=use_airSource)); - - replaceable package Medium_eva = Modelica.Media.Interfaces.PartialMedium constrainedby - Modelica.Media.Interfaces.PartialMedium annotation (Dialog(group="Component choices"), - choices( - choice(redeclare package Medium = IBPSA.Media.Air "Moist air"), - choice(redeclare package Medium = IBPSA.Media.Water "Water"), - choice(redeclare package Medium = - IBPSA.Media.Antifreeze.PropyleneGlycolWater ( - property_T=293.15, - X_a=0.40) - "Propylene glycol water, 40% mass fraction"))); - replaceable parameter - BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition - heatPumpParameters constrainedby - BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition( - final QGen_flow_nominal=Q_flow_nominal[1], - final TOda_nominal=TOda_nominal) - annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement( - transformation(extent={{-98,14},{-82,28}}))); - - - replaceable parameter - BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpData annotation (Dialog(group="Component data"), - choicesAllMatching=true, Placement(transformation(extent={{68,-36},{82,-24}}))); - replaceable parameter - BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition - temperatureSensorData - annotation (Dialog(group="Component data"), choicesAllMatching=true, - Placement(transformation(extent={{60,10},{80,30}}))); - - AixLib.Fluid.HeatPumps.HeatPump heatPump( - redeclare package Medium_con = Medium, - redeclare package Medium_eva = Medium_eva, - final use_rev=true, - final use_autoCalc=false, - final Q_useNominal=0, - final scalingFactor=heatPumpParameters.scalingFactor, - final use_refIne=heatPumpParameters.use_refIne, - final refIneFre_constant=heatPumpParameters.refIneFre_constant, - final nthOrder=1, - final useBusConnectorOnly=false, - final mFlow_conNominal=m_flow_nominal[1], - final VCon=heatPumpParameters.VCon, - final dpCon_nominal=heatPumpParameters.dpCon_nominal, - final use_conCap=false, - final CCon=0, - final GConOut=0, - final GConIns=0, - final mFlow_evaNominal=heatPumpParameters.mEva_flow_nominal, - final VEva=heatPumpParameters.VEva, - final dpEva_nominal=heatPumpParameters.dpEva_nominal, - final use_evaCap=false, - final CEva=0, - final GEvaOut=0, - final GEvaIns=0, - final tauSenT=temperatureSensorData.tau, - final transferHeat=true, - final allowFlowReversalEva=allowFlowReversal, - final allowFlowReversalCon=allowFlowReversal, - final tauHeaTraEva=temperatureSensorData.tauHeaTra, - final TAmbEva_nominal=temperatureSensorData.TAmb, - final tauHeaTraCon=temperatureSensorData.tauHeaTra, - final TAmbCon_nominal=temperatureSensorData.TAmb, - final pCon_start=p_start, - final TCon_start=T_start, - final pEva_start=Medium_eva.p_default, - final TEva_start=Medium_eva.T_default, - final energyDynamics=energyDynamics, - final show_TPort=show_T, - redeclare model PerDataMainHP = PerDataMainHP, - redeclare model PerDataRevHP = - AixLib.DataBase.Chiller.PerformanceData.LookUpTable2D (dataTable= - AixLib.DataBase.Chiller.EN14511.Vitocal200AWO201())) - annotation (Placement( - transformation( - extent={{22,-27},{-22,27}}, - rotation=270, - origin={-42,13}))); - - IBPSA.Fluid.Sources.Boundary_ph bou_sinkAir(final nPorts=1, redeclare package - Medium = Medium_eva) annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={-90,-10}))); - IBPSA.Fluid.Sources.MassFlowSource_T bou_air( - final m_flow=heatPumpParameters.mEva_flow_nominal, - final use_T_in=true, - redeclare package Medium = Medium_eva, - final use_m_flow_in=false, - final nPorts=1) - annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); - - Modelica.Blocks.Logical.Switch switch2 annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-130,50}))); - Modelica.Blocks.Sources.BooleanConstant AirOrSoil(final k=use_airSource) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-170,90}))); - - Utilities.KPIs.EnergyKPICalculator KPIWel(use_inpCon=true) - annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); - - IBPSA.Fluid.Movers.SpeedControlled_y pump( - redeclare final package Medium = Medium, - final energyDynamics=energyDynamics, - final p_start=p_start, - final T_start=T_start, - final allowFlowReversal=allowFlowReversal, - final show_T=show_T, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData - per( - final speed_rpm_nominal=pumpData.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal[1], - final dp_nominal=dpDem_nominal[1] + dp_nominal[1], - final rho=rho, - final V_flowCurve=pumpData.V_flowCurve, - final dpCurve=pumpData.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final addPowerToMedium=pumpData.addPowerToMedium, - final tau=pumpData.tau, - final use_inputFilter=pumpData.use_inputFilter, - final riseTime=pumpData.riseTimeInpFilter, - final init=Modelica.Blocks.Types.Init.InitialOutput, - final y_start=1) annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=180, - origin={10,-70}))); - - Modelica.Blocks.Sources.Constant TSoil(k=TSoilConst) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-170,50}))); - - Utilities.KPIs.EnergyKPICalculator KPIQHP(use_inpCon=false, y=heatPump.con.QFlow_in) - annotation (Placement(transformation(extent={{-140,-112},{-120,-92}}))); - - IBPSA.Fluid.Sources.Boundary_pT bouPum( - redeclare package Medium = Medium, - final p=p_start, - final T=T_start, - final nPorts=1) "Pressure boundary for pump" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={50,-86}))); - - IBPSA.Fluid.Sensors.TemperatureTwoPort senTGenOut( - redeclare final package Medium = Medium, - final allowFlowReversal=allowFlowReversal, - m_flow_nominal=m_flow_nominal[1], - tau=temperatureSensorData.tau, - initType=temperatureSensorData.initType, - T_start=T_start, - final transferHeat=temperatureSensorData.transferHeat, - TAmb=temperatureSensorData.TAmb, - tauHeaTra=temperatureSensorData.tauHeaTra) - "Temperature at supply (generation outlet)" - annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={70,80}))); - BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={100,-78}))); - Modelica.Blocks.Math.MultiSum multiSum(nu=2) annotation (Placement( - transformation( - extent={{-6,-6},{6,6}}, - rotation=180, - origin={130,-82}))); - Modelica.Blocks.Sources.BooleanExpression booExpHeaPumIsOn(y=heatPump.greaterThreshold.y) - annotation (Placement(transformation(extent={{-180,-20},{-160,0}}))); - Modelica.Blocks.Sources.RealExpression reaExpPEleHeaPum(y=heatPump.innerCycle.Pel) - annotation (Placement(transformation(extent={{-180,-80},{-160,-60}}))); - Modelica.Blocks.Sources.Constant conIceFac(final k=1) annotation (Placement( - transformation( - extent={{-11,-11},{11,11}}, - rotation=0, - origin={-169,11}))); - Modelica.Blocks.Sources.RealExpression reaExpTHeaPumOut(y=heatPump.senT_b1.T) - annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); - Modelica.Blocks.Sources.RealExpression reaExpTHeaPumIn(y=heatPump.senT_a1.T) - annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); - Modelica.Blocks.Sources.BooleanConstant conNotRev(final k=true) annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-170,-38}))); - Modelica.Blocks.Sources.RealExpression reaExpTEvaIn(y=heatPump.senT_a2.T) - annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); - - - - AixLib.Fluid.BoilerCHP.BoilerNoControl boiNoCtrl( - redeclare package Medium = AixLib.Media.Water, - final allowFlowReversal=true, - final m_flow_nominal=m_flow_nominal[1], - final m_flow_small=1E-4*abs(m_flow_nominal[1]), - final show_T=show_T, - final initType=Modelica.Blocks.Types.Init.NoInit, - final transferHeat=false, - final rho_default=rho, - final p_start=p_start, - final T_start=T_start, - final etaLoadBased= boiNoCtrl.paramBoiler.eta, - final G=0.003*Q_nom/50, - final C=1.5*Q_nom, - final Q_nom=boiNoCtrl.paramBoiler.Q_nom, - final V=boiNoCtrl.paramBoiler.volume, - final etaTempBased=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99], - final paramBoiler=AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_15kW()) - annotation (Placement(transformation(extent={{10,-2},{48,36}}))); - - - - - - Distribution.Components.Valves.ThreeWayValveWithFlowReturn - threeWayValveWithFlowReturn( + "Parallel connection of heat pump and gas boiler" + extends BaseClasses.PartialHeatPumpAndGasBoiler; + Distribution.Components.Valves.ThreeWayValveWithFlowReturn thrWayVal( redeclare package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, @@ -265,196 +12,34 @@ model HeatPumpAndGasBoilerParallel final C_nominal=C_nominal, final mSenFac=mSenFac, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parameters=threeWayValveParameters) - annotation (Placement(transformation(extent={{-20,-88},{-46,-62}}))); + parameters=parThrWayVal) + "Three-way-valve to either run heat pump or gas boiler" + annotation (Placement(transformation(extent={{40,20},{20,0}}))); replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve - threeWayValveParameters(from_dp=true) constrainedby + parThrWayVal(from_dp=true) constrainedby BESMod.Systems.RecordsCollection.Valves.ThreeWayValve( - final dp_nominal={heatPumpParameters.dpCon_nominal,boiNoCtrl.dp_nominal}, + final dp_nominal={parHeaPum.dpCon_nominal,boi.dp_nominal}, final m_flow_nominal=2*m_flow_nominal[1], final fraK=1, - use_inputFilter=false) annotation (Placement(transformation(extent={{-242,-70}, - {-222,-50}})), choicesAllMatching=true); - - - Utilities.KPIs.EnergyKPICalculator KPIBoi(use_inpCon=true) - annotation (Placement(transformation(extent={{-140,-142},{-120,-122}}))); + use_inputFilter=false) "Parameters for three-way-valve" annotation (Placement( + transformation(extent={{64,4},{78,18}})), choicesAllMatching=true); equation - - connect(bou_air.ports[1], heatPump.port_a2) annotation (Line( - points={{-80,50},{-74,50},{-74,42},{-55.5,42},{-55.5,35}}, - color={0,127,255})); - connect(heatPump.port_b2, bou_sinkAir.ports[1]) annotation (Line( - points={{-55.5,-9},{-56,-9},{-56,-10},{-80,-10}}, - color={0,127,255})); - connect(bou_air.T_in, switch2.y) - annotation (Line(points={{-102,54},{-108,54},{-108,50},{-119,50}}, - color={0,0,127})); - connect(switch2.u2, AirOrSoil.y) - annotation (Line(points={{-142,50},{-152,50},{-152,90},{-159,90}}, - color={255,0,255})); - - connect(TSoil.y, switch2.u3) annotation (Line(points={{-159,50},{-156,50},{-156, - 42},{-142,42}}, color={0,0,127})); - connect(bouPum.ports[1], pump.port_a) - annotation (Line(points={{50,-76},{50,-70},{20,-70}}, color={0,127,255})); - connect(senTGenOut.T, sigBusGen.THeaRodMea) annotation (Line(points={{70,91},{ - 70,96},{26,96},{26,74},{2,74},{2,98}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); - - connect(realToElecCon.internalElectricalPin, internalElectricalPin) - annotation (Line( - points={{89.8,-78.2},{72,-78.2},{72,-100}}, - color={0,0,0}, - thickness=1)); - connect(multiSum.y, realToElecCon.PEleLoa) - annotation (Line(points={{122.98,-82},{112,-82}}, color={0,0,127})); - if use_heaRod then - connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, - -84.1},{144,-84.1},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, - color={0,0,127}), - Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-79.9},{144, - -79.9},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, - color={0,0,127})); - else - connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-79.9},{144, - -79.9},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, - color={0,0,127})); - connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, - -84.1},{144,-84.1},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, - color={0,0,127}), - Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - end if; - connect(switch2.u1, weaBus.TDryBul) annotation (Line(points={{-142,58},{-144,58}, - {-144,80},{-101,80}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(pump.y, sigBusGen.uPump) annotation (Line(points={{10,-58},{24,-58},{24, - -22},{2,-22},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(KPIQHP.KPI, outBusGen.QHP_flow) annotation (Line(points={{-117.8,-102}, - {0,-102},{0,-100}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(KPIWel.KPI, outBusGen.PEleHP) annotation (Line(points={{-117.8,-70},{-104, - -70},{-104,-102},{0,-102},{0,-100}}, color={135,135, - 135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(reaExpPEleHeaPum.y, KPIWel.u) - annotation (Line(points={{-159,-70},{-141.8,-70}}, color={0,0,127})); - connect(conIceFac.y, heatPump.iceFac_in) annotation (Line(points={{-156.9,11}, - {-106,11},{-106,-3.72},{-72.6,-3.72}}, color={0,0,127})); - connect(heatPump.nSet, sigBusGen.yHeaPumSet) annotation (Line(points={{-37.5,-12.52}, - {-37.5,-26},{2,-26},{2,98}}, color={0,0,127}), Text( + connect(thrWayVal.portDHW_a, boi.port_b) annotation (Line(points={{20,17.6},{8,17.6}, + {8,26},{44,26},{44,50},{40,50}}, color={0,127,255})); + connect(thrWayVal.portDHW_b, boi.port_a) annotation (Line(points={{20,13.6},{20, + 14},{6,14},{6,50},{20,50}}, color={0,127,255})); + connect(heatPump.port_b1, thrWayVal.portBui_a) annotation (Line(points={{-30.5,37}, + {-30.5,42},{-6,42},{-6,6},{20,6}}, color={0,127,255})); + connect(thrWayVal.portGen_b, senTGenOut.port_a) annotation (Line(points={{40,13.6}, + {54,13.6},{54,80},{60,80}}, color={0,127,255})); + connect(pump.port_b, thrWayVal.portGen_a) annotation (Line(points={{1.77636e-15, + -70},{-6,-70},{-6,-34},{50,-34},{50,6},{40,6},{40,5.6}}, color={0,127,255})); + connect(thrWayVal.portBui_b, heatPump.port_a1) annotation (Line(points={{20,2},{ + -6,2},{-6,-7},{-30.5,-7}}, color={0,127,255})); + connect(thrWayVal.uBuf, sigBusGen.uBoiOrHeaPum) annotation (Line(points={{30,-2}, + {30,-16},{2,-16},{2,98}}, color={0,0,127}), Text( string="%second", index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(booExpHeaPumIsOn.y, sigBusGen.heaPumIsOn) annotation (Line(points={{-159, - -10},{-150,-10},{-150,98},{2,98}}, color={255,0,255}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(reaExpTHeaPumIn.y, sigBusGen.THeaPumIn) annotation (Line(points={{-39, - 70},{2,70},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(reaExpTHeaPumOut.y, sigBusGen.THeaPumOut) annotation (Line(points={{-39, - 90},{-28,90},{-28,74},{2,74},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(heatPump.modeSet, conNotRev.y) annotation (Line(points={{-46.5,-12.52}, - {-46.5,-38},{-159,-38}}, color={255,0,255})); - connect(reaExpTEvaIn.y, sigBusGen.THeaPumEvaIn) annotation (Line(points={{-39, - 50},{2,50},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(boiNoCtrl.T_out, sigBusGen.TBoilerOut) annotation (Line(points={{ - 42.68,23.08},{42.68,22},{52,22},{52,72},{2,72},{2,98}}, color={0,0, - 127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(pump.port_b, threeWayValveWithFlowReturn.portGen_a) annotation (Line( - points={{1.77636e-15,-70},{-14,-70},{-14,-69.28},{-20,-69.28}}, color={0, - 127,255})); - connect(threeWayValveWithFlowReturn.portBui_b, heatPump.port_a1) annotation ( - Line(points={{-46,-64.6},{-54,-64.6},{-54,-64},{-60,-64},{-60,-44},{-28.5, - -44},{-28.5,-9}}, color={0,127,255})); - connect(heatPump.port_b1, threeWayValveWithFlowReturn.portBui_a) annotation ( - Line(points={{-28.5,35},{-28.5,46},{-20,46},{-20,-46},{-52,-46},{-52,-69.8}, - {-46,-69.8}}, color={0,127,255})); - connect(threeWayValveWithFlowReturn.portDHW_a, boiNoCtrl.port_b) annotation ( - Line(points={{-46,-84.88},{-56,-84.88},{-56,-86},{-62,-86},{-62,-110},{48, - -110},{48,17}}, color={0,127,255})); - connect(threeWayValveWithFlowReturn.portDHW_b, boiNoCtrl.port_a) annotation ( - Line(points={{-46,-79.68},{-62,-79.68},{-62,-80},{-72,-80},{-72,-120},{-6, - -120},{-6,-44},{10,-44},{10,17}}, color={0,127,255})); - connect(threeWayValveWithFlowReturn.portGen_b, senTGenOut.port_a) annotation ( - Line(points={{-20,-79.68},{2,-79.68},{2,-82},{28,-82},{28,-120},{148,-120}, - {148,52},{38,52},{38,80},{60,80}}, color={0,127,255})); - connect(senTGenOut.port_b, portGen_out[1]) - annotation (Line(points={{80,80},{100,80}}, color={0,127,255})); - connect(pump.port_a, portGen_in[1]) annotation (Line(points={{20,-70},{56,-70}, - {56,-68},{100,-68},{100,-2}}, color={0,127,255})); - connect(sigBusGen.uThrWayValGen, threeWayValveWithFlowReturn.uBuf) - annotation (Line( - points={{2,98},{4,98},{4,-54},{-33,-54},{-33,-59.4}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); - connect(boiNoCtrl.u_rel, sigBusGen.yBoiler) annotation (Line(points={{15.7, - 30.3},{2,30.3},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(boiNoCtrl.thermalPower, KPIBoi.u) annotation (Line(points={{42.68, - 32.96},{178,32.96},{178,-174},{-174,-174},{-174,-132},{-141.8,-132}}, - color={0,0,127})); - connect(KPIBoi.KPI, outBusGen.QBoi_flow) annotation (Line(points={{-117.8, - -132},{0,-132},{0,-100}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - annotation (Line( - points={{-52.775,-6.78},{-52.775,33.61},{-56,33.61},{-56,74}}, - color={255,204,51}, - thickness=0.5), - Diagram(coordinateSystem(extent={{-180,-140},{100,100}}))); end HeatPumpAndGasBoilerParallel; diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerSerial.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerSerial.mo index b06a23b5..244d1401 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerSerial.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerSerial.mo @@ -1,413 +1,16 @@ within BESMod.Systems.Hydraulical.Generation; model HeatPumpAndGasBoilerSerial "serial arrangement of heatpump and boiler" - extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialGeneration( - final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, - final dTLoss_nominal=fill(0, nParallelDem), - dTTra_nominal={if TDem_nominal[i] > 273.15 + 55 then 10 elseif TDem_nominal[ - i] > 44.9 + 273.15 then 8 else 5 for i in 1:nParallelDem}, - dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal}, - nParallelDem=1); + extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialHeatPumpAndGasBoiler; - parameter Modelica.Units.SI.Power Q_nom=boiNoCtrl.paramBoiler.Q_nom - "Nominal heating power"; - - parameter Modelica.Units.SI.Volume V=boiNoCtrl.paramBoiler.volume "Volume"; - - parameter Boolean use_airSource=true - "Turn false to use water as temperature source." - annotation(Dialog(group="Component choices")); - - parameter Boolean use_heaRod=true "=false to disable the heating rod" - annotation(Dialog(group="Component choices")); - replaceable model PerDataMainHP = - AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D - constrainedby - AixLib.DataBase.HeatPump.PerformanceData.BaseClasses.PartialPerformanceData - annotation (Dialog(group="Component data"), __Dymola_choicesAllMatching=true); - parameter Modelica.Media.Interfaces.Types.Temperature TSoilConst=273.15 + 10 - "Constant soil temperature for ground source heat pumps" - annotation(Dialog(group="Component choices", enable=use_airSource)); - - replaceable package Medium_eva = Modelica.Media.Interfaces.PartialMedium constrainedby - Modelica.Media.Interfaces.PartialMedium annotation (Dialog(group="Component choices"), - choices( - choice(redeclare package Medium = IBPSA.Media.Air "Moist air"), - choice(redeclare package Medium = IBPSA.Media.Water "Water"), - choice(redeclare package Medium = - IBPSA.Media.Antifreeze.PropyleneGlycolWater ( - property_T=293.15, - X_a=0.40) - "Propylene glycol water, 40% mass fraction"))); - replaceable parameter - BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition - heatPumpParameters constrainedby - BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition( - final QGen_flow_nominal=Q_flow_nominal[1], - final TOda_nominal=TOda_nominal) - annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement( - transformation(extent={{-98,14},{-82,28}}))); - replaceable parameter - BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatingRodBaseDataDefinition - heatingRodParameters annotation (Dialog(group="Component data"), - choicesAllMatching=true, Placement( - transformation(extent={{64,44},{76,56}}))); - - replaceable parameter - BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpData annotation (Dialog(group="Component data"), - choicesAllMatching=true, Placement(transformation(extent={{42,-56}, - {56,-44}}))); - replaceable parameter - BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition - temperatureSensorData - annotation (Dialog(group="Component data"), choicesAllMatching=true, - Placement(transformation(extent={{60,10},{80,30}}))); - - AixLib.Fluid.HeatPumps.HeatPump heatPump( - redeclare package Medium_con = Medium, - redeclare package Medium_eva = Medium_eva, - final use_rev=true, - final use_autoCalc=false, - final Q_useNominal=0, - final scalingFactor=heatPumpParameters.scalingFactor, - final use_refIne=heatPumpParameters.use_refIne, - final refIneFre_constant=heatPumpParameters.refIneFre_constant, - final nthOrder=1, - final useBusConnectorOnly=false, - final mFlow_conNominal=m_flow_nominal[1], - final VCon=heatPumpParameters.VCon, - final dpCon_nominal=heatPumpParameters.dpCon_nominal, - final use_conCap=false, - final CCon=0, - final GConOut=0, - final GConIns=0, - final mFlow_evaNominal=heatPumpParameters.mEva_flow_nominal, - final VEva=heatPumpParameters.VEva, - final dpEva_nominal=heatPumpParameters.dpEva_nominal, - final use_evaCap=false, - final CEva=0, - final GEvaOut=0, - final GEvaIns=0, - final tauSenT=temperatureSensorData.tau, - final transferHeat=true, - final allowFlowReversalEva=allowFlowReversal, - final allowFlowReversalCon=allowFlowReversal, - final tauHeaTraEva=temperatureSensorData.tauHeaTra, - final TAmbEva_nominal=temperatureSensorData.TAmb, - final tauHeaTraCon=temperatureSensorData.tauHeaTra, - final TAmbCon_nominal=temperatureSensorData.TAmb, - final pCon_start=p_start, - final TCon_start=T_start, - final pEva_start=Medium_eva.p_default, - final TEva_start=Medium_eva.T_default, - final energyDynamics=energyDynamics, - final show_TPort=show_T, - redeclare model PerDataMainHP = PerDataMainHP, - redeclare model PerDataRevHP = - AixLib.DataBase.Chiller.PerformanceData.LookUpTable2D (dataTable= - AixLib.DataBase.Chiller.EN14511.Vitocal200AWO201())) - annotation (Placement( - transformation( - extent={{22,-27},{-22,27}}, - rotation=270, - origin={-44,15}))); - - IBPSA.Fluid.Sources.Boundary_ph bou_sinkAir(final nPorts=1, redeclare package - Medium = Medium_eva) annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={-90,-10}))); - IBPSA.Fluid.Sources.MassFlowSource_T bou_air( - final m_flow=heatPumpParameters.mEva_flow_nominal, - final use_T_in=true, - redeclare package Medium = Medium_eva, - final use_m_flow_in=false, - final nPorts=1) - annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); - - Modelica.Blocks.Logical.Switch switch2 annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-130,50}))); - Modelica.Blocks.Sources.BooleanConstant AirOrSoil(final k=use_airSource) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-170,90}))); - - Utilities.KPIs.EnergyKPICalculator KPIWel(use_inpCon=true) - annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); - - IBPSA.Fluid.Movers.SpeedControlled_y pump( - redeclare final package Medium = Medium, - final energyDynamics=energyDynamics, - final p_start=p_start, - final T_start=T_start, - final allowFlowReversal=allowFlowReversal, - final show_T=show_T, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData - per( - final speed_rpm_nominal=pumpData.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal[1], - final dp_nominal=dpDem_nominal[1] + dp_nominal[1], - final rho=rho, - final V_flowCurve=pumpData.V_flowCurve, - final dpCurve=pumpData.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final addPowerToMedium=pumpData.addPowerToMedium, - final tau=pumpData.tau, - final use_inputFilter=pumpData.use_inputFilter, - final riseTime=pumpData.riseTimeInpFilter, - final init=Modelica.Blocks.Types.Init.InitialOutput, - final y_start=1) annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=180, - origin={10,-70}))); - - Modelica.Blocks.Sources.Constant TSoil(k=TSoilConst) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-170,50}))); - - Utilities.KPIs.EnergyKPICalculator KPIQHP(use_inpCon=false, y=heatPump.con.QFlow_in) - annotation (Placement(transformation(extent={{-140,-112},{-120,-92}}))); - - IBPSA.Fluid.Sources.Boundary_pT bouPum( - redeclare package Medium = Medium, - final p=p_start, - final T=T_start, - final nPorts=1) "Pressure boundary for pump" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={50,-86}))); - - IBPSA.Fluid.Sensors.TemperatureTwoPort senTGenOut( - redeclare final package Medium = Medium, - final allowFlowReversal=allowFlowReversal, - m_flow_nominal=m_flow_nominal[1], - tau=temperatureSensorData.tau, - initType=temperatureSensorData.initType, - T_start=T_start, - final transferHeat=temperatureSensorData.transferHeat, - TAmb=temperatureSensorData.TAmb, - tauHeaTra=temperatureSensorData.tauHeaTra) - "Temperature at supply (generation outlet)" - annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={70,80}))); - BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={100,-78}))); - Modelica.Blocks.Math.MultiSum multiSum(nu=2) annotation (Placement( - transformation( - extent={{-6,-6},{6,6}}, - rotation=180, - origin={130,-82}))); - Modelica.Blocks.Sources.BooleanExpression booExpHeaPumIsOn(y=heatPump.greaterThreshold.y) - annotation (Placement(transformation(extent={{-180,-20},{-160,0}}))); - Modelica.Blocks.Sources.RealExpression reaExpPEleHeaPum(y=heatPump.innerCycle.Pel) - annotation (Placement(transformation(extent={{-180,-80},{-160,-60}}))); - Modelica.Blocks.Sources.Constant conIceFac(final k=1) annotation (Placement( - transformation( - extent={{-11,-11},{11,11}}, - rotation=0, - origin={-169,11}))); - Modelica.Blocks.Sources.RealExpression reaExpTHeaPumOut(y=heatPump.senT_b1.T) - annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); - Modelica.Blocks.Sources.RealExpression reaExpTHeaPumIn(y=heatPump.senT_a1.T) - annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); - Modelica.Blocks.Sources.BooleanConstant conNotRev(final k=true) annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-170,-38}))); - Modelica.Blocks.Sources.RealExpression reaExpTEvaIn(y=heatPump.senT_a2.T) - annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); - AixLib.Fluid.BoilerCHP.BoilerNoControl boiNoCtrl( - redeclare package Medium = AixLib.Media.Water, - final allowFlowReversal=true, - final m_flow_nominal=m_flow_nominal[1], - final m_flow_small=1E-4*abs(m_flow_nominal[1]), - final show_T=show_T, - final initType=Modelica.Blocks.Types.Init.NoInit, - final transferHeat=false, - final rho_default=rho, - final p_start=p_start, - final T_start=T_start, - final etaLoadBased= boiNoCtrl.paramBoiler.eta, - final G=0.003*Q_nom/50, - final C=1.5*Q_nom, - final Q_nom=boiNoCtrl.paramBoiler.Q_nom, - final V=boiNoCtrl.paramBoiler.volume, - final etaTempBased=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99], - final paramBoiler=AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_15kW()) - annotation (Placement(transformation(extent={{8,34},{46,72}}))); - Utilities.KPIs.EnergyKPICalculator KPIBoi(use_inpCon=true) - annotation (Placement(transformation(extent={{-136,-138},{-116,-118}}))); -protected - parameter Modelica.Units.SI.PressureDifference dpHeaRod_nominal=if use_heaRod - then heatingRodParameters.dp_nominal else 0; equation - connect(bou_air.ports[1], heatPump.port_a2) annotation (Line( - points={{-80,50},{-74,50},{-74,42},{-57.5,42},{-57.5,37}}, - color={0,127,255})); - connect(heatPump.port_b2, bou_sinkAir.ports[1]) annotation (Line( - points={{-57.5,-7},{-56,-7},{-56,-10},{-80,-10}}, - color={0,127,255})); - connect(bou_air.T_in, switch2.y) - annotation (Line(points={{-102,54},{-108,54},{-108,50},{-119,50}}, - color={0,0,127})); - connect(switch2.u2, AirOrSoil.y) - annotation (Line(points={{-142,50},{-152,50},{-152,90},{-159,90}}, - color={255,0,255})); - connect(pump.port_a, portGen_in[1]) annotation (Line( - points={{20,-70},{100,-70},{100,-2}}, - color={0,127,255})); - - connect(pump.port_b, heatPump.port_a1) annotation (Line( - points={{1.77636e-15,-70},{-30.5,-70},{-30.5,-7}}, - color={0,127,255})); - connect(TSoil.y, switch2.u3) annotation (Line(points={{-159,50},{-156,50},{-156, - 42},{-142,42}}, color={0,0,127})); - connect(bouPum.ports[1], pump.port_a) - annotation (Line(points={{50,-76},{50,-70},{20,-70}}, color={0,127,255})); - connect(senTGenOut.T, sigBusGen.THeaRodMea) annotation (Line(points={{70,91},{ - 70,96},{26,96},{26,74},{2,74},{2,98}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); - connect(senTGenOut.port_b, portGen_out[1]) - annotation (Line(points={{80,80},{100,80}}, color={0,127,255})); - - connect(realToElecCon.internalElectricalPin, internalElectricalPin) - annotation (Line( - points={{89.8,-78.2},{72,-78.2},{72,-100}}, - color={0,0,0}, - thickness=1)); - connect(multiSum.y, realToElecCon.PEleLoa) - annotation (Line(points={{122.98,-82},{112,-82}}, color={0,0,127})); - if use_heaRod then - connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, - -84.1},{144,-84.1},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, - color={0,0,127}), - Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-79.9},{144, - -79.9},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, - color={0,0,127})); - else - connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-79.9},{144, - -79.9},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, - color={0,0,127})); - connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, - -84.1},{144,-84.1},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, - color={0,0,127}), - Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - end if; - connect(switch2.u1, weaBus.TDryBul) annotation (Line(points={{-142,58},{-144,58}, - {-144,80},{-101,80}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(pump.y, sigBusGen.uPump) annotation (Line(points={{10,-58},{24,-58},{24, - -22},{2,-22},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(KPIQHP.KPI, outBusGen.QHP_flow) annotation (Line(points={{-117.8,-102}, - {0,-102},{0,-100}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(KPIWel.KPI, outBusGen.PEleHP) annotation (Line(points={{-117.8,-70},{-104, - -70},{-104,-102},{0,-102},{0,-100}}, color={135,135, - 135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(reaExpPEleHeaPum.y, KPIWel.u) - annotation (Line(points={{-159,-70},{-141.8,-70}}, color={0,0,127})); - connect(conIceFac.y, heatPump.iceFac_in) annotation (Line(points={{-156.9,11}, - {-106,11},{-106,-1.72},{-74.6,-1.72}}, color={0,0,127})); - connect(heatPump.nSet, sigBusGen.yHeaPumSet) annotation (Line(points={{-39.5,-10.52}, - {-39.5,-26},{2,-26},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - connect(booExpHeaPumIsOn.y, sigBusGen.heaPumIsOn) annotation (Line(points={{-159, - -10},{-142,-10},{-142,98},{2,98}}, color={255,0,255}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(reaExpTHeaPumIn.y, sigBusGen.THeaPumIn) annotation (Line(points={{-39, - 70},{2,70},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(reaExpTHeaPumOut.y, sigBusGen.THeaPumOut) annotation (Line(points={{-39, - 90},{-28,90},{-28,74},{2,74},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(heatPump.modeSet, conNotRev.y) annotation (Line(points={{-48.5,-10.52}, - {-48.5,-38},{-159,-38}}, color={255,0,255})); - connect(reaExpTEvaIn.y, sigBusGen.THeaPumEvaIn) annotation (Line(points={{-39, - 50},{2,50},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(heatPump.port_b1, boiNoCtrl.port_a) annotation (Line(points={{-30.5, - 37},{-30.5,53},{8,53}}, color={0,127,255})); - connect(boiNoCtrl.port_b, senTGenOut.port_a) - annotation (Line(points={{46,53},{46,80},{60,80}}, color={0,127,255})); - connect(boiNoCtrl.T_out, sigBusGen.TBoilerOut) annotation (Line(points={{ - 40.68,59.08},{56,59.08},{56,98},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(boiNoCtrl.thermalPower, KPIBoi.u) annotation (Line(points={{40.68, - 68.96},{196,68.96},{196,-220},{-210,-220},{-210,-128},{-137.8,-128}}, - color={0,0,127})); - connect(KPIBoi.KPI, outBusGen.QBoi_flow) annotation (Line(points={{-113.8, - -128},{0,-128},{0,-100}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(boiNoCtrl.u_rel, sigBusGen.yBoiler) annotation (Line(points={{13.7, - 66.3},{2,66.3},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); + connect(boi.port_a, heatPump.port_b1) annotation (Line(points={{20,50},{14,50}, + {14,37},{-30.5,37}}, color={0,127,255})); + connect(boi.port_b, senTGenOut.port_a) annotation (Line(points={{40,50},{54,50}, + {54,80},{60,80}}, color={0,127,255})); + connect(pump.port_b, heatPump.port_a1) annotation (Line(points={{0,-70},{-30.5, + -70},{-30.5,-7}}, color={0,127,255})); annotation (Line( points={{-52.775,-6.78},{-52.775,33.61},{-56,33.61},{-56,74}}, color={255,204,51}, diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index 9e2c0100..0abad5e8 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -1,460 +1,93 @@ within BESMod.Systems.Hydraulical.Generation; -model HeatPumpAndHeatingRod "Bivalent monoenergetic heat pump" - extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialGeneration( - final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, - final dTLoss_nominal=fill(0, nParallelDem), - dTTra_nominal={if TDem_nominal[i] > 273.15 + 55 then 10 elseif TDem_nominal[ - i] > 44.9 + 273.15 then 8 else 5 for i in 1:nParallelDem}, - dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal}, - nParallelDem=1); - - parameter Boolean use_airSource=true - "Turn false to use water as temperature source." - annotation(Dialog(group="Component choices")); - +model HeatPumpAndHeatingRod "Heat pump with heating rod in series" + extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialHeatPump( + dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal}, + multiSum(nu=3)); parameter Boolean use_heaRod=true "=false to disable the heating rod" annotation(Dialog(group="Component choices")); - replaceable model PerDataMainHP = - AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D - constrainedby - AixLib.DataBase.HeatPump.PerformanceData.BaseClasses.PartialPerformanceData - annotation (Dialog(group="Component data"), __Dymola_choicesAllMatching=true); - parameter Modelica.Media.Interfaces.Types.Temperature TSoilConst=273.15 + 10 - "Constant soil temperature for ground source heat pumps" - annotation(Dialog(group="Component choices", enable=use_airSource)); - - replaceable package Medium_eva = Modelica.Media.Interfaces.PartialMedium constrainedby - Modelica.Media.Interfaces.PartialMedium annotation (Dialog(group="Component choices"), - choices( - choice(redeclare package Medium = IBPSA.Media.Air "Moist air"), - choice(redeclare package Medium = IBPSA.Media.Water "Water"), - choice(redeclare package Medium = - IBPSA.Media.Antifreeze.PropyleneGlycolWater ( - property_T=293.15, - X_a=0.40) - "Propylene glycol water, 40% mass fraction"))); - replaceable parameter - BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition - heatPumpParameters constrainedby - BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition( - final QGen_flow_nominal=Q_flow_nominal[1], - final TOda_nominal=TOda_nominal) - annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement( - transformation(extent={{-98,14},{-82,28}}))); - replaceable parameter - BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatingRodBaseDataDefinition - heatingRodParameters annotation (Dialog(group="Component data"), - choicesAllMatching=true, Placement( - transformation(extent={{64,44},{76,56}}))); - - replaceable parameter - BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpData annotation (Dialog(group="Component data"), - choicesAllMatching=true, Placement(transformation(extent={{42,-56}, - {56,-44}}))); - replaceable parameter - BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition - temperatureSensorData - annotation (Dialog(group="Component data"), choicesAllMatching=true, - Placement(transformation(extent={{60,10},{80,30}}))); - - AixLib.Fluid.Interfaces.PassThroughMedium pasThrMedHeaRod(redeclare package - Medium = Medium, allowFlowReversal=allowFlowReversal) if not use_heaRod - "Pass through if heating rod is not used" - annotation (Placement(transformation(extent={{20,20},{40,40}}))); - - AixLib.Fluid.HeatPumps.HeatPump heatPump( - redeclare package Medium_con = Medium, - redeclare package Medium_eva = Medium_eva, - final use_rev=true, - final use_autoCalc=false, - final Q_useNominal=0, - final scalingFactor=heatPumpParameters.scalingFactor, - final use_refIne=heatPumpParameters.use_refIne, - final refIneFre_constant=heatPumpParameters.refIneFre_constant, - final nthOrder=1, - final useBusConnectorOnly=false, - final mFlow_conNominal=m_flow_nominal[1], - final VCon=heatPumpParameters.VCon, - final dpCon_nominal=heatPumpParameters.dpCon_nominal, - final use_conCap=false, - final CCon=0, - final GConOut=0, - final GConIns=0, - final mFlow_evaNominal=heatPumpParameters.mEva_flow_nominal, - final VEva=heatPumpParameters.VEva, - final dpEva_nominal=heatPumpParameters.dpEva_nominal, - final use_evaCap=false, - final CEva=0, - final GEvaOut=0, - final GEvaIns=0, - final tauSenT=temperatureSensorData.tau, - final transferHeat=temperatureSensorData.transferHeat, - final allowFlowReversalEva=allowFlowReversal, - final allowFlowReversalCon=allowFlowReversal, - final tauHeaTraEva=temperatureSensorData.tauHeaTra, - final TAmbEva_nominal=temperatureSensorData.TAmb, - final tauHeaTraCon=temperatureSensorData.tauHeaTra, - final TAmbCon_nominal=temperatureSensorData.TAmb, - final pCon_start=p_start, - final TCon_start=T_start, - final pEva_start=Medium_eva.p_default, - final TEva_start=Medium_eva.T_default, - final energyDynamics=energyDynamics, - final show_TPort=show_T, - redeclare model PerDataMainHP = PerDataMainHP, - redeclare model PerDataRevHP = - AixLib.DataBase.Chiller.PerformanceData.LookUpTable2D (dataTable= - AixLib.DataBase.Chiller.EN14511.Vitocal200AWO201())) - annotation (Placement( - transformation( - extent={{22,-27},{-22,27}}, - rotation=270, - origin={-44,15}))); - - IBPSA.Fluid.Sources.Boundary_ph bou_sinkAir(final nPorts=1, redeclare package - Medium = Medium_eva) annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=180, - origin={-90,-10}))); - IBPSA.Fluid.Sources.MassFlowSource_T bou_air( - final m_flow=heatPumpParameters.mEva_flow_nominal, - final use_T_in=true, - redeclare package Medium = Medium_eva, - final use_m_flow_in=false, - final nPorts=1) - annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); - - Modelica.Blocks.Logical.Switch switch2 annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-130,50}))); - Modelica.Blocks.Sources.BooleanConstant AirOrSoil(final k=use_airSource) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-170,90}))); - - Utilities.KPIs.EnergyKPICalculator KPIWel(use_inpCon=true) - annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); - Utilities.KPIs.EnergyKPICalculator KPIWHRel(use_inpCon=true) if use_heaRod - annotation (Placement(transformation(extent={{-140,-48},{-120,-28}}))); - - IBPSA.Fluid.Movers.SpeedControlled_y pump( - redeclare final package Medium = Medium, - final energyDynamics=energyDynamics, - final p_start=p_start, - final T_start=T_start, - final allowFlowReversal=allowFlowReversal, - final show_T=show_T, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData - per( - final speed_rpm_nominal=pumpData.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal[1], - final dp_nominal=dpDem_nominal[1] + dp_nominal[1], - final rho=rho, - final V_flowCurve=pumpData.V_flowCurve, - final dpCurve=pumpData.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final addPowerToMedium=pumpData.addPowerToMedium, - final tau=pumpData.tau, - final use_inputFilter=pumpData.use_inputFilter, - final riseTime=pumpData.riseTimeInpFilter, - final init=Modelica.Blocks.Types.Init.InitialOutput, - final y_start=1) annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=180, - origin={10,-70}))); AixLib.Fluid.HeatExchangers.HeatingRod hea( redeclare package Medium = Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=m_flow_nominal[1], final m_flow_small=1E-4*abs(m_flow_nominal[1]), final show_T=show_T, - final dp_nominal=heatingRodParameters.dp_nominal, + final dp_nominal=parHeaRod.dp_nominal, final tau=30, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, - final Q_flow_nominal=heatPumpParameters.QSec_flow_nominal, - final V=heatingRodParameters.V_hr, - final eta=heatingRodParameters.eta_hr, + final Q_flow_nominal=parHeaPum.QSec_flow_nominal, + final V=parHeaRod.V_hr, + final eta=parHeaRod.eta_hr, use_countNumSwi=false) if use_heaRod annotation (Placement(transformation(extent={{20,40},{40,60}}))); - - Modelica.Blocks.Sources.Constant TSoil(k=TSoilConst) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-170,50}))); - - Utilities.KPIs.EnergyKPICalculator KPIQHP(use_inpCon=false, y=heatPump.con.QFlow_in) - annotation (Placement(transformation(extent={{-140,-112},{-120,-92}}))); - Utilities.KPIs.EnergyKPICalculator KPIQHR(use_inpCon=false, y=hea.vol.heatPort.Q_flow) if - use_heaRod - annotation (Placement(transformation(extent={{-140,-140},{-120,-120}}))); - - IBPSA.Fluid.Sources.Boundary_pT bouPum( - redeclare package Medium = Medium, - final p=p_start, - final T=T_start, - final nPorts=1) "Pressure boundary for pump" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={50,-86}))); - - IBPSA.Fluid.Sensors.TemperatureTwoPort senTGenOut( - redeclare final package Medium = Medium, - final allowFlowReversal=allowFlowReversal, - m_flow_nominal=m_flow_nominal[1], - tau=temperatureSensorData.tau, - initType=temperatureSensorData.initType, - T_start=T_start, - final transferHeat=temperatureSensorData.transferHeat, - TAmb=temperatureSensorData.TAmb, - tauHeaTra=temperatureSensorData.tauHeaTra) - "Temperature at supply (generation outlet)" - annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={70,80}))); - BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={100,-78}))); - Modelica.Blocks.Math.MultiSum multiSum(nu=if use_heaRod then 3 else 2) annotation (Placement( - transformation( - extent={{-6,-6},{6,6}}, - rotation=180, - origin={130,-82}))); + AixLib.Fluid.Interfaces.PassThroughMedium pasThrMedHeaRod(redeclare package + Medium = Medium, allowFlowReversal=allowFlowReversal) if not use_heaRod + "Pass through if heating rod is not used" + annotation (Placement(transformation(extent={{20,20},{40,40}}))); + replaceable parameter RecordsCollection.HeatingRodBaseDataDefinition parHeaRod + "Heating rod parameters" annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{24,64},{36,76}}))); Utilities.KPIs.DeviceKPICalculator KPIHeaRod( - use_reaInp=false, - calc_singleOnTime=true, - calc_totalOnTime=true, - calc_numSwi=true) - annotation (Placement(transformation(extent={{-140,-20},{-120,0}}))); - Utilities.KPIs.DeviceKPICalculator KPIHeaRod1( use_reaInp=true, calc_singleOnTime=true, calc_totalOnTime=true, - calc_numSwi=true) - annotation (Placement(transformation(extent={{-100,-120},{-80,-100}}))); - Modelica.Blocks.Sources.BooleanExpression booExpHeaPumIsOn(y=heatPump.greaterThreshold.y) - annotation (Placement(transformation(extent={{-180,-20},{-160,0}}))); - Modelica.Blocks.Sources.RealExpression reaExpPEleHeaPum(y=heatPump.innerCycle.Pel) - annotation (Placement(transformation(extent={{-180,-80},{-160,-60}}))); - Modelica.Blocks.Sources.Constant conIceFac(final k=1) annotation (Placement( - transformation( - extent={{-11,-11},{11,11}}, - rotation=0, - origin={-169,11}))); - Modelica.Blocks.Sources.RealExpression reaExpTHeaPumOut(y=heatPump.senT_b1.T) - annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); - Modelica.Blocks.Sources.RealExpression reaExpTHeaPumIn(y=heatPump.senT_a1.T) - annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); - Modelica.Blocks.Sources.BooleanConstant conNotRev(final k=true) annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-170,-38}))); - Modelica.Blocks.Sources.RealExpression reaExpTEvaIn(y=heatPump.senT_a2.T) - annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + calc_numSwi=true) "Heating rod KPIs" + annotation (Placement(transformation(extent={{-120,-120},{-100,-100}}))); + Utilities.KPIs.EnergyKPICalculator KPIQHeaRod_flow(use_inpCon=false, y=hea.vol.heatPort.Q_flow) + if use_heaRod "Heating rod heat flow rate" + annotation (Placement(transformation(extent={{-140,-140},{-120,-120}}))); + Utilities.KPIs.EnergyKPICalculator KPIPEleHeaRod(use_inpCon=false, y=hea.Pel) + if use_heaRod "Heating rod heat flow rate" + annotation (Placement(transformation(extent={{-140,-100},{-120,-80}}))); protected parameter Modelica.Units.SI.PressureDifference dpHeaRod_nominal=if use_heaRod - then heatingRodParameters.dp_nominal else 0; + then parHeaRod.dp_nominal else 0; equation - - connect(bou_air.ports[1], heatPump.port_a2) annotation (Line( - points={{-80,50},{-74,50},{-74,42},{-57.5,42},{-57.5,37}}, - color={0,127,255})); - connect(heatPump.port_b2, bou_sinkAir.ports[1]) annotation (Line( - points={{-57.5,-7},{-56,-7},{-56,-10},{-80,-10}}, - color={0,127,255})); - connect(bou_air.T_in, switch2.y) - annotation (Line(points={{-102,54},{-108,54},{-108,50},{-119,50}}, - color={0,0,127})); - connect(switch2.u2, AirOrSoil.y) - annotation (Line(points={{-142,50},{-152,50},{-152,90},{-159,90}}, - color={255,0,255})); - connect(hea.Pel, KPIWHRel.u) annotation (Line(points={{41,56},{40,56},{40,68}, - {0,68},{0,-30},{-74,-30},{-74,-36},{-110,-36},{-110,-24},{-141.8,-24}, - {-141.8,-38}}, color={0,0,127})); - connect(pump.port_a, portGen_in[1]) annotation (Line( - points={{20,-70},{100,-70},{100,-2}}, - color={0,127,255})); - - connect(pasThrMedHeaRod.port_a, heatPump.port_b1) annotation (Line(points={{20, - 30},{10,30},{10,50},{-30,50},{-30,38},{-30.5,38},{-30.5,37}}, color={0, - 127,255})); - connect(pump.port_b, heatPump.port_a1) annotation (Line( - points={{1.77636e-15,-70},{-30.5,-70},{-30.5,-7}}, - color={0,127,255})); - connect(TSoil.y, switch2.u3) annotation (Line(points={{-159,50},{-156,50},{-156, - 42},{-142,42}}, color={0,0,127})); - connect(heatPump.port_b1, hea.port_a) annotation (Line(points={{-30.5,37},{-30.5, - 36},{-30,36},{-30,50},{20,50}}, - color={0,127,255})); - connect(bouPum.ports[1], pump.port_a) - annotation (Line(points={{50,-76},{50,-70},{20,-70}}, color={0,127,255})); - connect(senTGenOut.T, sigBusGen.THeaRodMea) annotation (Line(points={{70,91},{ - 70,96},{26,96},{26,74},{2,74},{2,98}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); - connect(senTGenOut.port_b, portGen_out[1]) - annotation (Line(points={{80,80},{100,80}}, color={0,127,255})); - connect(pasThrMedHeaRod.port_b, senTGenOut.port_a) annotation (Line(points={{40, - 30},{54,30},{54,80},{60,80}}, color={0,127,255})); + connect(heatPump.port_a1, pump.port_b) annotation (Line(points={{-30.5,-7},{ + -30.5,-70},{1.77636e-15,-70}}, color={0,127,255})); + connect(pasThrMedHeaRod.port_b, senTGenOut.port_a) annotation (Line(points={{40,30}, + {54,30},{54,80},{60,80}}, color={0,127,255})); connect(hea.port_b,senTGenOut. port_a) annotation (Line(points={{40,50},{54,50},{54,80},{60,80}}, color={0,127,255})); - - connect(realToElecCon.internalElectricalPin, internalElectricalPin) - annotation (Line( - points={{89.8,-78.2},{72,-78.2},{72,-100}}, - color={0,0,0}, - thickness=1)); - connect(multiSum.y, realToElecCon.PEleLoa) - annotation (Line(points={{122.98,-82},{112,-82}}, color={0,0,127})); - if use_heaRod then - connect(multiSum.u[3], hea.Pel) annotation (Line(points={{136,-82},{94,-82}, - {94,56},{41,56}}, color={0,0,127})); - connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136,-82}, - {144,-82},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, - color={0,0,127}), - Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-82},{144,-82}, - {144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, - color={0,0,127})); - else - connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-82},{144,-82}, - {144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, - color={0,0,127})); - connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136,-82}, - {144,-82},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, - color={0,0,127}), - Text( + connect(pasThrMedHeaRod.port_a, heatPump.port_b1) annotation (Line(points={{20,30}, + {10,30},{10,50},{-30,50},{-30,38},{-30.5,38},{-30.5,37}}, color={0, + 127,255})); + connect(heatPump.port_b1,hea. port_a) annotation (Line(points={{-30.5,37},{-30.5, + 36},{-30,36},{-30,50},{20,50}}, + color={0,127,255})); + connect(KPIHeaPum.KPI, outBusGen.heaRod) annotation (Line(points={{-97.8,-50},{ + -76,-50},{-76,-100},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - end if; - connect(switch2.u1, weaBus.TDryBul) annotation (Line(points={{-142,58},{-144,58}, - {-144,80},{-101,80}}, color={0,0,127}), Text( + connect(hea.u, sigBusGen.uHeaRod) annotation (Line(points={{18,56},{2,56},{2,98}}, + color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(pump.y, sigBusGen.uPump) annotation (Line(points={{10,-58},{24,-58},{24, - -22},{2,-22},{2,98}}, color={0,0,127}), Text( + connect(multiSum.u[3], hea.Pel) annotation (Line(points={{136,-82},{140,-82},{ + 140,56},{41,56}}, color={0,0,127})); + connect(KPIQHeaRod_flow.KPI, outBusGen.QHeaRod_flow) annotation (Line(points={{ + -117.8,-130},{0,-130},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIQHR.KPI, outBusGen.QHR_flow) annotation (Line(points={{-117.8,-130}, - {-106,-130},{-106,-102},{0,-102},{0,-100}}, color={135,135,135}), + connect(hea.Pel, KPIHeaRod.uRea) annotation (Line(points={{41,56},{42,56},{42, + -38},{-10,-38},{-10,-66},{92,-66},{92,-154},{-130,-154},{-130,-110},{ + -122.2,-110}}, color={0,0,127})); + connect(KPIPEleHeaRod.KPI, outBusGen.PEleHeaRod) annotation (Line(points={{ + -117.8,-90},{-68,-90},{-68,-92},{0,-92},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIQHP.KPI, outBusGen.QHP_flow) annotation (Line(points={{-117.8,-102}, - {0,-102},{0,-100}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(KPIWel.KPI, outBusGen.PEleHP) annotation (Line(points={{-117.8,-70},{-104, - -70},{-104,-102},{0,-102},{0,-100}}, color={135,135, - 135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(KPIWHRel.KPI, outBusGen.PEleHR) annotation (Line(points={{-117.8,-38}, - {-106,-38},{-106,-102},{0,-102},{0,-100}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(KPIHeaRod.KPI, outBusGen.heaPum) annotation (Line(points={{-117.8,-10}, - {-106,-10},{-106,-12},{-98,-12},{-98,-100},{0,-100}}, color={135, - 135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(KPIHeaRod1.KPI, outBusGen.heaRod) annotation (Line(points={{-77.8,-110}, - {0,-110},{0,-100}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(KPIHeaRod1.uRea, sigBusGen.uHeaRod) annotation (Line(points={{-102.2,-110}, - {-128,-110},{-128,-112},{-150,-112},{-150,98},{2,98}}, color={0, - 0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(booExpHeaPumIsOn.y, KPIHeaRod.u) - annotation (Line(points={{-159,-10},{-142.2,-10}}, color={255,0,255})); - connect(reaExpPEleHeaPum.y, KPIWel.u) - annotation (Line(points={{-159,-70},{-141.8,-70}}, color={0,0,127})); - connect(conIceFac.y, heatPump.iceFac_in) annotation (Line(points={{-156.9,11}, - {-106,11},{-106,-1.72},{-74.6,-1.72}}, color={0,0,127})); - connect(heatPump.nSet, sigBusGen.yHeaPumSet) annotation (Line(points={{-39.5,-10.52}, - {-39.5,-26},{2,-26},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - connect(booExpHeaPumIsOn.y, sigBusGen.heaPumIsOn) annotation (Line(points={{-159, - -10},{-142,-10},{-142,98},{2,98}}, color={255,0,255}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(reaExpTHeaPumIn.y, sigBusGen.THeaPumIn) annotation (Line(points={{-39, - 70},{2,70},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(reaExpTHeaPumOut.y, sigBusGen.THeaPumOut) annotation (Line(points={{-39, - 90},{-28,90},{-28,74},{2,74},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(heatPump.modeSet, conNotRev.y) annotation (Line(points={{-48.5,-10.52}, - {-48.5,-38},{-159,-38}}, color={255,0,255})); - connect(reaExpTEvaIn.y, sigBusGen.THeaPumEvaIn) annotation (Line(points={{-39, - 50},{2,50},{2,98}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(hea.u, sigBusGen.uHeaRod) annotation (Line(points={{18,56},{2,56},{2,98}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - annotation (Line( - points={{-52.775,-6.78},{-52.775,33.61},{-56,33.61},{-56,74}}, - color={255,204,51}, - thickness=0.5), - Diagram(coordinateSystem(extent={{-180,-140},{100,100}}))); end HeatPumpAndHeatingRod; diff --git a/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo new file mode 100644 index 00000000..19782d05 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo @@ -0,0 +1,168 @@ +within BESMod.Systems.Hydraulical.Generation; +model SimpleSolarThermalWithHeatPump + "Simple solar thermal model with monoenergetic heat pump" + extends HeatPumpAndHeatingRod( + m_flow_nominal={Q_flow_nominal[1]*f_design[1]/dTTra_nominal[1]/4184,parSolThe.m_flow_nominal}, + dTTra_nominal={if TDem_nominal[1] > 273.15 + 55 then 10 elseif TDem_nominal[1] > + 44.9 then 8 else 5,parSolThe.dTMax}, + final nParallelDem=2, + final dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal,dpST_nominal}); + + replaceable parameter + BESMod.Systems.Hydraulical.Generation.RecordsCollection.SolarThermalBaseDataDefinition + parSolThe constrainedby + BESMod.Systems.Hydraulical.Generation.RecordsCollection.SolarThermalBaseDataDefinition( + final c_p=cp) "Parameters for solar thermal system" annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{-86,-62},{-66,-42}}))); + replaceable parameter + BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition parPumSolThe + "Parameter for solar thermal pump" annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{-98,-176},{-84,-162}}))); + AixLib.Fluid.Solar.Thermal.SolarThermal solThe( + redeclare final package Medium = Medium, + final allowFlowReversal=true, + final m_flow_nominal=parSolThe.m_flow_nominal, + final m_flow_small=1E-4*abs(parSolThe.m_flow_nominal), + final show_T=false, + final tau=parTemSen.tau, + final initType=parTemSen.initType, + final T_start=T_start, + final transferHeat=parTemSen.transferHeat, + final TAmb=parTemSen.TAmb, + final tauHeaTra=parTemSen.tauHeaTra, + final p_start=p_start, + final dp_nominal=dpST_nominal, + final rho_default=rho, + final a=solThe.pressureDropCoeff, + final A=parSolThe.A, + final volPip=parSolThe.volPip, + final pressureDropCoeff=parSolThe.pressureDropCoeff, + final Collector=AixLib.DataBase.SolarThermal.SimpleAbsorber( + eta_zero=parSolThe.eta_zero, + c1=parSolThe.c1, + c2=parSolThe.c2), + vol(final energyDynamics=energyDynamics)) "Solar thermal collector" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-30,-148}))); + + IBPSA.Fluid.Movers.SpeedControlled_y pumpSolThe( + redeclare final package Medium = Medium, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final allowFlowReversal=allowFlowReversal, + final show_T=show_T, + redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData + per( + final speed_rpm_nominal=parPumSolThe.speed_rpm_nominal, + final m_flow_nominal=parSolThe.m_flow_nominal, + final dp_nominal=dpST_nominal + dpDem_nominal[2], + final rho=rho, + final V_flowCurve=parPumSolThe.V_flowCurve, + final dpCurve=parPumSolThe.dpCurve), + final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final addPowerToMedium=parPumSolThe.addPowerToMedium, + final tau=parPumSolThe.tau, + final use_inputFilter=parPumSolThe.use_inputFilter, + final riseTime=parPumSolThe.riseTimeInpFilter, + final init=Modelica.Blocks.Types.Init.InitialOutput, + final y_start=1) "Solar thermal pump" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={10,-150}))); + + IBPSA.Fluid.Sources.Boundary_pT bou( + redeclare package Medium = Medium, + final p=p_start, + final T=T_start, nPorts=1) annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={70,-150}))); + Modelica.Blocks.Sources.Constant uPumSolTheAlwOn(k=1) annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={50,-170}))); + + Utilities.KPIs.EnergyKPICalculator KPIWel1(use_inpCon=false, y=-solThe.heater.port.Q_flow) + annotation (Placement(transformation(extent={{-60,-100},{-40,-80}}))); + + Modelica.Blocks.Sources.RealExpression reaExpSolTheTCol(y=solThe.senTCold.T) + annotation (Placement(transformation(extent={{-100,-146},{-80,-126}}))); + Modelica.Blocks.Sources.RealExpression reaExpSolTheTHot(y=solThe.senTHot.T) + annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); + +protected + parameter Modelica.Units.SI.PressureDifference dpST_nominal=parSolThe.m_flow_nominal + ^2*parSolThe.pressureDropCoeff/(rho^2) + "Pressure drop at nominal mass flow rate"; +equation + + connect(pumpSolThe.port_a, bou.ports[1]) annotation (Line(points={{20,-150},{20, + -136},{60,-136},{60,-150}}, color={0,127,255})); + connect(pumpSolThe.port_b, solThe.port_a) annotation (Line(points={{-1.77636e-15, + -150},{-1.77636e-15,-148},{-20,-148}}, color={0,127,255})); + connect(solThe.port_b, portGen_out[2]) annotation (Line(points={{-40,-148},{-202, + -148},{-202,124},{106,124},{106,82},{108,82},{108,82.5},{100,82.5}}, + color={0,127,255})); + connect(portGen_in[2], pumpSolThe.port_a) annotation (Line(points={{100,0.5},{102, + 0.5},{102,-6},{100,-6},{100,-48},{162,-48},{162,-136},{20,-136},{20,-150}}, + color={0,127,255})); + connect(pumpSolThe.P, outBusGen.PelPumpST) annotation (Line(points={{-1,-159},{-6, + -159},{-6,-132},{0,-132},{0,-100}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(reaExpSolTheTCol.y, outBusGen.TSolCol_in) annotation (Line(points={{-79, + -136},{-68,-136},{-68,-124},{0,-124},{0,-100}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(reaExpSolTheTHot.y, outBusGen.TSolCol_out) annotation (Line(points={{ + -79,-90},{-66,-90},{-66,-108},{-16,-108},{-16,-116},{0,-116},{0,-100}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + + connect(solThe.T_air, weaBus.TDryBul) annotation (Line(points={{-24,-158},{-24,-178}, + {-194,-178},{-194,80},{-101,80}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(solThe.Irradiation, weaBus.HGloHor) annotation (Line(points={{-30,-158}, + {-30,-182},{-198,-182},{-198,80},{-101,80}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(KPIWel1.KPI, outBusGen.QSolThe_flow) annotation (Line(points={{-37.8, + -90},{-24,-90},{-24,-88},{0,-88},{0,-100}}, color={135,135,135}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(uPumSolTheAlwOn.y, pumpSolThe.y) + annotation (Line(points={{39,-170},{10,-170},{10,-162}}, color={0,0,127})); + annotation (Diagram(coordinateSystem(extent={{-200,-180},{100,100}}), + graphics={Rectangle( + extent={{100,-180},{-200,-118}}, + lineColor={0,0,0}, + lineThickness=1), Text( + extent={{-188,-122},{-124,-140}}, + textColor={0,0,0}, + textString="Solar Thermal")})); +end SimpleSolarThermalWithHeatPump; diff --git a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPAixLib.mo b/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPAixLib.mo deleted file mode 100644 index 635e71d0..00000000 --- a/BESMod/Systems/Hydraulical/Generation/SolarThermalBivHPAixLib.mo +++ /dev/null @@ -1,168 +0,0 @@ -within BESMod.Systems.Hydraulical.Generation; -model SolarThermalBivHPAixLib - "Solar thermal assistet monoenergetic heat pump with heating rod using AixLibs ST model" - extends HeatPumpAndHeatingRod( - m_flow_nominal={Q_flow_nominal[1]*f_design[1]/dTTra_nominal[1]/4184, - solarThermalParas.m_flow_nominal}, - dTTra_nominal={if TDem_nominal[1] > 273.15 + 55 - then 10 elseif TDem_nominal[1] > 44.9 then 8 else 5,solarThermalParas.dTMax}, - final nParallelDem=2, - final dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal, dpST_nominal}); - replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.SolarThermalBaseDataDefinition - solarThermalParas constrainedby - BESMod.Systems.Hydraulical.Generation.RecordsCollection.SolarThermalBaseDataDefinition(final c_p=cp) - annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement(transformation(extent={{-86,-62}, - {-66,-42}}))); - replaceable parameter - BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpSTData - annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement(transformation(extent={{-98, - -176},{-84,-162}}))); - AixLib.Fluid.Solar.Thermal.SolarThermal solarThermal( - redeclare final package Medium = Medium, - final allowFlowReversal=true, - final m_flow_nominal=solarThermalParas.m_flow_nominal, - final m_flow_small=1E-4*abs(solarThermalParas.m_flow_nominal), - final show_T=false, - final tau=temperatureSensorData.tau, - final initType=temperatureSensorData.initType, - final T_start=T_start, - final transferHeat=temperatureSensorData.transferHeat, - final TAmb=temperatureSensorData.TAmb, - final tauHeaTra=temperatureSensorData.tauHeaTra, - final p_start=p_start, - final dp_nominal=dpST_nominal, - final rho_default=rho, - final a=solarThermal.pressureDropCoeff, - final A=solarThermalParas.A, - final volPip=solarThermalParas.volPip, - final pressureDropCoeff=solarThermalParas.pressureDropCoeff, - final Collector=AixLib.DataBase.SolarThermal.SimpleAbsorber( - eta_zero=solarThermalParas.eta_zero, - c1=solarThermalParas.c1, - c2=solarThermalParas.c2), - vol(final energyDynamics=energyDynamics)) annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={-30,-148}))); - - IBPSA.Fluid.Movers.SpeedControlled_y pumpST( - redeclare final package Medium = Medium, - final energyDynamics=energyDynamics, - final p_start=p_start, - final T_start=T_start, - final allowFlowReversal=allowFlowReversal, - final show_T=show_T, - redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final speed_rpm_nominal=pumpSTData.speed_rpm_nominal, - final m_flow_nominal=solarThermalParas.m_flow_nominal, - final dp_nominal=dpST_nominal+ dpDem_nominal[2], - final rho=rho, - final V_flowCurve=pumpSTData.V_flowCurve, - final dpCurve=pumpSTData.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final addPowerToMedium=pumpSTData.addPowerToMedium, - final tau=pumpSTData.tau, - final use_inputFilter=pumpSTData.use_inputFilter, - final riseTime=pumpSTData.riseTimeInpFilter, - final init=Modelica.Blocks.Types.Init.InitialOutput, - final y_start=1) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={10,-150}))); - - IBPSA.Fluid.Sources.Boundary_pT bou( - redeclare package Medium = Medium, - final p=p_start, - final T=T_start, nPorts=1) annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={70,-150}))); - Modelica.Blocks.Sources.Constant uPumSolTheAlwOn(k=1) annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={50,-170}))); - - Utilities.KPIs.EnergyKPICalculator KPIWel1(use_inpCon=false, y=-solarThermal.heater.port.Q_flow) - annotation (Placement(transformation(extent={{-60,-100},{-40,-80}}))); - - Modelica.Blocks.Sources.RealExpression reaExpSolTheTCol(y=solarThermal.senTCold.T) - annotation (Placement(transformation(extent={{-100,-120},{-80,-100}}))); - Modelica.Blocks.Sources.RealExpression reaExpSolTheTHot(y=solarThermal.senTHot.T) - annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); - -protected - parameter Modelica.Units.SI.PressureDifference dpST_nominal=solarThermalParas.m_flow_nominal - ^2*solarThermalParas.pressureDropCoeff/(rho^2) - "Pressure drop at nominal mass flow rate"; -equation - - connect(pumpST.port_a, bou.ports[1]) annotation (Line(points={{20,-150},{20, - -136},{60,-136},{60,-150}}, - color={0,127,255})); - connect(pumpST.port_b, solarThermal.port_a) annotation (Line(points={{ - -1.77636e-15,-150},{-1.77636e-15,-148},{-20,-148}}, - color={0,127,255})); - connect(solarThermal.port_b, portGen_out[2]) annotation (Line(points={{-40, - -148},{-202,-148},{-202,124},{106,124},{106,82},{108,82},{108,82.5},{ - 100,82.5}}, color={0,127,255})); - connect(portGen_in[2], pumpST.port_a) annotation (Line(points={{100,0.5},{102, - 0.5},{102,-6},{100,-6},{100,-48},{162,-48},{162,-136},{20,-136},{20, - -150}}, color={0,127,255})); - connect(pumpST.P, outBusGen.PelPumpST) annotation (Line(points={{-1,-159},{-6, - -159},{-6,-132},{0,-132},{0,-100}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(reaExpSolTheTCol.y, outBusGen.TSolCol_in) annotation (Line(points={{ - -79,-110},{-62,-110},{-62,-126},{0,-126},{0,-100}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(reaExpSolTheTHot.y, outBusGen.TSolCol_out) annotation (Line(points={{ - -79,-90},{-66,-90},{-66,-108},{-16,-108},{-16,-116},{0,-116},{0,-100}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - - connect(solarThermal.T_air, weaBus.TDryBul) annotation (Line(points={{-24, - -158},{-24,-178},{-194,-178},{-194,80},{-101,80}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(solarThermal.Irradiation, weaBus.HGloHor) annotation (Line(points={{-30, - -158},{-30,-182},{-198,-182},{-198,80},{-101,80}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(KPIWel1.KPI, outBusGen.QSolThe_flow) annotation (Line(points={{-37.8, - -90},{-24,-90},{-24,-88},{0,-88},{0,-100}}, color={135,135,135}), - Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(uPumSolTheAlwOn.y, pumpST.y) - annotation (Line(points={{39,-170},{10,-170},{10,-162}}, color={0,0,127})); - annotation (Diagram(coordinateSystem(extent={{-200,-180},{100,100}}), - graphics={Rectangle( - extent={{100,-180},{-200,-118}}, - lineColor={0,0,0}, - lineThickness=1), Text( - extent={{-188,-122},{-124,-140}}, - textColor={0,0,0}, - textString="Solar Thermal")})); -end SolarThermalBivHPAixLib; diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo b/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo index f3939e84..5409bec4 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo @@ -5,9 +5,9 @@ model ElectricalHeater generation( redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodParameters, redeclare + parHeaRod, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData)); + parPum)); extends Modelica.Icons.Example; Modelica.Blocks.Sources.Constant const1(k=1) diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo index a72d6e25..f59e7944 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo @@ -7,8 +7,8 @@ model GasBoiler paramBoiler, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData)); + parTemSen, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)); extends Modelica.Icons.Example; Modelica.Blocks.Sources.Pulse pulse(period=1800) diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPump.mo b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPump.mo new file mode 100644 index 00000000..d9decd3b --- /dev/null +++ b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPump.mo @@ -0,0 +1,33 @@ +within BESMod.Systems.Hydraulical.Generation.Tests; +model HeatPump "Heat pump test case" + extends PartialTest(redeclare + BESMod.Systems.Hydraulical.Generation.HeatPump + generation( + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D (dataTable= + AixLib.DataBase.HeatPump.EN255.Vitocal350AWI114()), + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum, + redeclare + BESMod.Systems.RecordsCollection.Movers.DefaultMover + parPum, + redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen)); + extends Modelica.Icons.Example; + + Modelica.Blocks.Sources.Pulse pulse(period=1800) + annotation (Placement(transformation(extent={{-40,80},{-20,100}}))); +equation + connect(pulse.y, genControlBus.yHeaPumSet) annotation (Line(points={{-19,90},{ + -14,90},{-14,98},{10,98},{10,74}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(pulse.y, genControlBus.uPump) annotation (Line(points={{-19,90},{-14,90}, + {-14,98},{10,98},{10,74}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); +end HeatPump; diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo index a6839c5b..31c8a2a4 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo @@ -7,19 +7,15 @@ model HeatPumpAndHeatingRod redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D (dataTable= AixLib.DataBase.HeatPump.EN255.Vitocal350AWI114()), - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - heatPumpParameters, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodParameters, + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData, - redeclare package Medium_eva = IBPSA.Media.Air, - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData)); + parPum, + redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen, + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR + parHeaRod)); extends Modelica.Icons.Example; Modelica.Blocks.Sources.Constant const1(k=0) diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodDetailed.mo b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodDetailed.mo new file mode 100644 index 00000000..ee059c8a --- /dev/null +++ b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodDetailed.mo @@ -0,0 +1,45 @@ +within BESMod.Systems.Hydraulical.Generation.Tests; +model SolarThermalAndHeatPumpAndHeatingRodDetailed + extends PartialTest(redeclare + BESMod.Systems.Hydraulical.Generation.DetailedSolarThermalWithHeatPump + generation( + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D (dataTable= + AixLib.DataBase.HeatPump.EN14511.Vitocal200AWO201()), + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen, + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR + parHeaRod, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultSolarThermal + solarThermalParas, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPumSolThe)); + extends Modelica.Icons.Example; + + Modelica.Blocks.Sources.Constant const1(k=0) + annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); + Modelica.Blocks.Sources.Pulse pulse(period=1800) + annotation (Placement(transformation(extent={{-40,80},{-20,100}}))); +equation + connect(pulse.y, genControlBus.yHeaPumSet) annotation (Line(points={{-19,90}, + {-14,90},{-14,98},{10,98},{10,74}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(pulse.y, genControlBus.uPump) annotation (Line(points={{-19,90},{-14, + 90},{-14,98},{10,98},{10,74}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(const1.y, genControlBus.uHeaRod) annotation (Line(points={{-79,50},{ + -32,50},{-32,48},{10,48},{10,74}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); +end SolarThermalAndHeatPumpAndHeatingRodDetailed; diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodSimple.mo similarity index 72% rename from BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo rename to BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodSimple.mo index 16e3cf19..a54d207c 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodSimple.mo @@ -1,24 +1,23 @@ within BESMod.Systems.Hydraulical.Generation.Tests; -model SolarThermalAndHeatPumpAndHeatingRod +model SolarThermalAndHeatPumpAndHeatingRodSimple extends PartialTest(redeclare - BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib generation( + BESMod.Systems.Hydraulical.Generation.SimpleSolarThermalWithHeatPump + generation( redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - heatPumpParameters, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodParameters, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum, redeclare package Medium_eva = IBPSA.Media.Air, - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData, + redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPumSolThe, + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultSolarThermal - solarThermalParas, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpSTData)); + parSolThe, + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR + parHeaRod)); extends Modelica.Icons.Example; Modelica.Blocks.Sources.Constant const1(k=0) @@ -44,4 +43,4 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); -end SolarThermalAndHeatPumpAndHeatingRod; +end SolarThermalAndHeatPumpAndHeatingRodSimple; diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/package.order b/BESMod/Systems/Hydraulical/Generation/Tests/package.order index 18722a22..e60f4c29 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Generation/Tests/package.order @@ -1,5 +1,7 @@ ElectricalHeater GasBoiler +HeatPump HeatPumpAndHeatingRod -SolarThermalAndHeatPumpAndHeatingRod +SolarThermalAndHeatPumpAndHeatingRodDetailed +SolarThermalAndHeatPumpAndHeatingRodSimple PartialTest diff --git a/BESMod/Systems/Hydraulical/Generation/package.order b/BESMod/Systems/Hydraulical/Generation/package.order index 7d7a73c5..6bfac3ae 100644 --- a/BESMod/Systems/Hydraulical/Generation/package.order +++ b/BESMod/Systems/Hydraulical/Generation/package.order @@ -1,13 +1,13 @@ ElectricalHeater GasBoiler +HeatPump +HeatPumpAndGasBoilerParallel +HeatPumpAndGasBoilerSerial HeatPumpAndHeatingRod NoGeneration -SolarThermalBivHPAixLib -SolarThermalBivHPBuiLib +SimpleSolarThermalWithHeatPump +DetailedSolarThermalWithHeatPump Tests RecordsCollection Types BaseClasses -HeatPumpAndGasBoilerSerial -HeatPumpAndGasBoilerParallel -OnlyHeatPump diff --git a/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo index 0f4d0f77..74211424 100644 --- a/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo +++ b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo @@ -65,16 +65,16 @@ model IdealValveRadiator each final show_T=show_T, redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - each final speed_rpm_nominal=pumpData.speed_rpm_nominal, + each final speed_rpm_nominal=parPum.speed_rpm_nominal, final m_flow_nominal=m_flow_nominal, final dp_nominal=dp_nominal, each final rho=rho, - each final V_flowCurve=pumpData.V_flowCurve, - each final dpCurve=pumpData.dpCurve), + each final V_flowCurve=parPum.V_flowCurve, + each final dpCurve=parPum.dpCurve), each final inputType=IBPSA.Fluid.Types.InputType.Continuous, - each final addPowerToMedium=pumpData.addPowerToMedium, + each final addPowerToMedium=parPum.addPowerToMedium, each final nominalValuesDefineDefaultPressureCurve=true, - each final tau=pumpData.tau, + each final tau=parPum.tau, each final use_inputFilter=false, final m_flow_start=m_flow_nominal) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -82,7 +82,7 @@ model IdealValveRadiator origin={-10,10}))); replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpData annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,78},{-78,98}}))); + parPum annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,78},{-78,98}}))); BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{30,-106},{50,-86}}))); Modelica.Blocks.Routing.RealPassThrough reaPasThrOpe[nParallelDem] annotation (Placement(transformation( diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index 91e3cb7e..9bc29f8f 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -26,7 +26,7 @@ model RadiatorPressureBased "Pressure Based transfer system" replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpData annotation (Dialog(group="Component data"), + parPum annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement(transformation(extent={{-98,78}, {-72,100}}))); @@ -103,17 +103,17 @@ model RadiatorPressureBased "Pressure Based transfer system" final allowFlowReversal=allowFlowReversal, final show_T=show_T, redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final speed_rpm_nominal=pumpData.speed_rpm_nominal, + final speed_rpm_nominal=parPum.speed_rpm_nominal, final m_flow_nominal=sum(m_flow_nominal), final dp_nominal=transferDataBaseDefinition.dpPumpHeaCir_nominal + dpSup_nominal[1], final rho=rho, - final V_flowCurve=pumpData.V_flowCurve, - final dpCurve=pumpData.dpCurve), + final V_flowCurve=parPum.V_flowCurve, + final dpCurve=parPum.dpCurve), final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final addPowerToMedium=pumpData.addPowerToMedium, - final tau=pumpData.tau, - final use_inputFilter=pumpData.use_inputFilter, - final riseTime=pumpData.riseTimeInpFilter, + final addPowerToMedium=parPum.addPowerToMedium, + final tau=parPum.tau, + final use_inputFilter=parPum.use_inputFilter, + final riseTime=parPum.riseTimeInpFilter, final init=Modelica.Blocks.Types.Init.InitialOutput, final y_start=1) annotation (Placement( transformation( diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo index 9fad932c..1ea9b32b 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo @@ -7,7 +7,7 @@ model TestIdealValveRadiatorSystem BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData)); + parPum)); extends Modelica.Icons.Example; end TestIdealValveRadiatorSystem; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo index 1e916d61..e8040181 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo @@ -9,7 +9,7 @@ model TestPressureBasedSystem transferDataBaseDefinition, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData, + parPum, redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters)); diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo index 99240c3e..841b7e86 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo @@ -10,7 +10,7 @@ model TestPressureBasedSystemWithReliefValve transferDataBaseDefinition, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData, + parPum, redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters)); diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestUnderfloorHeating.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestUnderfloorHeating.mo index b963a88c..fa1852f0 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestUnderfloorHeating.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestUnderfloorHeating.mo @@ -7,7 +7,7 @@ model TestUnderfloorHeating BESMod.Systems.Hydraulical.Transfer.RecordsCollection.DefaultUFHData UFHParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - pumpData)); + parPum)); extends Modelica.Icons.Example; end TestUnderfloorHeating; diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index 0c8479b9..3a16d768 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -73,16 +73,16 @@ model UFHTransferSystem redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - each final speed_rpm_nominal=pumpData.speed_rpm_nominal, + each final speed_rpm_nominal=parPum.speed_rpm_nominal, final m_flow_nominal=m_flow_nominal, final dp_nominal=dp_nominal, each final rho=rho, - each final V_flowCurve=pumpData.V_flowCurve, - each final dpCurve=pumpData.dpCurve), + each final V_flowCurve=parPum.V_flowCurve, + each final dpCurve=parPum.dpCurve), each final inputType=IBPSA.Fluid.Types.InputType.Continuous, - each final addPowerToMedium=pumpData.addPowerToMedium, + each final addPowerToMedium=parPum.addPowerToMedium, each final nominalValuesDefineDefaultPressureCurve=true, - each final tau=pumpData.tau, + each final tau=parPum.tau, each final use_inputFilter=false, final m_flow_start=m_flow_nominal) annotation (Placement( transformation( @@ -91,7 +91,7 @@ model UFHTransferSystem origin={-30,50}))); replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - pumpData annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,78}, + parPum annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,78}, {-78,98}}))); BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{32,-108},{52,-88}}))); diff --git a/BESMod/Systems/RecordsCollection/Movers/DefaultMoverBA.mo b/BESMod/Systems/RecordsCollection/Movers/DefaultMoverBA.mo deleted file mode 100644 index 8d3f0431..00000000 --- a/BESMod/Systems/RecordsCollection/Movers/DefaultMoverBA.mo +++ /dev/null @@ -1,11 +0,0 @@ -within BESMod.Systems.RecordsCollection.Movers; -record DefaultMoverBA - extends BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition( - tau=1, - riseTimeInpFilter=30, - use_inputFilter=false, - addPowerToMedium=false, - speed_rpm_nominal=1500, - dpCurve={1.02,1.01,1,0.99,0}, - V_flowCurve={0,0.99,1,1.01,1.02}); -end DefaultMoverBA; diff --git a/BESMod/Systems/RecordsCollection/Movers/package.order b/BESMod/Systems/RecordsCollection/Movers/package.order index f11a073c..254c4935 100644 --- a/BESMod/Systems/RecordsCollection/Movers/package.order +++ b/BESMod/Systems/RecordsCollection/Movers/package.order @@ -1,4 +1,3 @@ AutomaticConfigurationData MoverBaseDataDefinition DefaultMover -DefaultMoverBA diff --git a/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo b/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo index 03f4da61..753383f5 100644 --- a/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo +++ b/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo @@ -6,20 +6,20 @@ model GetHeatPumpCurveVCLib bivalentHeatPumpControlDataDefinition, redeclare Examples.UseCaseDesignOptimization.AachenSystem systemParameters, redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover pumpData, redeclare package Medium_eva = IBPSA.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - heatPumpParameters, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodParameters, + parHeaPum, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap (refrigerant= "Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - temperatureSensorData), + parTemSen, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR + parHeaRod), ramp( height=35, duration=84400, diff --git a/BESMod/package.mo b/BESMod/package.mo index 68ec6ac8..3df60e0a 100644 --- a/BESMod/package.mo +++ b/BESMod/package.mo @@ -3,18 +3,23 @@ package BESMod extends Modelica.Icons.Package; annotation ( - version="0.3.1", + version="0.3.2", uses( BuildingSystems(version="2.0.0-beta"), Modelica(version="4.0.0"), SDF(version="0.4.2"), - AixLib(version="1.3.2"), - IBPSA(version="3.0.0")), - conversion(from( - version="0.2.2", - script="modelica://BESMod/Resources/Scripts/ConvertBESMod_from_0.2.2_to_0.3.0.mos", - to="0.3.0"), from(version="0.3.0", script= - "modelica://BESMod/Resources/Scripts/ConvertFromBESMod_0.3.0.mos")), + AixLib(version="1.3.1"), + IBPSA(version="4.0.0")), + conversion( + from( + version="0.2.2", + script="modelica://BESMod/Resources/Scripts/ConvertBESMod_from_0.2.2_to_0.3.0.mos", + to="0.3.0"), + from( + version="0.3.1", + script="modelica://BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos", + to="0.3.2") + ), Icon(graphics={Bitmap(extent={{-100,-100},{100,100}}, fileName="modelica://BESMod/Resources/Images/BESMod_icon.png")})); end BESMod; From b235d9484ecf8bb7ffe0fcf69f37d7f4ee7cc0f4 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Thu, 3 Aug 2023 21:02:01 +0200 Subject: [PATCH 074/131] Extensive renaming and restructuring to avoid code repetition --- BESMod/Examples/BAUSimStudy/PartialCase.mo | 8 +- BESMod/Examples/HeatPumpAndBoiler.mo | 48 +-- .../Examples/UseCaseDesignOptimization/BES.mo | 6 +- .../Examples/UseCaseHighOrderModel/BES_HOM.mo | 6 +- .../PartialModelicaConferenceUseCase.mo | 6 +- .../ConvertBESMod_from_0.3.1_to_0.3.2.mos | 16 +- ....mo => PartialHeatPumpSystemController.mo} | 123 +++--- ....mo => PartialThermostaticValveControl.mo} | 5 +- ...lTwoPoint_HPS_Controller_BivalentBoiler.mo | 12 +- .../Control/BaseClasses/package.order | 4 +- .../Control/Biv_PI_ConFlow_HPSController.mo | 2 +- ..._ConOut_HPS.mo => BivalentPartParallel.mo} | 6 +- .../Control/ConstHys_OnOff_HPSControll.mo | 2 +- .../ConstHys_PI_ConOut_HPSController.mo | 2 +- .../ConstHys_PI_StoTop_HPSController.mo | 4 +- .../Control/ConstHys_P_ConIn_HPSController.mo | 2 +- .../ConstHys_P_ConOut_HPSController.mo | 2 +- .../{MonovalentGasBoiler.mo => GasBoiler.mo} | 10 +- .../Control/NewControlBivalentParallel.mo | 4 +- .../Control/NewControlBivalentSerial.mo | 17 +- ...ControlBivalentSystem_BoilerAfterBuffer.mo | 6 +- .../Systems/Hydraulical/Control/package.order | 4 +- ...tailed.mo => PartialTwoStorageParallel.mo} | 387 ++++++++---------- .../PartialTwoStorageParallelWithHeaters.mo | 128 ++++++ .../Distribution/BaseClasses/package.order | 3 +- .../DistributionTwoStorageParallel.mo | 118 +++--- .../Distribution/Tests/TestDirectLoading.mo | 9 +- .../Distribution/Tests/TestIndirectLoading.mo | 9 +- .../Distribution/Tests/TestSimpleStorages.mo | 6 +- .../TwoStoDetailedDirectLoading.mo | 17 +- .../TwoStoDetailedIndirectLoading.mo | 19 +- .../Distribution/TwoStoragesBoilerWithDHW.mo | 182 ++++---- .../TwoStoragesBoilerWithoutDHW.mo | 318 -------------- .../Distribution/Types/HeaterType.mo | 9 + .../Distribution/Types/package.order | 1 + .../Hydraulical/Distribution/package.order | 1 - .../Generation/BaseClasses/PartialHeatPump.mo | 43 +- .../PartialHeatPumpAndGasBoiler.mo | 7 +- .../Hydraulical/Generation/GasBoiler.mo | 56 +-- .../HeatPumpAndGasBoilerParallel.mo | 19 +- .../Generation/HeatPumpAndHeatingRod.mo | 6 +- .../Hydraulical/Generation/Tests/GasBoiler.mo | 2 +- .../Tests/HeatPumpAndGasBoilerParallel.mo | 54 +++ .../Tests/HeatPumpAndGasBoilerSeries.mo | 41 ++ ...arThermalAndHeatPumpAndHeatingRodSimple.mo | 2 +- .../Generation/Tests/package.order | 2 + 46 files changed, 796 insertions(+), 938 deletions(-) rename BESMod/Systems/Hydraulical/Control/BaseClasses/{PartialTwoPoint_HPS_Controller.mo => PartialHeatPumpSystemController.mo} (84%) rename BESMod/Systems/Hydraulical/Control/BaseClasses/{SystemWithThermostaticValveControl.mo => PartialThermostaticValveControl.mo} (94%) rename BESMod/Systems/Hydraulical/Control/{PartBiv_PI_ConOut_HPS.mo => BivalentPartParallel.mo} (94%) rename BESMod/Systems/Hydraulical/Control/{MonovalentGasBoiler.mo => GasBoiler.mo} (98%) rename BESMod/Systems/Hydraulical/Distribution/BaseClasses/{PartialDistributionTwoStorageParallelDetailed.mo => PartialTwoStorageParallel.mo} (50%) create mode 100644 BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo delete mode 100644 BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithoutDHW.mo create mode 100644 BESMod/Systems/Hydraulical/Distribution/Types/HeaterType.mo create mode 100644 BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndGasBoilerParallel.mo create mode 100644 BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndGasBoilerSeries.mo diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index adab7e6b..bfd55bae 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -62,19 +62,19 @@ partial model PartialCase BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - threeWayValveParameters, + parThrWayVal, redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - bufParameters(use_QLos=true, T_m=338.15), + parStoBuf(use_QLos=true, T_m=338.15), redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - dhwParameters( + parStoDHW( dTLoadingHC1=10, use_QLos=true, T_m=65 + 273.15), redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodAftBufParameters), + parHeaRodAftBuf), redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased transfer( redeclare diff --git a/BESMod/Examples/HeatPumpAndBoiler.mo b/BESMod/Examples/HeatPumpAndBoiler.mo index 80e234fa..23c6dc55 100644 --- a/BESMod/Examples/HeatPumpAndBoiler.mo +++ b/BESMod/Examples/HeatPumpAndBoiler.mo @@ -45,12 +45,10 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerSerial generation( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal /parameterStudy.QHP_flow_biv, @@ -58,13 +56,10 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" dpEva_nominal=0, use_refIne=false, refIneFre_constant=0), - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRod, + redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare @@ -88,18 +83,17 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" safetyControl, TCutOff=parameterStudy.TCutOff, QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, - CheckTCut_Off(threshold=parameterStudy.TCutOff)), redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - bufParameters(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), + parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters(dTLoadingHC1=10), + parStoDHW(dTLoadingHC1=10), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - threeWayValveParameters), + parThrWayVal), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData @@ -107,7 +101,6 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), @@ -144,7 +137,6 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal /parameterStudy.QHP_flow_biv, @@ -158,7 +150,6 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare @@ -184,18 +175,17 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" safetyControl, TCutOff=parameterStudy.TCutOff, QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, - CheckTCut_Off(threshold=parameterStudy.TCutOff)), redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithoutDHW distribution( redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - bufParameters(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), + parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters(dTLoadingHC1=10), + parStoDHW(dTLoadingHC1=10), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - threeWayValveParameters), + parThrWayVal), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData @@ -203,7 +193,6 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), @@ -259,7 +248,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" parTemSen, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - threeWayValveParameters, + parThrWayVal, threeWayValveWithFlowReturn(redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parameters( @@ -291,17 +280,17 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( nParallelSup=1, - dpSup_nominal={2*(hydraulic.distribution.threeWayValveParameters.dpValve_nominal - + max(hydraulic.distribution.threeWayValveParameters.dp_nominal))}, + dpSup_nominal={2*(hydraulic.distribution.parThrWayVal.dpValve_nominal + + max(hydraulic.distribution.parThrWayVal.dp_nominal))}, redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - bufParameters(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), + parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters(dTLoadingHC1=10), + parStoDHW(dTLoadingHC1=10), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - threeWayValveParameters), + parThrWayVal), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData @@ -346,7 +335,6 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal /parameterStudy.QHP_flow_biv, @@ -360,7 +348,6 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare @@ -386,12 +373,10 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" safetyControl, TCutOff=parameterStudy.TCutOff, QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, - CheckTCut_Off(threshold=parameterStudy.TCutOff)), redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithDHW distribution( designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.FullStorage, - QDHWStoLoss_flow=1, VStoDHW(displayUnit="l") = 0.1, QHRAftBuf_flow_nominal=0, @@ -400,13 +385,13 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - threeWayValveParameters1, + parThrWayVal1, redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition - bufParameters, + parStoBuf, redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition - dhwParameters(dTLoadingHC1=10), + parStoDHW(dTLoadingHC1=10), redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition hydParameters), @@ -417,7 +402,6 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), diff --git a/BESMod/Examples/UseCaseDesignOptimization/BES.mo b/BESMod/Examples/UseCaseDesignOptimization/BES.mo index 7f87aa9c..12a4a77c 100644 --- a/BESMod/Examples/UseCaseDesignOptimization/BES.mo +++ b/BESMod/Examples/UseCaseDesignOptimization/BES.mo @@ -57,17 +57,17 @@ model BES distribution( redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - bufParameters( + parStoBuf( VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.B), redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters(dTLoadingHC1=10, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.A), + parStoDHW(dTLoadingHC1=10, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.A), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - threeWayValveParameters), + parThrWayVal), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData diff --git a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo index 78a41cb3..d9bd0478 100644 --- a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo +++ b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo @@ -68,12 +68,12 @@ model BES_HOM distribution( redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - bufParameters(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), + parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters(dTLoadingHC1=10), + parStoDHW(dTLoadingHC1=10), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - threeWayValveParameters), + parThrWayVal), redeclare BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index d8011799..4ba35ff4 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -72,12 +72,12 @@ partial model PartialModelicaConferenceUseCase distribution( redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - bufParameters(dTLoadingHC1=0), + parStoBuf(dTLoadingHC1=0), redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters(dTLoadingHC1=10), + parStoDHW(dTLoadingHC1=10), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - threeWayValveParameters), + parThrWayVal), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( dTTra_nominal=fill(10, hydraulic.transfer.nParallelDem), f_design=fill(1.2, hydraulic.transfer.nParallelDem), diff --git a/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos b/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos index 24427ab2..15537aad 100644 --- a/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos +++ b/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos @@ -2,7 +2,11 @@ clear convertClear(); -// Bus connectors + +convertClass("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib", "BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib"); +convertClass("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib", "BESMod.Systems.Hydraulical.Generation.SimpleSolarThermalWithHeatPump"); + +// Parameters convertElement("BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod", "heatPumpParameters", "parHeaPum"); convertElement("BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod", "heatingRodParameters", "parHeaRod"); convertElement("BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod", "temperatureSensorData", "parTemSen"); @@ -21,4 +25,12 @@ convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib", convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "temperatureSensorData", "parTemSen"); convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "temperatureSensorData", "parTemSen"); -convertClass \ No newline at end of file + +convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "bufParameters", "parStoBuf"); +convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "dhwParameters", "parStoDHW"); +convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "threeWayValveParameters", "parThrWayVal"); +convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "heatingRodAftBufPar", "parHeaRodAftBuf"); +convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "bufParameters", "parStoBuf"); +convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "dhwParameters", "parStoDHW"); +convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "threeWayValveParameters", "parThrWayVal"); +convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "heatingRodAftBufPar", "parHeaRodAftBuf"); diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo similarity index 84% rename from BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo rename to BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo index c8511360..0998d21b 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo @@ -1,8 +1,8 @@ within BESMod.Systems.Hydraulical.Control.BaseClasses; -partial model PartialTwoPoint_HPS_Controller - "Partial model with replaceable blocks for rule based control of HPS using on off heating rods" +partial model PartialHeatPumpSystemController + "Partial model with replaceable blocks for rule based control of heat pump systems" extends - BESMod.Systems.Hydraulical.Control.BaseClasses.SystemWithThermostaticValveControl; + BESMod.Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl; replaceable BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController DHWOnOffContoller annotation (choicesAllMatching=true, Placement( @@ -10,7 +10,7 @@ partial model PartialTwoPoint_HPS_Controller replaceable BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController BufferOnOffController annotation (choicesAllMatching=true, Placement( - transformation(extent={{-126,36},{-110,50}}))); + transformation(extent={{-118,32},{-102,48}}))); replaceable BESMod.Systems.Hydraulical.Control.RecordsCollection.HeatPumpSafetyControl safetyControl annotation (choicesAllMatching=true,Placement(transformation(extent={{200,30},{220,50}}))); @@ -20,7 +20,9 @@ partial model PartialTwoPoint_HPS_Controller final TOda_nominal=generationParameters.TOda_nominal, TSup_nominal=generationParameters.TSup_nominal[1], TSetRoomConst=sum(transferParameters.TDem_nominal)/transferParameters.nParallelDem) - annotation (choicesAllMatching=true, Placement(transformation(extent={{-92,-32},{-70,-10}}))); + "Parameters for bivalent control" + annotation (choicesAllMatching=true, Placement(transformation(extent={{-96,-36}, + {-82,-22}}))); replaceable BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control TSet_DHW constrainedby @@ -48,11 +50,11 @@ partial model PartialTwoPoint_HPS_Controller replaceable BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.BaseClasses.PartialHPNSetController HP_nSet_Controller annotation (choicesAllMatching=true, Placement( - transformation(extent={{82,64},{112,92}}))); + transformation(extent={{102,82},{118,98}}))); Modelica.Blocks.Logical.Switch switch1 - annotation (Placement(transformation(extent={{-5,-5},{5,5}}, + annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0, - origin={63,73}))); + origin={70,80}))); Modelica.Blocks.Sources.Constant const_dT_loading1(k=distributionParameters.dTTra_nominal[1]) annotation (Placement( transformation( @@ -121,14 +123,14 @@ partial model PartialTwoPoint_HPS_Controller Modelica.Blocks.Math.BooleanToReal booleanToReal annotation (Placement( transformation( - extent={{-6,-6},{6,6}}, + extent={{-10,-10},{10,10}}, rotation=270, - origin={-38,-36}))); + origin={-30,-50}))); Modelica.Blocks.Logical.Not bufOn "buffer is charged" annotation (Placement( transformation( - extent={{-5,-5},{5,5}}, + extent={{-10,-10},{10,10}}, rotation=270, - origin={-37,-17}))); + origin={-30,-22}))); BESMod.Utilities.SupervisoryControl.SupervisoryControl supervisoryControlDHW( ctrlType=supCtrlTypeDHWSet) annotation (Placement(transformation(extent={{-182,72},{-170,84}}))); @@ -136,18 +138,18 @@ partial model PartialTwoPoint_HPS_Controller supCtrlTypeDHWSet=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local "Type of supervisory control for DHW Setpoint"; Modelica.Blocks.Math.MinMax minMax(nu=transferParameters.nParallelDem) - annotation (Placement(transformation(extent={{-202,32},{-182,52}}))); + annotation (Placement(transformation(extent={{-200,30},{-180,50}}))); Modelica.Blocks.Math.BooleanToReal booleanToReal1 "Turn Pump in heat pump on" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=270, - origin={-170,-54}))); + origin={-170,-50}))); Modelica.Blocks.Logical.Or HP_or_HR_active annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=270, - origin={-170,-24}))); + origin={-170,-20}))); Components.HeatPumpBusPassThrough heatPumpBusPassThrough annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, @@ -155,8 +157,7 @@ partial model PartialTwoPoint_HPS_Controller origin={-230,-90}))); equation connect(BufferOnOffController.T_Top, sigBusDistr.TStoBufTopMea) annotation ( - Line(points={{-126.8,47.9},{-128,47.9},{-128,48},{-130,48},{-130,-86},{4,-86}, - {4,-100},{1,-100}}, + Line(points={{-118.8,45.6},{-118.8,46},{-124,46},{-124,-68},{1,-68},{1,-100}}, color={0,0,127}), Text( string="%second", index=1, @@ -170,8 +171,7 @@ equation extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(heatingCurve.TSet, BufferOnOffController.T_Set) annotation (Line( - points={{-139,30},{-139,28},{-118,28},{-118,35.3}}, - color={0,0,127})); + points={{-139,30},{-110,30},{-110,31.2}}, color={0,0,127})); connect(DHWOnOffContoller.T_bot, sigBusDistr.TStoDHWTopMea) annotation (Line( points={{-128.8,74},{-318,74},{-318,-166},{1,-166},{1,-100}}, @@ -180,8 +180,9 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(HP_active.y, HP_nSet_Controller.HP_On) annotation (Line(points={{32.5, - 91},{70,91},{70,78},{79,78}}, color={255,0,255})); + connect(HP_active.y, HP_nSet_Controller.HP_On) annotation (Line(points={{32.5,91}, + {32.5,100},{14,100},{14,84},{6,84},{6,50},{100.4,50},{100.4,90}}, + color={255,0,255})); connect(sigBusDistr, TSet_DHW.sigBusDistr) annotation (Line( points={{1,-100},{-2,-100},{-2,-152},{-292,-152},{-292,77.88},{-216,77.88}}, color={255,204,51}, @@ -195,10 +196,10 @@ equation Line(points={{-110.88,74},{-22,74},{-22,23.8333},{10,23.8333}}, color={ 255,0,255})); connect(BufferOnOffController.Auxilliar_Heater_On, HRactive.u[2]) annotation ( - Line(points={{-108.88,39.5},{-94,39.5},{-94,25},{10,25}}, color= + Line(points={{-100.88,36},{-20,36},{-20,25},{10,25}}, color= {255,0,255})); - connect(TSet_DHW.y, HRactive.u[3]) annotation (Line(points={{-190.8,71.04},{ - -96,71.04},{-96,26.1667},{10,26.1667}}, color= + connect(TSet_DHW.y, HRactive.u[3]) annotation (Line(points={{-190.8,71.04},{-96, + 71.04},{-96,26.1667},{10,26.1667}}, color= {255,0,255})); connect(securityControl.modeSet, hp_mode.y) annotation (Line(points={{191.867, @@ -211,14 +212,13 @@ equation extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(HP_nSet_Controller.n_Set, securityControl.nSet) annotation (Line( - points={{113.5,78},{144,78},{144,84.4},{191.867,84.4}}, color={0,0,127})); - connect(BufferOnOffController.HP_On, HP_active.u2) annotation (Line(points={{-108.88, - 47.9},{-78,47.9},{-78,54},{-38,54},{-38,87},{21,87}}, - color={255,0,255})); + points={{118.8,90},{118.8,84.4},{191.867,84.4}}, color={0,0,127})); + connect(BufferOnOffController.HP_On, HP_active.u2) annotation (Line(points={{-100.88, + 45.6},{-100.88,52},{21,52},{21,87}}, color={255,0,255})); connect(DHWOnOffContoller.HP_On, HP_active.u1) annotation (Line(points={{-110.88, 83.6},{-32,83.6},{-32,91},{21,91}}, color={255,0,255})); connect(DHWHysOrLegionella.y, switch1.u2) annotation (Line(points={{-71.25,69}, - {-20,69},{-20,73},{57,73}}, color={255,0,255})); + {-6.625,69},{-6.625,80},{58,80}}, color={255,0,255})); connect(TSet_DHW.y, DHWHysOrLegionella.u[1]) annotation (Line(points={{-190.8, 71.04},{-96,71.04},{-96,67.6875},{-82,67.6875}}, color={255,0,255})); @@ -233,8 +233,8 @@ equation 71.04},{-136.4,71.04},{-136.4,70.3125},{-82,70.3125}}, color={255,0,255})); connect(BufferOnOffController.T_bot, sigBusDistr.TStoBufTopMea) annotation ( - Line(points={{-126.8,39.5},{-130,39.5},{-130,-86},{134,-86},{134,-100},{1, - -100}}, color={0,0,127}), Text( + Line(points={{-118.8,36},{-120,36},{-120,46},{-124,46},{-124,-68},{1,-68},{ + 1,-100}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, @@ -246,7 +246,7 @@ equation connect(max.y, switchHR.u1) annotation (Line(points={{28.4,38},{37,38},{37,29}}, color={0,0,127})); connect(BufferOnOffController.Auxilliar_Heater_set, max.u1) annotation (Line( - points={{-108.88,36.98},{-84,36.98},{-84,35.6},{19.2,35.6}}, color={0,0, + points={{-100.88,33.12},{8,33.12},{8,35.6},{19.2,35.6}}, color={0,0, 127})); connect(DHWOnOffContoller.Auxilliar_Heater_set, max.u2) annotation (Line( points={{-110.88,71.12},{-104,71.12},{-104,64},{-10,64},{-10,40.4},{19.2, @@ -258,7 +258,8 @@ equation extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(HP_nSet_Controller.IsOn, sigBusGen.heaPumIsOn) annotation (Line( - points={{88,61.2},{88,-58},{-152,-58},{-152,-99}}, color={255,0,255}), + points={{105.2,80.4},{105.2,48},{-32,48},{-32,-8},{-132,-8},{-132,-46},{ + -152,-46},{-152,-99}}, color={255,0,255}), Text( string="%second", index=1, @@ -266,27 +267,27 @@ equation horizontalAlignment=TextAlignment.Right)); connect(const_dT_loading2.y,add_dT_LoadingDHW. u2) annotation (Line(points={{18.4,74}, {24,74},{24,80},{35,80}}, color={0,0,127})); - connect(switch1.y, HP_nSet_Controller.T_Set) annotation (Line(points={{68.5, - 73},{70,73},{70,86.4},{79,86.4}}, color={0,0,127})); + connect(switch1.y, HP_nSet_Controller.T_Set) annotation (Line(points={{81,80},{ + 94,80},{94,94.8},{100.4,94.8}}, color={0,0,127})); connect(heatingCurve.TSet, add_dT_LoadingBuf.u1) annotation (Line(points={{-139,30}, - {-139,28},{4,28},{4,66},{32,66},{32,62},{37,62}}, + {4,30},{4,66},{32,66},{32,62},{37,62}}, color={0,0,127})); connect(add_dT_LoadingBuf.y, switch1.u3) annotation (Line(points={{48.5,59},{ - 54,59},{54,69},{57,69}}, color={0,0,127})); - connect(add_dT_LoadingDHW.y, switch1.u1) annotation (Line(points={{46.5,83},{ - 51.25,83},{51.25,77},{57,77}}, color={0,0,127})); + 48.5,72},{58,72}}, color={0,0,127})); + connect(add_dT_LoadingDHW.y, switch1.u1) annotation (Line(points={{46.5,83},{50, + 83},{50,88},{58,88}}, color={0,0,127})); connect(const_dT_loading1.y, add_dT_LoadingBuf.u2) annotation (Line(points={{ 18.4,58},{26,58},{26,56},{37,56}}, color={0,0,127})); - connect(booleanToReal.y, sigBusDistr.uThrWayVal) annotation (Line(points={{ - -38,-42.6},{-38,-62},{1,-62},{1,-100}}, color={0,0,127}), Text( + connect(booleanToReal.y, sigBusDistr.uThrWayVal) annotation (Line(points={{-30,-61}, + {-30,-66},{1,-66},{1,-100}}, color={0,0,127}), Text( string="%second", index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(booleanToReal.u, bufOn.y) annotation (Line(points={{-38,-28.8},{-38, - -26},{-37,-26},{-37,-22.5}}, color={255,0,255})); - connect(bufOn.u, DHWHysOrLegionella.y) annotation (Line(points={{-37,-11},{ - -37,70},{-71.25,70},{-71.25,69}}, color={255,0,255})); + connect(booleanToReal.u, bufOn.y) annotation (Line(points={{-30,-38},{-30,-33}}, + color={255,0,255})); + connect(bufOn.u, DHWHysOrLegionella.y) annotation (Line(points={{-30,-10},{-30, + 69},{-71.25,69}}, color={255,0,255})); connect(TSet_DHW.TSet_DHW, supervisoryControlDHW.uLoc) annotation (Line( points={{-190.8,78},{-188,78},{-188,73.2},{-183.2,73.2}}, color={0,0, 127})); @@ -310,14 +311,15 @@ equation index=1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(heatingCurve.TOda, weaBus.TDryBul) annotation (Line(points={{-162,30}, - {-236,30},{-236,2},{-237,2}}, color={0,0,127}), Text( + connect(heatingCurve.TOda, weaBus.TDryBul) annotation (Line(points={{-162,30},{ + -166,30},{-166,24},{-238,24},{-238,2},{-237,2}}, + color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(BufferOnOffController.T_oda, weaBus.TDryBul) annotation (Line(points={ - {-118,50.84},{-118,58},{-236,58},{-236,30},{-237,30},{-237,2}}, color= + connect(BufferOnOffController.T_oda, weaBus.TDryBul) annotation (Line(points={{-110, + 48.96},{-110,56},{-238,56},{-238,2},{-237,2}}, color= {0,0,127}), Text( string="%second", index=1, @@ -330,28 +332,29 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(minMax.u, useProBus.TZoneSet) annotation (Line(points={{-202,42},{-206, - 42},{-206,52},{-208,52},{-208,60},{-119,60},{-119,103}}, color={0,0,127}), + connect(minMax.u, useProBus.TZoneSet) annotation (Line(points={{-200,40},{-244, + 40},{-244,104},{-119,104},{-119,103}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(minMax.yMax, heatingCurve.TSetRoom) - annotation (Line(points={{-181,48},{-150,48},{-150,42}}, color={0,0,127})); + annotation (Line(points={{-179,46},{-150,46},{-150,42}}, color={0,0,127})); connect(booleanToReal1.u, HP_or_HR_active.y) - annotation (Line(points={{-170,-42},{-170,-35}}, color={255,0,255})); - connect(booleanToReal1.y, sigBusGen.uPump) annotation (Line(points={{-170,-65}, - {-172,-65},{-172,-72},{-152,-72},{-152,-99}}, color={0,0,127}), Text( + annotation (Line(points={{-170,-38},{-170,-31}}, color={255,0,255})); + connect(booleanToReal1.y, sigBusGen.uPump) annotation (Line(points={{-170,-61}, + {-172,-61},{-172,-72},{-152,-72},{-152,-99}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(HP_or_HR_active.u1, HRactive.y) annotation (Line(points={{-170,-12},{ - -134,-12},{-134,-6},{-6,-6},{-6,18},{20.75,18},{20.75,25}}, color={ + connect(HP_or_HR_active.u1, HRactive.y) annotation (Line(points={{-170,-8},{ + -134,-8},{-134,-6},{-6,-6},{-6,16},{26,16},{26,26},{20.75,26},{20.75,25}}, + color={ 255,0,255})); connect(HP_or_HR_active.u2, sigBusGen.heaPumIsOn) annotation (Line( - points={{-178,-12},{-194,-12},{-194,-99},{-152,-99}}, color={255,0,255}), + points={{-178,-8},{-194,-8},{-194,-99},{-152,-99}}, color={255,0,255}), Text( string="%second", index=1, @@ -387,7 +390,7 @@ equation lineColor={0,140,72}, lineThickness=1), Text( - extent={{-216,-14},{-122,20}}, + extent={{-220,-12},{-126,22}}, lineColor={0,140,72}, lineThickness=1, textString="Buffer Control"), @@ -418,4 +421,4 @@ equation lineColor={28,108,200}, lineThickness=1, textString="Heat Pump Safety")})); -end PartialTwoPoint_HPS_Controller; +end PartialHeatPumpSystemController; diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/SystemWithThermostaticValveControl.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo similarity index 94% rename from BESMod/Systems/Hydraulical/Control/BaseClasses/SystemWithThermostaticValveControl.mo rename to BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo index 2296b3eb..d4f9fc23 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/SystemWithThermostaticValveControl.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo @@ -1,5 +1,6 @@ within BESMod.Systems.Hydraulical.Control.BaseClasses; -partial model SystemWithThermostaticValveControl +partial model PartialThermostaticValveControl + "Only provide thermostatic valve control" extends PartialControl; replaceable BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.BaseClasses.PartialThermostaticValveController @@ -44,4 +45,4 @@ equation lineColor={162,29,33}, lineThickness=1, textString="Thermostatic Valve")})); -end SystemWithThermostaticValveControl; +end PartialThermostaticValveControl; diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo index 7fd28075..861931c3 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo @@ -2,7 +2,7 @@ within BESMod.Systems.Hydraulical.Control.BaseClasses; partial model PartialTwoPoint_HPS_Controller_BivalentBoiler "Partial model with replaceable blocks for rule based control of HPS using Boiler" extends - BESMod.Systems.Hydraulical.Control.BaseClasses.SystemWithThermostaticValveControl; + BESMod.Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl; replaceable BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController DHWOnOffContoller annotation (choicesAllMatching=true, Placement( @@ -178,14 +178,14 @@ equation horizontalAlignment=TextAlignment.Right)); connect(DHWOnOffContoller.Auxilliar_Heater_On, heatDemand_AuxiliarHeater.u[1]) - annotation (Line(points={{-110.88,74},{-92,74},{-92,30},{-94,30},{-94, - 21.8333},{16,21.8333}}, color={255,0,255})); + annotation (Line(points={{-110.88,74},{-92,74},{-92,30},{-94,30},{-94,21.8333}, + {16,21.8333}}, color={255,0,255})); connect(BufferOnOffController.Auxilliar_Heater_On, heatDemand_AuxiliarHeater.u[ 2]) annotation (Line(points={{-108.88,39.5},{-108.88,38},{-94,38},{-94,23}, {16,23}}, color={255,0,255})); - connect(TSet_DHW.y, heatDemand_AuxiliarHeater.u[3]) annotation (Line(points={ - {-190.8,71.04},{-186,71.04},{-186,68},{-178,68},{-178,56},{-92,56},{ - -92,30},{-94,30},{-94,24.1667},{16,24.1667}}, color={255,0,255})); + connect(TSet_DHW.y, heatDemand_AuxiliarHeater.u[3]) annotation (Line(points={{-190.8, + 71.04},{-186,71.04},{-186,68},{-178,68},{-178,56},{-92,56},{-92,30},{ + -94,30},{-94,24.1667},{16,24.1667}}, color={255,0,255})); connect(securityControl.modeSet, hp_mode.y) annotation (Line(points={{191.867, 77.6},{168,77.6},{168,69},{162.7,69}}, color={255,0,255})); diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order index 893b8882..d2523321 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order @@ -1,4 +1,4 @@ PartialControl -SystemWithThermostaticValveControl -PartialTwoPoint_HPS_Controller +PartialThermostaticValveControl +PartialHeatPumpSystemController PartialTwoPoint_HPS_Controller_BivalentBoiler diff --git a/BESMod/Systems/Hydraulical/Control/Biv_PI_ConFlow_HPSController.mo b/BESMod/Systems/Hydraulical/Control/Biv_PI_ConFlow_HPSController.mo index 19e771f8..9aa67f25 100644 --- a/BESMod/Systems/Hydraulical/Control/Biv_PI_ConFlow_HPSController.mo +++ b/BESMod/Systems/Hydraulical/Control/Biv_PI_ConFlow_HPSController.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Control; model Biv_PI_ConFlow_HPSController "Using alt_bivalent + PI Inverter + Return Temperature as controller" - extends BaseClasses.PartialTwoPoint_HPS_Controller( + extends BaseClasses.PartialHeatPumpSystemController( redeclare BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW TSet_DHW, diff --git a/BESMod/Systems/Hydraulical/Control/PartBiv_PI_ConOut_HPS.mo b/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo similarity index 94% rename from BESMod/Systems/Hydraulical/Control/PartBiv_PI_ConOut_HPS.mo rename to BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo index 9256b2fb..2921a0b2 100644 --- a/BESMod/Systems/Hydraulical/Control/PartBiv_PI_ConOut_HPS.mo +++ b/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Control; -model PartBiv_PI_ConOut_HPS +model BivalentPartParallel "Part-parallel PI controlled HPS according to condenser outflow" - extends BaseClasses.PartialTwoPoint_HPS_Controller( + extends BaseClasses.PartialHeatPumpSystemController( redeclare BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController HP_nSet_Controller( @@ -44,4 +44,4 @@ equation annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, coordinateSystem(preserveAspectRatio=false))); -end PartBiv_PI_ConOut_HPS; +end BivalentPartParallel; diff --git a/BESMod/Systems/Hydraulical/Control/ConstHys_OnOff_HPSControll.mo b/BESMod/Systems/Hydraulical/Control/ConstHys_OnOff_HPSControll.mo index 58ed9124..d6832c57 100644 --- a/BESMod/Systems/Hydraulical/Control/ConstHys_OnOff_HPSControll.mo +++ b/BESMod/Systems/Hydraulical/Control/ConstHys_OnOff_HPSControll.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Control; model ConstHys_OnOff_HPSControll "Constant Hysteresis for an on/off HP" - extends BaseClasses.PartialTwoPoint_HPS_Controller( + extends BaseClasses.PartialHeatPumpSystemController( redeclare BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.OnOffHeatPumpController HP_nSet_Controller(final n_opt=nOptHP), diff --git a/BESMod/Systems/Hydraulical/Control/ConstHys_PI_ConOut_HPSController.mo b/BESMod/Systems/Hydraulical/Control/ConstHys_PI_ConOut_HPSController.mo index cc4e6128..ad9c9568 100644 --- a/BESMod/Systems/Hydraulical/Control/ConstHys_PI_ConOut_HPSController.mo +++ b/BESMod/Systems/Hydraulical/Control/ConstHys_PI_ConOut_HPSController.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Control; model ConstHys_PI_ConOut_HPSController "Hys + PI with condenser outlet as control variable" - extends BaseClasses.PartialTwoPoint_HPS_Controller( + extends BaseClasses.PartialHeatPumpSystemController( redeclare BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController HP_nSet_Controller( diff --git a/BESMod/Systems/Hydraulical/Control/ConstHys_PI_StoTop_HPSController.mo b/BESMod/Systems/Hydraulical/Control/ConstHys_PI_StoTop_HPSController.mo index 0f5597b5..d89555db 100644 --- a/BESMod/Systems/Hydraulical/Control/ConstHys_PI_StoTop_HPSController.mo +++ b/BESMod/Systems/Hydraulical/Control/ConstHys_PI_StoTop_HPSController.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Control; model ConstHys_PI_StoTop_HPSController "Using const. hys + PI Inverter + top level storage as controller" - extends BaseClasses.PartialTwoPoint_HPS_Controller( + extends BaseClasses.PartialHeatPumpSystemController( redeclare BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController HP_nSet_Controller( @@ -38,4 +38,6 @@ equation index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); + connect(switch2.y, HP_nSet_Controller.T_Meas) annotation (Line(points={{83, + -21.5},{82,-21.5},{82,-14},{97,-14},{97,61.2}}, color={0,0,127})); end ConstHys_PI_StoTop_HPSController; diff --git a/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConIn_HPSController.mo b/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConIn_HPSController.mo index ea2efc53..e92afe47 100644 --- a/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConIn_HPSController.mo +++ b/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConIn_HPSController.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Control; model ConstHys_P_ConIn_HPSController "Hys + P with condenser intlet as control variable" - extends BaseClasses.PartialTwoPoint_HPS_Controller( + extends BaseClasses.PartialHeatPumpSystemController( redeclare BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.P_InverterHeatPumpController HP_nSet_Controller(P=bivalentControlData.k, nMin=bivalentControlData.nMin), diff --git a/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConOut_HPSController.mo b/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConOut_HPSController.mo index bda6d949..1dabe19f 100644 --- a/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConOut_HPSController.mo +++ b/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConOut_HPSController.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Control; model ConstHys_P_ConOut_HPSController "Hys + P with condenser outlet as control variable" - extends BaseClasses.PartialTwoPoint_HPS_Controller( + extends BaseClasses.PartialHeatPumpSystemController( redeclare BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.P_InverterHeatPumpController HP_nSet_Controller(P=bivalentControlData.k, nMin=bivalentControlData.nMin), diff --git a/BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo similarity index 98% rename from BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo rename to BESMod/Systems/Hydraulical/Control/GasBoiler.mo index 2bc719f1..6da6df51 100644 --- a/BESMod/Systems/Hydraulical/Control/MonovalentGasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Control; -model MonovalentGasBoiler "PI Control of gas boiler" - extends BaseClasses.SystemWithThermostaticValveControl; +model GasBoiler "PI Control of gas boiler" + extends BaseClasses.PartialThermostaticValveControl; BESMod.Systems.Hydraulical.Control.Components.HeatingCurve heatingCurve( GraHeaCurve=monovalentControlParas.gradientHeatCurve, @@ -58,8 +58,8 @@ model MonovalentGasBoiler "PI Control of gas boiler" final TBiv=monovalentControlParas.TOda_nominal) annotation (choicesAllMatching=true, Placement(transformation(extent={{-218, -36},{-204,-22}}))); - Modelica.Blocks.Sources.BooleanConstant booleanConstant(k=false) if - not use_dhw annotation (Placement(transformation( + Modelica.Blocks.Sources.BooleanConstant booleanConstant(k=false) + if not use_dhw annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=180, origin={-30,-10}))); @@ -198,4 +198,4 @@ equation horizontalAlignment=TextAlignment.Left)); connect(bufOn.u, boilerOnOffDHW.y) annotation (Line(points={{-82,-50},{-122, -50},{-122,50},{-139,50}}, color={255,0,255})); -end MonovalentGasBoiler; +end GasBoiler; diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo index 7a6e697e..97359181 100644 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo @@ -183,7 +183,7 @@ equation connect(OperationalBoundryCheck.y, or1.u2) annotation (Line(points={{-137,-454}, {-137,-422},{-92,-422}}, color={255,0,255})); connect(lessThreshold.y, CheckBoilerConditions.u[1]) annotation (Line(points={{-130.4, - -320},{-20,-320},{-20,-466.933},{-4,-466.933}}, color={255,0,255})); + -320},{-20,-320},{-20,-476.033},{-4,-476.033}}, color={255,0,255})); connect(or1.y, CheckBoilerConditions.u[2]) annotation (Line(points={{-69,-414}, {-52,-414},{-52,-416},{-32,-416},{-32,-473},{-4,-473}}, color={255,0,255})); connect(CheckBoilerConditions.y, or2.u2) annotation (Line(points={{23.95,-473}, @@ -193,7 +193,7 @@ equation connect(CheckTCut_Off.y, or2.u1) annotation (Line(points={{95.6,-372},{136,-372}, {136,-450},{178,-450}}, color={255,0,255})); connect(heatDemand_AuxiliarHeater.y, CheckBoilerConditions.u[3]) annotation ( - Line(points={{26.75,23},{26.75,-196},{26,-196},{26,-479.067},{-4,-479.067}}, + Line(points={{26.75,23},{26.75,-196},{26,-196},{26,-469.967},{-4,-469.967}}, color={255,0,255})); connect(constZero2.y, BoilerSwitch.u3) annotation (Line(points={{-29,-238},{-58, -238},{-58,-220}}, color={0,0,127})); diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo index 108adb53..c1f7686b 100644 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo @@ -137,7 +137,7 @@ equation connect(TestBoilerZustand1.y, Boiler_uRel_Controller.IsOn) annotation (Line( points={{50.7,5},{50.7,4},{54,4},{54,6},{74,6},{74,0},{86,0},{86,7.2}}, color={255,0,255})); - connect(Boiler_uRel_Controller.T_Meas, sigBusGen.TBoilerOut) annotation (Line( + connect(Boiler_uRel_Controller.T_Meas, sigBusGen.TBoiOut) annotation (Line( points={{95,7.2},{96,7.2},{96,-74},{-148,-74},{-148,-82},{-152,-82},{ -152,-99}}, color={0,0,127}), Text( @@ -175,10 +175,11 @@ equation connect(constOne.y, thermalDesinfection.u1) annotation (Line(points={{-92.5,-175},{-117,-175}}, color={0,0,127})); connect(CheckBoilerConditions.u[3], heatDemand_AuxiliarHeater.y) annotation ( - Line(points={{-4,-469.967},{-32,-469.967},{-32,-172},{26.75,-172},{26.75, - 23}}, color={255,0,255})); - connect(not2.y,OperationalBoundryCheck. u1) annotation (Line(points={{-261, - -452},{-218,-452},{-218,-466}}, color={255,0,255})); + Line(points={{-4,-469.967},{-32,-469.967},{-32,-172},{26.75,-172},{26.75,23}}, + color={255,0,255})); + connect(not2.y,OperationalBoundryCheck. u1) annotation (Line(points={{-261,-452}, + {-254,-452},{-254,-466},{-218,-466}}, + color={255,0,255})); connect(HP_IsON2.y,not2. u) annotation (Line(points={{-319,-450},{-302,-450}, {-302,-452},{-284,-452}}, color={255,0,255})); @@ -187,7 +188,7 @@ equation connect(OperationalBoundryCheck.y, or1.u2) annotation (Line(points={{-195, -466},{-195,-422},{-92,-422}}, color={255,0,255})); - connect(thermalDesinfection.y, sigBusGen.yBoiler) annotation (Line(points={{ + connect(thermalDesinfection.y, sigBusGen.yBoi) annotation (Line(points={{ -128.5,-179},{-152,-179},{-152,-99}}, color={0,0,127}), Text( string="%second", index=1, @@ -195,8 +196,8 @@ equation horizontalAlignment=TextAlignment.Right)); connect(HP_NSet.y, HysteresisBoilerControl.u) annotation (Line(points={{ -216.4,-379},{-192.2,-379},{-192.2,-376},{-168,-376}}, color={0,0,127})); - connect(HysteresisBoilerControl.y, or1.u1) annotation (Line(points={{-145, - -376},{-130,-376},{-130,-406},{-92,-406},{-92,-414}}, color={255,0, + connect(HysteresisBoilerControl.y, or1.u1) annotation (Line(points={{-145,-376}, + {-128,-376},{-128,-414},{-92,-414}}, color={255,0, 255})); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram( diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo index 0c569f83..feed22a2 100644 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo @@ -141,7 +141,7 @@ equation -196.4,-320},{-167.2,-320}}, color={0,0,127})); connect(lessThreshold.y, CheckBoilerConditions.u[1]) annotation (Line(points={{-130.4, - -320},{-20,-320},{-20,-466.933},{-4,-466.933}}, color={255,0, + -320},{-20,-320},{-20,-476.033},{-4,-476.033}}, color={255,0, 255})); connect(or1.y, CheckBoilerConditions.u[2]) annotation (Line(points={{-69,-414}, {-52,-414},{-52,-416},{-32,-416},{-32,-473},{-4,-473}}, color={255,0, @@ -175,8 +175,8 @@ equation extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); connect(CheckBoilerConditions.u[3], heatDemand_AuxiliarHeater.y) annotation ( - Line(points={{-4,-479.067},{-28,-479.067},{-28,6},{40,6},{40,20},{26.75, - 20},{26.75,23}}, color={255,0,255})); + Line(points={{-4,-469.967},{-28,-469.967},{-28,6},{40,6},{40,20},{26.75,20}, + {26.75,23}}, color={255,0,255})); connect(not2.y,OperationalBoundryCheck. u1) annotation (Line(points={{-191, -456},{-148,-456},{-148,-470}}, color={255,0,255})); connect(HP_IsON2.y,not2. u) annotation (Line(points={{-249,-454},{-232,-454}, diff --git a/BESMod/Systems/Hydraulical/Control/package.order b/BESMod/Systems/Hydraulical/Control/package.order index aadfbe51..ea084a45 100644 --- a/BESMod/Systems/Hydraulical/Control/package.order +++ b/BESMod/Systems/Hydraulical/Control/package.order @@ -5,8 +5,8 @@ ConstHys_PI_ConOut_HPSController ConstHys_PI_StoTop_HPSController Biv_PI_ConFlow_HPSController NoControl -MonovalentGasBoiler -PartBiv_PI_ConOut_HPS +GasBoiler +BivalentPartParallel Components BaseClasses RecordsCollection diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo similarity index 50% rename from BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo rename to BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo index 1d1d5289..b2104f73 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialDistributionTwoStorageParallelDetailed.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo @@ -1,54 +1,45 @@ within BESMod.Systems.Hydraulical.Distribution.BaseClasses; -partial model PartialDistributionTwoStorageParallelDetailed - "Partial model to later extent" +partial model PartialTwoStorageParallel "Partial model to later extent" extends BaseClasses.PartialDistribution( final dpDem_nominal={0}, - final dpSup_nominal={2*(threeWayValveParameters.dpValve_nominal + max( - threeWayValveParameters.dp_nominal))}, - final dTTraDHW_nominal=dhwParameters.dTLoadingHC1, - final dTTra_nominal={bufParameters.dTLoadingHC1}, + final dpSup_nominal={2*(parThrWayVal.dpValve_nominal + max(parThrWayVal.dp_nominal))}, + final dTTraDHW_nominal=parStoDHW.dTLoadingHC1, + final dTTra_nominal={parStoBuf.dTLoadingHC1}, final m_flow_nominal=mDem_flow_nominal, - final VStoDHW=dhwParameters.V, - final QDHWStoLoss_flow=dhwParameters.QLoss_flow, + final VStoDHW=parStoDHW.V, + final QDHWStoLoss_flow=parStoDHW.QLoss_flow, designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.PartStorage, final TSup_nominal=TDem_nominal .+ dTLoss_nominal .+ dTTra_nominal, final nParallelSup=1, final nParallelDem=1); + parameter Modelica.Units.SI.TemperatureDifference dTLoaHCBuf "Temperature difference for loading of heating coil in buffer storage" annotation(Dialog(group="Component data")); parameter Modelica.Units.SI.PressureDifference dpBufHCSto_nominal "Nominal pressure difference in buffer storage heating coil"; final parameter Modelica.Units.SI.PressureDifference dpDHWHCSto_nominal=sum( - storageDHW.heatingCoil1.pipe.res.dp_nominal) + stoDHW.heatingCoil1.pipe.res.dp_nominal) "Nominal pressure difference in DHW storage heating coil"; - parameter Modelica.Units.SI.HeatFlowRate QHRAftBuf_flow_nominal - "Nominal heat flow rate of heating rod after DHW storage" - annotation (Dialog(group="Component data", enable=use_heatingRodAfterBuffer)); - parameter Boolean use_heatingRodAfterBuffer - "=false to disable the heating rod after the buffer storage" - annotation(Dialog(group="Component choices")); replaceable parameter BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition parTemSen annotation (Dialog(group="Component data"), choicesAllMatching=true, - Placement(transformation(extent={{42,-12}, - {58,4}}))); - replaceable parameter - BESMod.Systems.RecordsCollection.Valves.ThreeWayValve - threeWayValveParameters constrainedby - BESMod.Systems.RecordsCollection.Valves.ThreeWayValve( - final dp_nominal={dpBufHCSto_nominal, dpDHWHCSto_nominal}, + Placement(transformation(extent={{84,102},{100,118}}))); + replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve parThrWayVal + constrainedby BESMod.Systems.RecordsCollection.Valves.ThreeWayValve( + final dp_nominal={dpBufHCSto_nominal,dpDHWHCSto_nominal}, final m_flow_nominal=mSup_flow_nominal[1], final fraK=1, - use_inputFilter=false) annotation (Dialog(group="Component data"), - choicesAllMatching=true, Placement(transformation(extent={{-84,84},{-64,104}}))); + use_inputFilter=false) "Parameters for three way valve" annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{-78,102},{-62,118}}))); - replaceable parameter - RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition bufParameters - constrainedby - RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( + replaceable parameter + RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition parStoBuf + constrainedby RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( final Q_flow_nominal=Q_flow_nominal[1]*f_design[1], final rho=rho, final c_p=cp, @@ -58,92 +49,91 @@ partial model PartialDistributionTwoStorageParallelDetailed final QHC1_flow_nominal=Q_flow_nominal[1]*f_design[1], final mHC1_flow_nominal=mSup_flow_nominal[1], redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, - final use_HC2=storageBuf.useHeatingCoil2, - final use_HC1=storageBuf.useHeatingCoil1, + final use_HC2=stoBuf.useHeatingCoil2, + final use_HC1=stoBuf.useHeatingCoil1, final dTLoadingHC2=9999999, final fHeiHC2=1, final fDiaHC2=1, final QHC2_flow_nominal=9999999, final mHC2_flow_nominal=9999999, redeclare final AixLib.DataBase.Pipes.Copper.Copper_10x0_6 pipeHC2) - annotation (Dialog(group="Component data"), - choicesAllMatching=true, Placement(transformation(extent={{18,26},{32,40}}))); + "Parameters for buffer storage" annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{2,-4},{16,10}}))); replaceable parameter - RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition dhwParameters - constrainedby + RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition parStoDHW + if use_dhw constrainedby RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( - final Q_flow_nominal=0, - final VPerQ_flow=0, - final rho=rho, - final c_p=cp, - final V=if designType == Types.DHWDesignType.FullStorage then VDHWDay * fFullSto else VDHWDay, - final TAmb=TAmb, - T_m=TDHW_nominal, - final QHC1_flow_nominal=QDHW_flow_nominal, - final mHC1_flow_nominal=mSup_flow_nominal[1], - redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, - final use_HC2=storageBuf.useHeatingCoil2, - final use_HC1=storageBuf.useHeatingCoil1, - final dTLoadingHC2=9999999, - final fHeiHC2=1, - final fDiaHC2=1, - final QHC2_flow_nominal=9999999, - final mHC2_flow_nominal=9999999, - redeclare final AixLib.DataBase.Pipes.Copper.Copper_10x0_6 pipeHC2) - annotation(Dialog(group="Component data"), - choicesAllMatching=true, Placement(transformation(extent={{20,-62},{34,-48}}))); - replaceable parameter Generation.RecordsCollection.HeatingRodBaseDataDefinition heatingRodAftBufParameters - if use_heatingRodAfterBuffer - "Parameters for heating rod after buffer storage" - annotation (Dialog(group="Component data", enable=use_heatingRodAfterBuffer), - choicesAllMatching=true, Placement(transformation( - extent={{-6,-6},{6,6}}, - rotation=0, - origin={66,40}))); + final Q_flow_nominal=0, + final VPerQ_flow=0, + final rho=rho, + final c_p=cp, + final V=if designType == Types.DHWDesignType.FullStorage then VDHWDay* + fFullSto else VDHWDay, + final TAmb=TAmb, + T_m=TDHW_nominal, + final QHC1_flow_nominal=QDHW_flow_nominal, + final mHC1_flow_nominal=mSup_flow_nominal[1], + redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, + final use_HC2=stoBuf.useHeatingCoil2, + final use_HC1=stoBuf.useHeatingCoil1, + final dTLoadingHC2=9999999, + final fHeiHC2=1, + final fDiaHC2=1, + final QHC2_flow_nominal=9999999, + final mHC2_flow_nominal=9999999, + redeclare final AixLib.DataBase.Pipes.Copper.Copper_10x0_6 pipeHC2) + "Parameters for DHW storage" annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{-8,-68},{6,-54}}))); + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemBuf(final T= - bufParameters.TAmb) "Constant ambient temperature of storage" - annotation (Placement(transformation( + parStoBuf.TAmb) "Constant ambient temperature of storage" annotation ( + Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=0, - origin={-70,-10}))); + rotation=180, + origin={10,30}))); Modelica.Blocks.Sources.RealExpression reaExpTStoDHWTop(final y( unit="K", - displayUnit="degC") = storageDHW.layer[dhwParameters.nLayer].T) - annotation (Placement(transformation( + displayUnit="degC") = stoDHW.layer[parStoDHW.nLayer].T) if use_dhw + "Directly access temperature layer" annotation (Placement(transformation( extent={{-10,-6},{10,6}}, rotation=0, origin={-30,70}))); Modelica.Blocks.Sources.RealExpression reaExpTStoBufTop(final y( unit="K", - displayUnit="degC") = storageBuf.layer[bufParameters.nLayer].T) - annotation (Placement(transformation( + displayUnit="degC") = stoBuf.layer[parStoBuf.nLayer].T) + "Directly access temperature layer " annotation (Placement(transformation( extent={{-10,-5},{10,5}}, rotation=0, origin={-30,87}))); Modelica.Blocks.Sources.RealExpression reaExpTStoBufBot(final y( unit="K", - displayUnit="degC") = storageBuf.layer[1].T) annotation (Placement( - transformation( + displayUnit="degC") = stoBuf.layer[1].T) + "Directly access temperature layer" annotation (Placement(transformation( extent={{-10,-5},{10,5}}, rotation=0, origin={-30,79}))); Modelica.Blocks.Sources.RealExpression reaExpTStoDHWBot(final y( unit="K", - displayUnit="degC") = storageDHW.layer[1].T) annotation (Placement( - transformation( + displayUnit="degC") = stoDHW.layer[1].T) if use_dhw + "Directly access temperature layer " annotation (Placement(transformation( extent={{-10,-5},{10,5}}, rotation=0, origin={-30,95}))); Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemDHW(final T= - dhwParameters.TAmb) "Constant ambient temperature of storage" - annotation (Placement(transformation( + parStoDHW.TAmb) if use_dhw + "Constant ambient temperature of storage" annotation ( + Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=0, - origin={-70,-88}))); + rotation=180, + origin={0,-30}))); - AixLib.Fluid.Storage.BufferStorage storageBuf( + AixLib.Fluid.Storage.BufferStorage stoBuf( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, @@ -152,31 +142,31 @@ partial model PartialDistributionTwoStorageParallelDetailed redeclare package MediumHC2 = MediumGen, final m1_flow_nominal=mSup_flow_nominal[1], final m2_flow_nominal=m_flow_nominal[1], - final mHC1_flow_nominal=bufParameters.mHC1_flow_nominal, - final mHC2_flow_nominal=bufParameters.mHC2_flow_nominal, + final mHC1_flow_nominal=parStoBuf.mHC1_flow_nominal, + final mHC2_flow_nominal=parStoBuf.mHC2_flow_nominal, final useHeatingCoil2=false, - final useHeatingRod=bufParameters.use_hr, + final useHeatingRod=parStoBuf.use_hr, final TStart=T_start, redeclare final RecordsCollection.BufferStorage.bufferData data( - final hTank=bufParameters.h, + final hTank=parStoBuf.h, hHC1Low=0, - hHR=bufParameters.nLayerHR/bufParameters.nLayer*bufParameters.h, - final dTank=bufParameters.d, - final sWall=bufParameters.sIns/2, - final sIns=bufParameters.sIns/2, - final lambdaWall=bufParameters.lambda_ins, - final lambdaIns=bufParameters.lambda_ins, + hHR=parStoBuf.nLayerHR/parStoBuf.nLayer*parStoBuf.h, + final dTank=parStoBuf.d, + final sWall=parStoBuf.sIns/2, + final sIns=parStoBuf.sIns/2, + final lambdaWall=parStoBuf.lambda_ins, + final lambdaIns=parStoBuf.lambda_ins, final rhoIns=373, final cIns=1000, - pipeHC1=bufParameters.pipeHC1, - pipeHC2=bufParameters.pipeHC2, - lengthHC1=bufParameters.lengthHC1, - lengthHC2=bufParameters.lengthHC2), - final n=bufParameters.nLayer, - final hConIn=bufParameters.hConIn, - final hConOut=bufParameters.hConOut, - final hConHC1=bufParameters.hConHC1, - final hConHC2=bufParameters.hConHC2, + pipeHC1=parStoBuf.pipeHC1, + pipeHC2=parStoBuf.pipeHC2, + lengthHC1=parStoBuf.lengthHC1, + lengthHC2=parStoBuf.lengthHC2), + final n=parStoBuf.nLayer, + final hConIn=parStoBuf.hConIn, + final hConOut=parStoBuf.hConOut, + final hConHC1=parStoBuf.hConHC1, + final hConHC2=parStoBuf.hConHC2, upToDownHC1=true, upToDownHC2=true, final TStartWall=T_start, @@ -185,10 +175,10 @@ partial model PartialDistributionTwoStorageParallelDetailed AixLib.Fluid.Storage.BaseClasses.HeatTransferBuoyancyWetter, final allowFlowReversal_layers=allowFlowReversal, final allowFlowReversal_HC1=allowFlowReversal, - final allowFlowReversal_HC2=allowFlowReversal) - annotation (Placement(transformation(extent={{-36,14},{0,58}}))); + final allowFlowReversal_HC2=allowFlowReversal) "Buffer storage" + annotation (Placement(transformation(extent={{-50,0},{-18,40}}))); - AixLib.Fluid.Storage.BufferStorage storageDHW( + AixLib.Fluid.Storage.BufferStorage stoDHW( redeclare final package Medium = MediumDHW, final energyDynamics=energyDynamics, final p_start=p_start, @@ -197,32 +187,32 @@ partial model PartialDistributionTwoStorageParallelDetailed redeclare final package MediumHC2 = MediumGen, final m1_flow_nominal=mSup_flow_nominal[1], final m2_flow_nominal=mDHW_flow_nominal, - final mHC1_flow_nominal=dhwParameters.mHC1_flow_nominal, - final mHC2_flow_nominal=dhwParameters.mHC2_flow_nominal, + final mHC1_flow_nominal=parStoDHW.mHC1_flow_nominal, + final mHC2_flow_nominal=parStoDHW.mHC2_flow_nominal, final useHeatingCoil1=true, final useHeatingCoil2=false, - final useHeatingRod=dhwParameters.use_hr, + final useHeatingRod=parStoDHW.use_hr, final TStart=T_start, redeclare final RecordsCollection.BufferStorage.bufferData data( - final hTank=dhwParameters.h, + final hTank=parStoDHW.h, hHC1Low=0, - hHR=dhwParameters.nLayerHR/dhwParameters.nLayer*dhwParameters.h, - final dTank=dhwParameters.d, - final sWall=dhwParameters.sIns/2, - final sIns=dhwParameters.sIns/2, - final lambdaWall=dhwParameters.lambda_ins, - final lambdaIns=dhwParameters.lambda_ins, + hHR=parStoDHW.nLayerHR/parStoDHW.nLayer*parStoDHW.h, + final dTank=parStoDHW.d, + final sWall=parStoDHW.sIns/2, + final sIns=parStoDHW.sIns/2, + final lambdaWall=parStoDHW.lambda_ins, + final lambdaIns=parStoDHW.lambda_ins, final rhoIns=373, final cIns=1000, - pipeHC1=dhwParameters.pipeHC1, - pipeHC2=dhwParameters.pipeHC2, - lengthHC1=dhwParameters.lengthHC1, - lengthHC2=dhwParameters.lengthHC2), - final n=dhwParameters.nLayer, - final hConIn=dhwParameters.hConIn, - final hConOut=dhwParameters.hConOut, - final hConHC1=dhwParameters.hConHC1, - final hConHC2=dhwParameters.hConHC2, + pipeHC1=parStoDHW.pipeHC1, + pipeHC2=parStoDHW.pipeHC2, + lengthHC1=parStoDHW.lengthHC1, + lengthHC2=parStoDHW.lengthHC2), + final n=parStoDHW.nLayer, + final hConIn=parStoDHW.hConIn, + final hConOut=parStoDHW.hConOut, + final hConHC1=parStoDHW.hConHC1, + final hConHC2=parStoDHW.hConHC2, final upToDownHC1=true, final upToDownHC2=true, final TStartWall=T_start, @@ -231,51 +221,28 @@ partial model PartialDistributionTwoStorageParallelDetailed AixLib.Fluid.Storage.BaseClasses.HeatTransferBuoyancyWetter, final allowFlowReversal_layers=allowFlowReversal, final allowFlowReversal_HC1=allowFlowReversal, - final allowFlowReversal_HC2=allowFlowReversal) - annotation (Placement(transformation(extent={{-36,-74},{0,-28}}))); - - BESMod.Systems.Hydraulical.Components.HeatingRodWithSecurityControl hea( - redeclare package Medium = Medium, - final allowFlowReversal=allowFlowReversal, - final m_flow_nominal=m_flow_nominal[1], - final m_flow_small=1E-4*abs(m_flow_nominal[1]), - final show_T=show_T, - final dp_nominal=heatingRodAftBufParameters.dp_nominal, - final tau=30, - final energyDynamics=energyDynamics, - final p_start=p_start, - final T_start=T_start, - final Q_flow_nominal=QHRAftBuf_flow_nominal, - final V=heatingRodAftBufParameters.V_hr, - final eta=heatingRodAftBufParameters.eta_hr) if use_heatingRodAfterBuffer - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={50,90}))); - - AixLib.Fluid.Interfaces.PassThroughMedium pasThrHeaRodBuf(redeclare package - Medium = Medium, allowFlowReversal=allowFlowReversal) - if not use_heatingRodAfterBuffer - annotation (Placement(transformation(extent={{40,54},{60,74}}))); + final allowFlowReversal_HC2=allowFlowReversal) if use_dhw "DHW storage" + annotation (Placement(transformation(extent={{-50,-70},{-18,-30}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow QHRStoDHWPre_flow(final - T_ref=293.15, final alpha=0) if dhwParameters.use_hr annotation ( + T_ref=293.15, final alpha=0) if parStoDHW.use_hr and use_dhw + annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-70,-50}))); - Modelica.Blocks.Math.Gain gain(k=dhwParameters.QHR_flow_nominal) - if dhwParameters.use_hr + Modelica.Blocks.Math.Gain gain(k=parStoDHW.QHR_flow_nominal) + if parStoDHW.use_hr and use_dhw annotation (Placement(transformation(extent={{-112,-60},{-92,-40}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow QHRStoBufPre_flow(final - T_ref=293.15, final alpha=0) if bufParameters.use_hr annotation ( + T_ref=293.15, final alpha=0) if parStoBuf.use_hr annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={-70,30}))); - Modelica.Blocks.Math.Gain gainHRBuf(k=bufParameters.QHR_flow_nominal) - if bufParameters.use_hr - annotation (Placement(transformation(extent={{-100,0},{-80,20}}))); + origin={-62,20}))); + Modelica.Blocks.Math.Gain gainHRBuf(k=parStoBuf.QHR_flow_nominal) + if parStoBuf.use_hr + annotation (Placement(transformation(extent={{-100,10},{-80,30}}))); Components.Valves.ThreeWayValveWithFlowReturn threeWayValveWithFlowReturn( redeclare package Medium = MediumGen, @@ -286,8 +253,9 @@ partial model PartialDistributionTwoStorageParallelDetailed final C_start=C_start, final C_nominal=C_nominal, final mSenFac=mSenFac, - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parameters=threeWayValveParameters) - annotation (Placement(transformation(extent={{-80,54},{-60,74}}))); + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parameters=parThrWayVal) + annotation (Placement(transformation(extent={{-80,60},{-60,80}}))); Utilities.KPIs.EnergyKPICalculator eneKPICalBuf(use_inpCon=false, y=fixTemBuf.port.Q_flow) annotation (Placement(transformation(extent={{-60,-160},{-40,-140}}))); @@ -312,20 +280,21 @@ partial model PartialDistributionTwoStorageParallelDetailed BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{30,-108},{50,-88}}))); Utilities.KPIs.EnergyKPICalculator eneKPICalDHWHeaRod(use_inpCon=false, y= - QHRStoDHWPre_flow.Q_flow) if dhwParameters.use_hr annotation (Placement( + QHRStoDHWPre_flow.Q_flow) if parStoDHW.use_hr annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={30,-170}))); - Utilities.KPIs.EnergyKPICalculator eneKPICalAftBufHeaRod(use_inpCon=true) - if use_heatingRodAfterBuffer annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={30,-130}))); Utilities.KPIs.EnergyKPICalculator eneKPICalBufHeaRod(use_inpCon=false, y= - QHRStoBufPre_flow.Q_flow) if bufParameters.use_hr + QHRStoBufPre_flow.Q_flow) if parStoBuf.use_hr annotation (Placement(transformation(extent={{-100,-180},{-80,-160}}))); + AixLib.Fluid.Interfaces.PassThroughMedium pasThrNoDHW(redeclare package Medium = + Medium, allowFlowReversal=allowFlowReversal) if not use_dhw + "Pass through if DHW is disabled" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-70,-70}))); equation connect(reaExpTStoDHWBot.y, sigBusDistr.TStoDHWBotMea) annotation (Line( points={{-19,95},{2.5,95},{2.5,101},{0,101}}, color={0,0,127}), Text( @@ -351,25 +320,14 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(fixTemDHW.port, storageDHW.heatportOutside) annotation (Line(points={{ - -60,-88},{14,-88},{14,-49.62},{-0.45,-49.62}}, color={191,0,0})); - connect(storageBuf.heatportOutside, fixTemBuf.port) annotation (Line(points={{ - -0.45,37.32},{-0.45,36},{4,36},{4,-12},{2,-12},{2,-10},{-60,-10}}, - color={191,0,0})); - connect(portDHW_in, storageDHW.fluidportBottom2) annotation (Line(points={{100, - -82},{-12,-82},{-12,-74.23},{-12.825,-74.23}}, color={0,127,255})); - connect(hea.port_a, storageBuf.fluidportTop2) annotation (Line(points={{40,90}, - {28,90},{28,64},{-12.375,64},{-12.375,58.22}}, color={0,127,255}, - pattern=LinePattern.Dash)); - connect(pasThrHeaRodBuf.port_a, storageBuf.fluidportTop2) annotation (Line( - points={{40,64},{-12.375,64},{-12.375,58.22}}, - color={0,127,255}, - pattern=LinePattern.Dash)); - connect(portBui_in[1], storageBuf.fluidportBottom2) annotation (Line(points={{100, - 40},{102,40},{102,22},{26,22},{26,4},{-12.825,4},{-12.825,13.78}}, - color={0,127,255})); - connect(storageDHW.heatingRod, QHRStoDHWPre_flow.port) annotation (Line( - points={{-36,-51},{-48,-51},{-48,-50},{-60,-50}}, + connect(fixTemDHW.port, stoDHW.heatportOutside) annotation (Line(points={{-10,-30}, + {-14,-30},{-14,-44},{-12,-44},{-12,-48.8},{-18.4,-48.8}}, color={191,0,0})); + connect(stoBuf.heatportOutside, fixTemBuf.port) annotation (Line(points={{-18.4, + 21.2},{-6,21.2},{-6,30},{0,30}}, color={191,0,0})); + connect(portDHW_in, stoDHW.fluidportBottom2) annotation (Line(points={{100,-82}, + {-29.4,-82},{-29.4,-70.2}}, color={0,127,255})); + connect(stoDHW.heatingRod, QHRStoDHWPre_flow.port) annotation (Line( + points={{-50,-50},{-60,-50}}, color={191,0,0}, pattern=LinePattern.Dash)); connect(QHRStoDHWPre_flow.Q_flow, gain.y) annotation (Line( @@ -377,55 +335,46 @@ equation color={0,0,127}, pattern=LinePattern.Dash)); connect(QHRStoBufPre_flow.Q_flow, gainHRBuf.y) annotation (Line( - points={{-80,30},{-79,30},{-79,10}}, + points={{-72,20},{-79,20}}, color={0,0,127}, pattern=LinePattern.Dash)); - connect(QHRStoBufPre_flow.port, storageBuf.heatingRod) annotation (Line( - points={{-60,30},{-40,30},{-40,36},{-36,36}}, + connect(QHRStoBufPre_flow.port, stoBuf.heatingRod) annotation (Line( + points={{-52,20},{-50,20}}, color={191,0,0}, pattern=LinePattern.Dash)); connect(portGen_in[1], threeWayValveWithFlowReturn.portGen_a) annotation ( - Line(points={{-100,80},{-92,80},{-92,68.4},{-80,68.4}}, color={0,127,255})); + Line(points={{-100,80},{-92,80},{-92,74.4},{-80,74.4}}, color={0,127,255})); connect(portGen_out[1], threeWayValveWithFlowReturn.portGen_b) annotation ( - Line(points={{-100,40},{-96,40},{-96,38},{-92,38},{-92,60},{-80,60},{-80, - 60.4}}, + Line(points={{-100,40},{-96,40},{-96,38},{-92,38},{-92,60},{-80,60},{-80,66.4}}, color={0,127,255})); - connect(threeWayValveWithFlowReturn.portDHW_b, storageDHW.portHC1In) - annotation (Line(points={{-60,60.4},{-60,60},{-46,60},{-46,-37.89},{-36.45, - -37.89}}, color={0,127,255})); - connect(storageDHW.portHC1Out, threeWayValveWithFlowReturn.portDHW_a) - annotation (Line(points={{-36.225,-45.02},{-52,-45.02},{-52,56.4},{-60,56.4}}, + connect(threeWayValveWithFlowReturn.portDHW_b, stoDHW.portHC1In) annotation ( + Line(points={{-60,66.4},{-54,66.4},{-54,44},{-64,44},{-64,-38.6},{-50.4,-38.6}}, + color={0,127,255})); + connect(stoDHW.portHC1Out, threeWayValveWithFlowReturn.portDHW_a) annotation ( + Line(points={{-50.2,-44.8},{-66,-44.8},{-66,42},{-56,42},{-56,62.4},{-60,62.4}}, color={0,127,255})); connect(threeWayValveWithFlowReturn.uBuf, sigBusDistr.uThrWayVal) annotation ( - Line(points={{-70,76},{-70,101},{0,101}}, color={0,0,127}), Text( + Line(points={{-70,82},{-70,101},{0,101}}, color={0,0,127}), Text( string="%second", index=1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(senTBuiSup.port_a, hea.port_b) - annotation (Line(points={{66,80},{64,80},{64,90},{60,90}}, - color={0,127,255})); connect(senTBuiSup.port_b, portBui_out[1]) annotation (Line(points={{86,80},{100, 80}}, color={0,127,255})); - connect(senTBuiSup.T, sigBusDistr.TBuiSupMea) annotation (Line(points={{76,91}, - {76,100},{64,100},{64,104},{4,104},{4,102},{0,102},{0,101}}, - color={0,0, + connect(senTBuiSup.T, sigBusDistr.TBuiSupMea) annotation (Line(points={{76,91},{ + 76,104},{4,104},{4,102},{0,102},{0,101}}, color={0,0, 127}), Text( string="%second", index=1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(pasThrHeaRodBuf.port_b, senTBuiSup.port_a) annotation (Line(points={{ - 60,64},{64,64},{64,80},{66,80}}, color={0,127,255})); connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( Line( points={{50,-98},{70,-98}}, color={0,0,0}, thickness=1)); - connect(storageDHW.fluidportTop2, portDHW_out) annotation (Line(points={{-12.375, - -27.77},{-12.375,-20},{100,-20},{100,-22}}, color={0,127,255})); - connect(hea.Pel, eneKPICalAftBufHeaRod.u) annotation (Line(points={{61,96},{61, - 94},{66,94},{66,104},{114,104},{114,-130},{41.8,-130}}, color={0,0,127})); + connect(stoDHW.fluidportTop2, portDHW_out) annotation (Line(points={{-29,-29.8}, + {-29,-14},{84,-14},{84,-22},{100,-22}}, color={0,127,255})); connect(eneKPICalBuf.KPI, outBusDist.QBufLos_flow) annotation (Line(points={{-37.8, -150},{0,-150},{0,-100}}, color={135,135,135}), Text( string="%second", @@ -450,29 +399,23 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(eneKPICalAftBufHeaRod.KPI, outBusDist.PEleHRAftBuf) annotation (Line( - points={{17.8,-130},{0,-130},{0,-100}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(gain.u, sigBusDistr.uHRStoDHW) annotation (Line(points={{-114,-50},{-120, -50},{-120,102},{0,102},{0,101}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(gainHRBuf.u, sigBusDistr.uHRStoBuf) annotation (Line(points={{-102,10}, - {-120,10},{-120,102},{0,102},{0,101}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(hea.u, sigBusDistr.uHRAftBuf) annotation (Line(points={{38,96},{32,96}, - {32,100},{0,100},{0,101}}, color={0,0,127}), Text( + connect(gainHRBuf.u, sigBusDistr.uHRStoBuf) annotation (Line(points={{-102,20},{ + -116,20},{-116,101},{0,101}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - annotation (Diagram(coordinateSystem(extent={{-100,-180},{100,100}}))); -end PartialDistributionTwoStorageParallelDetailed; + connect(threeWayValveWithFlowReturn.portDHW_b, pasThrNoDHW.port_a) annotation ( + Line(points={{-60,66.4},{-54,66.4},{-54,44},{-64,44},{-64,-34},{-88,-34},{-88, + -70},{-80,-70}}, color={0,127,255})); + connect(pasThrNoDHW.port_b, threeWayValveWithFlowReturn.portDHW_a) annotation ( + Line(points={{-60,-70},{-56,-70},{-56,-44},{-66,-44},{-66,42},{-56,42},{-56, + 62},{-60,62},{-60,62.4}}, color={0,127,255})); + annotation (Diagram(coordinateSystem(extent={{-100,-180},{100,140}}))); +end PartialTwoStorageParallel; diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo new file mode 100644 index 00000000..85e38e22 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo @@ -0,0 +1,128 @@ +within BESMod.Systems.Hydraulical.Distribution.BaseClasses; +partial model PartialTwoStorageParallelWithHeaters + "Partial two storage model with heaters" + extends BaseClasses.PartialTwoStorageParallel; + parameter Modelica.Units.SI.HeatFlowRate QHRAftBuf_flow_nominal + "Nominal heat flow rate of heating rod after DHW storage" + annotation (Dialog(group="Component data", enable=heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod)); + parameter BESMod.Systems.Hydraulical.Distribution.Types.HeaterType heaAftBufTyp=BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.No + "Type of heater after the buffer storage" + annotation(Dialog(group="Component choices")); + + replaceable parameter Generation.RecordsCollection.HeatingRodBaseDataDefinition + parHeaRodAftBuf if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod + "Parameters for heating rod after buffer storage" annotation ( + Dialog(group="Component data", enable=heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod), + choicesAllMatching=true, + Placement(transformation( + extent={{-6,-6},{6,6}}, + rotation=0, + origin={50,38}))); + parameter Real etaTem[:,2]=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15, + 0.99] if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler + "Temperature based efficiency" + annotation(Dialog(group="Component data")); + + replaceable parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition + parBoi if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler + "Parameters for Boiler" + annotation(Placement(transformation(extent={{64,124},{80,140}})), + choicesAllMatching=true, Dialog(group="Component data")); + + BESMod.Systems.Hydraulical.Components.HeatingRodWithSecurityControl hea( + redeclare package Medium = Medium, + final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=m_flow_nominal[1], + final m_flow_small=1E-4*abs(m_flow_nominal[1]), + final show_T=show_T, + final dp_nominal=parHeaRodAftBuf.dp_nominal, + final tau=30, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final Q_flow_nominal=QHRAftBuf_flow_nominal, + final V=parHeaRodAftBuf.V_hr, + final eta=parHeaRodAftBuf.eta_hr) if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod + annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={50,90}))); + + AixLib.Fluid.Interfaces.PassThroughMedium pasThrHeaRodBuf(redeclare package + Medium = Medium, allowFlowReversal=allowFlowReversal) if heaAftBufTyp == + BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.No + annotation (Placement(transformation(extent={{40,54},{60,74}}))); + + Utilities.KPIs.EnergyKPICalculator eneKPICalAftBufHeaRod(use_inpCon=true) + if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={30,-130}))); + + AixLib.Fluid.BoilerCHP.BoilerNoControl boi( + redeclare package Medium = AixLib.Media.Water, + final allowFlowReversal=true, + final m_flow_nominal=m_flow_nominal[1], + final m_flow_small=1E-4*abs(m_flow_nominal[1]), + final show_T=show_T, + final initType=Modelica.Blocks.Types.Init.NoInit, + final transferHeat=false, + final rho_default=rho, + final p_start=p_start, + final T_start=T_start, + final etaLoadBased=parBoi.eta, + final G=0.003*parBoi.Q_nom/50, + final C=1.5*parBoi.Q_nom, + final Q_nom=parBoi.Q_nom, + final V=parBoi.volume, + final etaTempBased=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99], + final paramBoiler=parBoi) if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler + "Boiler with external control" + annotation (Placement(transformation(extent={{40,110},{60,130}}))); + + Utilities.KPIs.EnergyKPICalculator KPIBoi(use_inpCon=false, y=boi.thermalPower) + if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler + "Boiler heat flow KPI" + annotation (Placement(transformation(extent={{-60,-200},{-40,-180}}))); +equation + connect(hea.Pel, eneKPICalAftBufHeaRod.u) annotation (Line(points={{61,96},{61, + 94},{66,94},{66,104},{114,104},{114,-130},{41.8,-130}}, color={0,0,127})); + connect(eneKPICalAftBufHeaRod.KPI, outBusDist.PEleHRAftBuf) annotation (Line( + points={{17.8,-130},{0,-130},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(hea.u, sigBusDistr.uHRAftBuf) annotation (Line(points={{38,96},{32,96}, + {32,100},{0,100},{0,101}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(boi.u_rel, sigBusDistr.yBoi) annotation (Line(points={{43,127},{0,127},{ + 0,101}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(KPIBoi.KPI, outBusDist.QBoi_flow) annotation (Line(points={{-37.8,-190}, + {-24,-190},{-24,-192},{0,-192},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(stoBuf.fluidportTop2, pasThrHeaRodBuf.port_a) annotation (Line(points={{ + -29,40.2},{-29,60},{32,60},{32,64},{40,64}}, color={0,127,255})); + connect(stoBuf.fluidportTop2, hea.port_a) annotation (Line(points={{-29,40.2},{-29, + 60},{32,60},{32,90},{40,90}}, color={0,127,255})); + connect(stoBuf.fluidportTop2, boi.port_a) annotation (Line(points={{-29,40.2},{-29, + 60},{32,60},{32,96},{34,96},{34,120},{40,120}}, color={0,127,255})); + connect(boi.port_b, senTBuiSup.port_a) annotation (Line(points={{60,120},{66,120}, + {66,102},{64,102},{64,82},{62,82},{62,80},{66,80}}, color={0,127,255})); + connect(hea.port_b, senTBuiSup.port_a) annotation (Line(points={{60,90},{60,86}, + {66,86},{66,80}}, color={0,127,255})); + connect(pasThrHeaRodBuf.port_b, senTBuiSup.port_a) + annotation (Line(points={{60,64},{66,64},{66,80}}, color={0,127,255})); + annotation (Diagram(coordinateSystem(extent={{-100,-180},{100,140}}))); +end PartialTwoStorageParallelWithHeaters; diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/package.order index 4211005e..8dcef6b5 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/package.order @@ -1,3 +1,4 @@ PartialDistribution -PartialDistributionTwoStorageParallelDetailed +PartialTwoStorageParallel PartialDHWParameters +PartialTwoStorageParallelWithHeaters diff --git a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo index 458af552..2e58cc08 100644 --- a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo @@ -2,14 +2,14 @@ within BESMod.Systems.Hydraulical.Distribution; model DistributionTwoStorageParallel "Buffer storage and DHW storage" extends BaseClasses.PartialDistribution( - final VStoDHW=dhwParameters.V, - final QDHWStoLoss_flow=dhwParameters.QLoss_flow, + final VStoDHW=parStoDHW.V, + final QDHWStoLoss_flow=parStoDHW.QLoss_flow, designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.PartStorage, final dpDem_nominal={0}, - dpSup_nominal={2*(threeWayValveParameters.dpValve_nominal + max( - threeWayValveParameters.dp_nominal))}, - final dTTraDHW_nominal=dhwParameters.dTLoadingHC1, - final dTTra_nominal={bufParameters.dTLoadingHC1}, + dpSup_nominal={2*(parThrWayVal.dpValve_nominal + max( + parThrWayVal.dp_nominal))}, + final dTTraDHW_nominal=parStoDHW.dTLoadingHC1, + final dTTra_nominal={parStoBuf.dTLoadingHC1}, final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, final TSup_nominal=TDem_nominal .+ dTLoss_nominal .+ dTTra_nominal, dTLoss_nominal=fill(0, nParallelDem), @@ -17,56 +17,56 @@ model DistributionTwoStorageParallel nParallelSup=1, final nParallelDem=1); - AixLib.Fluid.Storage.Storage storageDHW( + AixLib.Fluid.Storage.Storage stoDHW( redeclare final package Medium = MediumDHW, - final n=dhwParameters.nLayer, - final d=dhwParameters.d, - final h=dhwParameters.h, - final lambda_ins=dhwParameters.lambda_ins, - final s_ins=dhwParameters.sIns, - final hConIn=dhwParameters.hConIn, - final hConOut=dhwParameters.hConOut, - final k_HE=dhwParameters.k_HE, - final A_HE=dhwParameters.A_HE, - final V_HE=dhwParameters.V_HE, - final beta=dhwParameters.beta, - final kappa=dhwParameters.kappa, + final n=parStoDHW.nLayer, + final d=parStoDHW.d, + final h=parStoDHW.h, + final lambda_ins=parStoDHW.lambda_ins, + final s_ins=parStoDHW.sIns, + final hConIn=parStoDHW.hConIn, + final hConOut=parStoDHW.hConOut, + final k_HE=parStoDHW.k_HE, + final A_HE=parStoDHW.A_HE, + final V_HE=parStoDHW.V_HE, + final beta=parStoDHW.beta, + final kappa=parStoDHW.kappa, final m_flow_nominal_layer=mDHW_flow_nominal, final m_flow_nominal_HE=mSup_flow_nominal[1], final energyDynamics=energyDynamics, final T_start=TDHW_nominal, final p_start=p_start, - final m_flow_small_layer=1E-4*abs(storageDHW.m_flow_nominal_layer), - final m_flow_small_layer_HE=1E-4*abs(storageDHW.m_flow_nominal_HE)) + final m_flow_small_layer=1E-4*abs(stoDHW.m_flow_nominal_layer), + final m_flow_small_layer_HE=1E-4*abs(stoDHW.m_flow_nominal_HE)) "The DHW storage (TWWS) for domestic hot water demand" annotation (Placement(transformation(extent={{66,-70},{32,-32}}))); Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemBuf(final T= - bufParameters.TAmb) "Constant ambient temperature of storage" + parStoBuf.TAmb) "Constant ambient temperature of storage" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={50,10}))); - AixLib.Fluid.Storage.Storage storageBuf( + AixLib.Fluid.Storage.Storage stoBuf( redeclare package Medium = Medium, - final n=bufParameters.nLayer, - final d=bufParameters.d, - final h=bufParameters.h, - final lambda_ins=bufParameters.lambda_ins, - final s_ins=bufParameters.sIns, - final hConIn=bufParameters.hConIn, - final hConOut=bufParameters.hConOut, - final k_HE=bufParameters.k_HE, - final A_HE=bufParameters.A_HE, - final V_HE=bufParameters.V_HE, - final beta=bufParameters.beta, - final kappa=bufParameters.kappa, + final n=parStoBuf.nLayer, + final d=parStoBuf.d, + final h=parStoBuf.h, + final lambda_ins=parStoBuf.lambda_ins, + final s_ins=parStoBuf.sIns, + final hConIn=parStoBuf.hConIn, + final hConOut=parStoBuf.hConOut, + final k_HE=parStoBuf.k_HE, + final A_HE=parStoBuf.A_HE, + final V_HE=parStoBuf.V_HE, + final beta=parStoBuf.beta, + final kappa=parStoBuf.kappa, final m_flow_nominal_layer=m_flow_nominal[1], final m_flow_nominal_HE=mSup_flow_nominal[1], final energyDynamics=energyDynamics, final T_start=T_start, final p_start=p_start, - final m_flow_small_layer=1E-4*abs(storageBuf.m_flow_nominal_layer), - final m_flow_small_layer_HE=1E-4*abs(storageBuf.m_flow_nominal_HE)) + final m_flow_small_layer=1E-4*abs(stoBuf.m_flow_nominal_layer), + final m_flow_small_layer_HE=1E-4*abs(stoBuf.m_flow_nominal_HE)) "The buffer storage (PS) for the building" annotation (Placement(transformation(extent={{66,40},{32,76}}))); Components.Valves.ThreeWayValveWithFlowReturn @@ -79,24 +79,24 @@ model DistributionTwoStorageParallel final C_start=C_start, final C_nominal=C_nominal, final mSenFac=mSenFac, - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parameters=threeWayValveParameters) + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parameters=parThrWayVal) annotation (Placement(transformation(extent={{-60,40},{-20,80}}))); - Modelica.Blocks.Sources.RealExpression T_stoDHWTop(final y(unit="K", displayUnit="degC")=storageDHW.layer[ - dhwParameters.nLayer].T) annotation (Placement(transformation( + Modelica.Blocks.Sources.RealExpression T_stoDHWTop(final y(unit="K", displayUnit="degC")=stoDHW.layer[ + parStoDHW.nLayer].T) annotation (Placement(transformation( extent={{-5,-3},{5,3}}, rotation=180, origin={37,87}))); - Modelica.Blocks.Sources.RealExpression T_stoBufTop(final y(unit="K", displayUnit="degC")=storageBuf.layer[ - bufParameters.nLayer].T) annotation (Placement(transformation( + Modelica.Blocks.Sources.RealExpression T_stoBufTop(final y(unit="K", displayUnit="degC")=stoBuf.layer[ + parStoBuf.nLayer].T) annotation (Placement(transformation( extent={{-5,-2},{5,2}}, rotation=180, origin={23,92}))); - Modelica.Blocks.Sources.RealExpression T_stoBufBot(final y(unit="K", displayUnit="degC")=storageBuf.layer[1].T) + Modelica.Blocks.Sources.RealExpression T_stoBufBot(final y(unit="K", displayUnit="degC")=stoBuf.layer[1].T) annotation (Placement(transformation( extent={{-5,-3},{5,3}}, rotation=180, origin={23,87}))); - Modelica.Blocks.Sources.RealExpression T_stoDHWBot(final y(unit="K", displayUnit="degC")=storageDHW.layer[1].T) + Modelica.Blocks.Sources.RealExpression T_stoDHWBot(final y(unit="K", displayUnit="degC")=stoDHW.layer[1].T) annotation (Placement(transformation( extent={{-5,-3},{5,3}}, rotation=180, @@ -104,7 +104,7 @@ model DistributionTwoStorageParallel replaceable parameter BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.SimpleStorageBaseDataDefinition - bufParameters constrainedby + parStoBuf constrainedby BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.SimpleStorageBaseDataDefinition( final Q_flow_nominal=Q_flow_nominal[1]*f_design[1], final rho=rho, @@ -117,7 +117,7 @@ model DistributionTwoStorageParallel choicesAllMatching=true, Placement(transformation(extent={{84,56},{98,70}}))); replaceable parameter BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.SimpleStorageBaseDataDefinition - dhwParameters constrainedby + parStoDHW constrainedby BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.SimpleStorageBaseDataDefinition( final rho=rho, final c_p=cp, @@ -131,7 +131,7 @@ model DistributionTwoStorageParallel redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1) annotation ( choicesAllMatching=true, Placement(transformation(extent={{82,-58},{98,-42}}))); Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemDHW(final T= - dhwParameters.TAmb) "Constant ambient temperature of storage" + parStoDHW.TAmb) "Constant ambient temperature of storage" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -144,7 +144,7 @@ model DistributionTwoStorageParallel BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{34,-110},{54,-90}}))); replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve - threeWayValveParameters constrainedby + parThrWayVal constrainedby BESMod.Systems.RecordsCollection.Valves.ThreeWayValve( final dp_nominal={resBui.dp_nominal, resDHW.dp_nominal}, final m_flow_nominal=mSup_flow_nominal[1], @@ -184,17 +184,17 @@ model DistributionTwoStorageParallel rotation=90, origin={10,10}))); equation - connect(fixTemBuf.port, storageBuf.heatPort) annotation (Line(points={{60,10}, + connect(fixTemBuf.port, stoBuf.heatPort) annotation (Line(points={{60,10}, {80,10},{80,58},{62.6,58}}, color={191,0,0})); - connect(storageBuf.port_b_consumer, portBui_out[1]) annotation (Line(points={{49,76}, + connect(stoBuf.port_b_consumer, portBui_out[1]) annotation (Line(points={{49,76}, {50,76},{50,80},{100,80}}, color={0,127,255})); - connect(storageBuf.port_a_consumer, portBui_in[1]) annotation (Line(points={{49,40}, + connect(stoBuf.port_a_consumer, portBui_in[1]) annotation (Line(points={{49,40}, {100,40}}, color={0,127,255})); - connect(storageDHW.port_b_consumer, portDHW_out) annotation (Line(points={{49,-32}, + connect(stoDHW.port_b_consumer, portDHW_out) annotation (Line(points={{49,-32}, {48,-32},{48,-22},{100,-22}}, color={0,127,255})); - connect(portDHW_in, storageDHW.port_a_consumer) annotation (Line(points={{100,-82}, + connect(portDHW_in, stoDHW.port_a_consumer) annotation (Line(points={{100,-82}, {48,-82},{48,-70},{49,-70}}, color={0,127,255})); - connect(fixTemDHW.port, storageDHW.heatPort) annotation (Line(points={{40,-90}, + connect(fixTemDHW.port, stoDHW.heatPort) annotation (Line(points={{40,-90}, {70,-90},{70,-51},{62.6,-51}}, color={191,0,0})); connect(T_stoDHWBot.y, sigBusDistr.TStoDHWBotMea) annotation (Line(points={{31.5, 99},{0,99},{0,101}}, color={0,0,127}), Text( @@ -225,10 +225,10 @@ equation points={{54,-100},{54,-98},{70,-98}}, color={0,0,0}, thickness=1)); - connect(storageBuf.port_b_heatGenerator, threeWayValveWithFlowReturn.portBui_a) + connect(stoBuf.port_b_heatGenerator, threeWayValveWithFlowReturn.portBui_a) annotation (Line(points={{34.72,43.6},{34.72,42},{-12,42},{-12,68},{-20,68}}, color={0,127,255})); - connect(storageDHW.port_b_heatGenerator, threeWayValveWithFlowReturn.portDHW_a) + connect(stoDHW.port_b_heatGenerator, threeWayValveWithFlowReturn.portDHW_a) annotation (Line(points={{34.72,-66.2},{-20,-66.2},{-20,44.8}}, color={0,127, 255})); connect(threeWayValveWithFlowReturn.portGen_b, portGen_out[1]) annotation ( @@ -245,11 +245,11 @@ equation connect(threeWayValveWithFlowReturn.portBui_b, resBui.port_a) annotation (Line(points={{-20,76},{-10,76},{-10,70},{0,70}}, color={0,127,255})); - connect(storageBuf.port_a_heatGenerator, resBui.port_b) annotation (Line( + connect(stoBuf.port_a_heatGenerator, resBui.port_b) annotation (Line( points={{34.72,73.84},{34.72,70},{20,70}}, color={0,127,255})); connect(threeWayValveWithFlowReturn.portDHW_b, resDHW.port_a) annotation ( Line(points={{-20,52.8},{-14,52.8},{-14,-30},{0,-30}}, color={0,127,255})); - connect(storageDHW.port_a_heatGenerator, resDHW.port_b) annotation (Line( + connect(stoDHW.port_a_heatGenerator, resDHW.port_b) annotation (Line( points={{34.72,-34.28},{34,-34.28},{34,-30},{20,-30}}, color={0,127,255})); connect(eneKPICalDHW.KPI, outBusDist.QDHWLos_flow) annotation (Line(points={{ @@ -264,6 +264,6 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(bouPumBuf.ports[1], storageBuf.port_a_consumer) annotation (Line( + connect(bouPumBuf.ports[1], stoBuf.port_a_consumer) annotation (Line( points={{10,20},{10,32},{49,32},{49,40}}, color={0,127,255})); end DistributionTwoStorageParallel; diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo index 7fe752cb..89c150f1 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo @@ -4,22 +4,21 @@ model TestDirectLoading BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading distribution( QHRAftBuf_flow_nominal=0, - use_heatingRodAfterBuffer=false, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - threeWayValveParameters, + parThrWayVal, redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - bufParameters, + parStoBuf, redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - dhwParameters(dTLoadingHC1=5), + parStoDHW(dTLoadingHC1=5), redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodAftBufParameters)); + parHeaRodAftBuf)); extends Modelica.Icons.Example; Modelica.Blocks.Sources.Pulse pulse( period=100) annotation ( diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo index 84cdc022..0293d94d 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo @@ -4,22 +4,21 @@ model TestIndirectLoading BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading distribution( QHRAftBuf_flow_nominal=0, - use_heatingRodAfterBuffer=false, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - threeWayValveParameters, + parThrWayVal, redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - bufParameters, + parStoBuf, redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - dhwParameters, + parStoDHW, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - heatingRodAftBufParameters, + parHeaRodAftBuf, dTLoaHCBuf=10)); extends Modelica.Icons.Example; diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestSimpleStorages.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestSimpleStorages.mo index 9fecf462..dadde777 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestSimpleStorages.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestSimpleStorages.mo @@ -4,11 +4,11 @@ model TestSimpleStorages BESMod.Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution(redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - bufParameters(dTLoadingHC1=5), redeclare + parStoBuf(dTLoadingHC1=5), redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - dhwParameters(dTLoadingHC1=5), + parStoDHW(dTLoadingHC1=5), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - threeWayValveParameters)); + parThrWayVal)); extends Modelica.Icons.Example; Modelica.Blocks.Sources.Pulse pulse( period=100) annotation ( diff --git a/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedDirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedDirectLoading.mo index bc654b5e..b179b5f8 100644 --- a/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedDirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedDirectLoading.mo @@ -1,16 +1,17 @@ within BESMod.Systems.Hydraulical.Distribution; model TwoStoDetailedDirectLoading "Two detailed storages, direct loading of space heating" - extends BaseClasses.PartialDistributionTwoStorageParallelDetailed( - storageBuf(final useHeatingCoil1=false), + extends BaseClasses.PartialTwoStorageParallelWithHeaters( + stoBuf(final useHeatingCoil1=false), final dpBufHCSto_nominal=0, final dTLoaHCBuf=0); equation - connect(threeWayValveWithFlowReturn.portBui_b, storageBuf.fluidportTop1) - annotation (Line(points={{-60,72},{-58,72},{-58,66},{-24,66},{-24,58.22},{-24.3, - 58.22}}, color={0,127,255})); - connect(threeWayValveWithFlowReturn.portBui_a, storageBuf.fluidportBottom1) - annotation (Line(points={{-60,68},{-60,68},{-60,64},{-42,64},{-42,4},{-24,4}, - {-24,13.56},{-24.075,13.56}}, + connect(threeWayValveWithFlowReturn.portBui_b, stoBuf.fluidportTop1) + annotation (Line(points={{-60,78},{-58,78},{-58,66},{-24,66},{-24,40.2},{ + -39.6,40.2}}, + color={0,127,255})); + connect(threeWayValveWithFlowReturn.portBui_a, stoBuf.fluidportBottom1) + annotation (Line(points={{-60,74},{-60,74},{-60,64},{-42,64},{-42,4},{-24,4}, + {-24,-0.4},{-39.4,-0.4}}, color={0,127,255})); end TwoStoDetailedDirectLoading; diff --git a/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedIndirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedIndirectLoading.mo index 710de858..991e6a29 100644 --- a/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedIndirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedIndirectLoading.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Distribution; model TwoStoDetailedIndirectLoading "Two detailed storages, indirect loading of space heating" - extends BaseClasses.PartialDistributionTwoStorageParallelDetailed(final - dpBufHCSto_nominal=sum(storageBuf.heatingCoil1.pipe.res.dp_nominal)); + extends BaseClasses.PartialTwoStorageParallelWithHeaters(final + dpBufHCSto_nominal=sum(stoBuf.heatingCoil1.pipe.res.dp_nominal)); IBPSA.Fluid.Sources.Boundary_pT bouPumBuf( redeclare package Medium = Medium, final p=p_start, @@ -13,12 +13,13 @@ model TwoStoDetailedIndirectLoading "Two detailed storages, indirect loading of rotation=90, origin={-10,-10}))); equation - connect(threeWayValveWithFlowReturn.portBui_b, storageBuf.portHC1In) - annotation (Line(points={{-60,72},{-58,72},{-58,48.54},{-36.45,48.54}}, + connect(threeWayValveWithFlowReturn.portBui_b, stoBuf.portHC1In) + annotation (Line(points={{-60,78},{-58,78},{-58,31.4},{-50.4,31.4}}, color={0,127,255})); - connect(threeWayValveWithFlowReturn.portBui_a, storageBuf.portHC1Out) - annotation (Line(points={{-60,68},{-58,68},{-58,66},{-50,66},{-50,41.72},{-36.225, - 41.72}}, color={0,127,255})); - connect(bouPumBuf.ports[1], storageBuf.fluidportBottom2) annotation (Line( - points={{-10,0},{-10,13.78},{-12.825,13.78}}, color={0,127,255})); + connect(threeWayValveWithFlowReturn.portBui_a, stoBuf.portHC1Out) + annotation (Line(points={{-60,74},{-58,74},{-58,66},{-50,66},{-50,25.2},{ + -50.2,25.2}}, + color={0,127,255})); + connect(bouPumBuf.ports[1], stoBuf.fluidportBottom2) annotation (Line( + points={{-10,0},{-10,-0.2},{-29.4,-0.2}}, color={0,127,255})); end TwoStoDetailedIndirectLoading; diff --git a/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo index b3f9bda0..1c124bb1 100644 --- a/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo +++ b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo @@ -3,10 +3,10 @@ model TwoStoragesBoilerWithDHW "Two storages with a boiler after buffer and with DHW support" extends BESMod.Systems.Hydraulical.Distribution.BaseClasses.PartialDistribution( final dpDem_nominal={0}, - final dpSup_nominal={2*(threeWayValveParameters1.dpValve_nominal + max( - threeWayValveParameters1.dp_nominal))}, - final dTTraDHW_nominal=dhwParameters.dTLoadingHC1, - final dTTra_nominal={bufParameters.dTLoadingHC1}, + final dpSup_nominal={2*(parThrWayVal1.dpValve_nominal + max( + parThrWayVal1.dp_nominal))}, + final dTTraDHW_nominal=parStoDHW.dTLoadingHC1, + final dTTra_nominal={parStoBuf.dTLoadingHC1}, final m_flow_nominal=mDem_flow_nominal, final TSup_nominal=TDem_nominal .+ dTLoss_nominal .+ dTTra_nominal, final nParallelSup=1, @@ -22,7 +22,7 @@ model TwoStoragesBoilerWithDHW parameter Modelica.Units.SI.PressureDifference dpBufHCSto_nominal=0 "Nominal pressure difference in buffer storage heating coil"; final parameter Modelica.Units.SI.PressureDifference dpDHWHCSto_nominal=sum( - storageDHW.heatingCoil1.pipe.res.dp_nominal) + stoDHW.heatingCoil1.pipe.res.dp_nominal) "Nominal pressure difference in DHW storage heating coil"; parameter Modelica.Units.SI.HeatFlowRate QHRAftBuf_flow_nominal "Nominal heat flow rate of heating rod after DHW storage" @@ -37,7 +37,7 @@ model TwoStoragesBoilerWithDHW parTemSen annotation (choicesAllMatching=true, Placement(transformation(extent={{126,116}, {144,130}}))); - replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve threeWayValveParameters1 + replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve parThrWayVal1 constrainedby BESMod.Systems.RecordsCollection.Valves.ThreeWayValve( final dp_nominal={dpBufHCSto_nominal,dpDHWHCSto_nominal}, final m_flow_nominal=mSup_flow_nominal[1], @@ -47,7 +47,7 @@ model TwoStoragesBoilerWithDHW replaceable BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition - bufParameters(discretizationStepsHR=2) + parStoBuf(discretizationStepsHR=2) constrainedby BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( final Q_flow_nominal=Q_flow_nominal[1]*f_design[1], @@ -58,8 +58,8 @@ replaceable final QHC1_flow_nominal=Q_flow_nominal[1]*f_design[1], final mHC1_flow_nominal=mSup_flow_nominal[1], redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, - final use_HC2=storageBuf.useHeatingCoil2, - final use_HC1=storageBuf.useHeatingCoil1, + final use_HC2=stoBuf.useHeatingCoil2, + final use_HC1=stoBuf.useHeatingCoil1, final dTLoadingHC1=0, final dTLoadingHC2=9999999, final fHeiHC2=1, @@ -72,14 +72,14 @@ replaceable replaceable BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition - dhwParameters(redeclare final AixLib.DataBase.Pipes.Copper.Copper_28x1 + parStoDHW(redeclare final AixLib.DataBase.Pipes.Copper.Copper_28x1 pipeHC1, redeclare final AixLib.DataBase.Pipes.Copper.Copper_28x1 pipeHC2) constrainedby BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( final rho=rho, final c_p=cp, final TAmb=TAmb, - final use_HC1=storageDHW.useHeatingCoil1, + final use_HC1=stoDHW.useHeatingCoil1, final QHC1_flow_nominal=Q_flow_nominal[1]*f_design[1], final V=VDHWDay, final Q_flow_nominal=QDHW_flow_nominal, @@ -87,7 +87,7 @@ replaceable T_m=TDHW_nominal, final mHC1_flow_nominal=mSup_flow_nominal[1], redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, - final use_HC2=storageDHW.useHeatingCoil2, + final use_HC2=stoDHW.useHeatingCoil2, final dTLoadingHC2=5, final fHeiHC2=1, final fDiaHC2=1, @@ -97,37 +97,37 @@ replaceable annotation (choicesAllMatching=true, Placement(transformation(extent={{20,-62}, {34,-48}}))); - Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperatureBuf(final T=bufParameters.TAmb) annotation (Placement(transformation( + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperatureBuf(final T=parStoBuf.TAmb) annotation (Placement(transformation( extent={{-12,-12},{12,12}}, rotation=0, origin={-82,2}))); - Modelica.Blocks.Sources.RealExpression T_stoDHWTop(final y(unit="K", displayUnit="degC")=storageDHW.layer[ - dhwParameters.nLayer].T) annotation (Placement(transformation( + Modelica.Blocks.Sources.RealExpression T_stoDHWTop(final y(unit="K", displayUnit="degC")=stoDHW.layer[ + parStoDHW.nLayer].T) annotation (Placement(transformation( extent={{-17,-6},{17,6}}, rotation=0, origin={-33,70}))); - Modelica.Blocks.Sources.RealExpression T_stoBufTop(final y(unit="K", displayUnit="degC")=storageBuf.layer[ - bufParameters.nLayer].T) annotation (Placement(transformation( + Modelica.Blocks.Sources.RealExpression T_stoBufTop(final y(unit="K", displayUnit="degC")=stoBuf.layer[ + parStoBuf.nLayer].T) annotation (Placement(transformation( extent={{-16,-5},{16,5}}, rotation=0, origin={-34,87}))); - Modelica.Blocks.Sources.RealExpression T_stoBufBot(final y(unit="K", displayUnit="degC")=storageBuf.layer[1].T) + Modelica.Blocks.Sources.RealExpression T_stoBufBot(final y(unit="K", displayUnit="degC")=stoBuf.layer[1].T) annotation (Placement(transformation( extent={{-16,-5},{16,5}}, rotation=0, origin={-34,79}))); - Modelica.Blocks.Sources.RealExpression T_stoDHWBot(final y(unit="K", displayUnit="degC")=storageDHW.layer[1].T) + Modelica.Blocks.Sources.RealExpression T_stoDHWBot(final y(unit="K", displayUnit="degC")=stoDHW.layer[1].T) annotation (Placement(transformation( extent={{-16,-5},{16,5}}, rotation=0, origin={-34,95}))); - Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperatureDHW(final T=dhwParameters.TAmb) annotation (Placement(transformation( + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperatureDHW(final T=parStoDHW.TAmb) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-72,-88}))); - AixLib.Fluid.Storage.BufferStorage storageBuf( + AixLib.Fluid.Storage.BufferStorage stoBuf( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, @@ -136,33 +136,33 @@ replaceable redeclare package MediumHC2 = MediumGen, final m1_flow_nominal=mSup_flow_nominal[1], final m2_flow_nominal=m_flow_nominal[1], - final mHC1_flow_nominal=bufParameters.mHC1_flow_nominal, - final mHC2_flow_nominal=bufParameters.mHC2_flow_nominal, + final mHC1_flow_nominal=parStoBuf.mHC1_flow_nominal, + final mHC2_flow_nominal=parStoBuf.mHC2_flow_nominal, useHeatingCoil1=false, final useHeatingCoil2=false, - final useHeatingRod=bufParameters.use_hr, + final useHeatingRod=parStoBuf.use_hr, final TStart=T_start, redeclare final BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.bufferData data( - final hTank=bufParameters.h, + final hTank=parStoBuf.h, hHC1Low=0, - hHR=bufParameters.nLayerHR/bufParameters.nLayer*bufParameters.h, - final dTank=bufParameters.d, - final sWall=bufParameters.sIns/2, - final sIns=bufParameters.sIns/2, - final lambdaWall=bufParameters.lambda_ins, - final lambdaIns=bufParameters.lambda_ins, + hHR=parStoBuf.nLayerHR/parStoBuf.nLayer*parStoBuf.h, + final dTank=parStoBuf.d, + final sWall=parStoBuf.sIns/2, + final sIns=parStoBuf.sIns/2, + final lambdaWall=parStoBuf.lambda_ins, + final lambdaIns=parStoBuf.lambda_ins, final rhoIns=373000, final cIns=1000, - pipeHC1=bufParameters.pipeHC1, - pipeHC2=bufParameters.pipeHC2, - lengthHC1=bufParameters.lengthHC1, - lengthHC2=bufParameters.lengthHC2), - final n=bufParameters.nLayer, - final hConIn=bufParameters.hConIn, - final hConOut=bufParameters.hConOut, - final hConHC1=bufParameters.hConHC1, - final hConHC2=bufParameters.hConHC2, + pipeHC1=parStoBuf.pipeHC1, + pipeHC2=parStoBuf.pipeHC2, + lengthHC1=parStoBuf.lengthHC1, + lengthHC2=parStoBuf.lengthHC2), + final n=parStoBuf.nLayer, + final hConIn=parStoBuf.hConIn, + final hConOut=parStoBuf.hConOut, + final hConHC1=parStoBuf.hConHC1, + final hConHC2=parStoBuf.hConHC2, upToDownHC1=true, upToDownHC2=true, final TStartWall=T_start, @@ -174,7 +174,7 @@ replaceable final allowFlowReversal_HC2=allowFlowReversal) annotation (Placement(transformation(extent={{-36,14},{0,58}}))); - AixLib.Fluid.Storage.BufferStorage storageDHW( + AixLib.Fluid.Storage.BufferStorage stoDHW( redeclare final package Medium = MediumDHW, final energyDynamics=energyDynamics, final p_start=p_start, @@ -183,33 +183,33 @@ replaceable redeclare final package MediumHC2 = MediumGen, final m1_flow_nominal=mSup_flow_nominal[1], final m2_flow_nominal=mDHW_flow_nominal, - final mHC1_flow_nominal=dhwParameters.mHC1_flow_nominal, - final mHC2_flow_nominal=dhwParameters.mHC2_flow_nominal, + final mHC1_flow_nominal=parStoDHW.mHC1_flow_nominal, + final mHC2_flow_nominal=parStoDHW.mHC2_flow_nominal, final useHeatingCoil1=true, final useHeatingCoil2=true, - final useHeatingRod=dhwParameters.use_hr, + final useHeatingRod=parStoDHW.use_hr, final TStart=T_start, redeclare final BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.bufferData data( - final hTank=dhwParameters.h, + final hTank=parStoDHW.h, hHC1Low=0, - hHR=dhwParameters.nLayerHR/dhwParameters.nLayer*dhwParameters.h, - final dTank=dhwParameters.d, - final sWall=dhwParameters.sIns/2, - final sIns=dhwParameters.sIns/2, - final lambdaWall=dhwParameters.lambda_ins, - final lambdaIns=dhwParameters.lambda_ins, + hHR=parStoDHW.nLayerHR/parStoDHW.nLayer*parStoDHW.h, + final dTank=parStoDHW.d, + final sWall=parStoDHW.sIns/2, + final sIns=parStoDHW.sIns/2, + final lambdaWall=parStoDHW.lambda_ins, + final lambdaIns=parStoDHW.lambda_ins, final rhoIns=373000, final cIns=1000, - pipeHC1=dhwParameters.pipeHC1, - pipeHC2=dhwParameters.pipeHC2, - lengthHC1=dhwParameters.lengthHC1, - lengthHC2=dhwParameters.lengthHC2), - final n=dhwParameters.nLayer, - final hConIn=dhwParameters.hConIn, - final hConOut=dhwParameters.hConOut, - final hConHC1=dhwParameters.hConHC1, - final hConHC2=dhwParameters.hConHC2, + pipeHC1=parStoDHW.pipeHC1, + pipeHC2=parStoDHW.pipeHC2, + lengthHC1=parStoDHW.lengthHC1, + lengthHC2=parStoDHW.lengthHC2), + final n=parStoDHW.nLayer, + final hConIn=parStoDHW.hConIn, + final hConOut=parStoDHW.hConOut, + final hConHC1=parStoDHW.hConHC1, + final hConHC2=parStoDHW.hConHC2, final upToDownHC1=true, final upToDownHC2=true, final TStartWall=T_start, @@ -222,22 +222,22 @@ replaceable annotation (Placement(transformation(extent={{-36,-74},{0,-28}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow QHRStoDHWPre_flow(final - T_ref=293.15, final alpha=0) if dhwParameters.use_hr annotation ( + T_ref=293.15, final alpha=0) if parStoDHW.use_hr annotation ( Placement(transformation( extent={{-7,-7},{7,7}}, rotation=0, origin={-69,-51}))); - Modelica.Blocks.Math.Gain gain(k=dhwParameters.QHR_flow_nominal) -if dhwParameters.use_hr + Modelica.Blocks.Math.Gain gain(k=parStoDHW.QHR_flow_nominal) +if parStoDHW.use_hr annotation (Placement(transformation(extent={{-102,-60},{-86,-42}}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow QHRStoBufPre_flow1(final - T_ref=293.15, final alpha=0) if bufParameters.use_hr annotation ( + T_ref=293.15, final alpha=0) if parStoBuf.use_hr annotation ( Placement(transformation( extent={{-7,-7},{7,7}}, rotation=0, origin={-47,35}))); - Modelica.Blocks.Math.Gain gainHRBuf(k=bufParameters.QHR_flow_nominal) -if bufParameters.use_hr + Modelica.Blocks.Math.Gain gainHRBuf(k=parStoBuf.QHR_flow_nominal) +if parStoBuf.use_hr annotation (Placement(transformation(extent={{-80,18},{-64,36}}))); BESMod.Systems.Hydraulical.Distribution.Components.Valves.ThreeWayValveWithFlowReturn @@ -251,7 +251,7 @@ if bufParameters.use_hr final C_nominal=C_nominal, final mSenFac=mSenFac, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parameters=threeWayValveParameters1) + parameters=parThrWayVal1) annotation (Placement(transformation(extent={{-84,54},{-64,74}}))); IBPSA.Fluid.Sensors.TemperatureTwoPort senTBuiSup( @@ -301,7 +301,7 @@ if bufParameters.use_hr final C_nominal=C_nominal, final mSenFac=mSenFac, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parameters(m_flow_nominal=m_flow_nominal[1], dp_nominal={0, sum(storageDHW.heatingCoil2.pipe.res.dp_nominal)})) + parameters(m_flow_nominal=m_flow_nominal[1], dp_nominal={0, sum(stoDHW.heatingCoil2.pipe.res.dp_nominal)})) annotation (Placement(transformation(extent={{38,48},{58,68}}))); AixLib.Fluid.Storage.BufferStorage HydraulischeWeiche( redeclare final package Medium = Medium, @@ -312,8 +312,8 @@ if bufParameters.use_hr redeclare package MediumHC2 = IBPSA.Media.Water, final m1_flow_nominal=m_flow_nominal[1], final m2_flow_nominal=m_flow_nominal[1], - final mHC1_flow_nominal=bufParameters.mHC1_flow_nominal, - final mHC2_flow_nominal=bufParameters.mHC2_flow_nominal, + final mHC1_flow_nominal=parStoBuf.mHC1_flow_nominal, + final mHC2_flow_nominal=parStoBuf.mHC2_flow_nominal, useHeatingCoil1=false, final useHeatingCoil2=false, final useHeatingRod=false, @@ -323,7 +323,7 @@ if bufParameters.use_hr data( final hTank=hydParameters.h, hHC1Low=0, - hHR=hydParameters.nLayerHR/hydParameters.nLayer*bufParameters.h, + hHR=hydParameters.nLayerHR/hydParameters.nLayer*parStoBuf.h, final dTank=hydParameters.d, final sWall=hydParameters.sIns/2, final sIns=hydParameters.sIns/2, @@ -338,8 +338,8 @@ if bufParameters.use_hr final n=hydParameters.nLayer, final hConIn=hydParameters.hConIn, final hConOut=hydParameters.hConOut, - final hConHC1=bufParameters.hConHC1, - final hConHC2=bufParameters.hConHC2, + final hConHC1=parStoBuf.hConHC1, + final hConHC2=parStoBuf.hConHC2, upToDownHC1=true, upToDownHC2=true, final TStartWall=T_start, @@ -363,8 +363,8 @@ replaceable final QHC1_flow_nominal=Q_flow_nominal[1]*f_design[1], final mHC1_flow_nominal=mSup_flow_nominal[1], redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, - final use_HC2=storageBuf.useHeatingCoil2, - final use_HC1=storageBuf.useHeatingCoil1, + final use_HC2=stoBuf.useHeatingCoil2, + final use_HC1=stoBuf.useHeatingCoil1, final dTLoadingHC2=9999999, final dTLoadingHC1=9999999, final fHeiHC2=1, @@ -416,10 +416,10 @@ replaceable annotation (Placement(transformation(extent={{108,164},{128,184}}))); Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemBuf(final T= - bufParameters.TAmb) "Constant ambient temperature of storage"; + parStoBuf.TAmb) "Constant ambient temperature of storage"; Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemDHW(final T= - dhwParameters.TAmb) "Constant ambient temperature of storage"; + parStoDHW.TAmb) "Constant ambient temperature of storage"; Utilities.KPIs.EnergyKPICalculator eneKPICalBuf(use_inpCon=false, y=fixTemBuf.port.Q_flow) annotation (Placement(transformation(extent={{-42,-118},{-22,-98}}))); @@ -451,13 +451,13 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(fixedTemperatureDHW.port, storageDHW.heatportOutside) annotation ( + connect(fixedTemperatureDHW.port, stoDHW.heatportOutside) annotation ( Line(points={{-62,-88},{14,-88},{14,-49.62},{-0.45,-49.62}},color={191,0,0})); - connect(storageBuf.heatportOutside, fixedTemperatureBuf.port) annotation ( + connect(stoBuf.heatportOutside, fixedTemperatureBuf.port) annotation ( Line(points={{-0.45,37.32},{12,37.32},{12,2},{-70,2}},color={191,0,0})); - connect(portDHW_in, storageDHW.fluidportBottom2) annotation (Line(points={{100, + connect(portDHW_in, stoDHW.fluidportBottom2) annotation (Line(points={{100, -82},{-12,-82},{-12,-74.23},{-12.825,-74.23}}, color={0,127,255})); - connect(storageDHW.heatingRod, QHRStoDHWPre_flow.port) annotation (Line( + connect(stoDHW.heatingRod, QHRStoDHWPre_flow.port) annotation (Line( points={{-36,-51},{-62,-51}}, color={191,0,0}, pattern=LinePattern.Dash)); @@ -469,7 +469,7 @@ equation points={{-54,35},{-58,35},{-58,27},{-63.2,27}}, color={0,0,127}, pattern=LinePattern.Dash)); - connect(QHRStoBufPre_flow1.port, storageBuf.heatingRod) annotation (Line( + connect(QHRStoBufPre_flow1.port, stoBuf.heatingRod) annotation (Line( points={{-40,35},{-40,36},{-36,36}}, color={191,0,0}, pattern=LinePattern.Dash)); @@ -478,10 +478,10 @@ equation connect(portGen_out[1], threeWayValveWithFlowReturn.portGen_b) annotation ( Line(points={{-100,40},{-96,40},{-96,38},{-92,38},{-92,60},{-84,60},{-84,60.4}}, color={0,127,255})); - connect(threeWayValveWithFlowReturn.portDHW_b, storageDHW.portHC1In) + connect(threeWayValveWithFlowReturn.portDHW_b, stoDHW.portHC1In) annotation (Line(points={{-64,60.4},{-60,60.4},{-60,60},{-46,60},{-46,-37.89}, {-36.45,-37.89}}, color={0,127,255})); - connect(storageDHW.portHC1Out, threeWayValveWithFlowReturn.portDHW_a) + connect(stoDHW.portHC1Out, threeWayValveWithFlowReturn.portDHW_a) annotation (Line(points={{-36.225,-45.02},{-52,-45.02},{-52,56.4},{-64,56.4}}, color={0,127,255})); connect(threeWayValveWithFlowReturn.uBuf, sigBusDistr.uThrWayVal) annotation ( @@ -503,21 +503,21 @@ equation points={{50,-98},{70,-98}}, color={0,0,0}, thickness=1)); - connect(storageDHW.fluidportTop2, portDHW_out) annotation (Line(points={{-12.375, + connect(stoDHW.fluidportTop2, portDHW_out) annotation (Line(points={{-12.375, -27.77},{-12.375,-20},{100,-20},{100,-22}}, color={0,127,255})); - connect(storageBuf.fluidportTop1, threeWayValveWithFlowReturn.portBui_b) + connect(stoBuf.fluidportTop1, threeWayValveWithFlowReturn.portBui_b) annotation (Line(points={{-24.3,58.22},{-52,58.22},{-52,62},{-56,62},{-56,72}, {-64,72}}, color={0,127,255})); - connect(storageBuf.fluidportBottom1, threeWayValveWithFlowReturn.portBui_a) + connect(stoBuf.fluidportBottom1, threeWayValveWithFlowReturn.portBui_a) annotation (Line(points={{-24.075,13.56},{-24.075,6},{-42,6},{-42,68},{-64,68}}, color={0,127,255})); - connect(threeWayValveWithFlowReturn2.portGen_b, storageBuf.fluidportBottom2) + connect(threeWayValveWithFlowReturn2.portGen_b, stoBuf.fluidportBottom2) annotation (Line(points={{38,54.4},{10,54.4},{10,4},{-12.825,4},{-12.825, 13.78}}, color={0,127,255})); - connect(threeWayValveWithFlowReturn2.portDHW_b, storageDHW.portHC2In) + connect(threeWayValveWithFlowReturn2.portDHW_b, stoDHW.portHC2In) annotation (Line(points={{58,54.4},{60,54.4},{60,-18},{-48,-18},{-48,-56.75}, {-36.225,-56.75}}, color={0,127,255})); - connect(threeWayValveWithFlowReturn2.portDHW_a, storageDHW.portHC2Out) + connect(threeWayValveWithFlowReturn2.portDHW_a, stoDHW.portHC2Out) annotation (Line(points={{58,50.4},{64,50.4},{64,-84},{-38,-84},{-38,-78},{ -40,-78},{-40,-64.11},{-36.225,-64.11}}, color={0,127,255})); @@ -527,7 +527,7 @@ equation connect(threeWayValveWithFlowReturn2.portBui_b, HydraulischeWeiche.fluidportTop1) annotation (Line(points={{58,66},{64,66},{64,78},{69.9,78},{69.9,74.08}}, color={0,127,255})); - connect(storageBuf.fluidportTop2, pumpBoiler.port_a) annotation (Line(points={{-12.375, + connect(stoBuf.fluidportTop2, pumpBoiler.port_a) annotation (Line(points={{-12.375, 58.22},{-12.375,65},{4,65}}, color={0,127,255})); connect(pumpBoiler.port_b, boiNoCtrl.port_a) annotation (Line(points={{14,65},{26,65},{26,98}}, color={0,127,255})); diff --git a/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithoutDHW.mo b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithoutDHW.mo deleted file mode 100644 index a016f50e..00000000 --- a/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithoutDHW.mo +++ /dev/null @@ -1,318 +0,0 @@ -within BESMod.Systems.Hydraulical.Distribution; -model TwoStoragesBoilerWithoutDHW - "Two storages with a boiler after the buffer but without DHW support" - extends BaseClasses.PartialDistribution( - final VStoDHW=dhwParameters.V, - final QDHWStoLoss_flow=dhwParameters.QLoss_flow, - designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.PartStorage, - final dpDem_nominal={0}, - final dpSup_nominal={2*(threeWayValveParameters.dpValve_nominal + max( - threeWayValveParameters.dp_nominal))}, - final dTTraDHW_nominal=dhwParameters.dTLoadingHC1, - final dTTra_nominal={bufParameters.dTLoadingHC1}, - final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, - final TSup_nominal=TDem_nominal .+ dTLoss_nominal .+ dTTra_nominal, - dTLoss_nominal=fill(0, nParallelDem), - final m_flow_nominal=mDem_flow_nominal, - final nParallelSup=1, - final nParallelDem=1); - - parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition - parBoi=AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_15kW() - "Parameters for Boiler"; - AixLib.Fluid.Storage.Storage storageDHW( - redeclare final package Medium = MediumDHW, - final n=dhwParameters.nLayer, - final d=dhwParameters.d, - final h=dhwParameters.h, - final lambda_ins=dhwParameters.lambda_ins, - final s_ins=dhwParameters.sIns, - final hConIn=dhwParameters.hConIn, - final hConOut=dhwParameters.hConOut, - final k_HE=dhwParameters.k_HE, - final A_HE=dhwParameters.A_HE, - final V_HE=dhwParameters.V_HE, - final beta=dhwParameters.beta, - final kappa=dhwParameters.kappa, - final m_flow_nominal_layer=mDHW_flow_nominal, - final m_flow_nominal_HE=mSup_flow_nominal[1], - final energyDynamics=energyDynamics, - final T_start=TDHW_nominal, - final p_start=p_start, - final m_flow_small_layer=1E-4*abs(storageDHW.m_flow_nominal_layer), - final m_flow_small_layer_HE=1E-4*abs(storageDHW.m_flow_nominal_HE)) - "The DHW storage (TWWS) for domestic hot water demand" - annotation (Placement(transformation(extent={{66,-70},{32,-32}}))); - Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemBuf(final T= - bufParameters.TAmb) "Constant ambient temperature of storage" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={50,10}))); - AixLib.Fluid.Storage.Storage storageBuf( - redeclare package Medium = Medium, - final n=bufParameters.nLayer, - final d=bufParameters.d, - final h=bufParameters.h, - final lambda_ins=bufParameters.lambda_ins, - final s_ins=bufParameters.sIns, - final hConIn=bufParameters.hConIn, - final hConOut=bufParameters.hConOut, - final k_HE=bufParameters.k_HE, - final A_HE=bufParameters.A_HE, - final V_HE=bufParameters.V_HE, - final beta=bufParameters.beta, - final kappa=bufParameters.kappa, - final m_flow_nominal_layer=m_flow_nominal[1], - final m_flow_nominal_HE=mSup_flow_nominal[1], - final energyDynamics=energyDynamics, - final T_start=T_start, - final p_start=p_start, - final m_flow_small_layer=1E-4*abs(storageBuf.m_flow_nominal_layer), - final m_flow_small_layer_HE=1E-4*abs(storageBuf.m_flow_nominal_HE)) - "The buffer storage (PS) for the building" - annotation (Placement(transformation(extent={{66,40},{32,76}}))); - Components.Valves.ThreeWayValveWithFlowReturn - threeWayValveWithFlowReturn( - redeclare package Medium = MediumGen, - final energyDynamics=energyDynamics, - final p_start=p_start, - final T_start=T_start, - final X_start=X_start, - final C_start=C_start, - final C_nominal=C_nominal, - final mSenFac=mSenFac, - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parameters=threeWayValveParameters) - annotation (Placement(transformation(extent={{-60,40},{-20,80}}))); - Modelica.Blocks.Sources.RealExpression T_stoDHWTop(final y(unit="K", displayUnit="degC")=storageDHW.layer[ - dhwParameters.nLayer].T) annotation (Placement(transformation( - extent={{-5,-3},{5,3}}, - rotation=180, - origin={37,87}))); - Modelica.Blocks.Sources.RealExpression T_stoBufTop(final y(unit="K", displayUnit="degC")=storageBuf.layer[ - bufParameters.nLayer].T) annotation (Placement(transformation( - extent={{-5,-2},{5,2}}, - rotation=180, - origin={23,92}))); - Modelica.Blocks.Sources.RealExpression T_stoBufBot(final y(unit="K", displayUnit="degC")=storageBuf.layer[1].T) - annotation (Placement(transformation( - extent={{-5,-3},{5,3}}, - rotation=180, - origin={23,87}))); - Modelica.Blocks.Sources.RealExpression T_stoDHWBot(final y(unit="K", displayUnit="degC")=storageDHW.layer[1].T) - annotation (Placement(transformation( - extent={{-5,-3},{5,3}}, - rotation=180, - origin={37,99}))); - - replaceable parameter - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.SimpleStorageBaseDataDefinition - bufParameters constrainedby - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.SimpleStorageBaseDataDefinition( - final Q_flow_nominal=Q_flow_nominal[1]*f_design[1], - final rho=rho, - final c_p=cp, - final TAmb=TAmb, - final T_m=TDem_nominal[1], - final QHC1_flow_nominal=Q_flow_nominal[1], - final mHC1_flow_nominal=mSup_flow_nominal[1], - redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1) annotation ( - choicesAllMatching=true, Placement(transformation(extent={{84,56},{98,70}}))); - replaceable parameter - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.SimpleStorageBaseDataDefinition - dhwParameters constrainedby - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.SimpleStorageBaseDataDefinition( - final rho=rho, - final c_p=cp, - final TAmb=TAmb, - final QHC1_flow_nominal=QDHW_flow_nominal, - final V=if designType == Types.DHWDesignType.FullStorage then VDHWDay * fFullSto else VDHWDay, - final Q_flow_nominal=0, - final VPerQ_flow=0, - final T_m=TDHW_nominal, - final mHC1_flow_nominal=mSup_flow_nominal[1], - redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1) annotation ( - choicesAllMatching=true, Placement(transformation(extent={{82,-58},{98,-42}}))); - Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemDHW(final T= - dhwParameters.TAmb) "Constant ambient temperature of storage" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={30,-90}))); - - Utilities.KPIs.EnergyKPICalculator eneKPICalBuf(use_inpCon=false, y=fixTemBuf.port.Q_flow) - annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); - Utilities.KPIs.EnergyKPICalculator eneKPICalDHW(use_inpCon=false, y=fixTemDHW.port.Q_flow) - annotation (Placement(transformation(extent={{-80,-100},{-60,-80}}))); - BESMod.Utilities.Electrical.ZeroLoad zeroLoad - annotation (Placement(transformation(extent={{34,-110},{54,-90}}))); - replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve - threeWayValveParameters constrainedby - BESMod.Systems.RecordsCollection.Valves.ThreeWayValve( - final dp_nominal={resBui.dp_nominal, resDHW.dp_nominal}, - final m_flow_nominal=mSup_flow_nominal[1], - final fraK=1, - use_inputFilter=false) annotation (Placement( - transformation(extent={{-60,2},{-40,22}})), choicesAllMatching=true); - IBPSA.Fluid.FixedResistances.PressureDrop resBui( - redeclare final package Medium = MediumGen, - final allowFlowReversal=allowFlowReversal, - final m_flow_nominal=mSup_flow_nominal[1], - final show_T=show_T, - final from_dp=false, - final dp_nominal=1000, - final linearized=false, - final deltaM=0.3) - "Assume some pressure loss to avoid division by zero error." - annotation (Placement(transformation(extent={{0,60},{20,80}}))); - IBPSA.Fluid.FixedResistances.PressureDrop resDHW( - redeclare final package Medium = MediumGen, - final allowFlowReversal=allowFlowReversal, - final m_flow_nominal=mSup_flow_nominal[1], - final show_T=show_T, - final from_dp=false, - final dp_nominal=1000, - final linearized=false, - final deltaM=0.3) - "Assume some pressure loss to avoid division by zero error." - annotation (Placement(transformation(extent={{0,-40},{20,-20}}))); - IBPSA.Fluid.Sources.Boundary_pT bouPumBuf( - redeclare package Medium = Medium, - final p=p_start, - final T=T_start, - final nPorts=1) - "Pressure reference for transfer circuit as generation circuit reference is not connected (indirect loading)" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={10,10}))); - AixLib.Fluid.BoilerCHP.BoilerNoControl boiNoCtrl( - redeclare package Medium = AixLib.Media.Water, - final allowFlowReversal=true, - final m_flow_nominal=m_flow_nominal[1], - final m_flow_small=1E-4*abs(m_flow_nominal[1]), - final show_T=show_T, - final initType=Modelica.Blocks.Types.Init.NoInit, - final transferHeat=false, - final rho_default=rho, - final p_start=p_start, - final T_start=T_start, - final etaLoadBased=parBoi.eta, - final G=0.003*parBoi.Q_nom/50, - final C=1.5*parBoi.Q_nom, - final Q_nom=parBoi.Q_nom, - final V=parBoi.volume, - final etaTempBased=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99], - final paramBoiler=parBoi) - annotation (Placement(transformation(extent={{60,80},{80,100}}))); - Utilities.KPIs.EnergyKPICalculator KPIBoi(use_inpCon=true) - annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); -equation - connect(fixTemBuf.port, storageBuf.heatPort) annotation (Line(points={{60,10}, - {80,10},{80,58},{62.6,58}}, color={191,0,0})); - connect(storageBuf.port_a_consumer, portBui_in[1]) annotation (Line(points={{49,40}, - {100,40}}, color={0,127,255})); - connect(storageDHW.port_b_consumer, portDHW_out) annotation (Line(points={{49,-32}, - {48,-32},{48,-22},{100,-22}}, color={0,127,255})); - connect(portDHW_in, storageDHW.port_a_consumer) annotation (Line(points={{100,-82}, - {48,-82},{48,-70},{49,-70}}, color={0,127,255})); - connect(fixTemDHW.port, storageDHW.heatPort) annotation (Line(points={{40,-90}, - {70,-90},{70,-51},{62.6,-51}}, color={191,0,0})); - connect(T_stoDHWBot.y, sigBusDistr.TStoDHWBotMea) annotation (Line(points={{31.5, - 99},{0,99},{0,101}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(T_stoDHWTop.y, sigBusDistr.TStoDHWTopMea) annotation (Line(points={{31.5, - 87},{28,87},{28,101},{0,101}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(T_stoBufBot.y, sigBusDistr.TStoBufBotMea) annotation (Line(points={{17.5, - 87},{0,87},{0,101}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(T_stoBufTop.y, sigBusDistr.TStoBufTopMea) annotation (Line(points={{17.5, - 92},{0,92},{0,101}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( - Line( - points={{54,-100},{54,-98},{70,-98}}, - color={0,0,0}, - thickness=1)); - connect(storageBuf.port_b_heatGenerator, threeWayValveWithFlowReturn.portBui_a) - annotation (Line(points={{34.72,43.6},{34.72,42},{-12,42},{-12,68},{-20,68}}, - color={0,127,255})); - connect(storageDHW.port_b_heatGenerator, threeWayValveWithFlowReturn.portDHW_a) - annotation (Line(points={{34.72,-66.2},{-20,-66.2},{-20,44.8}}, color={0,127, - 255})); - connect(threeWayValveWithFlowReturn.portGen_b, portGen_out[1]) annotation ( - Line(points={{-60,52.8},{-84,52.8},{-84,40},{-100,40}}, color={0,127,255})); - connect(portGen_in[1], threeWayValveWithFlowReturn.portGen_a) annotation ( - Line(points={{-100,80},{-66,80},{-66,68.8},{-60,68.8}}, color={0,127,255})); - connect(threeWayValveWithFlowReturn.uBuf, sigBusDistr.uThrWayVal) annotation ( - Line(points={{-40,84},{-40,98},{4,98},{4,100},{0,100},{0,101}}, color={0,0, - 127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(threeWayValveWithFlowReturn.portBui_b, resBui.port_a) - annotation (Line(points={{-20,76},{-10,76},{-10,70},{0,70}}, - color={0,127,255})); - connect(storageBuf.port_a_heatGenerator, resBui.port_b) annotation (Line( - points={{34.72,73.84},{34.72,70},{20,70}}, color={0,127,255})); - connect(threeWayValveWithFlowReturn.portDHW_b, resDHW.port_a) annotation ( - Line(points={{-20,52.8},{-14,52.8},{-14,-30},{0,-30}}, color={0,127,255})); - connect(storageDHW.port_a_heatGenerator, resDHW.port_b) annotation (Line( - points={{34.72,-34.28},{34,-34.28},{34,-30},{20,-30}}, - color={0,127,255})); - connect(eneKPICalDHW.KPI, outBusDist.QDHWLos_flow) annotation (Line(points={{ - -57.8,-90},{0,-90},{0,-100}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(eneKPICalBuf.KPI, outBusDist.QBufLos_flow) annotation (Line(points={{ - -57.8,-50},{0,-50},{0,-100}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(bouPumBuf.ports[1], storageBuf.port_a_consumer) annotation (Line( - points={{10,20},{10,32},{49,32},{49,40}}, color={0,127,255})); - connect(storageBuf.port_b_consumer, boiNoCtrl.port_a) annotation (Line(points={{49,76}, - {48,76},{48,90},{60,90}}, color={0,127,255})); - connect(boiNoCtrl.port_b, portBui_out[1]) - annotation (Line(points={{80,90},{100,90},{100,80}}, color={0,127,255})); - connect(boiNoCtrl.T_out, sigBusDistr.TBoilerOutDistribution) annotation (Line( - points={{77.2,93.2},{92,93.2},{92,128},{0,128},{0,101}}, color={0,0, - 127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(boiNoCtrl.u_rel, sigBusDistr.yBoilerDistribution) annotation (Line( - points={{63,97},{50,97},{50,100},{0,100},{0,101}}, color={0,0, - 127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(boiNoCtrl.thermalPower, KPIBoi.u) annotation (Line(points={{77.2,98.4},{ - 76,98.4},{76,120},{-108,120},{-108,-30},{-101.8,-30}}, - color={0,0,127})); - connect(KPIBoi.KPI, outBusDist.QBoi_flow) annotation (Line(points={{-77.8,-30},{ - -16,-30},{-16,-48},{0,-48},{0,-100}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); -end TwoStoragesBoilerWithoutDHW; diff --git a/BESMod/Systems/Hydraulical/Distribution/Types/HeaterType.mo b/BESMod/Systems/Hydraulical/Distribution/Types/HeaterType.mo new file mode 100644 index 00000000..e74752a5 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Distribution/Types/HeaterType.mo @@ -0,0 +1,9 @@ +within BESMod.Systems.Hydraulical.Distribution.Types; +type HeaterType = enumeration( + No + "No heater", + HeatingRod + "Use a heating rod", + Boiler + "Use a boiler") + "Select between boiler, heating rod or no additional heater"; diff --git a/BESMod/Systems/Hydraulical/Distribution/Types/package.order b/BESMod/Systems/Hydraulical/Distribution/Types/package.order index 6e11fa5c..2124959b 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Types/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/Types/package.order @@ -1,2 +1,3 @@ DHWDesignType EnergyLabel +HeaterType diff --git a/BESMod/Systems/Hydraulical/Distribution/package.order b/BESMod/Systems/Hydraulical/Distribution/package.order index 4d91ce14..5f23fabe 100644 --- a/BESMod/Systems/Hydraulical/Distribution/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/package.order @@ -4,7 +4,6 @@ DistributionTwoStorageParallel DHWOnly TwoStoDetailedDirectLoading TwoStoDetailedIndirectLoading -TwoStoragesBoilerWithoutDHW TwoStoragesBoilerWithDHW Components RecordsCollection diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo index cecafe90..9f04f141 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo @@ -7,22 +7,15 @@ model PartialHeatPump "Generation with only the heat pump" i] > 44.9 + 273.15 then 8 else 5 for i in 1:nParallelDem}, dp_nominal={heatPump.dpCon_nominal}, nParallelDem=1); - - parameter Boolean use_airSource=true - "Turn false to use water as temperature source." - annotation(Dialog(group="Component choices")); - - parameter Boolean use_heaRod=true "=false to disable the heating rod" - annotation(Dialog(group="Component choices")); - replaceable model PerDataMainHP = + replaceable model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D constrainedby AixLib.DataBase.HeatPump.PerformanceData.BaseClasses.PartialPerformanceData - annotation (Dialog(group="Component data"), __Dymola_choicesAllMatching=true); - parameter Modelica.Media.Interfaces.Types.Temperature TSoilConst=273.15 + 10 - "Constant soil temperature for ground source heat pumps" - annotation(Dialog(group="Component choices", enable=use_airSource)); - + "Heat pump model approach" + annotation (Dialog(group="Component data"), choicesAllMatching=true); + parameter Boolean use_airSource=true + "Turn false to use water as temperature source." + annotation(Dialog(group="Component choices")); replaceable package Medium_eva = IBPSA.Media.Air constrainedby Modelica.Media.Interfaces.PartialMedium annotation (Dialog(group="Component choices"), choices( @@ -33,6 +26,10 @@ model PartialHeatPump "Generation with only the heat pump" property_T=293.15, X_a=0.40) "Propylene glycol water, 40% mass fraction"))); + parameter Modelica.Media.Interfaces.Types.Temperature TSoilConst=273.15 + 10 + "Constant soil temperature for ground source heat pumps" + annotation(Dialog(group="Component choices", enable=use_airSource)); + replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition parHeaPum constrainedby @@ -230,7 +227,6 @@ model PartialHeatPump "Generation with only the heat pump" calc_numSwi=true) "Heat pump KPIs" annotation (Placement(transformation(extent={{-120,-60},{-100,-40}}))); equation - connect(bouEva.ports[1], heatPump.port_a2) annotation (Line(points={{-80,50},{-74, 50},{-74,42},{-57.5,42},{-57.5,37}}, color={0,127,255})); connect(heatPump.port_b2, bou_sinkAir.ports[1]) annotation (Line( @@ -258,23 +254,10 @@ equation thickness=1)); connect(multiSum.y, realToElecCon.PEleLoa) annotation (Line(points={{122.98,-82},{112,-82}}, color={0,0,127})); - if use_heaRod then - connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, - -80.95},{144,-80.95},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, - color={0,0,127}), - Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-83.05},{144, + connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-83.05},{144, -83.05},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, color={0,0,127})); - else - connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-83.05},{144, - -83.05},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, - color={0,0,127})); - connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, + connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, -80.95},{144,-80.95},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, color={0,0,127}), Text( @@ -282,7 +265,7 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - end if; + connect(switch.u1, weaBus.TDryBul) annotation (Line(points={{-142,58},{-144,58}, {-144,80},{-101,80}}, color={0,0,127}), Text( string="%second", diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo index fe62eeee..e942f22b 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo @@ -2,12 +2,15 @@ within BESMod.Systems.Hydraulical.Generation.BaseClasses; model PartialHeatPumpAndGasBoiler "Partial heat pump and boiler" extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialHeatPump( dp_nominal={heatPump.dpCon_nominal + boi.dp_nominal}); + parameter Real etaTem[:,2]=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15, + 0.99] "Temperature based efficiency" + annotation(Dialog(group="Component data")); replaceable parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition parBoi "Parameters for Boiler" annotation(Placement(transformation(extent={{22,62},{38,78}})), - choicesAllMatching=true, Dialog(group="Component choices")); + choicesAllMatching=true, Dialog(group="Component data")); AixLib.Fluid.BoilerCHP.BoilerNoControl boi( redeclare package Medium = Medium, @@ -28,7 +31,7 @@ model PartialHeatPumpAndGasBoiler "Partial heat pump and boiler" final C=1.5*parBoi.Q_nom, final Q_nom=parBoi.Q_nom, final V=parBoi.volume, - final etaTempBased=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99], + final etaTempBased=etaTem, final paramBoiler=parBoi) "Boiler with external control" annotation (Placement(transformation(extent={{20,40},{40,60}}))); diff --git a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo index 5e7e6e7e..41bc0263 100644 --- a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo @@ -1,24 +1,28 @@ within BESMod.Systems.Hydraulical.Generation; model GasBoiler "Just a gas boiler" - extends BaseClasses.PartialGeneration(dp_nominal={boilerNoControl.dp_nominal}, - final nParallelDem=1); - replaceable parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition - paramBoiler "Parameters for Boiler" annotation(Dialog(group="Component data"), - choicesAllMatching=true); - parameter Real etaTempBased[:,2]=[293.15,1.09; 303.15,1.08; 313.15,1.05; - 323.15,1.; 373.15,0.99] "Table matrix for temperature based efficiency" + extends BaseClasses.PartialGeneration(dp_nominal={boi.dp_nominal}, final + nParallelDem=1); + + parameter Real etaTem[:,2]=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; + 373.15,0.99] "Temperature based efficiency" annotation(Dialog(group="Component data")); + + replaceable parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition + parBoi + "Parameters for Boiler" + annotation(Placement(transformation(extent={{-58,44},{-42,60}})), + choicesAllMatching=true, Dialog(group="Component data")); + replaceable parameter BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition parTemSen annotation (Dialog(group="Component data"), choicesAllMatching=true, - Placement(transformation(extent={{-98,-16},{-78,4}}))); + Placement(transformation(extent={{-98,-16},{-80,-2}}))); replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition parPum annotation (Dialog(group="Component data"), - choicesAllMatching=true, Placement(transformation(extent={{54,-80}, - {68,-68}}))); - AixLib.Fluid.BoilerCHP.BoilerNoControl boilerNoControl( + choicesAllMatching=true, Placement(transformation(extent={{64,-76},{78,-64}}))); + AixLib.Fluid.BoilerCHP.BoilerNoControl boi( redeclare package Medium = Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=m_flow_nominal[1], @@ -32,12 +36,12 @@ model GasBoiler "Just a gas boiler" final rho_default=rho, final p_start=p_start, final T_start=T_start, - paramBoiler=paramBoiler, - etaTempBased=etaTempBased) + paramBoiler=parBoi, + etaTempBased=etaTem) "Boiler with external control" annotation (Placement(transformation(extent={{-66,-6},{-34,26}}))); - Utilities.KPIs.EnergyKPICalculator KPIQHR(use_inpCon=false, y=boilerNoControl.QflowCalculation.y) + Utilities.KPIs.EnergyKPICalculator KPIQHR(use_inpCon=false, y=boi.QflowCalculation.y) annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}))); IBPSA.Fluid.Movers.SpeedControlled_y pump( @@ -85,36 +89,36 @@ model GasBoiler "Just a gas boiler" calc_numSwi=true) annotation (Placement(transformation(extent={{-60,-80},{-40,-60}}))); -initial equation - assert(paramBoiler.Q_nom >= Q_flow_nominal[1], "Nominal heat flow rate +initial algorithm + assert(parBoi.Q_nom >= Q_flow_nominal[1], "Nominal heat flow rate of boiler is smaller than nominal heat demand", AssertionLevel.warning); equation - connect(boilerNoControl.port_b, portGen_out[1]) annotation (Line(points={{-34, - 10},{-20,10},{-20,80},{100,80}}, color={0,127,255})); - connect(boilerNoControl.T_in, sigBusGen.TBoiIn) annotation (Line(points={{-38.48, - 19.28},{2,19.28},{2,98}}, color={0,0,127}), Text( + connect(boi.port_b, portGen_out[1]) annotation (Line(points={{-34,10},{-20,10},{ + -20,80},{100,80}}, color={0,127,255})); + connect(boi.T_in, sigBusGen.TBoiIn) annotation (Line(points={{-38.48,19.28},{2,19.28}, + {2,98}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(boilerNoControl.T_out, sigBusGen.TBoiOut) annotation (Line(points={{-38.48, - 15.12},{2,15.12},{2,98}}, color={0,0,127}), Text( + connect(boi.T_out, sigBusGen.TBoiOut) annotation (Line(points={{-38.48,15.12},{2, + 15.12},{2,98}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(boilerNoControl.u_rel, sigBusGen.uBoiSet) annotation (Line(points={{-61.2, - 21.2},{-68,21.2},{-68,98},{2,98}}, color={0,0,127}), Text( + connect(boi.u_rel, sigBusGen.uBoiSet) annotation (Line(points={{-61.2,21.2},{-68, + 21.2},{-68,98},{2,98}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(portGen_in[1], pump.port_a) annotation (Line(points={{100,-2},{94,-2}, {94,-6},{86,-6},{86,-50},{56,-50}}, color={0,127,255})); - connect(boilerNoControl.port_a, pump.port_b) annotation (Line(points={{-66,10}, - {-68,10},{-68,-50},{36,-50},{36,-50}}, color={0,127,255})); + connect(boi.port_a, pump.port_b) annotation (Line(points={{-66,10},{-68,10},{-68, + -50},{36,-50},{36,-50}}, color={0,127,255})); connect(bou1.ports[1], pump.port_a) annotation (Line(points={{66,-36},{66,-50},{56,-50}}, color={0,127,255})); connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo index dd5e60a4..44ad8a6f 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo @@ -2,6 +2,16 @@ within BESMod.Systems.Hydraulical.Generation; model HeatPumpAndGasBoilerParallel "Parallel connection of heat pump and gas boiler" extends BaseClasses.PartialHeatPumpAndGasBoiler; + + replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve + parThrWayVal constrainedby + BESMod.Systems.RecordsCollection.Valves.ThreeWayValve( + final dp_nominal={parHeaPum.dpCon_nominal,boi.dp_nominal}, + final m_flow_nominal=2*m_flow_nominal[1], + final fraK=1) "Parameters for three-way-valve" annotation (Placement( + transformation(extent={{64,4},{78,18}})), choicesAllMatching=true, + Dialog(group="Component data")); + Distribution.Components.Valves.ThreeWayValveWithFlowReturn thrWayVal( redeclare package Medium = Medium, final energyDynamics=energyDynamics, @@ -15,14 +25,7 @@ model HeatPumpAndGasBoilerParallel parameters=parThrWayVal) "Three-way-valve to either run heat pump or gas boiler" annotation (Placement(transformation(extent={{40,20},{20,0}}))); - replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve - parThrWayVal(from_dp=true) constrainedby - BESMod.Systems.RecordsCollection.Valves.ThreeWayValve( - final dp_nominal={parHeaPum.dpCon_nominal,boi.dp_nominal}, - final m_flow_nominal=2*m_flow_nominal[1], - final fraK=1, - use_inputFilter=false) "Parameters for three-way-valve" annotation (Placement( - transformation(extent={{64,4},{78,18}})), choicesAllMatching=true); + equation connect(thrWayVal.portDHW_a, boi.port_b) annotation (Line(points={{20,17.6},{8,17.6}, {8,26},{44,26},{44,50},{40,50}}, color={0,127,255})); diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index 0abad5e8..8e633640 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -3,8 +3,10 @@ model HeatPumpAndHeatingRod "Heat pump with heating rod in series" extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialHeatPump( dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal}, multiSum(nu=3)); - parameter Boolean use_heaRod=true "=false to disable the heating rod" - annotation(Dialog(group="Component choices")); + + parameter Boolean use_heaRod=true "=false to disable the heating rod" + annotation(Dialog(group="Component choices")); + AixLib.Fluid.HeatExchangers.HeatingRod hea( redeclare package Medium = Medium, final allowFlowReversal=allowFlowReversal, diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo index f59e7944..7e516d09 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/GasBoiler.mo @@ -4,7 +4,7 @@ model GasBoiler BESMod.Systems.Hydraulical.Generation.GasBoiler generation( dTTra_nominal={10}, redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW - paramBoiler, + parBoi, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndGasBoilerParallel.mo b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndGasBoilerParallel.mo new file mode 100644 index 00000000..a15b1f45 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndGasBoilerParallel.mo @@ -0,0 +1,54 @@ +within BESMod.Systems.Hydraulical.Generation.Tests; +model HeatPumpAndGasBoilerParallel + "Test case for parallel heat pump and gas boiler" + extends PartialTest( redeclare + BESMod.Systems.Hydraulical.Generation.HeatPumpAndGasBoilerParallel + generation( + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D (dataTable= + AixLib.DataBase.HeatPump.EN255.Vitocal350AWI114()), + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum, + redeclare + BESMod.Systems.RecordsCollection.Movers.DefaultMover + parPum, + redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen, + redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal)); + extends Modelica.Icons.Example; + + Modelica.Blocks.Sources.Pulse pulse(period=1800) + annotation (Placement(transformation(extent={{-40,80},{-20,100}}))); + Modelica.Blocks.Sources.Constant constThrWayValGen(k=0.5) "Constant source" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={70,88}))); +equation + connect(pulse.y, genControlBus.yHeaPumSet) annotation (Line(points={{-19,90}, + {-14,90},{-14,98},{10,98},{10,74}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(pulse.y, genControlBus.uPump) annotation (Line(points={{-19,90},{-14, + 90},{-14,98},{10,98},{10,74}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(constThrWayValGen.y, genControlBus.uBoiOrHeaPum) annotation (Line( + points={{59,88},{36,88},{36,74},{10,74}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(pulse.y, genControlBus.yBoi) annotation (Line(points={{-19,90},{-14,90}, + {-14,98},{10,98},{10,74}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); +end HeatPumpAndGasBoilerParallel; diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndGasBoilerSeries.mo b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndGasBoilerSeries.mo new file mode 100644 index 00000000..ec59e253 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndGasBoilerSeries.mo @@ -0,0 +1,41 @@ +within BESMod.Systems.Hydraulical.Generation.Tests; +model HeatPumpAndGasBoilerSeries + "Test case for serial heat pump and gas boiler" + extends PartialTest( redeclare + BESMod.Systems.Hydraulical.Generation.HeatPumpAndGasBoilerSerial + generation( + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D (dataTable= + AixLib.DataBase.HeatPump.EN255.Vitocal350AWI114()), + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum, + redeclare + BESMod.Systems.RecordsCollection.Movers.DefaultMover + parPum, + redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen, + redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi)); + extends Modelica.Icons.Example; + + Modelica.Blocks.Sources.Pulse pulse(period=1800) + annotation (Placement(transformation(extent={{-40,80},{-20,100}}))); +equation + connect(pulse.y, genControlBus.yHeaPumSet) annotation (Line(points={{-19,90}, + {-14,90},{-14,98},{10,98},{10,74}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(pulse.y, genControlBus.uPump) annotation (Line(points={{-19,90},{-14, + 90},{-14,98},{10,98},{10,74}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(pulse.y, genControlBus.yBoi) annotation (Line(points={{-19,90},{-14,90}, + {-14,98},{10,98},{10,74}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); +end HeatPumpAndGasBoilerSeries; diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodSimple.mo b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodSimple.mo index a54d207c..f7d3a499 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodSimple.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodSimple.mo @@ -12,12 +12,12 @@ model SolarThermalAndHeatPumpAndHeatingRodSimple parTemSen, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPumSolThe, - redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultSolarThermal parSolThe, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR parHeaRod)); + extends Modelica.Icons.Example; Modelica.Blocks.Sources.Constant const1(k=0) diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/package.order b/BESMod/Systems/Hydraulical/Generation/Tests/package.order index e60f4c29..ebf273a8 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Generation/Tests/package.order @@ -1,6 +1,8 @@ ElectricalHeater GasBoiler HeatPump +HeatPumpAndGasBoilerParallel +HeatPumpAndGasBoilerSeries HeatPumpAndHeatingRod SolarThermalAndHeatPumpAndHeatingRodDetailed SolarThermalAndHeatPumpAndHeatingRodSimple From d578833bb2fb9fe87c81f6a223e3f9aed2771527 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Thu, 3 Aug 2023 21:07:37 +0200 Subject: [PATCH 075/131] fix connection errors --- .../Distribution/TwoStoDetailedDirectLoading.mo | 6 ++++-- .../Distribution/TwoStoDetailedIndirectLoading.mo | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedDirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedDirectLoading.mo index b179b5f8..d1042076 100644 --- a/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedDirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedDirectLoading.mo @@ -11,7 +11,9 @@ equation -39.6,40.2}}, color={0,127,255})); connect(threeWayValveWithFlowReturn.portBui_a, stoBuf.fluidportBottom1) - annotation (Line(points={{-60,74},{-60,74},{-60,64},{-42,64},{-42,4},{-24,4}, - {-24,-0.4},{-39.4,-0.4}}, + annotation (Line(points={{-60,74},{-56,74},{-56,-12},{-40,-12},{-40,-0.4},{ + -39.4,-0.4}}, color={0,127,255})); + connect(portBui_in[1], stoBuf.fluidportBottom2) annotation (Line(points={{100, + 40},{70,40},{70,-8},{-29.4,-8},{-29.4,-0.2}}, color={0,127,255})); end TwoStoDetailedDirectLoading; diff --git a/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedIndirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedIndirectLoading.mo index 991e6a29..6aaef6e7 100644 --- a/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedIndirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/TwoStoDetailedIndirectLoading.mo @@ -6,12 +6,12 @@ model TwoStoDetailedIndirectLoading "Two detailed storages, indirect loading of redeclare package Medium = Medium, final p=p_start, final T=T_start, - final nPorts=1) + final nPorts=2) "Pressure reference for transfer circuit as generation circuit reference is not connected (indirect loading)" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=90, - origin={-10,-10}))); + origin={52,10}))); equation connect(threeWayValveWithFlowReturn.portBui_b, stoBuf.portHC1In) annotation (Line(points={{-60,78},{-58,78},{-58,31.4},{-50.4,31.4}}, @@ -21,5 +21,8 @@ equation -50.2,25.2}}, color={0,127,255})); connect(bouPumBuf.ports[1], stoBuf.fluidportBottom2) annotation (Line( - points={{-10,0},{-10,-0.2},{-29.4,-0.2}}, color={0,127,255})); + points={{53,20},{53,22},{26,22},{26,-6},{-29.4,-6},{-29.4,-0.2}}, + color={0,127,255})); + connect(bouPumBuf.ports[2], portBui_in[1]) annotation (Line(points={{52,20},{52, + 28},{84,28},{84,40},{100,40}}, color={0,127,255})); end TwoStoDetailedIndirectLoading; From 3ff7897a17a29ec3a33a71424178e5b9ba6cc4ed Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 9 Aug 2023 08:48:09 +0200 Subject: [PATCH 076/131] add better heating curve and control restructuring --- BESMod/Examples/BAUSimStudy/PartialCase.mo | 2 +- BESMod/Examples/GasBoilerBuildingOnly.mo | 2 +- BESMod/Examples/HeatPumpAndBoiler.mo | 28 +- .../PartialSolarThermalHPS.mo | 2 +- .../Examples/UseCaseDesignOptimization/BES.mo | 9 +- .../Examples/UseCaseHighOrderModel/BES_HOM.mo | 2 +- .../PartialModelicaConferenceUseCase.mo | 2 +- .../ConvertBESMod_from_0.3.1_to_0.3.2.mos | 8 +- .../BaseClasses/PartialHydraulicSystem.mo | 3 +- .../Control/BaseClasses/PartialControl.mo | 8 +- .../PartialHeatPumpSystemController.mo | 463 +++++-------- .../PartialThermostaticValveControl.mo | 19 +- ...lTwoPoint_HPS_Controller_BivalentBoiler.mo | 388 +---------- .../Control/Biv_PI_ConFlow_HPSController.mo | 31 - .../Control/BivalentPartParallel.mo | 4 +- .../Components/BoilerInHybridSystem.mo | 73 ++ .../Components/BuildingAndDHWControl.mo | 294 ++++++++ .../Control/Components/ConstantAdd.mo | 53 ++ .../DHWSetControl/AntiLegionellaControl.mo | 6 +- .../BaseClasses/PartialTSet_DHW_Control.mo | 7 +- .../Components/DHWSetControl/ConstTSet_DHW.mo | 6 +- .../Control/Components/HeatingCurve.mo | 31 +- .../Control/Components/MeasuredValue.mo | 7 + ...ffController.mo => AlternativeBivalent.mo} | 32 +- .../BaseClasses/PartialOnOffController.mo | 45 +- .../ConstantHysteresisTimeBasedHR.mo | 35 +- .../OnOffController/DegreeMinuteController.mo | 16 +- .../Examples/OnOffControllerTest.mo | 52 +- .../Examples/ParallelBivalentControl.mo | 8 +- .../Examples/PartialOnOffController.mo | 8 +- .../OnOffController/FloatingHysteresis.mo | 21 +- ...lentControl.mo => PartParallelBivalent.mo} | 43 +- .../{ => Utilities}/StorageHysteresis.mo | 4 +- .../OnOffController/Utilities/package.order | 1 + .../Components/OnOffController/package.order | 5 +- .../Components/SetAndMeasuredValueSelector.mo | 109 +++ .../Control/Components/package.order | 5 + .../Control/ConstHys_OnOff_HPSControll.mo | 30 - .../ConstHys_PI_ConOut_HPSController.mo | 32 - .../ConstHys_PI_StoTop_HPSController.mo | 43 -- .../Control/ConstHys_P_ConIn_HPSController.mo | 25 - .../ConstHys_P_ConOut_HPSController.mo | 25 - .../Systems/Hydraulical/Control/GasBoiler.mo | 15 +- .../Control/MonoenergeticHeatPumpSystem.mo | 31 + .../Control/NewControlBivalentParallel.mo | 199 +----- .../Control/NewControlBivalentSerial.mo | 150 +--- ...ControlBivalentSystem_BoilerAfterBuffer.mo | 147 +--- .../BivalentHeatPumpControlDataDefinition.mo | 39 +- .../Systems/Hydraulical/Control/package.order | 7 +- .../BaseClasses/PartialTwoStorageParallel.mo | 27 +- .../PartialTwoStorageParallelWithHeaters.mo | 24 +- .../Valves/ThreeWayValveWithFlowReturn.mo | 43 +- .../Distribution/Tests/TestBoilerWithDHW.mo | 49 ++ .../Distribution/Tests/package.order | 1 + .../Distribution/TwoStoragesBoilerWithDHW.mo | 653 ++++-------------- .../PartialHeatPumpAndGasBoiler.mo | 4 +- .../Hydraulical/Generation/GasBoiler.mo | 5 +- .../Transfer/BaseClasses/PartialTransfer.mo | 8 +- .../Transfer/IdealValveRadiator.mo | 1 + .../Hydraulical/Transfer/NoHeatTransfer.mo | 1 + .../Transfer/RadiatorPressureBased.mo | 1 + .../TransferControlBaseDataDefinition.mo | 6 + .../Transfer/RecordsCollection/package.order | 1 + .../Hydraulical/Transfer/UFHTransferSystem.mo | 6 +- .../PartialGetHeatGenerationCurve.mo | 2 +- 65 files changed, 1254 insertions(+), 2153 deletions(-) delete mode 100644 BESMod/Systems/Hydraulical/Control/Biv_PI_ConFlow_HPSController.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BoilerInHybridSystem.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/ConstantAdd.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/MeasuredValue.mo rename BESMod/Systems/Hydraulical/Control/Components/OnOffController/{AlternativeBivalentOnOffController.mo => AlternativeBivalent.mo} (68%) rename BESMod/Systems/Hydraulical/Control/Components/OnOffController/{ParallelBivalentControl.mo => PartParallelBivalent.mo} (78%) rename BESMod/Systems/Hydraulical/Control/Components/OnOffController/{ => Utilities}/StorageHysteresis.mo (99%) create mode 100644 BESMod/Systems/Hydraulical/Control/Components/SetAndMeasuredValueSelector.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/ConstHys_OnOff_HPSControll.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/ConstHys_PI_ConOut_HPSController.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/ConstHys_PI_StoTop_HPSController.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/ConstHys_P_ConIn_HPSController.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/ConstHys_P_ConOut_HPSController.mo create mode 100644 BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo create mode 100644 BESMod/Systems/Hydraulical/Distribution/Tests/TestBoilerWithDHW.mo create mode 100644 BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferControlBaseDataDefinition.mo diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index bfd55bae..c6e13b08 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -43,7 +43,7 @@ partial model PartialCase thermostaticValveController, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - thermostaticValveParameters, + parTheVal, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl bivalentControlData(TBiv=TBiv), diff --git a/BESMod/Examples/GasBoilerBuildingOnly.mo b/BESMod/Examples/GasBoilerBuildingOnly.mo index 18c6e527..d3109c56 100644 --- a/BESMod/Examples/GasBoilerBuildingOnly.mo +++ b/BESMod/Examples/GasBoilerBuildingOnly.mo @@ -24,7 +24,7 @@ model GasBoilerBuildingOnly thermostaticValveController, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - thermostaticValveParameters, + parTheVal, redeclare BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController HP_nSet_Controller, diff --git a/BESMod/Examples/HeatPumpAndBoiler.mo b/BESMod/Examples/HeatPumpAndBoiler.mo index 23c6dc55..c7831ea2 100644 --- a/BESMod/Examples/HeatPumpAndBoiler.mo +++ b/BESMod/Examples/HeatPumpAndBoiler.mo @@ -71,7 +71,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" thermostaticValveController, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - thermostaticValveParameters, + parTheVal, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl bivalentControlData(TBiv=parameterStudy.TBiv), @@ -163,7 +163,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" thermostaticValveController, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - thermostaticValveParameters, + parTheVal, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl bivalentControlData(TBiv=parameterStudy.TBiv), @@ -263,7 +263,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" thermostaticValveController, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - thermostaticValveParameters, + parTheVal, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl bivalentControlData(TBiv=parameterStudy.TBiv), @@ -335,9 +335,10 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal - /parameterStudy.QHP_flow_biv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, dpCon_nominal=0, dpEva_nominal=0, use_refIne=false, @@ -348,6 +349,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare @@ -361,7 +363,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" thermostaticValveController, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - thermostaticValveParameters, + parTheVal, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl bivalentControlData(TBiv=parameterStudy.TBiv), @@ -373,19 +375,24 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" safetyControl, TCutOff=parameterStudy.TCutOff, QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, + CheckTCut_Off(threshold=parameterStudy.TCutOff)), redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithDHW distribution( designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.FullStorage, + + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal, + redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, + + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, QDHWStoLoss_flow=1, VStoDHW(displayUnit="l") = 0.1, - QHRAftBuf_flow_nominal=0, - use_heatingRodAfterBuffer=false, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal1, + parThrWayValBoi, redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition parStoBuf, @@ -394,7 +401,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" parStoDHW(dTLoadingHC1=10), redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition - hydParameters), + parHydSep), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData @@ -402,6 +409,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), diff --git a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo index 863fb51e..0147342b 100644 --- a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo +++ b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo @@ -19,7 +19,7 @@ partial model PartialSolarThermalHPS thermostaticValveController, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - thermostaticValveParameters, + parTheVal, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl safetyControl, diff --git a/BESMod/Examples/UseCaseDesignOptimization/BES.mo b/BESMod/Examples/UseCaseDesignOptimization/BES.mo index 12a4a77c..5a237433 100644 --- a/BESMod/Examples/UseCaseDesignOptimization/BES.mo +++ b/BESMod/Examples/UseCaseDesignOptimization/BES.mo @@ -14,7 +14,6 @@ model BES BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal /parameterStudy.QHP_flow_biv, @@ -28,19 +27,18 @@ model BES redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen), - redeclare Systems.Hydraulical.Control.PartBiv_PI_ConOut_HPS control( + redeclare Systems.Hydraulical.Control.BivalentPartParallel control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled thermostaticValveController, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - thermostaticValveParameters, + parTheVal, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl bivalentControlData(TBiv=parameterStudy.TBiv), @@ -52,7 +50,6 @@ model BES safetyControl, TCutOff=parameterStudy.TCutOff, QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor), - redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( redeclare @@ -61,11 +58,9 @@ model BES VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.B), - redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage parStoDHW(dTLoadingHC1=10, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.A), - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parThrWayVal), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( diff --git a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo index d9bd0478..695be18a 100644 --- a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo +++ b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo @@ -53,7 +53,7 @@ model BES_HOM thermostaticValveController, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - thermostaticValveParameters, + parTheVal, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl safetyControl, diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 4ba35ff4..2488f5f2 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -56,7 +56,7 @@ partial model PartialModelicaConferenceUseCase thermostaticValveController, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - thermostaticValveParameters, + parTheVal, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl safetyControl, diff --git a/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos b/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos index 15537aad..94dc4030 100644 --- a/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos +++ b/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos @@ -25,12 +25,16 @@ convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib", convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "temperatureSensorData", "parTemSen"); convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "temperatureSensorData", "parTemSen"); +convertElement("BESMod.Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl", "thermostaticValveParameters", "parTheVal"); +convertElement("BESMod.Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl", "thermostaticValveParameters", "parTheVal"); + + convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "bufParameters", "parStoBuf"); convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "dhwParameters", "parStoDHW"); convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "threeWayValveParameters", "parThrWayVal"); -convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "heatingRodAftBufPar", "parHeaRodAftBuf"); +convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "heatingRodAftBufParameters", "parHeaRodAftBuf"); convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "bufParameters", "parStoBuf"); convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "dhwParameters", "parStoDHW"); convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "threeWayValveParameters", "parThrWayVal"); -convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "heatingRodAftBufPar", "parHeaRodAftBuf"); +convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "heatingRodAftBufParameters", "parHeaRodAftBuf"); diff --git a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo index b55f25f0..80c9fed6 100644 --- a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo +++ b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo @@ -90,7 +90,8 @@ partial model PartialHydraulicSystem final dp_nominal=transfer.dp_nominal, final dTLoss_nominal=transfer.dTLoss_nominal, final f_design=transfer.f_design, - final QLoss_flow_nominal=transfer.QLoss_flow_nominal), + final QLoss_flow_nominal=transfer.QLoss_flow_nominal, + final nHeaTra=transfer.nHeaTra), final use_openModelica=use_openModelica) annotation (choicesAllMatching=true, Placement(transformation(extent={{-132,54}, {154,122}}))); diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo index 19191c75..36d7579f 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo @@ -22,13 +22,13 @@ partial model PartialControl "Partial controller for HPS" Interfaces.TransferControlBus sigBusTra annotation (Placement(transformation(extent={{152,-124},{196,-76}}))); replaceable parameter BESMod.Systems.RecordsCollection.SubsystemControlBaseDataDefinition - generationParameters + generationParameters "Parameters of generation subsystem" annotation (Placement(transformation(extent={{-194,-106},{-174,-86}}))); replaceable parameter BESMod.Systems.Hydraulical.Distribution.RecordsCollection.DistributionControlBaseDataDefinition - distributionParameters + distributionParameters "Parameters of distribution subsystem" annotation (Placement(transformation(extent={{-36,-108},{-16,-88}}))); - replaceable parameter BESMod.Systems.RecordsCollection.SubsystemControlBaseDataDefinition - transferParameters + replaceable parameter BESMod.Systems.Hydraulical.Transfer.RecordsCollection.TransferControlBaseDataDefinition + transferParameters "Parameters of transfer subsystem" annotation (Placement(transformation(extent={{138,-108},{158,-88}}))); BESMod.Systems.Interfaces.UseProBus useProBus annotation ( Placement(transformation(extent={{-140,80},{-98,126}}), diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo index 0998d21b..ea0d72b9 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo @@ -3,17 +3,34 @@ partial model PartialHeatPumpSystemController "Partial model with replaceable blocks for rule based control of heat pump systems" extends BESMod.Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl; - replaceable + parameter Utilities.SupervisoryControl.Types.SupervisoryControlType + supCtrHeaCurTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local + "Heating curve supervisory control"; + parameter Utilities.SupervisoryControl.Types.SupervisoryControlType + supCtrDHWTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local + "Supervisory control approach for DHW supply temperature "; + + replaceable model DHWHysteresis = + BESMod.Systems.Hydraulical.Control.Components.OnOffController.ConstantHysteresisTimeBasedHR + constrainedby BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController - DHWOnOffContoller annotation (choicesAllMatching=true, Placement( - transformation(extent={{-128,70},{-112,86}}))); - replaceable + "Hysteresis for DHW system" annotation (choicesAllMatching=true); + replaceable model BuildingHysteresis = + BESMod.Systems.Hydraulical.Control.Components.OnOffController.ConstantHysteresisTimeBasedHR + constrainedby BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController - BufferOnOffController annotation (choicesAllMatching=true, Placement( - transformation(extent={{-118,32},{-102,48}}))); + "Hysteresis for building" annotation (choicesAllMatching=true); + replaceable model DHWSetTemperature = + BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW + constrainedby + BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control( + final TSetDHW_nominal=distributionParameters.TDHW_nominal) + "DHW set temperture module" annotation (choicesAllMatching=true); + replaceable BESMod.Systems.Hydraulical.Control.RecordsCollection.HeatPumpSafetyControl safetyControl - annotation (choicesAllMatching=true,Placement(transformation(extent={{200,30},{220,50}}))); + annotation (choicesAllMatching=true,Placement(transformation(extent={{204,84}, + {218,98}}))); replaceable parameter RecordsCollection.BivalentHeatPumpControlDataDefinition bivalentControlData constrainedby RecordsCollection.BivalentHeatPumpControlDataDefinition( @@ -23,60 +40,19 @@ partial model PartialHeatPumpSystemController "Parameters for bivalent control" annotation (choicesAllMatching=true, Placement(transformation(extent={{-96,-36}, {-82,-22}}))); - replaceable - BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control - TSet_DHW constrainedby - BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control( - final T_DHW=distributionParameters.TDHW_nominal) annotation ( - choicesAllMatching=true, Placement(transformation(extent={{-216,66},{-192, - 90}}))); - BESMod.Systems.Hydraulical.Control.Components.HeatingCurve - heatingCurve( - GraHeaCurve=bivalentControlData.gradientHeatCurve, - THeaThres=bivalentControlData.TSetRoomConst, - dTOffSet_HC=bivalentControlData.dTOffSetHeatCurve) - annotation (Placement(transformation(extent={{-160,20},{-140,40}}))); - Modelica.Blocks.MathBoolean.Or - HRactive(nu=3) - annotation (Placement(transformation( - extent={{-5,-5},{5,5}}, - rotation=0, - origin={15,25}))); - Modelica.Blocks.Logical.Or HP_active - annotation (Placement(transformation( - extent={{-5,-5},{5,5}}, - rotation=0, - origin={27,91}))); replaceable BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.BaseClasses.PartialHPNSetController HP_nSet_Controller annotation (choicesAllMatching=true, Placement( transformation(extent={{102,82},{118,98}}))); - Modelica.Blocks.Logical.Switch switch1 - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, - rotation=0, - origin={70,80}))); - Modelica.Blocks.Sources.Constant const_dT_loading1(k=distributionParameters.dTTra_nominal[1]) - annotation (Placement( - transformation( - extent={{4,-4},{-4,4}}, - rotation=180, - origin={14,58}))); - Modelica.Blocks.MathBoolean.Or - DHWHysOrLegionella(nu=4) - "Use the HR if the HP reached its limit" annotation (Placement( - transformation( - extent={{-5,-5},{5,5}}, - rotation=0, - origin={-77,69}))); - AixLib.Controls.HeatPump.SafetyControls.SafetyControl securityControl( + AixLib.Controls.HeatPump.SafetyControls.SafetyControl safCtr( final minRunTime=safetyControl.minRunTime, final minLocTime=safetyControl.minLocTime, final maxRunPerHou=safetyControl.maxRunPerHou, final use_opeEnv=safetyControl.use_opeEnv, final use_opeEnvFroRec=false, - final dataTable=AixLib.DataBase.HeatPump.EN14511.Vitocal200AWO201( - tableUppBou=[-20,50; -10,60; 30,60; 35,55]), + final dataTable=AixLib.DataBase.HeatPump.EN14511.Vitocal200AWO201(tableUppBou= + [-20,50; -10,60; 30,60; 35,55]), final tableUpp=safetyControl.tableUpp, final use_minRunTime=safetyControl.use_minRunTime, final use_minLocTime=safetyControl.use_minLocTime, @@ -87,315 +63,196 @@ partial model PartialHeatPumpSystemController final use_chiller=false, final calcPel_deFro=0, final pre_n_start=safetyControl.pre_n_start_hp, - use_antFre=false) annotation (Placement(transformation( - extent={{-16,-17},{16,17}}, - rotation=0, - origin={210,81}))); - Modelica.Blocks.Sources.BooleanConstant hp_mode(final k=true) annotation ( - Placement(transformation( - extent={{-7,-7},{7,7}}, + use_antFre=false) "Safety control" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0, - origin={155,69}))); - - Modelica.Blocks.Logical.Switch switchHR annotation (Placement(transformation( - extent={{-5,-5},{5,5}}, + origin={210,70}))); + Modelica.Blocks.Sources.BooleanConstant heaPumHea(final k=true) + "Heat pump is always heating" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, rotation=0, - origin={43,25}))); - Modelica.Blocks.Sources.Constant constZero(final k=0) annotation (Placement( - transformation( - extent={{2,-2},{-2,2}}, - rotation=180, - origin={24,10}))); - Modelica.Blocks.Math.Max max annotation (Placement(transformation( - extent={{4,-4},{-4,4}}, - rotation=180, - origin={24,38}))); - - Modelica.Blocks.Math.Add add_dT_LoadingBuf - annotation (Placement(transformation(extent={{38,54},{48,64}}))); - Modelica.Blocks.Sources.Constant const_dT_loading2(k=distributionParameters.dTTraDHW_nominal - + bivalentControlData.dTHysDHW/2) annotation (Placement(transformation( - extent={{4,-4},{-4,4}}, - rotation=180, - origin={14,74}))); - Modelica.Blocks.Math.Add add_dT_LoadingDHW - annotation (Placement(transformation(extent={{36,78},{46,88}}))); + origin={170,90}))); - Modelica.Blocks.Math.BooleanToReal booleanToReal annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={-30,-50}))); - Modelica.Blocks.Logical.Not bufOn "buffer is charged" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={-30,-22}))); - BESMod.Utilities.SupervisoryControl.SupervisoryControl supervisoryControlDHW( - ctrlType=supCtrlTypeDHWSet) - annotation (Placement(transformation(extent={{-182,72},{-170,84}}))); - parameter BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType - supCtrlTypeDHWSet=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local - "Type of supervisory control for DHW Setpoint"; - Modelica.Blocks.Math.MinMax minMax(nu=transferParameters.nParallelDem) - annotation (Placement(transformation(extent={{-200,30},{-180,50}}))); - Modelica.Blocks.Math.BooleanToReal booleanToReal1 "Turn Pump in heat pump on" - annotation (Placement( - transformation( + Modelica.Blocks.Math.BooleanToReal booToRea "Turn pump on if any device is on" + annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, origin={-170,-50}))); - Modelica.Blocks.Logical.Or HP_or_HR_active annotation (Placement( + Modelica.Blocks.MathBoolean.Or anyGenDevIsOn(nu=2) + "True if any generation device is on and pump must run" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=270, origin={-170,-20}))); - Components.HeatPumpBusPassThrough heatPumpBusPassThrough annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, + Components.HeatPumpBusPassThrough heaPumSigBusPasThr + "Bus connector pass through for OpenModelica" annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, rotation=180, - origin={-230,-90}))); -equation - connect(BufferOnOffController.T_Top, sigBusDistr.TStoBufTopMea) annotation ( - Line(points={{-118.8,45.6},{-118.8,46},{-124,46},{-124,-68},{1,-68},{1,-100}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(DHWOnOffContoller.T_Top, sigBusDistr.TStoDHWTopMea) annotation (Line( - points={{-128.8,83.6},{-316,83.6},{-316,-166},{1,-166},{1,-100}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(heatingCurve.TSet, BufferOnOffController.T_Set) annotation (Line( - points={{-139,30},{-110,30},{-110,31.2}}, color={0,0,127})); - - connect(DHWOnOffContoller.T_bot, sigBusDistr.TStoDHWTopMea) annotation (Line( - points={{-128.8,74},{-318,74},{-318,-166},{1,-166},{1,-100}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(HP_active.y, HP_nSet_Controller.HP_On) annotation (Line(points={{32.5,91}, - {32.5,100},{14,100},{14,84},{6,84},{6,50},{100.4,50},{100.4,90}}, - color={255,0,255})); - connect(sigBusDistr, TSet_DHW.sigBusDistr) annotation (Line( - points={{1,-100},{-2,-100},{-2,-152},{-292,-152},{-292,77.88},{-216,77.88}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); + origin={170,64}))); + Components.BuildingAndDHWControl buiAndDHWCtr( + final nZones=transferParameters.nParallelDem, + final TSup_nominal=max(transferParameters.TSup_nominal), + final TRet_nominal=max(transferParameters.TSup_nominal - transferParameters.dTTra_nominal), + final TOda_nominal=generationParameters.TOda_nominal, + final TSetDHW_nominal=distributionParameters.TDHW_nominal, + final nHeaTra=transferParameters.nHeaTra, + final supCtrHeaCurTyp=supCtrHeaCurTyp, + final supCtrDHWTyp=supCtrDHWTyp, + redeclare final model DHWHysteresis = DHWHysteresis, + redeclare final model BuildingHysteresis = BuildingHysteresis, + redeclare final model DHWSetTemperature = DHWSetTemperature) + "Control for building and DHW system" + annotation (Placement(transformation(extent={{-200,20},{-120,80}}))); - connect(DHWOnOffContoller.Auxilliar_Heater_On, HRactive.u[1]) annotation ( - Line(points={{-110.88,74},{-22,74},{-22,23.8333},{10,23.8333}}, color={ - 255,0,255})); - connect(BufferOnOffController.Auxilliar_Heater_On, HRactive.u[2]) annotation ( - Line(points={{-100.88,36},{-20,36},{-20,25},{10,25}}, color= - {255,0,255})); - connect(TSet_DHW.y, HRactive.u[3]) annotation (Line(points={{-190.8,71.04},{-96, - 71.04},{-96,26.1667},{10,26.1667}}, color= - {255,0,255})); + Components.SetAndMeasuredValueSelector setAndMeaSelPri + "Selection of set and measured value for primary generation device" + annotation (Placement(transformation(extent={{40,60},{60,80}}))); + Components.SetAndMeasuredValueSelector setAndMeaSelSec + "Selection of set and measured value for secondary generation device" + annotation (Placement(transformation(extent={{40,0},{60,20}}))); +equation - connect(securityControl.modeSet, hp_mode.y) annotation (Line(points={{191.867, - 77.6},{168,77.6},{168,69},{162.7,69}}, color={255,0,255})); - connect(securityControl.nOut, sigBusGen.yHeaPumSet) annotation (Line( - points={{227.333,84.4},{264,84.4},{264,-132},{-42,-132},{-42,-99},{-152, - -99}}, color={0,0,127}), Text( + connect(safCtr.modeSet, heaPumHea.y) annotation (Line(points={{198.667,68},{186, + 68},{186,90},{181,90}}, color={255,0,255})); + connect(safCtr.nOut, sigBusGen.yHeaPumSet) annotation (Line(points={{220.833,72}, + {254,72},{254,-118},{-152,-118},{-152,-99}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(HP_nSet_Controller.n_Set, securityControl.nSet) annotation (Line( - points={{118.8,90},{118.8,84.4},{191.867,84.4}}, color={0,0,127})); - connect(BufferOnOffController.HP_On, HP_active.u2) annotation (Line(points={{-100.88, - 45.6},{-100.88,52},{21,52},{21,87}}, color={255,0,255})); - connect(DHWOnOffContoller.HP_On, HP_active.u1) annotation (Line(points={{-110.88, - 83.6},{-32,83.6},{-32,91},{21,91}}, color={255,0,255})); - connect(DHWHysOrLegionella.y, switch1.u2) annotation (Line(points={{-71.25,69}, - {-6.625,69},{-6.625,80},{58,80}}, color={255,0,255})); + connect(HP_nSet_Controller.n_Set, safCtr.nSet) annotation (Line(points={{118.8, + 90},{154,90},{154,76},{190,76},{190,72},{198.667,72}}, color={0,0,127})); - connect(TSet_DHW.y, DHWHysOrLegionella.u[1]) annotation (Line(points={{-190.8, - 71.04},{-96,71.04},{-96,67.6875},{-82,67.6875}}, color={255,0,255})); - connect(DHWOnOffContoller.Auxilliar_Heater_On, DHWHysOrLegionella.u[2]) - annotation (Line(points={{-110.88,74},{-92,74},{-92,68.5625},{-82,68.5625}}, - color={ - 255,0,255})); - connect(DHWOnOffContoller.HP_On, DHWHysOrLegionella.u[3]) annotation (Line( - points={{-110.88,83.6},{-90,83.6},{-90,69.4375},{-82,69.4375}}, - color={255,0,255})); - connect(TSet_DHW.y, DHWHysOrLegionella.u[4]) annotation (Line(points={{-190.8, - 71.04},{-136.4,71.04},{-136.4,70.3125},{-82,70.3125}}, - color={255,0,255})); - connect(BufferOnOffController.T_bot, sigBusDistr.TStoBufTopMea) annotation ( - Line(points={{-118.8,36},{-120,36},{-120,46},{-124,46},{-124,-68},{1,-68},{ - 1,-100}}, color={0,0,127}), Text( + connect(HP_nSet_Controller.IsOn, sigBusGen.heaPumIsOn) annotation (Line( + points={{105.2,80.4},{105.2,78},{106,78},{106,48},{260,48},{260,-114},{-152, + -114},{-152,-99}}, color={255,0,255}), + Text( string="%second", index=1, - extent={{-6,3},{-6,3}}, + extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(HRactive.y, switchHR.u2) - annotation (Line(points={{20.75,25},{37,25}}, color={255,0,255})); - connect(constZero.y, switchHR.u3) annotation (Line(points={{26.2,10},{28,10},{ - 28,21},{37,21}}, color={0,0,127})); - connect(max.y, switchHR.u1) - annotation (Line(points={{28.4,38},{37,38},{37,29}}, color={0,0,127})); - connect(BufferOnOffController.Auxilliar_Heater_set, max.u1) annotation (Line( - points={{-100.88,33.12},{8,33.12},{8,35.6},{19.2,35.6}}, color={0,0, - 127})); - connect(DHWOnOffContoller.Auxilliar_Heater_set, max.u2) annotation (Line( - points={{-110.88,71.12},{-104,71.12},{-104,64},{-10,64},{-10,40.4},{19.2, - 40.4}}, color={0,0,127})); - connect(switchHR.y, sigBusGen.uHeaRod) annotation (Line(points={{48.5,25},{62,25}, - {62,-48},{-152,-48},{-152,-99}}, color={0,0,127}), Text( + connect(booToRea.u, anyGenDevIsOn.y) + annotation (Line(points={{-170,-38},{-170,-31.5}}, color={255,0,255})); + connect(booToRea.y, sigBusGen.uPump) annotation (Line(points={{-170,-61},{-172, + -61},{-172,-72},{-152,-72},{-152,-99}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(HP_nSet_Controller.IsOn, sigBusGen.heaPumIsOn) annotation (Line( - points={{105.2,80.4},{105.2,48},{-32,48},{-32,-8},{-132,-8},{-132,-46},{ - -152,-46},{-152,-99}}, color={255,0,255}), - Text( + connect(heaPumSigBusPasThr.sigBusGen, sigBusGen) annotation (Line( + points={{160,64},{154,64},{154,-56},{-16,-56},{-16,-70},{-126,-70},{-126, + -68},{-152,-68},{-152,-99}}, + color={255,204,51}, + thickness=0.5), Text( string="%second", index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - connect(const_dT_loading2.y,add_dT_LoadingDHW. u2) annotation (Line(points={{18.4,74}, - {24,74},{24,80},{35,80}}, color={0,0,127})); - connect(switch1.y, HP_nSet_Controller.T_Set) annotation (Line(points={{81,80},{ - 94,80},{94,94.8},{100.4,94.8}}, color={0,0,127})); - connect(heatingCurve.TSet, add_dT_LoadingBuf.u1) annotation (Line(points={{-139,30}, - {4,30},{4,66},{32,66},{32,62},{37,62}}, - color={0,0,127})); - connect(add_dT_LoadingBuf.y, switch1.u3) annotation (Line(points={{48.5,59},{ - 48.5,72},{58,72}}, color={0,0,127})); - connect(add_dT_LoadingDHW.y, switch1.u1) annotation (Line(points={{46.5,83},{50, - 83},{50,88},{58,88}}, color={0,0,127})); - connect(const_dT_loading1.y, add_dT_LoadingBuf.u2) annotation (Line(points={{ - 18.4,58},{26,58},{26,56},{37,56}}, color={0,0,127})); - connect(booleanToReal.y, sigBusDistr.uThrWayVal) annotation (Line(points={{-30,-61}, - {-30,-66},{1,-66},{1,-100}}, color={0,0,127}), Text( + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(heaPumSigBusPasThr.vapourCompressionMachineControlBus, safCtr.sigBusHP) + annotation (Line( + points={{180.2,64.2},{190,64.2},{190,63.1},{198.75,63.1}}, + color={255,204,51}, + thickness=0.5)); + connect(buiAndDHWCtr.TZoneSet, useProBus.TZoneSet) annotation (Line(points={{ + -204,35},{-238,35},{-238,103},{-119,103}}, color={0,0,127}), Text( string="%second", index=1, - extent={{-3,-6},{-3,-6}}, + extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(booleanToReal.u, bufOn.y) annotation (Line(points={{-30,-38},{-30,-33}}, - color={255,0,255})); - connect(bufOn.u, DHWHysOrLegionella.y) annotation (Line(points={{-30,-10},{-30, - 69},{-71.25,69}}, color={255,0,255})); - connect(TSet_DHW.TSet_DHW, supervisoryControlDHW.uLoc) annotation (Line( - points={{-190.8,78},{-188,78},{-188,73.2},{-183.2,73.2}}, color={0,0, - 127})); - connect(supervisoryControlDHW.y, DHWOnOffContoller.T_Set) annotation (Line( - points={{-168.8,78},{-150,78},{-150,74},{-122,74},{-122,69.2},{-120,69.2}}, - color={0,0,127})); - connect(supervisoryControlDHW.y, add_dT_LoadingDHW.u1) annotation (Line( - points={{-168.8,78},{-150,78},{-150,76},{-10,76},{-10,86},{35,86}}, - color={0,0,127})); - connect(supervisoryControlDHW.actInt, sigBusHyd.overwriteTSetDHW) annotation ( - Line(points={{-183.2,78},{-186,78},{-186,94},{-28,94},{-28,101}}, color={ - 255,0,255}), Text( + connect(buiAndDHWCtr.TZoneMea, buiMeaBus.TZoneMea) annotation (Line(points={{ + -204,45},{-250,45},{-250,118},{64,118},{64,103},{65,103}}, color={0,0, + 127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(supervisoryControlDHW.uSup, sigBusHyd.TSetDHW) annotation (Line( - points={{-183.2,82.8},{-183.2,92},{-28,92},{-28,101}}, color={0,0,127}), - Text( + connect(sigBusDistr, buiAndDHWCtr.sigBusDistr) annotation (Line( + points={{1,-100},{1,-116},{-250,-116},{-250,72.5},{-200,72.5}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(buiAndDHWCtr.sigBusHyd, sigBusHyd) annotation (Line( + points={{-185.6,80.25},{-185.6,112},{-186,112},{-186,118},{-28,118},{-28, + 101}}, + color={255,204,51}, + thickness=0.5), Text( string="%second", index=1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(heatingCurve.TOda, weaBus.TDryBul) annotation (Line(points={{-162,30},{ - -166,30},{-166,24},{-238,24},{-238,2},{-237,2}}, - color={0,0,127}), Text( + connect(buiAndDHWCtr.TOda, weaBus.TDryBul) annotation (Line(points={{-204,55},{ + -244,55},{-244,2},{-237,2}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(BufferOnOffController.T_oda, weaBus.TDryBul) annotation (Line(points={{-110, - 48.96},{-110,56},{-238,56},{-238,2},{-237,2}}, color= - {0,0,127}), Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - connect(DHWOnOffContoller.T_oda, weaBus.TDryBul) annotation (Line(points={{-120, - 86.96},{-192,86.96},{-192,94},{-248,94},{-248,2},{-237,2}}, color={0,0, - 127}), Text( + connect(buiAndDHWCtr.secGen, anyGenDevIsOn.u[1]) annotation (Line(points={{-118, + 37.5},{-110,37.5},{-110,6},{-168,6},{-168,-6},{-171.75,-6},{-171.75,-10}}, + color={255,0,255})); + connect(buiAndDHWCtr.priGren, anyGenDevIsOn.u[2]) annotation (Line(points={{ + -118,27.5},{-110,27.5},{-110,6},{-168,6},{-168,-6},{-168.25,-6},{ + -168.25,-10}}, color={255,0,255})); + connect(HP_nSet_Controller.HP_On, buiAndDHWCtr.priGren) annotation (Line(points={{100.4, + 90},{96,90},{96,40},{-80,40},{-80,27.5},{-118,27.5}}, color={ + 255,0,255})); + connect(setAndMeaSelPri.DHW, buiAndDHWCtr.DHW) annotation (Line(points={{39,76}, + {28,76},{28,74},{-106,74},{-106,68},{-118,68}}, color={0,0,127})); + connect(buiAndDHWCtr.TDHWSet, setAndMeaSelPri.TDHWSet) annotation (Line(points={ + {-118,75},{-118,74},{28,74},{28,78.8},{39,78.8}}, color={0,0,127})); + connect(setAndMeaSelPri.TBuiSet, buiAndDHWCtr.TBuiSet) annotation (Line(points={ + {39,72.8},{38,72.8},{38,74},{-106,74},{-106,60},{-118,60}}, color={0,0,127})); + connect(setAndMeaSelPri.TSet, HP_nSet_Controller.T_Set) annotation (Line(points= + {{61,76},{94,76},{94,94.8},{100.4,94.8}}, color={0,0,127})); + connect(setAndMeaSelPri.TMea, HP_nSet_Controller.T_Meas) + annotation (Line(points={{61,66},{110,66},{110,80.4}}, color={0,0,127})); + connect(setAndMeaSelPri.sigBusGen, sigBusGen) annotation (Line( + points={{40,61.8},{16,61.8},{16,62},{-68,62},{-68,-99},{-152,-99}}, + color={255,204,51}, + thickness=0.5), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(minMax.u, useProBus.TZoneSet) annotation (Line(points={{-200,40},{-244, - 40},{-244,104},{-119,104},{-119,103}}, color={0,0,127}), - Text( + connect(setAndMeaSelPri.sigBusDistr, sigBusDistr) annotation (Line( + points={{40,67.9},{14,67.9},{14,68},{1,68},{1,-100}}, + color={255,204,51}, + thickness=0.5), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(minMax.yMax, heatingCurve.TSetRoom) - annotation (Line(points={{-179,46},{-150,46},{-150,42}}, color={0,0,127})); - connect(booleanToReal1.u, HP_or_HR_active.y) - annotation (Line(points={{-170,-38},{-170,-31}}, color={255,0,255})); - connect(booleanToReal1.y, sigBusGen.uPump) annotation (Line(points={{-170,-61}, - {-172,-61},{-172,-72},{-152,-72},{-152,-99}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(HP_or_HR_active.u1, HRactive.y) annotation (Line(points={{-170,-8},{ - -134,-8},{-134,-6},{-6,-6},{-6,16},{26,16},{26,26},{20.75,26},{20.75,25}}, - color={ - 255,0,255})); - connect(HP_or_HR_active.u2, sigBusGen.heaPumIsOn) annotation (Line( - points={{-178,-8},{-194,-8},{-194,-99},{-152,-99}}, color={255,0,255}), - Text( + connect(setAndMeaSelSec.TDHWSet, buiAndDHWCtr.TDHWSet) annotation (Line(points={ + {39,18.8},{34,18.8},{34,16},{-28,16},{-28,74},{-120,74},{-120,75},{-118, + 75}}, color={0,0,127})); + connect(setAndMeaSelSec.TBuiSet, buiAndDHWCtr.TBuiSet) annotation (Line(points={ + {39,12.8},{4,12.8},{4,16},{-28,16},{-28,74},{-106,74},{-106,60},{-118,60}}, + color={0,0,127})); + connect(setAndMeaSelSec.DHW, buiAndDHWCtr.DHW) annotation (Line(points={{39,16}, + {-28,16},{-28,74},{-106,74},{-106,68},{-118,68}}, color={255,0,255})); + connect(setAndMeaSelSec.sigBusDistr, sigBusDistr) annotation (Line( + points={{40,7.9},{40,6},{1,6},{1,-100}}, + color={255,204,51}, + thickness=0.5), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(heatPumpBusPassThrough.sigBusGen, sigBusGen) annotation (Line( - points={{-220,-90},{-200,-90},{-200,-80},{-180,-80},{-180,-72},{-152,-72}, - {-152,-99}}, + connect(setAndMeaSelSec.sigBusGen, sigBusGen) annotation (Line( + points={{40,1.8},{40,-56},{-16,-56},{-16,-70},{-68,-70},{-68,-99},{-152,-99}}, color={255,204,51}, thickness=0.5), Text( string="%second", index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(heatPumpBusPassThrough.vapourCompressionMachineControlBus, - securityControl.sigBusHP) annotation (Line( - points={{-240.2,-89.8},{-252,-89.8},{-252,-80},{72,-80},{72,-38},{192,-38}, - {192,69.27},{192,69.27}}, - color={255,204,51}, - thickness=0.5)); + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + annotation (Diagram(graphics={ Rectangle( - extent={{-240,100},{-50,60}}, - lineColor={238,46,47}, - lineThickness=1), - Text( - extent={{-234,94},{-140,128}}, - lineColor={238,46,47}, - lineThickness=1, - textString="DHW Control"), - Rectangle( - extent={{-240,58},{-50,14}}, - lineColor={0,140,72}, - lineThickness=1), - Text( - extent={{-220,-12},{-126,22}}, - lineColor={0,140,72}, - lineThickness=1, - textString="Buffer Control"), - Rectangle( - extent={{0,100},{132,52}}, + extent={{0,100},{132,36}}, lineColor={28,108,200}, lineThickness=1), Text( @@ -404,14 +261,14 @@ equation lineThickness=1, textString="Heat Pump Control"), Rectangle( - extent={{0,46},{132,4}}, + extent={{0,32},{132,-22}}, lineColor={162,29,33}, lineThickness=1), Text( - extent={{2,4},{106,-16}}, + extent={{2,-22},{106,-42}}, lineColor={162,29,33}, lineThickness=1, - textString="Heating Rod Control"), + textString="Auxilliary Heater Control"), Rectangle( extent={{138,100},{240,52}}, lineColor={28,108,200}, diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo index d4f9fc23..6522913e 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo @@ -7,29 +7,32 @@ partial model PartialThermostaticValveControl thermostaticValveController constrainedby BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.BaseClasses.PartialThermostaticValveController( final nZones=transferParameters.nParallelDem, final leakageOpening= - thermostaticValveParameters.leakageOpening) annotation ( - choicesAllMatching=true, Placement(transformation(extent={{112,-94},{138, - -64}}))); + parTheVal.leakageOpening) annotation ( + choicesAllMatching=true, Placement(transformation(extent={{122,-78},{138, + -62}}))); replaceable parameter BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - thermostaticValveParameters annotation (choicesAllMatching=true, Placement( - transformation(extent={{178,-80},{198,-60}}))); + parTheVal "Thermostatic valve parameters" + annotation (choicesAllMatching=true, Placement( + transformation(extent={{182,-78},{198,-62}}))); equation connect(thermostaticValveController.opening, sigBusTra.opening) annotation ( - Line(points={{140.6,-79},{174,-79},{174,-100}}, color={0,0,127}), Text( + Line(points={{139.6,-70},{174,-70},{174,-100}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(thermostaticValveController.TZoneMea, buiMeaBus.TZoneMea) annotation ( - Line(points={{109.4,-70},{104,-70},{104,-42},{238,-42},{238,103},{65,103}}, + Line(points={{120.4,-65.2},{120.4,-66},{76,-66},{76,-116},{-250,-116},{-250, + 118},{65,118},{65,103}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(thermostaticValveController.TZoneSet, useProBus.TZoneSet) annotation ( - Line(points={{109.4,-88},{102,-88},{102,-40},{236,-40},{236,103},{-119,103}}, + Line(points={{120.4,-74.8},{76,-74.8},{76,-116},{-250,-116},{-250,102},{-119, + 102},{-119,103}}, color={0,0,127}), Text( string="%second", index=1, diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo index 861931c3..5070d352 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo @@ -2,389 +2,11 @@ within BESMod.Systems.Hydraulical.Control.BaseClasses; partial model PartialTwoPoint_HPS_Controller_BivalentBoiler "Partial model with replaceable blocks for rule based control of HPS using Boiler" extends - BESMod.Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl; - replaceable - BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController - DHWOnOffContoller annotation (choicesAllMatching=true, Placement( - transformation(extent={{-128,70},{-112,86}}))); - replaceable - BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController - BufferOnOffController annotation (choicesAllMatching=true, Placement( - transformation(extent={{-126,36},{-110,50}}))); - replaceable BESMod.Systems.Hydraulical.Control.RecordsCollection.HeatPumpSafetyControl - safetyControl - annotation (choicesAllMatching=true,Placement(transformation(extent={{200,30},{220,50}}))); - replaceable parameter RecordsCollection.BivalentHeatPumpControlDataDefinition - bivalentControlData constrainedby - RecordsCollection.BivalentHeatPumpControlDataDefinition( - final TOda_nominal=generationParameters.TOda_nominal, - TSup_nominal=generationParameters.TSup_nominal[1], - TSetRoomConst=sum(transferParameters.TDem_nominal)/transferParameters.nParallelDem) - annotation (choicesAllMatching=true, Placement(transformation(extent={{-92,-32},{-70,-10}}))); - replaceable - BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control - TSet_DHW constrainedby - BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control( - final T_DHW=distributionParameters.TDHW_nominal) annotation ( - choicesAllMatching=true, Placement(transformation(extent={{-216,66},{-192, - 90}}))); - BESMod.Systems.Hydraulical.Control.Components.HeatingCurve - heatingCurve( - GraHeaCurve=bivalentControlData.gradientHeatCurve, - THeaThres=bivalentControlData.TSetRoomConst, - dTOffSet_HC=bivalentControlData.dTOffSetHeatCurve) - annotation (Placement(transformation(extent={{-160,20},{-140,40}}))); - Modelica.Blocks.MathBoolean.Or heatDemand_AuxiliarHeater(nu=3) - "heat demand based on buffer temperatures" annotation (Placement( - transformation( - extent={{-5,-5},{5,5}}, - rotation=0, - origin={21,23}))); - Modelica.Blocks.Logical.Or HP_active - annotation (Placement(transformation( - extent={{-5,-5},{5,5}}, - rotation=0, - origin={27,91}))); - replaceable - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.BaseClasses.PartialHPNSetController - HP_nSet_Controller annotation (choicesAllMatching=true, Placement( - transformation(extent={{82,64},{112,92}}))); - Modelica.Blocks.Logical.Switch switch1 - annotation (Placement(transformation(extent={{-5,-5},{5,5}}, - rotation=0, - origin={63,73}))); - Modelica.Blocks.Sources.Constant const_dT_loading1(k=distributionParameters.dTTra_nominal[1]) - annotation (Placement( - transformation( - extent={{4,-4},{-4,4}}, - rotation=180, - origin={14,58}))); + BESMod.Systems.Hydraulical.Control.BaseClasses.PartialHeatPumpSystemController; - Modelica.Blocks.MathBoolean.Or - DHWHysOrLegionella(nu=4) - "Use the HR if the HP reached its limit" annotation (Placement( - transformation( - extent={{-5,-5},{5,5}}, - rotation=0, - origin={-77,69}))); - AixLib.Controls.HeatPump.SafetyControls.SafetyControl securityControl( - final minRunTime=safetyControl.minRunTime, - final minLocTime=safetyControl.minLocTime, - final maxRunPerHou=safetyControl.maxRunPerHou, - final use_opeEnv=safetyControl.use_opeEnv, - final use_opeEnvFroRec=false, - final dataTable=AixLib.DataBase.HeatPump.EN14511.Vitocal200AWO201( - tableUppBou=[-20,50; -10,60; 30,60; 35,55]), - final tableUpp=safetyControl.tableUpp, - final use_minRunTime=safetyControl.use_minRunTime, - final use_minLocTime=safetyControl.use_minLocTime, - final use_runPerHou=safetyControl.use_runPerHou, - final dTHystOperEnv=safetyControl.dT_opeEnv, - final use_deFro=false, - final minIceFac=0, - final use_chiller=false, - final calcPel_deFro=0, - final pre_n_start=safetyControl.pre_n_start_hp, - use_antFre=false) annotation (Placement(transformation( - extent={{-16,-17},{16,17}}, - rotation=0, - origin={210,81}))); - Modelica.Blocks.Sources.BooleanConstant hp_mode(final k=true) annotation ( - Placement(transformation( - extent={{-7,-7},{7,7}}, - rotation=0, - origin={155,69}))); - - Modelica.Blocks.Math.Add add_dT_LoadingBuf - annotation (Placement(transformation(extent={{38,54},{48,64}}))); - Modelica.Blocks.Sources.Constant const_dT_loading2(k=distributionParameters.dTTraDHW_nominal - + bivalentControlData.dTHysDHW/2) annotation (Placement(transformation( - extent={{4,-4},{-4,4}}, - rotation=180, - origin={14,74}))); - Modelica.Blocks.Math.Add add_dT_LoadingDHW - annotation (Placement(transformation(extent={{36,78},{46,88}}))); - - Modelica.Blocks.Math.BooleanToReal booleanToReal annotation (Placement( - transformation( - extent={{-6,-6},{6,6}}, - rotation=270, - origin={-38,-36}))); - Modelica.Blocks.Logical.Not bufOn "buffer is charged" annotation (Placement( - transformation( - extent={{-5,-5},{5,5}}, - rotation=270, - origin={-37,-17}))); - BESMod.Utilities.SupervisoryControl.SupervisoryControl supervisoryControlDHW( - ctrlType=supCtrlTypeDHWSet) - annotation (Placement(transformation(extent={{-182,72},{-170,84}}))); - parameter BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType - supCtrlTypeDHWSet=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local - "Type of supervisory control for DHW Setpoint"; - Modelica.Blocks.Math.MinMax minMax(nu=transferParameters.nParallelDem) - annotation (Placement(transformation(extent={{-202,32},{-182,52}}))); - Modelica.Blocks.Math.BooleanToReal booleanToReal1 "Turn Pump in heat pump on" - annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={-170,-54}))); - Modelica.Blocks.Logical.Or HP_or_HR_active annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={-170,-24}))); - Components.HeatPumpBusPassThrough heatPumpBusPassThrough annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={-230,-90}))); + Components.BoilerInHybridSystem boilerInHybridSystem + annotation (Placement(transformation(extent={{-60,-20},{-12,0}}))); equation - connect(BufferOnOffController.T_Top, sigBusDistr.TStoBufTopMea) annotation ( - Line(points={{-126.8,47.9},{-128,47.9},{-128,48},{-130,48},{-130,-86},{4,-86}, - {4,-100},{1,-100}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(DHWOnOffContoller.T_Top, sigBusDistr.TStoDHWTopMea) annotation (Line( - points={{-128.8,83.6},{-316,83.6},{-316,-166},{1,-166},{1,-100}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(heatingCurve.TSet, BufferOnOffController.T_Set) annotation (Line( - points={{-139,30},{-139,28},{-118,28},{-118,35.3}}, - color={0,0,127})); - - connect(DHWOnOffContoller.T_bot, sigBusDistr.TStoDHWTopMea) annotation (Line( - points={{-128.8,74},{-318,74},{-318,-166},{1,-166},{1,-100}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(HP_active.y, HP_nSet_Controller.HP_On) annotation (Line(points={{32.5, - 91},{70,91},{70,78},{79,78}}, color={255,0,255})); - connect(sigBusDistr, TSet_DHW.sigBusDistr) annotation (Line( - points={{1,-100},{-2,-100},{-2,-152},{-292,-152},{-292,77.88},{-216,77.88}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - - connect(DHWOnOffContoller.Auxilliar_Heater_On, heatDemand_AuxiliarHeater.u[1]) - annotation (Line(points={{-110.88,74},{-92,74},{-92,30},{-94,30},{-94,21.8333}, - {16,21.8333}}, color={255,0,255})); - connect(BufferOnOffController.Auxilliar_Heater_On, heatDemand_AuxiliarHeater.u[ - 2]) annotation (Line(points={{-108.88,39.5},{-108.88,38},{-94,38},{-94,23}, - {16,23}}, color={255,0,255})); - connect(TSet_DHW.y, heatDemand_AuxiliarHeater.u[3]) annotation (Line(points={{-190.8, - 71.04},{-186,71.04},{-186,68},{-178,68},{-178,56},{-92,56},{-92,30},{ - -94,30},{-94,24.1667},{16,24.1667}}, color={255,0,255})); - - connect(securityControl.modeSet, hp_mode.y) annotation (Line(points={{191.867, - 77.6},{168,77.6},{168,69},{162.7,69}}, color={255,0,255})); - connect(securityControl.nOut, sigBusGen.yHeaPumSet) annotation (Line( - points={{227.333,84.4},{264,84.4},{264,-132},{-42,-132},{-42,-99},{-152, - -99}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(HP_nSet_Controller.n_Set, securityControl.nSet) annotation (Line( - points={{113.5,78},{144,78},{144,84.4},{191.867,84.4}}, color={0,0,127})); - connect(BufferOnOffController.HP_On, HP_active.u2) annotation (Line(points={{-108.88, - 47.9},{-78,47.9},{-78,54},{-38,54},{-38,87},{21,87}}, - color={255,0,255})); - connect(DHWOnOffContoller.HP_On, HP_active.u1) annotation (Line(points={{-110.88, - 83.6},{-32,83.6},{-32,91},{21,91}}, color={255,0,255})); - connect(DHWHysOrLegionella.y, switch1.u2) annotation (Line(points={{-71.25,69}, - {-20,69},{-20,73},{57,73}}, color={255,0,255})); - - connect(TSet_DHW.y, DHWHysOrLegionella.u[1]) annotation (Line(points={{-190.8, - 71.04},{-96,71.04},{-96,67.6875},{-82,67.6875}}, color={255,0,255})); - connect(DHWOnOffContoller.Auxilliar_Heater_On, DHWHysOrLegionella.u[2]) - annotation (Line(points={{-110.88,74},{-92,74},{-92,68.5625},{-82,68.5625}}, - color={ - 255,0,255})); - connect(DHWOnOffContoller.HP_On, DHWHysOrLegionella.u[3]) annotation (Line( - points={{-110.88,83.6},{-90,83.6},{-90,69.4375},{-82,69.4375}}, - color={255,0,255})); - connect(TSet_DHW.y, DHWHysOrLegionella.u[4]) annotation (Line(points={{-190.8, - 71.04},{-136.4,71.04},{-136.4,70.3125},{-82,70.3125}}, - color={255,0,255})); - connect(BufferOnOffController.T_bot, sigBusDistr.TStoBufTopMea) annotation ( - Line(points={{-126.8,39.5},{-130,39.5},{-130,-86},{134,-86},{134,-100},{1, - -100}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(HP_nSet_Controller.IsOn, sigBusGen.heaPumIsOn) annotation (Line( - points={{88,61.2},{88,48},{156,48},{156,-54},{-152,-54},{-152,-99}}, - color={255,0,255}), - Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - connect(const_dT_loading2.y,add_dT_LoadingDHW. u2) annotation (Line(points={{18.4,74}, - {24,74},{24,80},{35,80}}, color={0,0,127})); - connect(switch1.y, HP_nSet_Controller.T_Set) annotation (Line(points={{68.5, - 73},{70,73},{70,86.4},{79,86.4}}, color={0,0,127})); - connect(heatingCurve.TSet, add_dT_LoadingBuf.u1) annotation (Line(points={{-139,30}, - {-139,28},{4,28},{4,66},{32,66},{32,62},{37,62}}, - color={0,0,127})); - connect(add_dT_LoadingBuf.y, switch1.u3) annotation (Line(points={{48.5,59},{ - 54,59},{54,69},{57,69}}, color={0,0,127})); - connect(add_dT_LoadingDHW.y, switch1.u1) annotation (Line(points={{46.5,83},{ - 51.25,83},{51.25,77},{57,77}}, color={0,0,127})); - connect(const_dT_loading1.y, add_dT_LoadingBuf.u2) annotation (Line(points={{ - 18.4,58},{26,58},{26,56},{37,56}}, color={0,0,127})); - connect(booleanToReal.y, sigBusDistr.uThrWayVal) annotation (Line(points={{ - -38,-42.6},{-38,-62},{1,-62},{1,-100}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - connect(booleanToReal.u, bufOn.y) annotation (Line(points={{-38,-28.8},{-38, - -26},{-37,-26},{-37,-22.5}}, color={255,0,255})); - connect(bufOn.u, DHWHysOrLegionella.y) annotation (Line(points={{-37,-11},{ - -37,70},{-71.25,70},{-71.25,69}}, color={255,0,255})); - connect(TSet_DHW.TSet_DHW, supervisoryControlDHW.uLoc) annotation (Line( - points={{-190.8,78},{-188,78},{-188,73.2},{-183.2,73.2}}, color={0,0, - 127})); - connect(supervisoryControlDHW.y, DHWOnOffContoller.T_Set) annotation (Line( - points={{-168.8,78},{-150,78},{-150,74},{-122,74},{-122,69.2},{-120,69.2}}, - color={0,0,127})); - connect(supervisoryControlDHW.y, add_dT_LoadingDHW.u1) annotation (Line( - points={{-168.8,78},{-150,78},{-150,76},{-10,76},{-10,86},{35,86}}, - color={0,0,127})); - connect(supervisoryControlDHW.actInt, sigBusHyd.overwriteTSetDHW) annotation ( - Line(points={{-183.2,78},{-186,78},{-186,94},{-28,94},{-28,101}}, color={ - 255,0,255}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(supervisoryControlDHW.uSup, sigBusHyd.TSetDHW) annotation (Line( - points={{-183.2,82.8},{-183.2,92},{-28,92},{-28,101}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); - connect(heatingCurve.TOda, weaBus.TDryBul) annotation (Line(points={{-162,30}, - {-236,30},{-236,2},{-237,2}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(BufferOnOffController.T_oda, weaBus.TDryBul) annotation (Line(points={ - {-118,50.84},{-118,58},{-236,58},{-236,30},{-237,30},{-237,2}}, color= - {0,0,127}), Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - connect(DHWOnOffContoller.T_oda, weaBus.TDryBul) annotation (Line(points={{-120, - 86.96},{-192,86.96},{-192,94},{-248,94},{-248,2},{-237,2}}, color={0,0, - 127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(minMax.u, useProBus.TZoneSet) annotation (Line(points={{-202,42},{-206, - 42},{-206,52},{-208,52},{-208,60},{-119,60},{-119,103}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(minMax.yMax, heatingCurve.TSetRoom) - annotation (Line(points={{-181,48},{-150,48},{-150,42}}, color={0,0,127})); - connect(booleanToReal1.u, HP_or_HR_active.y) - annotation (Line(points={{-170,-42},{-170,-35}}, color={255,0,255})); - connect(booleanToReal1.y, sigBusGen.uPump) annotation (Line(points={{-170,-65}, - {-172,-65},{-172,-72},{-152,-72},{-152,-99}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(HP_or_HR_active.u1, heatDemand_AuxiliarHeater.y) annotation (Line( - points={{-170,-12},{-170,-6},{-90,-6},{-90,-2},{32,-2},{32,23},{26.75, - 23}}, color={255,0,255})); - connect(HP_or_HR_active.u2, sigBusGen.heaPumIsOn) annotation (Line( - points={{-178,-12},{-194,-12},{-194,-99},{-152,-99}}, color={255,0,255}), - Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(heatPumpBusPassThrough.sigBusGen, sigBusGen) annotation (Line( - points={{-220,-90},{-200,-90},{-200,-80},{-180,-80},{-180,-72},{-152,-72}, - {-152,-99}}, - color={255,204,51}, - thickness=0.5), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(heatPumpBusPassThrough.vapourCompressionMachineControlBus, - securityControl.sigBusHP) annotation (Line( - points={{-240.2,-89.8},{-252,-89.8},{-252,-80},{72,-80},{72,-38},{192,-38}, - {192,69.27},{192,69.27}}, - color={255,204,51}, - thickness=0.5)); - annotation (Diagram(graphics={ - Rectangle( - extent={{-240,100},{-50,60}}, - lineColor={238,46,47}, - lineThickness=1), - Text( - extent={{-234,94},{-140,128}}, - lineColor={238,46,47}, - lineThickness=1, - textString="DHW Control"), - Rectangle( - extent={{-240,58},{-50,14}}, - lineColor={0,140,72}, - lineThickness=1), - Text( - extent={{-216,-14},{-122,20}}, - lineColor={0,140,72}, - lineThickness=1, - textString="Buffer Control"), - Rectangle( - extent={{0,100},{132,52}}, - lineColor={28,108,200}, - lineThickness=1), - Text( - extent={{4,122},{108,102}}, - lineColor={28,108,200}, - lineThickness=1, - textString="Heat Pump Control"), - Rectangle( - extent={{0,46},{132,-4}}, - lineColor={162,29,33}, - lineThickness=1), - Text( - extent={{14,-4},{118,-24}}, - lineColor={162,29,33}, - lineThickness=1, - textString="Boiler Control"), - Rectangle( - extent={{138,100},{240,52}}, - lineColor={28,108,200}, - lineThickness=1), - Text( - extent={{138,122},{242,102}}, - lineColor={28,108,200}, - lineThickness=1, - textString="Heat Pump Safety")})); + connect(boilerInHybridSystem.secGen, buiAndDHWCtr.secGen) annotation (Line( + points={{-64.8,-6},{-110,-6},{-110,37.5},{-118,37.5}}, color={255,0,255})); end PartialTwoPoint_HPS_Controller_BivalentBoiler; diff --git a/BESMod/Systems/Hydraulical/Control/Biv_PI_ConFlow_HPSController.mo b/BESMod/Systems/Hydraulical/Control/Biv_PI_ConFlow_HPSController.mo deleted file mode 100644 index 9aa67f25..00000000 --- a/BESMod/Systems/Hydraulical/Control/Biv_PI_ConFlow_HPSController.mo +++ /dev/null @@ -1,31 +0,0 @@ -within BESMod.Systems.Hydraulical.Control; -model Biv_PI_ConFlow_HPSController - "Using alt_bivalent + PI Inverter + Return Temperature as controller" - extends BaseClasses.PartialHeatPumpSystemController( - redeclare - BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW - TSet_DHW, - redeclare - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController - HP_nSet_Controller( - P=bivalentControlData.k, - nMin=bivalentControlData.nMin, - T_I=bivalentControlData.T_I), - redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.AlternativeBivalentOnOffController - BufferOnOffController(final T_biv=bivalentControlData.TBiv, hysteresis= - bivalentControlData.dTHysDHW), - redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.AlternativeBivalentOnOffController - DHWOnOffContoller(final T_biv=bivalentControlData.TBiv, hysteresis= - bivalentControlData.dTHysDHW)); - -equation - connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) - annotation (Line(points={{97,61.2},{97,-66},{-118,-66},{-118,-99},{-152,-99}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); -end Biv_PI_ConFlow_HPSController; diff --git a/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo b/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo index 2921a0b2..b9354f50 100644 --- a/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo +++ b/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo @@ -9,7 +9,7 @@ model BivalentPartParallel nMin=bivalentControlData.nMin, T_I=bivalentControlData.T_I), redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent BufferOnOffController( Hysteresis=bivalentControlData.dTHysBui, TCutOff=TCutOff, @@ -19,7 +19,7 @@ model BivalentPartParallel QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), QHP_flow_cutOff=QHP_flow_cutOff), redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent DHWOnOffContoller( Hysteresis=bivalentControlData.dTHysDHW, TCutOff=TCutOff, diff --git a/BESMod/Systems/Hydraulical/Control/Components/BoilerInHybridSystem.mo b/BESMod/Systems/Hydraulical/Control/Components/BoilerInHybridSystem.mo new file mode 100644 index 00000000..de755151 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BoilerInHybridSystem.mo @@ -0,0 +1,73 @@ +within BESMod.Systems.Hydraulical.Control.Components; +model BoilerInHybridSystem + Modelica.Blocks.Logical.LessThreshold lesTBiv(threshold=bivalentControlData.TBiv) + "Checks, if Toda is below Tbiv" + annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); + Modelica.Blocks.Logical.Or or1 + "entweder WP im Sperrmodus oder voll ausgelastet" + annotation (Placement(transformation(extent={{0,-30},{20,-10}}))); + Modelica.Blocks.MathBoolean.And allConMet(nu=3) + "If all 3 conditions are met, turn secondary heater on" + annotation (Placement(transformation(extent={{34,-10},{54,10}}))); + Modelica.Blocks.Logical.Or or2 + "if Toda is smaller than TCutOff, activate Boiler" + annotation (Placement(transformation(extent={{72,-10},{92,10}}))); + Modelica.Blocks.Logical.LessThreshold lesTCutOff(threshold=bivalentControlData.TCutOff) + "Checks if Toda is below TCutOff" + annotation (Placement(transformation(extent={{-60,50},{-40,70}}))); + Modelica.Blocks.Logical.And safCtrOn + "=true if the primary devices is blocked due to safety issues" + annotation (Placement(transformation(extent={{-40,-30},{-20,-50}}))); + Modelica.Blocks.Logical.Not not2 + annotation (Placement(transformation(extent={{-80,-70},{-60,-50}}))); + Modelica.Blocks.Logical.Hysteresis hysPriGenAtMax(uLow=0.85, uHigh=0.9) + "Hysteresis in to check if primary device runs at full load" + annotation (Placement(transformation(extent={{-60,0},{-40,20}}))); + Modelica.Blocks.Interfaces.BooleanInput secGen + "=true if secondary generator should be used" + annotation (Placement(transformation(extent={{-138,20},{-98,60}}))); + Modelica.Blocks.Interfaces.RealInput TOda(unit="K", displayUnit="degC") + "Outdoor air temperature" + annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); + Modelica.Blocks.Interfaces.BooleanInput priGenSetOn + "=true if primary generator should be on" + annotation (Placement(transformation(extent={{-140,-44},{-100,-4}}))); + Modelica.Blocks.Interfaces.BooleanInput priGenIsOn + "=true if primary generator is on" + annotation (Placement(transformation(extent={{-138,-80},{-98,-40}}))); + Modelica.Blocks.Interfaces.RealInput ySetPriGen "Primary generator set speed" + annotation (Placement(transformation(extent={{-140,-10},{-100,30}}))); + Modelica.Blocks.Interfaces.BooleanOutput secGenOn "Turn secondary generator on" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); +equation + connect(lesTBiv.y, allConMet.u[1]) annotation (Line(points={{-39,90},{-24,90},{ + -24,40},{4,40},{4,-2.33333},{34,-2.33333}}, color={255,0,255})); + connect(or1.y, allConMet.u[2]) annotation (Line(points={{21,-20},{30,-20},{30, + -2},{34,-2},{34,0}}, color={255,0,255})); + connect(allConMet.y, or2.u2) annotation (Line(points={{55.5,0},{62,0},{62,-8},{ + 70,-8}}, color={255,0,255})); + connect(lesTCutOff.y, or2.u1) annotation (Line(points={{-39,60},{64,60},{64,0}, + {70,0}}, color={255,0,255})); + connect(not2.y, safCtrOn.u1) annotation (Line(points={{-59,-60},{-48,-60},{-48, + -40},{-42,-40}}, color={255,0,255})); + connect(safCtrOn.y, or1.u2) annotation (Line(points={{-19,-40},{-10,-40},{-10, + -28},{-2,-28}}, color={255,0,255})); + connect(hysPriGenAtMax.y, or1.u1) annotation (Line(points={{-39,10},{-8,10},{-8, + -20},{-2,-20}}, color={255,0,255})); + connect(allConMet.u[3], secGen) annotation (Line(points={{34,2.33333},{34,-2},{ + 4,-2},{4,40},{-118,40}}, color={255,0,255})); + connect(lesTBiv.u, TOda) annotation (Line(points={{-62,90},{-92,90},{-92,80},{ + -120,80}}, color={0,0,127})); + connect(lesTCutOff.u, TOda) annotation (Line(points={{-62,60},{-88,60},{-88,80}, + {-120,80}}, color={0,0,127})); + connect(priGenIsOn, not2.u) + annotation (Line(points={{-118,-60},{-82,-60}}, color={255,0,255})); + connect(safCtrOn.u2, priGenSetOn) annotation (Line(points={{-42,-32},{-94,-32}, + {-94,-24},{-120,-24}}, color={255,0,255})); + connect(hysPriGenAtMax.u, ySetPriGen) + annotation (Line(points={{-62,10},{-120,10}}, color={0,0,127})); + connect(or2.y, secGenOn) + annotation (Line(points={{93,0},{110,0}}, color={255,0,255})); + annotation (Diagram(coordinateSystem(extent={{-100,-100},{100,100}})), Icon( + coordinateSystem(extent={{-100,-100},{80,100}}))); +end BoilerInHybridSystem; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo new file mode 100644 index 00000000..671a44e7 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo @@ -0,0 +1,294 @@ +within BESMod.Systems.Hydraulical.Control.Components; +model BuildingAndDHWControl + "Control model to control both building and DHW systems" + parameter Integer nZones "Number of heated zones"; + parameter Modelica.Units.SI.Temperature TSup_nominal + "Nominal supply temperature"; + parameter Modelica.Units.SI.Temperature TRet_nominal + "Nominal supply temperature"; + parameter Modelica.Units.SI.Temperature TOda_nominal + "Nominal outdoor air temperature"; + parameter Modelica.Units.SI.Temperature TSetDHW_nominal + "Nominal DHW temperature"; + parameter Real nHeaTra "Exponent of heat transfer system"; + parameter Utilities.SupervisoryControl.Types.SupervisoryControlType + supCtrHeaCurTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local + "Heating curve supervisory control"; + parameter Utilities.SupervisoryControl.Types.SupervisoryControlType + supCtrDHWTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local + "Supervisory control approach for DHW supply temperature "; + + + replaceable model DHWHysteresis = + BESMod.Systems.Hydraulical.Control.Components.OnOffController.ConstantHysteresisTimeBasedHR + constrainedby BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController + "Hysteresis for DHW system" annotation (choicesAllMatching=true); + replaceable model BuildingHysteresis = + BESMod.Systems.Hydraulical.Control.Components.OnOffController.ConstantHysteresisTimeBasedHR + constrainedby BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController + "Hysteresis for building" annotation (choicesAllMatching=true); + replaceable model DHWSetTemperature = + BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW + constrainedby BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control + "DHW set temperture module" annotation (choicesAllMatching=true); + + + DHWHysteresis hysDHW + "Hysteresis for DHW system" annotation (Placement( + transformation(extent={{62,62},{78,78}}))); + BuildingHysteresis hysBui + "Hysteresis for building" annotation (Placement( + transformation(extent={{42,-78},{58,-62}}))); + DHWSetTemperature TSetDHW "DHW set temperature module" annotation ( + Placement(transformation(extent={{-78,82},{-62,98}}))); + + BESMod.Systems.Hydraulical.Control.Components.HeatingCurve heaCur( + final TSup_nominal=TSup_nominal, + final TRet_nominal=TRet_nominal, + final TOda_nominal=TOda_nominal, + final nHeaTra=nHeaTra) "Heating curve" + annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}))); + Modelica.Blocks.Logical.Or priGenOn "Turn on primary generation device" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={170,-70}))); + Modelica.Blocks.MathBoolean.Or orDHW(nu=3) "If any is true, dhw is activated" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={130,70}))); + BESMod.Utilities.SupervisoryControl.SupervisoryControl supCtrDHW(ctrlType=supCtrDHWTyp) + "Supervisory control of DHW" + annotation (Placement(transformation(extent={{0,60},{20,80}}))); + Modelica.Blocks.Math.MinMax minMax(nu=nZones) + annotation (Placement(transformation(extent={{-80,-76},{-60,-56}}))); + Modelica.Blocks.Interfaces.RealInput TOda(unit="K", displayUnit="degC") + "Outdoor air temperature" + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Interfaces.RealOutput TDHWSet(unit="K", displayUnit="degC") + "DHW supply set temperature" + annotation (Placement(transformation(extent={{300,70},{320,90}}))); + Modelica.Blocks.Math.MinMax maxSecHeaGen(nu=3) + "Maximal value suggested for secondary heat generator" annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=180, + origin={130,-34}))); + Interfaces.DistributionControlBus sigBusDistr + "Necessary to control DHW temperatures" + annotation (Placement(transformation(extent={{-110,60},{-90,80}}))); + Interfaces.SystemControlBus sigBusHyd annotation (Placement(transformation( + extent={{80,86},{120,120}}), iconTransformation(extent={{-48,84},{-8, + 118}}))); + Modelica.Blocks.Interfaces.BooleanOutput priGren + "=true to activate primary generation device" + annotation (Placement(transformation(extent={{300,-120},{320,-100}}))); + Modelica.Blocks.MathBoolean.Or secGenOn(nu=3) + "If any is true, secondary heater is activated" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={130,-90}))); + Modelica.Blocks.Interfaces.BooleanOutput secGen + "=true to activate secondary generator" + annotation (Placement(transformation(extent={{300,-80},{320,-60}}))); + Modelica.Blocks.Logical.Switch swiAntLeg + "Switch to full load for anti legionella" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-30,50}))); + Modelica.Blocks.Interfaces.RealOutput ySecGenSet + "Suggested relative power of secondary heat generator" + annotation (Placement(transformation(extent={{300,-50},{320,-30}}))); + Modelica.Blocks.Interfaces.RealInput TZoneMea[nZones](each final unit="K", + each final displayUnit="degC") "Zones temperatures measurements" + annotation (Placement(transformation(extent={{-140,-60},{-100,-20}}))); + Modelica.Blocks.Interfaces.RealInput TZoneSet[nZones](each final unit="K", + each final displayUnit="degC") "Zones set temperatures" + annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}))); + Utilities.SupervisoryControl.SupervisoryControl supCtrHeaCur(ctrlType= + supCtrHeaCurTyp) "Supervisory control of heating curve" + annotation (Placement(transformation(extent={{0,-100},{20,-80}}))); + Modelica.Blocks.Sources.Constant constAntLeg(final k=1) + "For anti legionella, run secondary device at full load" + annotation (Placement(transformation(extent={{-80,50},{-60,70}}))); + Modelica.Blocks.Sources.Constant constAntLegOff(final k=0) + "Disable secondary device if no anti legionella" + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); + Modelica.Blocks.Logical.Not bufOn "buffer is charged" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={160,80}))); + Modelica.Blocks.Math.BooleanToReal booToReal(final realTrue=1, final realFalse= + 0) "Convert singal to real" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={200,80}))); + Modelica.Blocks.Interfaces.BooleanOutput DHW "=true for DHW loading" + annotation (Placement(transformation(extent={{300,42},{320,62}}))); + Modelica.Blocks.Interfaces.RealOutput TBuiSet(unit="K", displayUnit="degC") + "Building supply set temperature" + annotation (Placement(transformation(extent={{300,10},{320,30}}))); +equation + connect(hysBui.priGenOn, priGenOn.u2) annotation (Line(points={{59.12,-64.4},{74, + -64.4},{74,-106},{152,-106},{152,-78},{158,-78}}, color={255,0,255})); + connect(hysDHW.priGenOn, priGenOn.u1) annotation (Line(points={{79.12,75.6},{79.12, + 74},{106,74},{106,-62},{150,-62},{150,-70},{158,-70}}, color={255,0,255})); + connect(TSetDHW.y, orDHW.u[1]) annotation (Line(points={{-61.2,85.36},{-54, + 85.36},{-54,50},{-48,50},{-48,34},{90,34},{90,74},{108,74},{108,67.6667}, + {120,67.6667}}, color={255,0,255})); + connect(hysDHW.secGenOn, orDHW.u[2]) annotation (Line(points={{79.12,66},{90,66}, + {90,50},{120,50},{120,70}}, color={255,0,255})); + connect(TSetDHW.TSetDHW, supCtrDHW.uLoc) annotation (Line(points={{-61.2,90},{-10, + 90},{-10,62},{-2,62}}, color={0,0,127})); + connect(supCtrDHW.y, hysDHW.TSupSet) annotation (Line(points={{22,70},{22,56},{70, + 56},{70,61.2}}, color={0,0,127})); + connect(minMax.yMax,heaCur.TZoneSet) + annotation (Line(points={{-59,-60},{-30,-60},{-30,-78}}, color={0,0,127})); + connect(heaCur.TOda, TOda) annotation (Line(points={{-42,-90},{-94,-90},{-94,0}, + {-120,0}}, color={0,0,127})); + connect(TSetDHW.sigBusDistr, sigBusDistr) annotation (Line( + points={{-78,89.92},{-78,90},{-86,90},{-86,70},{-100,70}}, + color={255,204,51}, + thickness=0.5)); + connect(hysBui.TOda, TOda) annotation (Line(points={{50,-61.04},{50,-54},{-54,-54}, + {-54,0},{-120,0}}, color={0,0,127})); + connect(supCtrDHW.uSup, sigBusHyd.TSetDHWOve) annotation (Line(points={{-2,78}, + {-8,78},{-8,88},{78,88},{78,84},{100,84},{100,103}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(supCtrDHW.actInt, sigBusHyd.oveTSetDHW) annotation (Line(points={{-2,70}, + {-8,70},{-8,78},{-6,78},{-6,86},{78,86},{78,84},{100,84},{100,103}}, + color={255,0,255}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(hysDHW.priGenOn, orDHW.u[3]) annotation (Line(points={{79.12,75.6},{ + 79.12,74},{108,74},{108,72.3333},{120,72.3333}}, + color={255,0,255})); + connect(priGenOn.y, priGren) annotation (Line(points={{181,-70},{208,-70},{208, + -110},{310,-110}}, + color={255,0,255})); + connect(secGenOn.y, secGen) annotation (Line(points={{141.5,-90},{292,-90},{292, + -70},{310,-70}}, color={255,0,255})); + connect(secGenOn.u[1], hysBui.secGenOn) annotation (Line(points={{120,-92.3333}, + {114,-92.3333},{114,-74},{59.12,-74}}, color={255,0,255})); + connect(hysDHW.secGenOn, secGenOn.u[2]) annotation (Line(points={{79.12,66},{90, + 66},{90,50},{114,50},{114,-90},{120,-90}}, color={255,0,255})); + connect(TSetDHW.y, secGenOn.u[3]) annotation (Line(points={{-61.2,85.36},{-54, + 85.36},{-54,50},{-48,50},{-48,34},{90,34},{90,50},{114,50},{114, + -87.6667},{120,-87.6667}}, + color={255,0,255})); + connect(maxSecHeaGen.u[1], hysDHW.ySecGenSet) annotation (Line(points={{120, + -31.6667},{86,-31.6667},{86,8},{52,8},{52,54},{79.12,54},{79.12,63.12}}, + color={0, + 0,127})); + connect(maxSecHeaGen.u[2], hysBui.ySecGenSet) annotation (Line(points={{120,-34}, + {86,-34},{86,-76.88},{59.12,-76.88}}, color={0,0,127})); + connect(swiAntLeg.y, maxSecHeaGen.u[3]) annotation (Line(points={{-19,50},{52, + 50},{52,8},{86,8},{86,-36.3333},{120,-36.3333}}, + color={0,0,127})); + connect(TSetDHW.y, swiAntLeg.u2) annotation (Line(points={{-61.2,85.36},{-54, + 85.36},{-54,50},{-42,50}}, + color={255,0,255})); + connect(hysDHW.TStoTop, sigBusDistr.TStoDHWTopMea) annotation (Line(points={{61.2, + 75.6},{48,75.6},{48,102},{-90,102},{-90,70},{-100,70}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(hysDHW.TStoBot, sigBusDistr.TStoDHWBotMea) annotation (Line(points={{61.2, + 66},{48,66},{48,102},{-90,102},{-90,70},{-100,70}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(maxSecHeaGen.yMax, ySecGenSet) + annotation (Line(points={{141,-40},{310,-40}}, + color={0,0,127})); + connect(TOda, hysDHW.TOda) annotation (Line(points={{-120,0},{-94,0},{-94,102},{ + 70,102},{70,78.96}}, color={0,0,127})); + connect(hysBui.TStoTop, sigBusDistr.TStoBufTopMea) annotation (Line(points={{41.2, + -64.4},{38,-64.4},{38,-64},{34,-64},{34,6},{-100,6},{-100,70}}, color={0, + 0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(hysBui.TStoBot, sigBusDistr.TStoBufBotMea) annotation (Line(points={{41.2, + -74},{34,-74},{34,6},{-100,6},{-100,70}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(supCtrHeaCur.y, hysBui.TSupSet) + annotation (Line(points={{22,-90},{50,-90},{50,-78.8}}, color={0,0,127})); + connect(supCtrHeaCur.uLoc, heaCur.TSet) annotation (Line(points={{-2,-98},{-14, + -98},{-14,-90},{-19,-90}}, color={0,0,127})); + connect(minMax.u, TZoneSet) annotation (Line(points={{-80,-66},{-92,-66},{-92, + -80},{-120,-80}}, color={0,0,127})); + connect(constAntLegOff.y, swiAntLeg.u3) annotation (Line(points={{-59,30},{-50, + 30},{-50,42},{-42,42}}, color={0,0,127})); + connect(constAntLeg.y, swiAntLeg.u1) + annotation (Line(points={{-59,60},{-59,58},{-42,58}}, color={0,0,127})); + connect(booToReal.y, sigBusDistr.uThrWayVal) annotation (Line(points={{211,80}, + {216,80},{216,116},{-100,116},{-100,70}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(bufOn.u, orDHW.y) annotation (Line(points={{148,80},{141.5,80},{141.5, + 70}}, color={255,0,255})); + connect(booToReal.u, bufOn.y) + annotation (Line(points={{188,80},{171,80}}, color={255,0,255})); + connect(orDHW.y, DHW) annotation (Line(points={{141.5,70},{144,70},{144,52},{310, + 52}}, color={255,0,255})); + connect(supCtrHeaCur.uSup, sigBusHyd.TBuiSupOve) annotation (Line(points={{-2,-82}, + {-16,-82},{-16,12},{-106,12},{-106,132},{100,132},{100,103}}, color={0,0, + 127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(supCtrHeaCur.actInt, sigBusHyd.oveTBuiSup) annotation (Line(points={{-2, + -90},{-16,-90},{-16,12},{-106,12},{-106,132},{100,132},{100,103}}, + color={255,0,255}), Text( + string="%second", + index=1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + connect(supCtrHeaCur.y, TBuiSet) annotation (Line(points={{22,-90},{56,-90},{56, + -134},{284,-134},{284,20},{310,20}}, color={0,0,127})); + connect(supCtrDHW.y, TDHWSet) annotation (Line(points={{22,70},{22,42},{274,42}, + {274,80},{310,80}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140}, + {300,100}})), Diagram(coordinateSystem(preserveAspectRatio=false, + extent={{-100,-140},{300,100}}), graphics={ + Rectangle( + extent={{-98,102},{222,22}}, + lineColor={238,46,47}, + lineThickness=1), + Text( + extent={{-94,92},{0,126}}, + lineColor={238,46,47}, + lineThickness=1, + textString="DHW Control"), + Rectangle( + extent={{-100,-48},{80,-140}}, + lineColor={0,140,72}, + lineThickness=1), + Text( + extent={{-100,-146},{-6,-112}}, + lineColor={0,140,72}, + lineThickness=1, + textString="Building Control")})); +end BuildingAndDHWControl; diff --git a/BESMod/Systems/Hydraulical/Control/Components/ConstantAdd.mo b/BESMod/Systems/Hydraulical/Control/Components/ConstantAdd.mo new file mode 100644 index 00000000..27bbca98 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/ConstantAdd.mo @@ -0,0 +1,53 @@ +within BESMod.Systems.Hydraulical.Control.Components; +block ConstantAdd + "Output the addition of a constant offset with the input signal" + + parameter Real k(start=1, unit="1") + "Offset value added to input signal"; +public + Modelica.Blocks.Interfaces.RealInput u "Input signal connector" + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Interfaces.RealOutput y "Output signal connector" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + +equation + y = k+u; + annotation ( + Documentation(info=" +

+This block computes output y as +product of gain k with the +input u: +

+
+y = k * u;
+
+ +"), + Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100, + 100}}), graphics={ + Polygon( + points={{-100,-100},{-100,100},{100,0},{-100,-100}}, + lineColor={0,0,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-150,-140},{150,-100}}, + textString="k=%k"), + Text( + extent={{-150,140},{150,100}}, + textString="%name", + textColor={0,0,255}), + Rectangle( + extent={{-50,48},{-30,-44}}, + lineColor={28,108,200}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-10,46},{10,-46}}, + lineColor={28,108,200}, + fillColor={28,108,200}, + fillPattern=FillPattern.Solid, + origin={-38,0}, + rotation=90)})); +end ConstantAdd; diff --git a/BESMod/Systems/Hydraulical/Control/Components/DHWSetControl/AntiLegionellaControl.mo b/BESMod/Systems/Hydraulical/Control/Components/DHWSetControl/AntiLegionellaControl.mo index aefe17ba..b3325945 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/DHWSetControl/AntiLegionellaControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/DHWSetControl/AntiLegionellaControl.mo @@ -25,7 +25,7 @@ model AntiLegionellaControl "Control to avoid Legionella in the DHW" Modelica.Blocks.Sources.Constant constTLegMin(final k=TLegMin) "Temperature at which the legionella in DWH dies" annotation (Placement(transformation(extent={{-88,-84},{-70,-66}}))); - Modelica.Blocks.Sources.Constant const(final k=T_DHW) + Modelica.Blocks.Sources.Constant const(final k=TSetDHW_nominal) annotation (Placement(transformation(extent={{-6,78},{14,98}}))); Modelica.Blocks.Logical.GreaterEqual TConLessTLegMin @@ -88,8 +88,8 @@ algorithm equation connect(switchTLeg.u3, constTLegMin.y) annotation (Line(points={{62.6,-4.6},{52, -4.6},{52,-75},{-69.1,-75}},color={0,0,127})); - connect(switchTLeg.y, TSet_DHW) annotation (Line(points={{78.7,1},{92,1},{92,0}, - {110,0}}, color={0,0,127})); + connect(switchTLeg.y, TSetDHW) + annotation (Line(points={{78.7,1},{92,1},{92,0},{110,0}}, color={0,0,127})); connect(const.y, switchTLeg.u1) annotation (Line(points={{15,88},{56,88},{56,6.6}, {62.6,6.6}}, color={0,0,127})); connect(timeAntiLeg.u,pre1. y) diff --git a/BESMod/Systems/Hydraulical/Control/Components/DHWSetControl/BaseClasses/PartialTSet_DHW_Control.mo b/BESMod/Systems/Hydraulical/Control/Components/DHWSetControl/BaseClasses/PartialTSet_DHW_Control.mo index 66d8d132..38e1678c 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/DHWSetControl/BaseClasses/PartialTSet_DHW_Control.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/DHWSetControl/BaseClasses/PartialTSet_DHW_Control.mo @@ -1,8 +1,9 @@ within BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses; partial model PartialTSet_DHW_Control "Model to output the dhw set temperature" - parameter Modelica.Media.Interfaces.Types.Temperature T_DHW - "Constant TSet DHW output value"; - Modelica.Blocks.Interfaces.RealOutput TSet_DHW + parameter Modelica.Units.SI.Temperature TSetDHW_nominal + "Nominal DHW set temperature"; + Modelica.Blocks.Interfaces.RealOutput TSetDHW(unit="K", displayUnit="degC") + "DHW set temperature" annotation (Placement(transformation(extent={{100,-10},{120,10}}))); Systems.Hydraulical.Interfaces.DistributionControlBus sigBusDistr "Necessary to control DHW temperatures" diff --git a/BESMod/Systems/Hydraulical/Control/Components/DHWSetControl/ConstTSet_DHW.mo b/BESMod/Systems/Hydraulical/Control/Components/DHWSetControl/ConstTSet_DHW.mo index 6341e653..e754baf6 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/DHWSetControl/ConstTSet_DHW.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/DHWSetControl/ConstTSet_DHW.mo @@ -2,15 +2,15 @@ within BESMod.Systems.Hydraulical.Control.Components.DHWSetControl; model ConstTSet_DHW "Constant DHW set temperature" extends BaseClasses.PartialTSet_DHW_Control; - Modelica.Blocks.Sources.Constant const(final k=T_DHW) + Modelica.Blocks.Sources.Constant const(final k=TSetDHW_nominal) annotation (Placement(transformation(extent={{-18,-22},{28,24}}))); Modelica.Blocks.Sources.BooleanConstant booleanConstant(final k=false) annotation (Placement(transformation(extent={{38,-66},{60,-48}}))); equation - connect(const.y, TSet_DHW) annotation (Line(points={{30.3,1},{68.15,1},{68.15, - 0},{110,0}}, color={0,0,127})); + connect(const.y, TSetDHW) annotation (Line(points={{30.3,1},{68.15,1},{68.15,0}, + {110,0}}, color={0,0,127})); connect(booleanConstant.y, y) annotation (Line(points={{61.1,-57},{86.15,-57}, {86.15,-58},{110,-58}}, color={255,0,255})); annotation (Icon(graphics={ diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatingCurve.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatingCurve.mo index 88491149..a63f4e08 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatingCurve.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/HeatingCurve.mo @@ -1,28 +1,39 @@ within BESMod.Systems.Hydraulical.Control.Components; model HeatingCurve - "Defines T_supply of buffer storage tank (in dependency of ambient temperature)" - parameter Real GraHeaCurve=1 "Heat curve gradient"; - parameter Modelica.Units.SI.Temperature THeaThres=273.15 + 15 - "Constant heating threshold temperature"; - parameter Modelica.Units.SI.TemperatureDifference dTOffSet_HC=2 - "Additional Offset of heating curve"; + "Defines supply temperature to building in dependency of ambient temperature" + + parameter Modelica.Units.SI.Temperature TSup_nominal + "Nominal supply temperature"; + parameter Modelica.Units.SI.Temperature TRet_nominal + "Nominal supply temperature"; + parameter Modelica.Units.SI.Temperature TOda_nominal + "Nominal outdoor air temperature"; + parameter Real nHeaTra "Exponent of heat transfer system"; Modelica.Blocks.Interfaces.RealInput TOda annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); Modelica.Blocks.Interfaces.RealOutput TSet annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - Modelica.Blocks.Interfaces.RealInput TSetRoom annotation (Placement( + Modelica.Blocks.Interfaces.RealInput TZoneSet "Zone / room set temperature" + annotation (Placement( transformation( extent={{-20,-20},{20,20}}, rotation=270, origin={0,120}))); +protected + parameter Modelica.Units.SI.Temperature TSupMea_nominal= + (TSup_nominal + TRet_nominal) / 2 "Nominal mean temperature"; + Real derQRel = - 1 / (TZoneSet - TOda_nominal); + equation - if TOda < THeaThres then - TSet = GraHeaCurve*(TSetRoom - TOda) + TSetRoom + dTOffSet_HC; + if TOda < TZoneSet then + TSet = TSup_nominal + (derQRel * (TSupMea_nominal - TZoneSet) * 1 / nHeaTra + + (TSup_nominal - TRet_nominal) / 2 * derQRel) + * (TOda - TOda_nominal); else // No heating required. - TSet = TSetRoom + dTOffSet_HC; + TSet = TZoneSet; end if; annotation (Icon(graphics={Rectangle( extent={{-100,100},{100,-100}}, diff --git a/BESMod/Systems/Hydraulical/Control/Components/MeasuredValue.mo b/BESMod/Systems/Hydraulical/Control/Components/MeasuredValue.mo new file mode 100644 index 00000000..21d417df --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/MeasuredValue.mo @@ -0,0 +1,7 @@ +within BESMod.Systems.Hydraulical.Control.Components; +type MeasuredValue = enumeration( + GenerationSupplyTemperature + "Supply temperature of generation system", + DistributionTemperature + "Temperature in distribution") + "Select possible measurements for control"; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/AlternativeBivalentOnOffController.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/AlternativeBivalent.mo similarity index 68% rename from BESMod/Systems/Hydraulical/Control/Components/OnOffController/AlternativeBivalentOnOffController.mo rename to BESMod/Systems/Hydraulical/Control/Components/OnOffController/AlternativeBivalent.mo index 15636cab..b360283d 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/AlternativeBivalentOnOffController.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/AlternativeBivalent.mo @@ -1,8 +1,9 @@ within BESMod.Systems.Hydraulical.Control.Components.OnOffController; -model AlternativeBivalentOnOffController "Controlls an alternative bivalent heat pump system with storages" +model AlternativeBivalent + "Alternative bivalent control" extends BaseClasses.PartialOnOffController; - StorageHysteresis storageHysteresis(final bandwidth=hysteresis, final - pre_y_start=true) + Utilities.StorageHysteresis storageHysteresis(final bandwidth=hysteresis, + final pre_y_start=true) annotation (Placement(transformation(extent={{-40,22},{0,62}}))); Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualT_biv(threshold= T_biv) annotation (Placement(transformation(extent={{20,80},{40,100}}))); @@ -24,31 +25,30 @@ model AlternativeBivalentOnOffController "Controlls an alternative bivalent heat rotation=0, origin={82,-80}))); equation - connect(T_Set, storageHysteresis.T_set) annotation (Line(points={{0,-118},{ - -56,-118},{-56,58},{-44,58}}, color={0,0,127})); - connect(T_Top, storageHysteresis.T_top) annotation (Line(points={{-120,60},{ - -74,60},{-74,42},{-44,42}}, - color={0,0,127})); - connect(T_bot, storageHysteresis.T_bot) annotation (Line(points={{-120,-60},{ - -50,-60},{-50,26},{-44,26}}, color={0,0,127})); - connect(T_oda, greaterEqualT_biv.u) + connect(TSupSet, storageHysteresis.T_set) annotation (Line(points={{0,-118},{-56, + -118},{-56,58},{-44,58}}, color={0,0,127})); + connect(TStoTop, storageHysteresis.T_top) annotation (Line(points={{-120,60},{-74, + 60},{-74,42},{-44,42}}, color={0,0,127})); + connect(TStoBot, storageHysteresis.T_bot) annotation (Line(points={{-120,-60},{-50, + -60},{-50,26},{-44,26}}, color={0,0,127})); + connect(TOda, greaterEqualT_biv.u) annotation (Line(points={{0,120},{0,90},{18,90}}, color={0,0,127})); - connect(HP_On, greaterEqualT_biv1.y) annotation (Line(points={{110,60},{96,60}, + connect(priGenOn, greaterEqualT_biv1.y) annotation (Line(points={{110,60},{96,60}, {96,70},{81,70}}, color={255,0,255})); connect(greaterEqualT_biv.y, greaterEqualT_biv1.u1) annotation (Line(points={ {41,90},{52,90},{52,70},{58,70}}, color={255,0,255})); connect(storageHysteresis.y, greaterEqualT_biv1.u2) annotation (Line(points={ {2,42},{26.85,42},{26.85,62},{58,62}}, color={255,0,255})); - connect(Auxilliar_Heater_On, greaterEqualT_biv2.y) annotation (Line(points={{ - 110,-60},{96,-60},{96,-50},{81,-50}}, color={255,0,255})); + connect(secGenOn, greaterEqualT_biv2.y) annotation (Line(points={{110,-60},{96,-60}, + {96,-50},{81,-50}}, color={255,0,255})); connect(greaterEqualT_biv.y, greaterEqualT_biv3.u) annotation (Line(points={{41,90},{50,90},{50,2}}, color={255,0,255})); connect(greaterEqualT_biv3.y, greaterEqualT_biv2.u1) annotation (Line(points={{50,-21},{50,-50},{58,-50}}, color={255,0,255})); connect(storageHysteresis.y, greaterEqualT_biv2.u2) annotation (Line(points={ {2,42},{28,42},{28,-58},{58,-58}}, color={255,0,255})); - connect(Auxilliar_Heater_set, or3.y) + connect(ySecGenSet, or3.y) annotation (Line(points={{110,-80},{88.6,-80}}, color={0,0,127})); connect(greaterEqualT_biv2.y, or3.u) annotation (Line(points={{81,-50},{82, -50},{82,-70},{74.8,-70},{74.8,-80}}, color={255,0,255})); -end AlternativeBivalentOnOffController; +end AlternativeBivalent; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/PartialOnOffController.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/PartialOnOffController.mo index a5124814..301ab975 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/PartialOnOffController.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/PartialOnOffController.mo @@ -1,40 +1,41 @@ within BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses; partial model PartialOnOffController "Partial model for an on off controller" - Modelica.Blocks.Interfaces.RealInput T_Top - "Top layer temperature of the storage in distribution system" - annotation (Placement(transformation(extent={{-140,40},{-100,80}}), - iconTransformation(extent={{-120,60},{-100,80}}))); - Modelica.Blocks.Interfaces.BooleanOutput HP_On(start=true) - "Turn the main the device of a HPS, the HP on or off" annotation (Placement( - transformation(extent={{100,50},{120,70}}), iconTransformation(extent={ - {100,56},{128,84}}))); - Modelica.Blocks.Interfaces.RealInput T_Set "Set point temperature" + Modelica.Blocks.Interfaces.RealInput TStoTop + "Top layer temperature of the storage in distribution system" annotation ( + Placement(transformation(extent={{-140,40},{-100,80}}), iconTransformation( + extent={{-120,60},{-100,80}}))); + Modelica.Blocks.Interfaces.BooleanOutput priGenOn(start=true) + "Turn the main the device on or off" annotation (Placement(transformation( + extent={{100,50},{120,70}}), iconTransformation(extent={{100,56},{128, + 84}}))); + Modelica.Blocks.Interfaces.RealInput TSupSet "Set point temperature" annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, + extent={{-20,-20},{20,20}}, rotation=90, - origin={0,-118}), iconTransformation(extent={{-10,-10},{10,10}}, + origin={0,-118}), iconTransformation( + extent={{-10,-10},{10,10}}, rotation=90, origin={0,-110}))); - Modelica.Blocks.Interfaces.RealInput T_bot + Modelica.Blocks.Interfaces.RealInput TStoBot "Supply temperature of the lower layers of the storage. Does not have to be the lowest layer, depending on comfort even the top may be selected" annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}), iconTransformation(extent={{-120,-60},{-100,-40}}))); - Modelica.Blocks.Interfaces.BooleanOutput Auxilliar_Heater_On(start=true) - "Turn the auxilliar heater (most times a heating rod) on or off" - annotation (Placement(transformation(extent={{100,-70},{120,-50}}), - iconTransformation(extent={{100,-64},{128,-36}}))); - Modelica.Blocks.Interfaces.RealInput T_oda "Ambient air temperature" - annotation (Placement(transformation( + Modelica.Blocks.Interfaces.BooleanOutput secGenOn(start=true) + "Turn the auxilliar heater on or off" annotation (Placement(transformation( + extent={{100,-70},{120,-50}}), iconTransformation(extent={{100,-64},{ + 128,-36}}))); + Modelica.Blocks.Interfaces.RealInput TOda "Ambient air temperature" annotation + (Placement(transformation( extent={{-20,-20},{20,20}}, rotation=270, origin={0,120}), iconTransformation( extent={{-10,-10},{10,10}}, rotation=270, origin={0,112}))); - Modelica.Blocks.Interfaces.RealOutput Auxilliar_Heater_set(start=1) - "Setpoint of the auxilliar heater" - annotation (Placement(transformation(extent={{100,-90},{120,-70}}), - iconTransformation(extent={{100,-100},{128,-72}}))); + Modelica.Blocks.Interfaces.RealOutput ySecGenSet(start=1) + "Setpoint of the auxilliar heater" annotation (Placement(transformation( + extent={{100,-90},{120,-70}}), iconTransformation(extent={{100,-100},{ + 128,-72}}))); annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ Rectangle( extent={{-100,100},{100,-100}}, diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/ConstantHysteresisTimeBasedHR.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/ConstantHysteresisTimeBasedHR.mo index a31c93dc..da2c0d76 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/ConstantHysteresisTimeBasedHR.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/ConstantHysteresisTimeBasedHR.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Control.Components.OnOffController; model ConstantHysteresisTimeBasedHR - "On-Off controller with a constant hysteresis for a time-based hr control" + "Const. hysteresis and time-based auxilliar heater control" extends BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController; @@ -9,7 +9,7 @@ model ConstantHysteresisTimeBasedHR "Seconds for regulation when hr should be activated: If lower set temperature is hurt for more than this time period"; parameter Real addSet_dt_hr=1 "Each time dt_hr passes, the output of the heating rod is increased by this amount in percentage. Maximum and default is 100 (on-off hr)%"; - BESMod.Systems.Hydraulical.Control.Components.OnOffController.StorageHysteresis + BESMod.Systems.Hydraulical.Control.Components.OnOffController.Utilities.StorageHysteresis storageHysteresis(final bandwidth=Hysteresis, final pre_y_start=true) annotation (Placement(transformation(extent={{-58,18},{-18,58}}))); BESMod.Systems.Hydraulical.Control.Components.OnOffController.Utilities.TriggerTime @@ -36,34 +36,31 @@ model ConstantHysteresisTimeBasedHR Modelica.Blocks.Sources.Constant const2(final k=Hysteresis/4) annotation (Placement(transformation(extent={{-98,-118},{-88,-108}}))); equation - connect(T_Top, storageHysteresis.T_top) annotation (Line(points={{-120,60},{ - -86,60},{-86,38},{-62,38}}, - color={0,0,127})); - connect(T_Set, storageHysteresis.T_set) annotation (Line(points={{0,-118},{0, - -20},{-80,-20},{-80,54},{-62,54}}, - color={0,0,127})); - connect(storageHysteresis.y, HP_On) annotation (Line(points={{-16,38},{30,38}, + connect(TStoTop, storageHysteresis.T_top) annotation (Line(points={{-120,60},{-86, + 60},{-86,38},{-62,38}}, color={0,0,127})); + connect(TSupSet, storageHysteresis.T_set) annotation (Line(points={{0,-118},{0,-20}, + {-80,-20},{-80,54},{-62,54}}, color={0,0,127})); + connect(storageHysteresis.y, priGenOn) annotation (Line(points={{-16,38},{30,38}, {30,60},{110,60}}, color={255,0,255})); - connect(greaterThreshold.y, Auxilliar_Heater_On) - annotation (Line(points={{86.8,-60},{110,-60}}, - color={255,0,255})); + connect(greaterThreshold.y, secGenOn) + annotation (Line(points={{86.8,-60},{110,-60}}, color={255,0,255})); connect(const.y, switch1.u3) annotation (Line(points={{24.5,-93},{28,-93},{28, -84.6},{32.6,-84.6}}, color={0,0,127})); - connect(switch1.y, Auxilliar_Heater_set) annotation (Line(points={{48.7,-79}, - {70,-79},{70,-80},{110,-80}}, color={0,0,127})); + connect(switch1.y, ySecGenSet) annotation (Line(points={{48.7,-79},{70,-79},{70, + -80},{110,-80}}, color={0,0,127})); connect(switch1.y, greaterThreshold.u) annotation (Line(points={{48.7,-79},{ 56,-79},{56,-60},{68.4,-60}}, color={0,0,127})); connect(realExpression.y, switch1.u1) annotation (Line(points={{27,-60},{30, -60},{30,-73.4},{32.6,-73.4}}, color={0,0,127})); - connect(T_Top, storageHysteresis.T_bot) annotation (Line(points={{-120,60},{ - -92,60},{-92,22},{-62,22}}, color={0,0,127})); - connect(T_Top, AuxilliarHeaterHys.u) annotation (Line(points={{-120,60},{-92, - 60},{-92,-66},{-64,-66}}, color={0,0,127})); + connect(TStoTop, storageHysteresis.T_bot) annotation (Line(points={{-120,60},{-92, + 60},{-92,22},{-62,22}}, color={0,0,127})); + connect(TStoTop, AuxilliarHeaterHys.u) annotation (Line(points={{-120,60},{-92,60}, + {-92,-66},{-64,-66}}, color={0,0,127})); connect(const2.y, add1.u1) annotation (Line(points={{-87.5,-113},{-74,-113},{ -74,-103.4},{-73.2,-103.4}}, color={0,0,127})); connect(add1.y, AuxilliarHeaterHys.reference) annotation (Line(points={{-69, -87.3},{-69,-54},{-64,-54}}, color={0,0,127})); - connect(T_Set, add1.u2) annotation (Line(points={{0,-118},{0,-104},{-20,-104}, + connect(TSupSet, add1.u2) annotation (Line(points={{0,-118},{0,-104},{-20,-104}, {-20,-103.4},{-64.8,-103.4}}, color={0,0,127})); connect(AuxilliarHeaterHys.y, triggerTime.u) annotation (Line(points={{-41,-60}, {-38,-60},{-38,-78},{-34,-78}}, color={255,0,255})); diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/DegreeMinuteController.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/DegreeMinuteController.mo index 1cc325fc..4934af73 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/DegreeMinuteController.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/DegreeMinuteController.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Control.Components.OnOffController; model DegreeMinuteController - "OnOff controller based on degree minute approach" + "Based on degree minute approach" extends BaseClasses.PartialOnOffController; parameter Real DegreeMinute_HP_on(unit="K.min")=-60 "Degree minute when HP is turned on"; @@ -13,25 +13,25 @@ model DegreeMinuteController "Temperature difference when to reset the sum to 0"; Real DegreeMinute(start=0) "Current degree minute value"; - Modelica.Units.SI.TemperatureDifference delta_T=T_Top - T_Set; + Modelica.Units.SI.TemperatureDifference delta_T=TStoTop - TSupSet; algorithm when DegreeMinute < DegreeMinute_HP_on then - HP_On := true; + priGenOn := true; end when; when DegreeMinute > DegreeMinute_HP_off then - HP_On := false; + priGenOn := false; end when; when DegreeMinute < DegreeMinute_AuxHeater_on then - Auxilliar_Heater_On := true; - Auxilliar_Heater_set := 1; + secGenOn := true; + ySecGenSet := 1; end when; when delta_T > delta_T_AuxHeater_off then - Auxilliar_Heater_On := false; - Auxilliar_Heater_set := 0; + secGenOn := false; + ySecGenSet := 0; end when; equation diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/OnOffControllerTest.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/OnOffControllerTest.mo index 46f7971e..e3215eec 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/OnOffControllerTest.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/OnOffControllerTest.mo @@ -24,33 +24,33 @@ model OnOffControllerTest Modelica.Blocks.Sources.Constant T_Set1(k=273.15) annotation (Placement(transformation(extent={{-152,-90},{-116,-54}}))); equation - connect(T_Set.y, degreeMinuteController.T_Set) annotation (Line(points={{-122.2, - -2},{-106,-2},{-106,0},{-70,0},{-70,-28},{-5,-28},{-5,-20}}, - color={0,0,127})); - connect(T_Set.y, floatingHysteresis.T_Set) annotation (Line(points={{-122.2, - -2},{-86,-2},{-86,-94},{-5,-94},{-5,-77.9}}, color={0,0,127})); - connect(T_Set.y, constantHysteresisTimeBasedHR.T_Set) annotation (Line(points= - {{-122.2,-2},{-112,-2},{-112,-4},{-80,-4},{-80,32},{-6,32},{-6,40}}, + connect(T_Set.y, degreeMinuteController.TSupSet) annotation (Line(points={{-122.2, + -2},{-106,-2},{-106,0},{-70,0},{-70,-28},{-5,-28},{-5,-20}}, color={0,0, + 127})); + connect(T_Set.y, floatingHysteresis.TSupSet) annotation (Line(points={{-122.2,-2}, + {-86,-2},{-86,-94},{-5,-94},{-5,-77.9}}, color={0,0,127})); + connect(T_Set.y, constantHysteresisTimeBasedHR.TSupSet) annotation (Line(points + ={{-122.2,-2},{-112,-2},{-112,-4},{-80,-4},{-80,32},{-6,32},{-6,40}}, color={0,0,127})); - connect(T_Top.y, constantHysteresisTimeBasedHR.T_Top) annotation (Line(points= - {{-120.1,63},{-44,63},{-44,76},{-30.2,76}}, color={0,0,127})); - connect(T_Top.y, constantHysteresisTimeBasedHR.T_bot) annotation (Line(points= - {{-120.1,63},{-72,63},{-72,40},{-44,40},{-44,52},{-30.2,52}}, color={0, - 0,127})); - connect(T_Top.y, degreeMinuteController.T_Top) annotation (Line(points={{-120.1, - 63},{-96,63},{-96,16},{-28.1,16}}, color={0,0,127})); - connect(T_Top.y, degreeMinuteController.T_bot) annotation (Line(points={{-120.1, - 63},{-88,63},{-88,-8},{-28.1,-8}}, color={0,0,127})); - connect(T_Top.y, floatingHysteresis.T_Top) annotation (Line(points={{-120.1, - 63},{-92,63},{-92,-43.7},{-28.1,-43.7}}, color={0,0,127})); - connect(T_Top.y, floatingHysteresis.T_bot) annotation (Line(points={{-120.1, - 63},{-90,63},{-90,-66.5},{-28.1,-66.5}}, color={0,0,127})); - connect(T_Set1.y, floatingHysteresis.T_oda) annotation (Line(points={{-114.2, - -72},{-60.1,-72},{-60.1,-35.72},{-5,-35.72}}, color={0,0,127})); - connect(T_Set1.y, degreeMinuteController.T_oda) annotation (Line(points={{ - -114.2,-72},{-58,-72},{-58,24.4},{-5,24.4}}, color={0,0,127})); - connect(T_Set1.y, constantHysteresisTimeBasedHR.T_oda) annotation (Line( - points={{-114.2,-72},{-60,-72},{-60,84.4},{-6,84.4}}, color={0,0,127})); + connect(T_Top.y, constantHysteresisTimeBasedHR.TStoTop) annotation (Line(points + ={{-120.1,63},{-44,63},{-44,76},{-30.2,76}}, color={0,0,127})); + connect(T_Top.y, constantHysteresisTimeBasedHR.TStoBot) annotation (Line(points + ={{-120.1,63},{-72,63},{-72,40},{-44,40},{-44,52},{-30.2,52}}, color={0,0, + 127})); + connect(T_Top.y, degreeMinuteController.TStoTop) annotation (Line(points={{-120.1, + 63},{-96,63},{-96,16},{-28.1,16}}, color={0,0,127})); + connect(T_Top.y, degreeMinuteController.TStoBot) annotation (Line(points={{-120.1, + 63},{-88,63},{-88,-8},{-28.1,-8}}, color={0,0,127})); + connect(T_Top.y, floatingHysteresis.TStoTop) annotation (Line(points={{-120.1, + 63},{-92,63},{-92,-43.7},{-28.1,-43.7}}, color={0,0,127})); + connect(T_Top.y, floatingHysteresis.TStoBot) annotation (Line(points={{-120.1, + 63},{-90,63},{-90,-66.5},{-28.1,-66.5}}, color={0,0,127})); + connect(T_Set1.y, floatingHysteresis.TOda) annotation (Line(points={{-114.2,-72}, + {-60.1,-72},{-60.1,-35.72},{-5,-35.72}}, color={0,0,127})); + connect(T_Set1.y, degreeMinuteController.TOda) annotation (Line(points={{-114.2, + -72},{-58,-72},{-58,24.4},{-5,24.4}}, color={0,0,127})); + connect(T_Set1.y, constantHysteresisTimeBasedHR.TOda) annotation (Line(points={ + {-114.2,-72},{-60,-72},{-60,84.4},{-6,84.4}}, color={0,0,127})); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, coordinateSystem(preserveAspectRatio=false)), diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/ParallelBivalentControl.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/ParallelBivalentControl.mo index bd45f5d7..187303e7 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/ParallelBivalentControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/ParallelBivalentControl.mo @@ -1,17 +1,17 @@ within BESMod.Systems.Hydraulical.Control.Components.OnOffController.Examples; model ParallelBivalentControl extends PartialOnOffController(dTHys=onOffController.Hysteresis, redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent onOffController( - Auxilliar_Heater_On(start=false), - Auxilliar_Heater_set(start=0), Hysteresis=10, TCutOff=263.15, TBiv=270.15, TOda_nominal=258.15, TRoom=293.15, QDem_flow_nominal=12000, - QHP_flow_cutOff=3000)); + QHP_flow_cutOff=3000, + secGenOn(start=false), + ySecGenSet(start=0))); extends Modelica.Icons.Example; end ParallelBivalentControl; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/PartialOnOffController.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/PartialOnOffController.mo index 6cfe7842..a40e3817 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/PartialOnOffController.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/PartialOnOffController.mo @@ -19,13 +19,13 @@ partial model PartialOnOffController annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); equation - connect(ramp.y, onOffController.T_oda) + connect(ramp.y, onOffController.TOda) annotation (Line(points={{-57,68},{10,68},{10,41.24}}, color={0,0,127})); - connect(pulse.y, onOffController.T_Top) annotation (Line(points={{-63,12},{-56, + connect(pulse.y, onOffController.TStoTop) annotation (Line(points={{-63,12},{-56, 12},{-56,30},{-20.8,30},{-20.8,29.9}}, color={0,0,127})); - connect(pulse.y, onOffController.T_bot) annotation (Line(points={{-63,12},{-56, + connect(pulse.y, onOffController.TStoBot) annotation (Line(points={{-63,12},{-56, 12},{-56,-2.5},{-20.8,-2.5}}, color={0,0,127})); - connect(constTSet.y, onOffController.T_Set) + connect(constTSet.y, onOffController.TSupSet) annotation (Line(points={{-39,-50},{10,-50},{10,-18.7}}, color={0,0,127})); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/FloatingHysteresis.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/FloatingHysteresis.mo index d7cbdb26..2b343db8 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/FloatingHysteresis.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/FloatingHysteresis.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Control.Components.OnOffController; model FloatingHysteresis - "OnOff controller based on the theory of floating hysteresis" + "Based on the floating hysteresis approach" extends BaseClasses.PartialOnOffController; parameter Modelica.Units.SI.TemperatureDifference Hysteresis_max=10 @@ -27,21 +27,22 @@ algorithm //end when; // When upper temperature of storage tank is lower than lower hysteresis value, activate hp - when T_Top < T_Set - Hysteresis_floating/2 then - HP_On := true; + when TStoTop < TSupSet - Hysteresis_floating/2 then + priGenOn := true; t1 :=time; // Start activation counter end when; // When second / lower temperature of storage tank is higher than upper hysteresis, deactivate hp - when T_bot > T_Set + Hysteresis_floating/2 then - HP_On := false; - Auxilliar_Heater_On := false; - Auxilliar_Heater_set := 0; + when TStoBot > TSupSet + Hysteresis_floating/2 then + priGenOn := false; + secGenOn := false; + ySecGenSet := 0; end when; // Activate hr in case temperature is below lower hysteresis and critical time period is passed - when (T_Top < T_Set - Hysteresis_floating/2) and time > (t1 + dt_hr) and HP_On then - Auxilliar_Heater_On :=true; - Auxilliar_Heater_set := 1; + when (TStoTop < TSupSet - Hysteresis_floating/2) and time > (t1 + dt_hr) and + priGenOn then + secGenOn := true; + ySecGenSet := 1; end when; annotation (Icon(graphics={ diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/ParallelBivalentControl.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/PartParallelBivalent.mo similarity index 78% rename from BESMod/Systems/Hydraulical/Control/Components/OnOffController/ParallelBivalentControl.mo rename to BESMod/Systems/Hydraulical/Control/Components/OnOffController/PartParallelBivalent.mo index 975bc511..58b07e05 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/ParallelBivalentControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/PartParallelBivalent.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Hydraulical.Control.Components.OnOffController; -model ParallelBivalentControl - "Parallel bivalent control" +model PartParallelBivalent "Part-parallel bivalent control" extends BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController; @@ -12,7 +11,7 @@ model ParallelBivalentControl parameter Modelica.Units.SI.HeatFlowRate QDem_flow_nominal; parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff; - BESMod.Systems.Hydraulical.Control.Components.OnOffController.StorageHysteresis + BESMod.Systems.Hydraulical.Control.Components.OnOffController.Utilities.StorageHysteresis storageHysteresis(final bandwidth=Hysteresis, final pre_y_start=true) annotation (Placement(transformation(extent={{-58,18},{-18,58}}))); @@ -26,38 +25,38 @@ protected parameter Real phiBiv = (TRoom - TBiv)/(TRoom - TOda_nominal) "Part load at bivalence temperature"; parameter Real partLoadHeaPumAtCutOff(min=0, max=1)=QHP_flow_cutOff/QDem_flow_nominal "Percentage of nominal heat demand supplied by heat pump at cut-off temperature"; - Real partLoadAuxHea = min(1, (TRoom - T_oda) / (TRoom - TOda_nominal)); + Real partLoadAuxHea=min(1, (TRoom - TOda)/(TRoom - TOda_nominal)); equation - if T_oda < TCutOff then + if TOda < TCutOff then // Only auxilliar device is active - Auxilliar_Heater_On = storageHysteresis.y; - Auxilliar_Heater_set = partLoadAuxHea; - elseif T_oda < TBiv then + secGenOn = storageHysteresis.y; + ySecGenSet = partLoadAuxHea; + elseif TOda < TBiv then // Both devices are active - Auxilliar_Heater_On = storageHysteresis.y; - Auxilliar_Heater_set = max(0, partLoadAuxHea - (partLoadHeaPumAtCutOff + (phiBiv - partLoadHeaPumAtCutOff)* (T_oda - TCutOff) / (TBiv - TCutOff))); + secGenOn = storageHysteresis.y; + ySecGenSet = max(0, partLoadAuxHea - (partLoadHeaPumAtCutOff + (phiBiv - + partLoadHeaPumAtCutOff)*(TOda - TCutOff)/(TBiv - TCutOff))); else // Only heat pump is active - Auxilliar_Heater_On = false; - Auxilliar_Heater_set = 0; + secGenOn = false; + ySecGenSet = 0; end if; - connect(T_Top, storageHysteresis.T_top) annotation (Line(points={{-120,60},{-86, + connect(TStoTop, storageHysteresis.T_top) annotation (Line(points={{-120,60},{-86, 60},{-86,38},{-62,38}}, color={0,0,127})); - connect(T_Set, storageHysteresis.T_set) annotation (Line(points={{0,-118},{0, - -20},{-80,-20},{-80,54},{-62,54}}, - color={0,0,127})); - connect(T_Top, storageHysteresis.T_bot) annotation (Line(points={{-120,60},{ - -92,60},{-92,22},{-62,22}}, color={0,0,127})); + connect(TSupSet, storageHysteresis.T_set) annotation (Line(points={{0,-118},{0,-20}, + {-80,-20},{-80,54},{-62,54}}, color={0,0,127})); + connect(TStoTop, storageHysteresis.T_bot) annotation (Line(points={{-120,60},{-92, + 60},{-92,22},{-62,22}}, color={0,0,127})); connect(greaterEqualT_biv.y, and1.u1) annotation (Line(points={{37.2,66},{42,66}, {42,56},{58,56}}, color={255,0,255})); connect(storageHysteresis.y, and1.u2) annotation (Line(points={{-16,38},{42,38}, {42,48},{58,48}}, color={255,0,255})); - connect(and1.y, HP_On) annotation (Line(points={{81,56},{92,56},{92,60},{110,60}}, - color={255,0,255})); - connect(T_oda, greaterEqualT_biv.u) + connect(and1.y, priGenOn) annotation (Line(points={{81,56},{92,56},{92,60},{110, + 60}}, color={255,0,255})); + connect(TOda, greaterEqualT_biv.u) annotation (Line(points={{0,120},{0,66},{9.6,66}}, color={0,0,127})); annotation (Icon(graphics={ Polygon( points={{-65,89},{-73,67},{-57,67},{-65,89}}, @@ -111,4 +110,4 @@ equation lineColor={28,108,200}, textString="Internal (see equations)")})); -end ParallelBivalentControl; +end PartParallelBivalent; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/StorageHysteresis.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/StorageHysteresis.mo similarity index 99% rename from BESMod/Systems/Hydraulical/Control/Components/OnOffController/StorageHysteresis.mo rename to BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/StorageHysteresis.mo index 4d202f03..aa504164 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/StorageHysteresis.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/StorageHysteresis.mo @@ -1,5 +1,5 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController; -block StorageHysteresis "On-off controller for a storage control. " +within BESMod.Systems.Hydraulical.Control.Components.OnOffController.Utilities; +block StorageHysteresis "On-off controller for a storage control." extends Modelica.Blocks.Icons.PartialBooleanBlock; Modelica.Blocks.Interfaces.RealInput T_set "Set temperature" annotation (Placement(transformation(extent={{-140,100},{-100,60}}))); diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/package.order b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/package.order index fdad104b..9445d5a9 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/package.order @@ -1,2 +1,3 @@ TriggerTime CountTimeBelowThreshold +StorageHysteresis diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/package.order b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/package.order index edd6df65..afd99d86 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/package.order @@ -1,9 +1,8 @@ -AlternativeBivalentOnOffController +AlternativeBivalent ConstantHysteresisTimeBasedHR DegreeMinuteController FloatingHysteresis -ParallelBivalentControl -StorageHysteresis +PartParallelBivalent Examples Utilities BaseClasses diff --git a/BESMod/Systems/Hydraulical/Control/Components/SetAndMeasuredValueSelector.mo b/BESMod/Systems/Hydraulical/Control/Components/SetAndMeasuredValueSelector.mo new file mode 100644 index 00000000..a401be31 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/SetAndMeasuredValueSelector.mo @@ -0,0 +1,109 @@ +within BESMod.Systems.Hydraulical.Control.Components; +model SetAndMeasuredValueSelector + "Model to select the measured value and add to the set value accordingly" + parameter BESMod.Systems.Hydraulical.Control.Components.MeasuredValue meaVal + "Type of measurement to use in control"; + + parameter Modelica.Units.SI.TemperatureDifference dTTraToDis_nominal + "Nominal temperature difference between transfer and distribution system"; + parameter Modelica.Units.SI.TemperatureDifference dTDisToGen_nominal + "Nominal temperature difference between distribution and generation system"; + parameter Modelica.Units.SI.TemperatureDifference dTDHWToGen_nominal + "Nominal temperature difference between DHW and generation system"; + parameter Modelica.Units.SI.TemperatureDifference dTHysDHW + "DHW hysteresis to ensure control completes DHW charging as quickly as possible"; + + Interfaces.DistributionControlBus sigBusDistr + "Necessary to control DHW temperatures" + annotation (Placement(transformation(extent={{-116,-36},{-84,-6}}), + iconTransformation(extent={{-116,-36},{-84,-6}}))); + Interfaces.GenerationControlBus + sigBusGen + annotation (Placement(transformation(extent={{-116,-98},{-84,-66}}), + iconTransformation(extent={{-116,-98},{-84,-66}}))); + Modelica.Blocks.Interfaces.BooleanInput DHW "=true for DHW loading" + annotation (Placement(transformation(extent={{-120,50},{-100,70}}))); + Modelica.Blocks.Interfaces.RealInput TBuiSet(unit="K", displayUnit="degC") + "Building supply set temperature" + annotation (Placement(transformation(extent={{-120,18},{-100,38}}))); + Modelica.Blocks.Interfaces.RealInput TDHWSet(unit="K", displayUnit="degC") + "DHW supply set temperature" + annotation (Placement(transformation(extent={{-120,78},{-100,98}}))); + BESMod.Systems.Hydraulical.Control.Components.ConstantAdd constAddBuf( + final k=dTBui_nominal) + "Add temperature difference in DHW system" + annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); + Modelica.Blocks.Logical.Switch swiDHWBuiSet "Switch between building and DHW" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-10,60}))); + BESMod.Systems.Hydraulical.Control.Components.ConstantAdd constAddDHW( + final k=dTTraDHW_nominal + dTHysDHW/2) + "Add temperature difference in DHW system" + annotation (Placement(transformation(extent={{-60,70},{-40,90}}))); + Modelica.Blocks.Interfaces.RealOutput TMea(unit="K", displayUnit="degC") + "Building supply set temperature" + annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); + Modelica.Blocks.Interfaces.RealOutput TSet(unit="K", displayUnit="degC") + "Set temperature" + annotation (Placement(transformation(extent={{100,50},{120,70}}))); + Modelica.Blocks.Logical.Switch swiDHWBuiMea + if meaVal == BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.DistributionTemperature + "Switch between building and DHW" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-10,-40}))); + Modelica.Blocks.Routing.RealPassThrough reaPasTrhGenSup if meaVal == BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature + "Real pass through for conditional option" + annotation (Placement(transformation(extent={{-20,-92},{0,-72}}))); +protected + parameter Modelica.Units.SI.TemperatureDifference dTTraDHW_nominal= + if meaVal == BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature + then dTDHWToGen_nominal else 0 + "Helper for conditional sum in DHW dTs"; + parameter Modelica.Units.SI.TemperatureDifference dTBui_nominal= + if meaVal == BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature + then dTTraToDis_nominal + dTDisToGen_nominal else dTTraToDis_nominal + "Helper for conditional sum in building dTs"; +equation + connect(constAddDHW.y, swiDHWBuiSet.u1) annotation (Line(points={{-39,80},{-28,80}, + {-28,68},{-22,68}}, color={0,0,127})); + connect(constAddBuf.y, swiDHWBuiSet.u3) annotation (Line(points={{-39,40},{-28,40}, + {-28,52},{-22,52}}, color={0,0,127})); + connect(constAddDHW.u, TDHWSet) annotation (Line(points={{-62,80},{-94,80},{-94, + 88},{-110,88}}, color={0,0,127})); + connect(constAddBuf.u, TBuiSet) annotation (Line(points={{-62,40},{-94,40},{-94, + 28},{-110,28}}, color={0,0,127})); + connect(swiDHWBuiSet.u2, DHW) + annotation (Line(points={{-22,60},{-110,60}}, color={255,0,255})); + connect(TSet, swiDHWBuiSet.y) + annotation (Line(points={{110,60},{1,60}}, color={0,0,127})); + connect(DHW, swiDHWBuiMea.u2) annotation (Line(points={{-110,60},{-32,60},{-32,-40}, + {-22,-40}}, color={255,0,255})); + connect(swiDHWBuiMea.y, TMea) + annotation (Line(points={{1,-40},{110,-40}}, color={0,0,127})); + connect(swiDHWBuiMea.u1, sigBusDistr.TStoDHWTopMea) annotation (Line(points={{-22, + -32},{-78,-32},{-78,-21},{-100,-21}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(swiDHWBuiMea.u3, sigBusDistr.TStoBufTopMea) annotation (Line(points={{-22, + -48},{-78,-48},{-78,-24},{-80,-24},{-80,-21},{-100,-21}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(reaPasTrhGenSup.y, TMea) annotation (Line(points={{1,-82},{88,-82},{88,-40}, + {110,-40}}, color={0,0,127})); + connect(reaPasTrhGenSup.u, sigBusGen.TGenOutMea) annotation (Line(points={{-22,-82}, + {-100,-82}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end SetAndMeasuredValueSelector; diff --git a/BESMod/Systems/Hydraulical/Control/Components/package.order b/BESMod/Systems/Hydraulical/Control/Components/package.order index 135380c2..954402b6 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/package.order @@ -4,3 +4,8 @@ ThermostaticValveController OnOffController HeatPumpNSetController HeatPumpBusPassThrough +BuildingAndDHWControl +ConstantAdd +BoilerInHybridSystem +SetAndMeasuredValueSelector +MeasuredValue diff --git a/BESMod/Systems/Hydraulical/Control/ConstHys_OnOff_HPSControll.mo b/BESMod/Systems/Hydraulical/Control/ConstHys_OnOff_HPSControll.mo deleted file mode 100644 index d6832c57..00000000 --- a/BESMod/Systems/Hydraulical/Control/ConstHys_OnOff_HPSControll.mo +++ /dev/null @@ -1,30 +0,0 @@ -within BESMod.Systems.Hydraulical.Control; -model ConstHys_OnOff_HPSControll - "Constant Hysteresis for an on/off HP" - extends BaseClasses.PartialHeatPumpSystemController( - redeclare - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.OnOffHeatPumpController - HP_nSet_Controller(final n_opt=nOptHP), - redeclare - Components.OnOffController.ConstantHysteresisTimeBasedHR - BufferOnOffController(Hysteresis=bivalentControlData.dTHysBui, dt_hr= - bivalentControlData.dtHeaRodBui), - redeclare - Components.OnOffController.ConstantHysteresisTimeBasedHR - DHWOnOffContoller(Hysteresis=bivalentControlData.dTHysDHW, dt_hr= - bivalentControlData.dtHeaRodDHW)); - parameter Real nOptHP=0.7 - "Frequency of the heat pump map with an optimal isentropic efficiency. Necessary, as on-off HP will be optimized for this frequency and only used there." - annotation (Dialog(group="Heat Pumps")); -equation - - connect(sigBusGen.THeaPumIn, HP_nSet_Controller.T_Meas) annotation ( - Line( - points={{-152,-99},{-114,-99},{-114,0},{97,0},{97,61.2}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); -end ConstHys_OnOff_HPSControll; diff --git a/BESMod/Systems/Hydraulical/Control/ConstHys_PI_ConOut_HPSController.mo b/BESMod/Systems/Hydraulical/Control/ConstHys_PI_ConOut_HPSController.mo deleted file mode 100644 index ad9c9568..00000000 --- a/BESMod/Systems/Hydraulical/Control/ConstHys_PI_ConOut_HPSController.mo +++ /dev/null @@ -1,32 +0,0 @@ -within BESMod.Systems.Hydraulical.Control; -model ConstHys_PI_ConOut_HPSController - "Hys + PI with condenser outlet as control variable" - extends BaseClasses.PartialHeatPumpSystemController( - redeclare - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController - HP_nSet_Controller( - P=bivalentControlData.k, - nMin=bivalentControlData.nMin, - T_I=bivalentControlData.T_I), - redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ConstantHysteresisTimeBasedHR - BufferOnOffController( - Hysteresis=bivalentControlData.dTHysBui, - dt_hr=bivalentControlData.dtHeaRodBui, - addSet_dt_hr=bivalentControlData.addSet_dtHeaRodBui), - redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ConstantHysteresisTimeBasedHR - DHWOnOffContoller( - Hysteresis=bivalentControlData.dTHysDHW, - dt_hr=bivalentControlData.dtHeaRodDHW, - addSet_dt_hr=bivalentControlData.addSet_dtHeaRodDHW)); - -equation - connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( - Line(points={{97,61.2},{97,-64},{-152,-64},{-152,-99}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); -end ConstHys_PI_ConOut_HPSController; diff --git a/BESMod/Systems/Hydraulical/Control/ConstHys_PI_StoTop_HPSController.mo b/BESMod/Systems/Hydraulical/Control/ConstHys_PI_StoTop_HPSController.mo deleted file mode 100644 index d89555db..00000000 --- a/BESMod/Systems/Hydraulical/Control/ConstHys_PI_StoTop_HPSController.mo +++ /dev/null @@ -1,43 +0,0 @@ -within BESMod.Systems.Hydraulical.Control; -model ConstHys_PI_StoTop_HPSController - "Using const. hys + PI Inverter + top level storage as controller" - extends BaseClasses.PartialHeatPumpSystemController( - redeclare - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController - HP_nSet_Controller( - P=bivalentControlData.k, - nMin=bivalentControlData.nMin, - T_I=bivalentControlData.T_I), - redeclare - Components.OnOffController.ConstantHysteresisTimeBasedHR - BufferOnOffController(Hysteresis=bivalentControlData.dTHysBui, dt_hr= - bivalentControlData.dtHeaRodBui), - redeclare - Components.OnOffController.ConstantHysteresisTimeBasedHR - DHWOnOffContoller(Hysteresis=bivalentControlData.dTHysDHW, dt_hr= - bivalentControlData.dtHeaRodDHW)); - - Modelica.Blocks.Logical.Switch switch2 "on: DHW, off: Buffer" - annotation (Placement(transformation(extent={{-5,-5},{5,5}}, - rotation=90, - origin={83,-27}))); -equation - connect(DHWHysOrLegionella.y, switch2.u2) annotation (Line(points={{-71.25, - 69},{-20,69},{-20,-30},{6,-30},{6,-33},{83,-33}}, color={255,0,255})); - connect(switch2.u1, sigBusDistr.T_StoDHW_top) annotation (Line(points={{79,-33}, - {79,-62},{108,-62},{108,-100},{1,-100}}, color={ - 0,0,127}), Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - connect(switch2.u3, sigBusDistr.T_StoBuf_top) annotation (Line(points={{87,-33}, - {87,-46},{1,-46},{1,-100}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - connect(switch2.y, HP_nSet_Controller.T_Meas) annotation (Line(points={{83, - -21.5},{82,-21.5},{82,-14},{97,-14},{97,61.2}}, color={0,0,127})); -end ConstHys_PI_StoTop_HPSController; diff --git a/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConIn_HPSController.mo b/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConIn_HPSController.mo deleted file mode 100644 index e92afe47..00000000 --- a/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConIn_HPSController.mo +++ /dev/null @@ -1,25 +0,0 @@ -within BESMod.Systems.Hydraulical.Control; -model ConstHys_P_ConIn_HPSController - "Hys + P with condenser intlet as control variable" - extends BaseClasses.PartialHeatPumpSystemController( - redeclare - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.P_InverterHeatPumpController - HP_nSet_Controller(P=bivalentControlData.k, nMin=bivalentControlData.nMin), - redeclare - Components.OnOffController.ConstantHysteresisTimeBasedHR - BufferOnOffController(Hysteresis=bivalentControlData.dTHysBui, dt_hr= - bivalentControlData.dtHeaRodBui), - redeclare - Components.OnOffController.ConstantHysteresisTimeBasedHR - DHWOnOffContoller(Hysteresis=bivalentControlData.dTHysDHW, dt_hr= - bivalentControlData.dtHeaRodDHW)); - -equation - connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumIn) - annotation (Line(points={{97,61.2},{97,-99},{-152,-99}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); -end ConstHys_P_ConIn_HPSController; diff --git a/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConOut_HPSController.mo b/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConOut_HPSController.mo deleted file mode 100644 index 1dabe19f..00000000 --- a/BESMod/Systems/Hydraulical/Control/ConstHys_P_ConOut_HPSController.mo +++ /dev/null @@ -1,25 +0,0 @@ -within BESMod.Systems.Hydraulical.Control; -model ConstHys_P_ConOut_HPSController - "Hys + P with condenser outlet as control variable" - extends BaseClasses.PartialHeatPumpSystemController( - redeclare - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.P_InverterHeatPumpController - HP_nSet_Controller(P=bivalentControlData.k, nMin=bivalentControlData.nMin), - redeclare - Components.OnOffController.ConstantHysteresisTimeBasedHR - BufferOnOffController(Hysteresis=bivalentControlData.dTHysBui, dt_hr= - bivalentControlData.dtHeaRodBui), - redeclare - Components.OnOffController.ConstantHysteresisTimeBasedHR - DHWOnOffContoller(Hysteresis=bivalentControlData.dTHysDHW, dt_hr= - bivalentControlData.dtHeaRodDHW)); - -equation - connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) - annotation (Line(points={{97,61.2},{97,-99},{-152,-99}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); -end ConstHys_P_ConOut_HPSController; diff --git a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo index 6da6df51..4e8af717 100644 --- a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo @@ -8,7 +8,7 @@ model GasBoiler "PI Control of gas boiler" dTOffSet_HC=monovalentControlParas.dTOffSetHeatCurve) annotation (Placement(transformation(extent={{-220,20},{-200,40}}))); BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW - TSet_DHW(T_DHW=distributionParameters.TDHW_nominal) if use_dhw + TSet_DHW(TSetDHW_nominal=distributionParameters.TDHW_nominal) if use_dhw annotation (Placement(transformation(extent={{-220,80},{-200,100}}))); replaceable BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController @@ -104,10 +104,8 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(TSet_DHW.TSet_DHW, boilerOnOffDHW.reference) annotation (Line( - points={{-199,90},{-194,90},{-194,72},{-168,72},{-168,56},{-162,56}}, - color={0,0, - 127})); + connect(TSet_DHW.TSetDHW, boilerOnOffDHW.reference) annotation (Line(points={{-199, + 90},{-194,90},{-194,72},{-168,72},{-168,56},{-162,56}}, color={0,0,127})); connect(heatingCurve.TSet, BoilerOnOffBuf.reference) annotation (Line( points={{-199,30},{-168,30},{-168,16},{-162,16}}, color={0,0, 127})); @@ -146,9 +144,8 @@ equation horizontalAlignment=TextAlignment.Right)); connect(const_dT_loading1.y, add_dT_LoadingDHW.u2) annotation (Line(points={{-79,90}, {-72,90},{-72,76},{-62,76}}, color={0,0,127})); - connect(TSet_DHW.TSet_DHW, add_dT_LoadingDHW.u1) annotation (Line(points={{-199,90}, - {-194,90},{-194,72},{-70,72},{-70,64},{-62,64}}, - color={0,0,127})); + connect(TSet_DHW.TSetDHW, add_dT_LoadingDHW.u1) annotation (Line(points={{-199, + 90},{-194,90},{-194,72},{-70,72},{-70,64},{-62,64}}, color={0,0,127})); connect(switch1.y, HP_nSet_Controller.T_Set) annotation (Line(points={{21,70}, {40,70},{40,74},{84,74},{84,70.8},{98.4,70.8}}, color={0,0,127})); @@ -180,7 +177,7 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(minMax.yMax, heatingCurve.TSetRoom) + connect(minMax.yMax,heatingCurve.TZoneSet) annotation (Line(points={{-219,66},{-210,66},{-210,42}}, color={0,0,127})); connect(minMax.u, useProBus.TZoneSet) annotation (Line(points={{-240,60},{-244, 60},{-244,103},{-119,103}}, color={0,0,127}), Text( diff --git a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo new file mode 100644 index 00000000..1463a063 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo @@ -0,0 +1,31 @@ +within BESMod.Systems.Hydraulical.Control; +model MonoenergeticHeatPumpSystem + "Control for HPS with on/off heating rod" + extends BaseClasses.PartialHeatPumpSystemController; + + Modelica.Blocks.Sources.Constant constZero(final k=0) annotation (Placement( + transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={70,-10}))); + Modelica.Blocks.Logical.Switch swiSecGen "Switch second generator on or off" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={110,10}))); +equation + connect(constZero.y,swiSecGen. u3) + annotation (Line(points={{81,-10},{92,-10},{92,2},{98,2}}, color={0,0,127})); + connect(swiSecGen.y, sigBusGen.uHeaRod) annotation (Line(points={{121,10},{126, + 10},{126,-60},{-152,-60},{-152,-99}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(buiAndDHWCtr.secGen,swiSecGen. u2) annotation (Line(points={{-118,37.5}, + {-118,36},{-110,36},{-110,10},{28,10},{28,26},{66,26},{66,10},{98,10}}, + color={255,0,255})); + connect(swiSecGen.u1, buiAndDHWCtr.ySecGenSet) annotation (Line(points={{98,18}, + {90,18},{90,45},{-118,45}}, color={0,0,127})); +end MonoenergeticHeatPumpSystem; diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo index 97359181..9ce4703d 100644 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo @@ -1,4 +1,4 @@ -within BESMod.Systems.Hydraulical.Control; +within BESMod.Systems.Hydraulical.Control; model NewControlBivalentParallel "Bivalent Parallel Generation Control Class (Part-parallel PI controlled HPS according to condenser outflow)" extends BaseClasses.PartialTwoPoint_HPS_Controller_BivalentBoiler( @@ -9,7 +9,7 @@ model NewControlBivalentParallel nMin=bivalentControlData.nMin, T_I=bivalentControlData.T_I), redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent BufferOnOffController( Hysteresis=bivalentControlData.dTHysBui, TCutOff=TCutOff, @@ -19,7 +19,7 @@ model NewControlBivalentParallel QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), QHP_flow_cutOff=QHP_flow_cutOff), redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent DHWOnOffContoller( Hysteresis=bivalentControlData.dTHysDHW, TCutOff=TCutOff, @@ -40,113 +40,11 @@ model NewControlBivalentParallel T_I=1200, Ni=0.9) constrainedby Components.HeatPumpNSetController.PI_InverterHeatPumpController - annotation (choicesAllMatching=true, Placement(transformation(extent={{68,14}, - {98,42}}))); - Modelica.Blocks.Sources.BooleanConstant BooleanConstant(final k=true) - annotation (Placement(transformation( - extent={{-7,-7},{7,7}}, - rotation=0, - origin={43,17}))); - Modelica.Blocks.Sources.RealExpression T_Oda(final y( - unit="K", - displayUnit="degC") = heatingCurve.TOda) - annotation (Placement( - transformation( - extent={{-16,-5},{16,5}}, - rotation=0, - origin={-214,-323}))); - Modelica.Blocks.Sources.RealExpression HP_NSet(final y( - unit="K", - displayUnit="degC") = HP_nSet_Controller.n_Set) - "Compressor Drehzahl für Boiler Steuerung" annotation (Placement( - transformation( - extent={{-16,-5},{16,5}}, - rotation=0, - origin={-234,-379}))); - Modelica.Blocks.Logical.LessThreshold lessThreshold(threshold= - bivalentControlData.TBiv) "checks, if Toda is below Tbiv" - annotation (Placement(transformation(extent={{-164,-336},{-132,-304}}))); - Modelica.Blocks.Logical.And OperationalBoundryCheck - "checks, if hp is allowed to operate regarding operational boundry. If HP_ON = true and IsON=False, then hp is deactivated on purpose. In this case, this signal will be true." - annotation (Placement(transformation(extent={{-158,-464},{-138,-444}}))); - Modelica.Blocks.Logical.Not not1 - annotation (Placement(transformation(extent={{-224,-450},{-204,-430}}))); - Modelica.Blocks.Sources.BooleanExpression HP_IsON1(y=HP_nSet_Controller.IsOn) - annotation (Placement(transformation(extent={{-282,-448},{-262,-428}}))); - Modelica.Blocks.Sources.BooleanExpression HP_HP_ON(y=HP_nSet_Controller.HP_On) - annotation (Placement(transformation(extent={{-284,-480},{-264,-460}}))); - Modelica.Blocks.Logical.Or or1 - "hp outside operational boundary or high utilization (high compressor rotational speed)" - annotation (Placement(transformation(extent={{-90,-424},{-70,-404}}))); - Modelica.Blocks.MathBoolean.And CheckBoilerConditions(nu=3) - "if all 3 conditions are met, turn on boiler" - annotation (Placement(transformation(extent={{-4,-486},{22,-460}}))); - Modelica.Blocks.Logical.Or or2 - "if Toda is smaller than TCutOff, activate Boiler" - annotation (Placement(transformation(extent={{180,-460},{200,-440}}))); - Modelica.Blocks.Logical.LessThreshold CheckTCut_Off(threshold= - bivalentControlData.TCutOff) "checks if Toda is below TCutOff" - annotation (Placement(transformation(extent={{62,-388},{94,-356}}))); - Modelica.Blocks.Sources.RealExpression T_Oda1(final y( - unit="K", - displayUnit="degC") = heatingCurve.TOda) - "Außtentemperatur für Boiler Steuerung" annotation (Placement( - transformation( - extent={{-16,-5},{16,5}}, - rotation=0, - origin={0,-373}))); - Modelica.Blocks.Logical.Switch BoilerSwitch - "checks if Boiler is allowed to turn on, if not set Gas to 0" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-66,-208}))); - Modelica.Blocks.Sources.Constant constZero2(k=0) - annotation (Placement(transformation(extent={{-8,-248},{-28,-228}}))); - Modelica.Blocks.Logical.Switch thermalDesinfection - "use Boiler to desinfect DHW tank" annotation (Placement(transformation( - extent={{5,-5},{-5,5}}, - rotation=0, - origin={-123,-179}))); - Modelica.Blocks.Sources.Constant constOne(final k=1) - "maximum Boiler usage for thermal desinfection" annotation (Placement( - transformation( - extent={{-5,-5},{5,5}}, - rotation=180, - origin={-87,-175}))); - Modelica.Blocks.Sources.Constant const3(k=0.5) "WP und Boiler" - annotation (Placement(transformation(extent={{-800,-38},{-780,-18}}))); - Modelica.Blocks.Logical.Switch ThrWayVal1 - "to decide position of three way vlave in generation class" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-708,-70}))); - Modelica.Blocks.Sources.Constant const2(k=1) "nur WP" - annotation (Placement(transformation(extent={{-800,-100},{-780,-80}}))); - Modelica.Blocks.Logical.Switch ThrWayVal2 - "to decide position of three way vlave in generation class" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-634,-104}))); - Modelica.Blocks.Sources.Constant const1(k=0) "nur Boiler falls TCutOff" - annotation (Placement(transformation(extent={{-682,-32},{-662,-12}}))); - Modelica.Blocks.Logical.Switch ThrWayVal3 - "to decide position of three way vlave in generation class" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-520,-104}))); - Modelica.Blocks.Sources.Constant const4(k=0.5) "WP und Boiler" - annotation (Placement(transformation(extent={{-596,-76},{-576,-56}}))); - Modelica.Blocks.Logical.Hysteresis HysteresisBoilerControl(uLow=0.85, uHigh= - 0.9) - "Hysteresis in boiler Control to check for HP Compressor utilization" - annotation (Placement(transformation(extent={{-192,-408},{-172,-388}}))); + annotation (choicesAllMatching=true, Placement(transformation(extent={{74,12}, + {104,40}}))); equation connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( - Line(points={{97,61.2},{97,56},{98,56},{98,50},{138,50},{138,-36},{-152, + Line(points={{110,80.4},{110,56},{98,56},{98,50},{138,50},{138,-36},{-152, -36},{-152,-99}}, color={0,0,127}), Text( string="%second", @@ -155,95 +53,16 @@ equation horizontalAlignment=TextAlignment.Right)); connect(switch1.y, Boiler_uRel_Controller.T_Set) annotation (Line(points={{68.5,73}, - {68.5,72},{72,72},{72,48},{58,48},{58,36.4},{65,36.4}}, + {68.5,72},{72,72},{72,48},{58,48},{58,34.4},{71,34.4}}, color={0,0,127})); - connect(BooleanConstant.y, Boiler_uRel_Controller.HP_On) annotation (Line( - points={{50.7,17},{50.7,4},{56,4},{56,28},{65,28}}, - color={255,0,255})); - connect(BooleanConstant.y, Boiler_uRel_Controller.IsOn) annotation (Line( - points={{50.7,17},{50.7,4},{74,4},{74,11.2}}, color={255,0,255})); connect(Boiler_uRel_Controller.T_Meas, sigBusGen.TBoilerOut) annotation (Line( - points={{83,11.2},{82,11.2},{82,-60},{-150,-60},{-150,-68},{-152,-68},{ - -152,-99}}, color={0,0,127}), + points={{89,9.2},{82,9.2},{82,-60},{-150,-60},{-150,-68},{-152,-68},{-152, + -99}}, color={0,0,127}), Text( string="%second", index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(T_Oda.y,lessThreshold. u) annotation (Line(points={{-196.4,-323},{ - -196.4,-320},{-167.2,-320}}, - color={0,0,127})); - connect(not1.y, OperationalBoundryCheck.u1) annotation (Line(points={{-203, - -440},{-160,-440},{-160,-454}}, color={255,0,255})); - connect(HP_IsON1.y,not1. u) annotation (Line(points={{-261,-438},{-244,-438}, - {-244,-440},{-226,-440}}, - color={255,0,255})); - connect(HP_HP_ON.y, OperationalBoundryCheck.u2) annotation (Line(points={{-263, - -470},{-220,-470},{-220,-462},{-160,-462}}, color={255,0,255})); - connect(OperationalBoundryCheck.y, or1.u2) annotation (Line(points={{-137,-454}, - {-137,-422},{-92,-422}}, color={255,0,255})); - connect(lessThreshold.y, CheckBoilerConditions.u[1]) annotation (Line(points={{-130.4, - -320},{-20,-320},{-20,-476.033},{-4,-476.033}}, color={255,0,255})); - connect(or1.y, CheckBoilerConditions.u[2]) annotation (Line(points={{-69,-414}, - {-52,-414},{-52,-416},{-32,-416},{-32,-473},{-4,-473}}, color={255,0,255})); - connect(CheckBoilerConditions.y, or2.u2) annotation (Line(points={{23.95,-473}, - {23.95,-472},{178,-472},{178,-458}}, color={255,0,255})); - connect(T_Oda1.y,CheckTCut_Off. u) annotation (Line(points={{17.6,-373},{37, - -373},{37,-372},{58.8,-372}}, color={0,0,127})); - connect(CheckTCut_Off.y, or2.u1) annotation (Line(points={{95.6,-372},{136,-372}, - {136,-450},{178,-450}}, color={255,0,255})); - connect(heatDemand_AuxiliarHeater.y, CheckBoilerConditions.u[3]) annotation ( - Line(points={{26.75,23},{26.75,-196},{26,-196},{26,-469.967},{-4,-469.967}}, - color={255,0,255})); - connect(constZero2.y, BoilerSwitch.u3) annotation (Line(points={{-29,-238},{-58, - -238},{-58,-220}}, color={0,0,127})); - connect(or2.y, BoilerSwitch.u2) annotation (Line(points={{201,-450},{201,-280}, - {-66,-280},{-66,-220}}, color={255,0,255})); - connect(Boiler_uRel_Controller.n_Set, BoilerSwitch.u1) annotation (Line( - points={{99.5,28},{104,28},{104,-46},{-42,-46},{-42,-100},{-74,-100},{ - -74,-220}}, color={0,0,127})); - connect(BoilerSwitch.y, thermalDesinfection.u3) annotation (Line(points={{-66, - -197},{-66,-183},{-117,-183}}, color={0,0,127})); - connect(TSet_DHW.y, thermalDesinfection.u2) annotation (Line(points={{-190.8,71.04}, - {-190.8,-150},{-108,-150},{-108,-179},{-117,-179}}, color={255,0,255})); - connect(constOne.y, thermalDesinfection.u1) - annotation (Line(points={{-92.5,-175},{-117,-175}}, color={0,0,127})); - connect(const3.y, ThrWayVal1.u1) annotation (Line(points={{-779,-28},{-750,-28}, - {-750,-62},{-720,-62}}, color={0,0,127})); - connect(const2.y, ThrWayVal1.u3) annotation (Line(points={{-779,-90},{-750,-90}, - {-750,-78},{-720,-78}}, color={0,0,127})); - connect(ThrWayVal1.y, ThrWayVal2.u3) annotation (Line(points={{-697,-70},{-672, - -70},{-672,-112},{-646,-112}}, color={0,0,127})); - connect(const1.y, ThrWayVal2.u1) annotation (Line(points={{-661,-22},{-661,-59}, - {-646,-59},{-646,-96}}, color={0,0,127})); - connect(CheckBoilerConditions.y, ThrWayVal1.u2) annotation (Line(points={{23.95, - -473},{23.95,-352},{-922,-352},{-922,-70},{-720,-70}}, color={255,0,255})); - connect(CheckTCut_Off.y, ThrWayVal2.u2) annotation (Line(points={{95.6,-372}, - {116,-372},{116,-290},{-686,-290},{-686,-104},{-646,-104}}, color={ - 255,0,255})); - connect(ThrWayVal2.y, ThrWayVal3.u3) annotation (Line(points={{-623,-104},{-578, - -104},{-578,-112},{-532,-112}}, color={0,0,127})); - connect(const4.y, ThrWayVal3.u1) annotation (Line(points={{-575,-66},{-560,-66}, - {-560,-96},{-532,-96}}, color={0,0,127})); - connect(TSet_DHW.y, ThrWayVal3.u2) annotation (Line(points={{-190.8,71.04},{-190.8, - 188},{-550,188},{-550,-104},{-532,-104}}, color={255,0,255})); - connect(HP_NSet.y, HysteresisBoilerControl.u) annotation (Line(points={{ - -216.4,-379},{-204,-379},{-204,-398},{-194,-398}}, color={0,0,127})); - connect(HysteresisBoilerControl.y, or1.u1) annotation (Line(points={{-171, - -398},{-132,-398},{-132,-414},{-92,-414}}, color={255,0,255})); - connect(ThrWayVal3.y, sigBusGen.uThrWayValGen) annotation (Line(points={{-509, - -104},{-370,-104},{-370,-128},{-142,-128},{-142,-99},{-152,-99}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(thermalDesinfection.y, sigBusGen.yBoiler) annotation (Line(points={{-128.5, - -179},{-152,-179},{-152,-99}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo index c1f7686b..13b0859f 100644 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo @@ -1,4 +1,4 @@ -within BESMod.Systems.Hydraulical.Control; +within BESMod.Systems.Hydraulical.Control; model NewControlBivalentSerial "Bivalent Serial Control Class (Part-parallel PI controlled HPS according to condenser outflow)" extends BaseClasses.PartialTwoPoint_HPS_Controller_BivalentBoiler( @@ -9,7 +9,7 @@ model NewControlBivalentSerial nMin=bivalentControlData.nMin, T_I=bivalentControlData.T_I), redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent BufferOnOffController( Hysteresis=bivalentControlData.dTHysBui, TCutOff=TCutOff, @@ -19,7 +19,7 @@ model NewControlBivalentSerial QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), QHP_flow_cutOff=QHP_flow_cutOff), redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent DHWOnOffContoller( Hysteresis=bivalentControlData.dTHysDHW, TCutOff=TCutOff, @@ -42,85 +42,11 @@ model NewControlBivalentSerial Components.HeatPumpNSetController.PI_InverterHeatPumpController annotation (choicesAllMatching=true, Placement(transformation(extent={{80,10}, {110,38}}))); - Modelica.Blocks.Sources.BooleanConstant TestBoilerZustand1(final k=true) - annotation (Placement(transformation( - extent={{-7,-7},{7,7}}, - rotation=0, - origin={43,5}))); - Modelica.Blocks.Sources.RealExpression T_Oda(final y( - unit="K", - displayUnit="degC") = heatingCurve.TOda) - "Außtentemperatur für Boiler Steuerung" annotation (Placement( - transformation( - extent={{-16,-5},{16,5}}, - rotation=0, - origin={-214,-323}))); - Modelica.Blocks.Sources.RealExpression HP_NSet(final y( - unit="K", - displayUnit="degC") = HP_nSet_Controller.n_Set) - "Compressor Drehzahl für Boiler Steuerung" annotation (Placement( - transformation( - extent={{-16,-5},{16,5}}, - rotation=0, - origin={-234,-379}))); - Modelica.Blocks.Logical.LessThreshold lessThreshold(threshold= - bivalentControlData.TBiv) "checks if Toda is smaller than TBiv" - annotation (Placement(transformation(extent={{-164,-336},{-132,-304}}))); - Modelica.Blocks.Logical.Or or1 - "hp outside operational boundary or high utilization (high compressor rotational speed)" - annotation (Placement(transformation(extent={{-90,-424},{-70,-404}}))); - Modelica.Blocks.MathBoolean.And CheckBoilerConditions(nu=3) - "if all 3 conditions are met, turn on boiler" - annotation (Placement(transformation(extent={{-4,-486},{22,-460}}))); - Modelica.Blocks.Logical.Or or2 - "if Toda is smaller than TCutOff, activate Boiler" - annotation (Placement(transformation(extent={{180,-460},{200,-440}}))); - Modelica.Blocks.Logical.LessThreshold CheckTCut_Off(threshold= - bivalentControlData.TCutOff) "checks if Toda is below TCutOff" - annotation (Placement(transformation(extent={{62,-388},{94,-356}}))); - Modelica.Blocks.Sources.RealExpression T_Oda1(final y( - unit="K", - displayUnit="degC") = heatingCurve.TOda) - "Außtentemperatur für Boiler Steuerung" annotation (Placement( - transformation( - extent={{-16,-5},{16,5}}, - rotation=0, - origin={0,-373}))); - Modelica.Blocks.Logical.Switch BoilerSwitch - "checks if Boiler is allowed to turn on, if not set Gas to 0" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-66,-208}))); - Modelica.Blocks.Sources.Constant ConstZero2(k=0) - annotation (Placement(transformation(extent={{-8,-248},{-28,-228}}))); - Modelica.Blocks.Logical.Switch thermalDesinfection - "use Boiler to desinfect DHW tank" annotation (Placement(transformation( - extent={{5,-5},{-5,5}}, - rotation=0, - origin={-123,-179}))); - Modelica.Blocks.Sources.Constant constOne(final k=1) - "maximum Boiler usage for thermal desinfection" annotation (Placement( - transformation( - extent={{-5,-5},{5,5}}, - rotation=180, - origin={-87,-175}))); - Modelica.Blocks.Logical.And OperationalBoundryCheck - "checks, if hp is allowed to operate regarding operational boundry. If HP_ON = true and IsON=False, then hp is deactivated on purpose. In this case, this signal will be true." - annotation (Placement(transformation(extent={{-216,-476},{-196,-456}}))); - Modelica.Blocks.Logical.Not not2 - annotation (Placement(transformation(extent={{-282,-462},{-262,-442}}))); - Modelica.Blocks.Sources.BooleanExpression HP_IsON2(y=HP_nSet_Controller.IsOn) - annotation (Placement(transformation(extent={{-340,-460},{-320,-440}}))); - Modelica.Blocks.Sources.BooleanExpression HP_HP_ON1(y=HP_nSet_Controller.HP_On) - annotation (Placement(transformation(extent={{-342,-492},{-322,-472}}))); - Modelica.Blocks.Logical.Hysteresis HysteresisBoilerControl(uLow=0.85, uHigh= - 0.9) - "Hysteresis in boiler Control to check for HP Compressor utilization" - annotation (Placement(transformation(extent={{-166,-386},{-146,-366}}))); + Components.BoilerInHybridSystem boiInHybSys annotation (Placement( + transformation(rotation=0, extent={{-32,20},{-12,40}}))); equation connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( - Line(points={{97,61.2},{97,20},{98,20},{98,-22},{-152,-22},{-152,-99}}, + Line(points={{110,80.4},{110,20},{98,20},{98,-22},{-152,-22},{-152,-99}}, color={0,0,127}), Text( string="%second", @@ -131,74 +57,14 @@ equation connect(switch1.y, Boiler_uRel_Controller.T_Set) annotation (Line(points={{68.5,73}, {68.5,72},{72,72},{72,38},{70,38},{70,32.4},{77,32.4}}, color={0,0,127})); - connect(TestBoilerZustand1.y, Boiler_uRel_Controller.HP_On) annotation (Line( - points={{50.7,5},{50.7,4},{54,4},{54,6},{70,6},{70,24},{77,24}}, - color={255,0,255})); - connect(TestBoilerZustand1.y, Boiler_uRel_Controller.IsOn) annotation (Line( - points={{50.7,5},{50.7,4},{54,4},{54,6},{74,6},{74,0},{86,0},{86,7.2}}, - color={255,0,255})); connect(Boiler_uRel_Controller.T_Meas, sigBusGen.TBoiOut) annotation (Line( - points={{95,7.2},{96,7.2},{96,-74},{-148,-74},{-148,-82},{-152,-82},{ - -152,-99}}, color={0,0,127}), + points={{95,7.2},{96,7.2},{96,-74},{-152,-74},{-152,-99}}, + color={0,0,127}), Text( string="%second", index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(T_Oda.y,lessThreshold. u) annotation (Line(points={{-196.4,-323},{ - -196.4,-320},{-167.2,-320}}, - color={0,0,127})); - connect(lessThreshold.y, CheckBoilerConditions.u[1]) annotation (Line(points={{-130.4, - -320},{-20,-320},{-20,-476.033},{-4,-476.033}}, color={255,0, - 255})); - connect(or1.y, CheckBoilerConditions.u[2]) annotation (Line(points={{-69,-414}, - {-52,-414},{-52,-416},{-32,-416},{-32,-473},{-4,-473}}, color={255,0, - 255})); - connect(CheckBoilerConditions.y, or2.u2) annotation (Line(points={{23.95,-473}, - {23.95,-472},{178,-472},{178,-458}}, color={255,0,255})); - connect(T_Oda1.y,CheckTCut_Off. u) annotation (Line(points={{17.6,-373},{37, - -373},{37,-372},{58.8,-372}}, color={0,0,127})); - connect(CheckTCut_Off.y, or2.u1) annotation (Line(points={{95.6,-372},{136,-372}, - {136,-450},{178,-450}}, color={255,0,255})); - connect(ConstZero2.y, BoilerSwitch.u3) annotation (Line(points={{-29,-238},{-58, - -238},{-58,-220}}, color={0,0,127})); - connect(or2.y, BoilerSwitch.u2) annotation (Line(points={{201,-450},{201,-280}, - {-66,-280},{-66,-220}}, color={255,0,255})); - connect(Boiler_uRel_Controller.n_Set, BoilerSwitch.u1) annotation (Line( - points={{111.5,24},{116,24},{116,-58},{-74,-58},{-74,-220}}, color={0,0, - 127})); - connect(BoilerSwitch.y, thermalDesinfection.u3) annotation (Line(points={{-66, - -197},{-66,-183},{-117,-183}}, color={0,0,127})); - connect(TSet_DHW.y, thermalDesinfection.u2) annotation (Line(points={{-190.8, - 71.04},{-190.8,-150},{-108,-150},{-108,-179},{-117,-179}}, color={255, - 0,255})); - connect(constOne.y, thermalDesinfection.u1) - annotation (Line(points={{-92.5,-175},{-117,-175}}, color={0,0,127})); - connect(CheckBoilerConditions.u[3], heatDemand_AuxiliarHeater.y) annotation ( - Line(points={{-4,-469.967},{-32,-469.967},{-32,-172},{26.75,-172},{26.75,23}}, - color={255,0,255})); - connect(not2.y,OperationalBoundryCheck. u1) annotation (Line(points={{-261,-452}, - {-254,-452},{-254,-466},{-218,-466}}, - color={255,0,255})); - connect(HP_IsON2.y,not2. u) annotation (Line(points={{-319,-450},{-302,-450}, - {-302,-452},{-284,-452}}, - color={255,0,255})); - connect(HP_HP_ON1.y, OperationalBoundryCheck.u2) annotation (Line(points={{ - -321,-482},{-278,-482},{-278,-474},{-218,-474}}, color={255,0,255})); - connect(OperationalBoundryCheck.y, or1.u2) annotation (Line(points={{-195, - -466},{-195,-422},{-92,-422}}, - color={255,0,255})); - connect(thermalDesinfection.y, sigBusGen.yBoi) annotation (Line(points={{ - -128.5,-179},{-152,-179},{-152,-99}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(HP_NSet.y, HysteresisBoilerControl.u) annotation (Line(points={{ - -216.4,-379},{-192.2,-379},{-192.2,-376},{-168,-376}}, color={0,0,127})); - connect(HysteresisBoilerControl.y, or1.u1) annotation (Line(points={{-145,-376}, - {-128,-376},{-128,-414},{-92,-414}}, color={255,0, - 255})); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo index feed22a2..7b601b50 100644 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo @@ -1,4 +1,4 @@ -within BESMod.Systems.Hydraulical.Control; +within BESMod.Systems.Hydraulical.Control; model NewControlBivalentSystem_BoilerAfterBuffer "intended use for bivalent systems with boiler after buffer (Part-parallel PI controlled HPS according to condenser outflow)" extends BaseClasses.PartialTwoPoint_HPS_Controller_BivalentBoiler( @@ -9,7 +9,7 @@ model NewControlBivalentSystem_BoilerAfterBuffer nMin=bivalentControlData.nMin, T_I=bivalentControlData.T_I), redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent BufferOnOffController( Hysteresis=bivalentControlData.dTHysBui, TCutOff=TCutOff, @@ -19,7 +19,7 @@ model NewControlBivalentSystem_BoilerAfterBuffer QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), QHP_flow_cutOff=QHP_flow_cutOff), redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ParallelBivalentControl + BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent DHWOnOffContoller( Hysteresis=bivalentControlData.dTHysDHW, TCutOff=TCutOff, @@ -42,85 +42,9 @@ model NewControlBivalentSystem_BoilerAfterBuffer Components.HeatPumpNSetController.PI_InverterHeatPumpController annotation (choicesAllMatching=true, Placement(transformation(extent={{74,12}, {104,40}}))); - Modelica.Blocks.Sources.BooleanConstant TestBoilerZustand1(final k=true) - annotation (Placement(transformation( - extent={{-7,-7},{7,7}}, - rotation=0, - origin={51,7}))); - Modelica.Blocks.Sources.RealExpression T_Oda(final y( - unit="K", - displayUnit="degC") = heatingCurve.TOda) - "Außtentemperatur für Boiler Steuerung" annotation (Placement( - transformation( - extent={{-16,-5},{16,5}}, - rotation=0, - origin={-214,-323}))); - Modelica.Blocks.Sources.RealExpression HP_NSet(final y( - unit="K", - displayUnit="degC") = HP_nSet_Controller.n_Set) - "Compressor Drehzahl für Boiler Steuerung" annotation (Placement( - transformation( - extent={{-16,-5},{16,5}}, - rotation=0, - origin={-234,-379}))); - Modelica.Blocks.Logical.LessThreshold lessThreshold(threshold= - bivalentControlData.TBiv) "checks, if Toda is below Tbiv" - annotation (Placement(transformation(extent={{-164,-336},{-132,-304}}))); - Modelica.Blocks.Logical.Or or1 - "entweder WP im Sperrmodus oder voll ausgelastet" - annotation (Placement(transformation(extent={{-90,-424},{-70,-404}}))); - Modelica.Blocks.MathBoolean.And CheckBoilerConditions(nu=3) - "if all 3 conditions are met, turn on boiler" - annotation (Placement(transformation(extent={{-4,-486},{22,-460}}))); - Modelica.Blocks.Logical.Or or2 - "if Toda is smaller than TCutOff, activate Boiler" - annotation (Placement(transformation(extent={{180,-460},{200,-440}}))); - Modelica.Blocks.Logical.LessThreshold CheckTCut_Off(threshold= - bivalentControlData.TCutOff) "checks if Toda is below TCutOff" - annotation (Placement(transformation(extent={{62,-388},{94,-356}}))); - Modelica.Blocks.Sources.RealExpression T_Oda1(final y( - unit="K", - displayUnit="degC") = heatingCurve.TOda) - "Außtentemperatur für Boiler Steuerung" annotation (Placement( - transformation( - extent={{-16,-5},{16,5}}, - rotation=0, - origin={0,-373}))); - Modelica.Blocks.Logical.Switch BoilerSwitch - "checks if Boiler is allowed to turn on, if not set Gas to 0" annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={-66,-208}))); - Modelica.Blocks.Sources.Constant constZero2(k=0) - annotation (Placement(transformation(extent={{-8,-248},{-28,-228}}))); - Modelica.Blocks.Logical.Switch thermalDesinfection - "use Boiler to desinfect DHW tank" annotation (Placement(transformation( - extent={{5,-5},{-5,5}}, - rotation=0, - origin={-123,-179}))); - Modelica.Blocks.Sources.Constant constOne(final k=1) - "maximum Boiler usage for thermal desinfection" annotation (Placement( - transformation( - extent={{-5,-5},{5,5}}, - rotation=180, - origin={-87,-175}))); - Modelica.Blocks.Logical.And OperationalBoundryCheck - "checks, if hp is allowed to operate regarding operational boundry. If HP_ON = true and IsON=False, then hp is deactivated on purpose. In this case, this signal will be true." - annotation (Placement(transformation(extent={{-146,-480},{-126,-460}}))); - Modelica.Blocks.Logical.Not not2 - annotation (Placement(transformation(extent={{-212,-466},{-192,-446}}))); - Modelica.Blocks.Sources.BooleanExpression HP_IsON2(y=HP_nSet_Controller.IsOn) - annotation (Placement(transformation(extent={{-270,-464},{-250,-444}}))); - Modelica.Blocks.Sources.BooleanExpression HP_HP_ON1(y=HP_nSet_Controller.HP_On) - annotation (Placement(transformation(extent={{-272,-496},{-252,-476}}))); - Modelica.Blocks.Logical.Hysteresis HysteresisBoilerControl(uLow=0.85, uHigh= - 0.9) - "Hysteresis in boiler Control to check for HP Compressor utilization" - annotation (Placement(transformation(extent={{-152,-394},{-132,-374}}))); equation connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( - Line(points={{97,61.2},{97,50},{146,50},{146,-36},{-152,-36},{-152,-99}}, + Line(points={{110,80.4},{110,50},{146,50},{146,-36},{-152,-36},{-152,-99}}, color={0,0,127}), Text( string="%second", @@ -128,44 +52,6 @@ equation extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(switch1.y, Boiler_uRel_Controller.T_Set) annotation (Line(points={{68.5,73}, - {68.5,72},{72,72},{72,46},{64,46},{64,34.4},{71,34.4}}, - color={0,0,127})); - connect(TestBoilerZustand1.y, Boiler_uRel_Controller.HP_On) annotation (Line( - points={{58.7,7},{58.7,6},{64,6},{64,26},{71,26}}, - color={255,0,255})); - connect(TestBoilerZustand1.y, Boiler_uRel_Controller.IsOn) annotation (Line( - points={{58.7,7},{58.7,6},{72,6},{72,2},{80,2},{80,9.2}}, - color={255,0,255})); - connect(T_Oda.y,lessThreshold. u) annotation (Line(points={{-196.4,-323},{ - -196.4,-320},{-167.2,-320}}, - color={0,0,127})); - connect(lessThreshold.y, CheckBoilerConditions.u[1]) annotation (Line(points={{-130.4, - -320},{-20,-320},{-20,-476.033},{-4,-476.033}}, color={255,0, - 255})); - connect(or1.y, CheckBoilerConditions.u[2]) annotation (Line(points={{-69,-414}, - {-52,-414},{-52,-416},{-32,-416},{-32,-473},{-4,-473}}, color={255,0, - 255})); - connect(CheckBoilerConditions.y, or2.u2) annotation (Line(points={{23.95,-473}, - {23.95,-472},{178,-472},{178,-458}}, color={255,0,255})); - connect(T_Oda1.y,CheckTCut_Off. u) annotation (Line(points={{17.6,-373},{37, - -373},{37,-372},{58.8,-372}}, color={0,0,127})); - connect(CheckTCut_Off.y, or2.u1) annotation (Line(points={{95.6,-372},{136,-372}, - {136,-450},{178,-450}}, color={255,0,255})); - connect(constZero2.y, BoilerSwitch.u3) annotation (Line(points={{-29,-238},{-58, - -238},{-58,-220}}, color={0,0,127})); - connect(or2.y, BoilerSwitch.u2) annotation (Line(points={{201,-450},{201,-280}, - {-66,-280},{-66,-220}}, color={255,0,255})); - connect(Boiler_uRel_Controller.n_Set, BoilerSwitch.u1) annotation (Line( - points={{105.5,26},{110,26},{110,-58},{-42,-58},{-42,-100},{-74,-100},{ - -74,-220}}, color={0,0,127})); - connect(BoilerSwitch.y, thermalDesinfection.u3) annotation (Line(points={{-66, - -197},{-66,-183},{-117,-183}}, color={0,0,127})); - connect(TSet_DHW.y, thermalDesinfection.u2) annotation (Line(points={{-190.8, - 71.04},{-190.8,-150},{-108,-150},{-108,-179},{-117,-179}}, color={255, - 0,255})); - connect(constOne.y, thermalDesinfection.u1) - annotation (Line(points={{-92.5,-175},{-117,-175}}, color={0,0,127})); connect(Boiler_uRel_Controller.T_Meas, sigBusDistr.TBoilerOutDistribution) annotation (Line(points={{89,9.2},{88,9.2},{88,-60},{1,-60},{1,-100}}, color={0,0, @@ -174,31 +60,6 @@ equation index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(CheckBoilerConditions.u[3], heatDemand_AuxiliarHeater.y) annotation ( - Line(points={{-4,-469.967},{-28,-469.967},{-28,6},{40,6},{40,20},{26.75,20}, - {26.75,23}}, color={255,0,255})); - connect(not2.y,OperationalBoundryCheck. u1) annotation (Line(points={{-191, - -456},{-148,-456},{-148,-470}}, color={255,0,255})); - connect(HP_IsON2.y,not2. u) annotation (Line(points={{-249,-454},{-232,-454}, - {-232,-456},{-214,-456}}, - color={255,0,255})); - connect(HP_HP_ON1.y, OperationalBoundryCheck.u2) annotation (Line(points={{ - -251,-486},{-208,-486},{-208,-478},{-148,-478}}, color={255,0,255})); - connect(OperationalBoundryCheck.y, or1.u2) annotation (Line(points={{-125, - -470},{-125,-422},{-92,-422}}, - color={255,0,255})); - connect(thermalDesinfection.y, sigBusDistr.yBoilerDistribution) annotation ( - Line(points={{-128.5,-179},{-154,-179},{-154,-150},{1,-150},{1,-100}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(HP_NSet.y, HysteresisBoilerControl.u) annotation (Line(points={{ - -216.4,-379},{-185.2,-379},{-185.2,-384},{-154,-384}}, color={0,0,127})); - connect(HysteresisBoilerControl.y, or1.u1) annotation (Line(points={{-131, - -384},{-116,-384},{-116,-414},{-92,-414},{-92,-414}}, color={255,0, - 255})); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/BivalentHeatPumpControlDataDefinition.mo b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BivalentHeatPumpControlDataDefinition.mo index c8660457..78cc9777 100644 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/BivalentHeatPumpControlDataDefinition.mo +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BivalentHeatPumpControlDataDefinition.mo @@ -7,45 +7,14 @@ partial record BivalentHeatPumpControlDataDefinition annotation (Dialog(group="General")); parameter Modelica.Units.SI.TemperatureDifference dTHysDHW "Hysteresis for DHW demand control" annotation (Dialog(group="General")); - parameter Real k "Proportional gain of Primary PID Controller" - annotation(Dialog(group="Primary PID Control", - enable=use_hydraulic or use_ventilation)); + parameter Real k "Proportional gain of Primary PID Controller" + annotation(Dialog(group="Primary PID Control")); parameter Modelica.Units.SI.Time T_I "Time constant of Integrator block of PI control" annotation (Dialog(group= - "Primary PID Control", enable=use_hydraulic or use_ventilation)); + "Primary PID Control")); parameter Modelica.Units.SI.Time Ni "Anti wind up constant of PID control" - annotation (Dialog(group="Primary PID Control", enable=use_hydraulic or - use_ventilation)); - - parameter Modelica.Units.SI.TemperatureDifference dTOffSetHeatCurve - "Additional Offset of heating curve" - annotation (Evaluate=true, Dialog(group="Heating Curve")); - parameter Modelica.Units.SI.Temperature TOda_nominal - "Nominal outdoor air temperature"; - parameter Modelica.Units.SI.Temperature TSup_nominal - "Nominal supply temperature of primary energy system"; - parameter Modelica.Units.SI.Temperature TSetRoomConst=293.15 - "Room set temerature"; - parameter Modelica.Units.SI.Temperature TBiv=TOda_nominal - "Nominal bivalence temperature. = TOda_nominal for monovalent systems."; - - parameter Real gradientHeatCurve=((TSup_nominal) - (TSetRoomConst + dTOffSetHeatCurve))/(TSetRoomConst-TOda_nominal) "Heat curve gradient" annotation(Evaluate=true, Dialog(group= - "Heating Curve")); - parameter Modelica.Units.SI.Time dtHeaRodBui - "Seconds for regulation when hr should be activated: If lower set temperature is hurt for more than this time period" - annotation (group="Heat Pumps", Dialog(group="Secondary RBC")); - - parameter Real addSet_dtHeaRodBui - "Each time dt_hr passes, the output of the heating rod is increased by this amount in percentage. Maximum and default is 100 (on-off hr)%" annotation(Dialog(group= - "Secondary RBC")); - parameter Modelica.Units.SI.Time dtHeaRodDHW - "Seconds for regulation when hr should be activated: If lower set temperature is hurt for more than this time period" - annotation (group="Heat Pumps", Dialog(group="Secondary RBC")); - - parameter Real addSet_dtHeaRodDHW - "Each time dt_hr passes, the output of the heating rod is increased by this amount in percentage. Maximum and default is 100 (on-off hr)%" annotation(Dialog(group= - "Secondary RBC")); + annotation (Dialog(group="Primary PID Control")); parameter Real nMin "Minimum relative input signal of primary device PID control" annotation (Dialog(group="Primary PID Control")); diff --git a/BESMod/Systems/Hydraulical/Control/package.order b/BESMod/Systems/Hydraulical/Control/package.order index ea084a45..ecd089cb 100644 --- a/BESMod/Systems/Hydraulical/Control/package.order +++ b/BESMod/Systems/Hydraulical/Control/package.order @@ -1,9 +1,4 @@ -ConstHys_OnOff_HPSControll -ConstHys_P_ConOut_HPSController -ConstHys_P_ConIn_HPSController -ConstHys_PI_ConOut_HPSController -ConstHys_PI_StoTop_HPSController -Biv_PI_ConFlow_HPSController +MonoenergeticHeatPumpSystem NoControl GasBoiler BivalentPartParallel diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo index b2104f73..a7dce526 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo @@ -2,7 +2,7 @@ within BESMod.Systems.Hydraulical.Distribution.BaseClasses; partial model PartialTwoStorageParallel "Partial model to later extent" extends BaseClasses.PartialDistribution( final dpDem_nominal={0}, - final dpSup_nominal={2*(parThrWayVal.dpValve_nominal + max(parThrWayVal.dp_nominal))}, + final dpSup_nominal={parThrWayVal.dpValve_nominal + max(parThrWayVal.dp_nominal)}, final dTTraDHW_nominal=parStoDHW.dTLoadingHC1, final dTTra_nominal={parStoBuf.dTLoadingHC1}, final m_flow_nominal=mDem_flow_nominal, @@ -77,13 +77,13 @@ partial model PartialTwoStorageParallel "Partial model to later extent" final QHC1_flow_nominal=QDHW_flow_nominal, final mHC1_flow_nominal=mSup_flow_nominal[1], redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, - final use_HC2=stoBuf.useHeatingCoil2, - final use_HC1=stoBuf.useHeatingCoil1, - final dTLoadingHC2=9999999, - final fHeiHC2=1, - final fDiaHC2=1, - final QHC2_flow_nominal=9999999, - final mHC2_flow_nominal=9999999, + final use_HC2=stoDHW.useHeatingCoil2, + final use_HC1=stoDHW.useHeatingCoil1, + final dTLoadingHC2=dTLoadingHC2, + fHeiHC2=1, + fDiaHC2=1, + final QHC2_flow_nominal=QHC2_flow_nominal, + final mHC2_flow_nominal=mHC2_flow_nominal, redeclare final AixLib.DataBase.Pipes.Copper.Copper_10x0_6 pipeHC2) "Parameters for DHW storage" annotation ( Dialog(group="Component data"), @@ -190,7 +190,7 @@ partial model PartialTwoStorageParallel "Partial model to later extent" final mHC1_flow_nominal=parStoDHW.mHC1_flow_nominal, final mHC2_flow_nominal=parStoDHW.mHC2_flow_nominal, final useHeatingCoil1=true, - final useHeatingCoil2=false, + final useHeatingCoil2=use_secHeaCoiDHWSto, final useHeatingRod=parStoDHW.use_hr, final TStart=T_start, redeclare final RecordsCollection.BufferStorage.bufferData data( @@ -295,6 +295,15 @@ partial model PartialTwoStorageParallel "Partial model to later extent" extent={{-10,-10},{10,10}}, rotation=0, origin={-70,-70}))); +protected + parameter Boolean use_secHeaCoiDHWSto + "=false to disable second heating coil in DHW storage"; + parameter Modelica.Units.SI.TemperatureDifference dTLoadingHC2=9999999 + "Temperature difference for loading of first heating coil"; + parameter Modelica.Units.SI.HeatFlowRate QHC2_flow_nominal=9999999 + "Nominal heat flow rate in second heating coil"; + parameter Modelica.Units.SI.MassFlowRate mHC2_flow_nominal=9999999 + "Nominal mass flow rate of HC fluid"; equation connect(reaExpTStoDHWBot.y, sigBusDistr.TStoDHWBotMea) annotation (Line( points={{-19,95},{2.5,95},{2.5,101},{0,101}}, color={0,0,127}), Text( diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo index 85e38e22..41d0b46f 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo @@ -1,7 +1,8 @@ within BESMod.Systems.Hydraulical.Distribution.BaseClasses; partial model PartialTwoStorageParallelWithHeaters "Partial two storage model with heaters" - extends BaseClasses.PartialTwoStorageParallel; + extends BaseClasses.PartialTwoStorageParallel( + final use_secHeaCoiDHWSto=false); parameter Modelica.Units.SI.HeatFlowRate QHRAftBuf_flow_nominal "Nominal heat flow rate of heating rod after DHW storage" annotation (Dialog(group="Component data", enable=heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod)); @@ -54,8 +55,9 @@ partial model PartialTwoStorageParallelWithHeaters BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.No annotation (Placement(transformation(extent={{40,54},{60,74}}))); - Utilities.KPIs.EnergyKPICalculator eneKPICalAftBufHeaRod(use_inpCon=true) - if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod annotation (Placement(transformation( + Utilities.KPIs.EnergyKPICalculator eneKPICalAftBufHeaRod(use_inpCon=false, y= + hea.Pel) if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod + "Heating rod after buffer KPIs" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={30,-130}))); @@ -85,9 +87,13 @@ partial model PartialTwoStorageParallelWithHeaters if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler "Boiler heat flow KPI" annotation (Placement(transformation(extent={{-60,-200},{-40,-180}}))); + Utilities.KPIs.EnergyKPICalculator eneKPICalAftBufBoi(use_inpCon=false, y=boi.fuelPower) + if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler + "Boiler after buffer KPIs" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={30,-150}))); equation - connect(hea.Pel, eneKPICalAftBufHeaRod.u) annotation (Line(points={{61,96},{61, - 94},{66,94},{66,104},{114,104},{114,-130},{41.8,-130}}, color={0,0,127})); connect(eneKPICalAftBufHeaRod.KPI, outBusDist.PEleHRAftBuf) annotation (Line( points={{17.8,-130},{0,-130},{0,-100}}, color={135,135,135}), Text( string="%second", @@ -107,7 +113,7 @@ equation extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(KPIBoi.KPI, outBusDist.QBoi_flow) annotation (Line(points={{-37.8,-190}, - {-24,-190},{-24,-192},{0,-192},{0,-100}}, color={135,135,135}), Text( + {0,-190},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, @@ -124,5 +130,11 @@ equation {66,86},{66,80}}, color={0,127,255})); connect(pasThrHeaRodBuf.port_b, senTBuiSup.port_a) annotation (Line(points={{60,64},{66,64},{66,80}}, color={0,127,255})); + connect(eneKPICalAftBufBoi.KPI, outBusDist.PBoiAftBuf) annotation (Line(points={ + {17.8,-150},{0,-150},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); annotation (Diagram(coordinateSystem(extent={{-100,-180},{100,140}}))); end PartialTwoStorageParallelWithHeaters; diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ThreeWayValveWithFlowReturn.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ThreeWayValveWithFlowReturn.mo index 58f8f1b1..4faa324c 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ThreeWayValveWithFlowReturn.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/ThreeWayValveWithFlowReturn.mo @@ -30,35 +30,6 @@ model ThreeWayValveWithFlowReturn redeclare package Medium = Medium) "Port connecting to heating demand" annotation (Placement(transformation(extent={{110,70},{90,90}}))); - IBPSA.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear threWayValRet( - redeclare final package Medium = Medium, - final energyDynamics=energyDynamics, - final p_start=p_start, - final T_start=T_start, - final tau=parameters.tau, - final from_dp=true, - final portFlowDirection_1=Modelica.Fluid.Types.PortFlowDirection.Bidirectional, - final portFlowDirection_2=Modelica.Fluid.Types.PortFlowDirection.Bidirectional, - final portFlowDirection_3=Modelica.Fluid.Types.PortFlowDirection.Bidirectional, - final verifyFlowReversal=false, - final use_inputFilter=parameters.use_inputFilter, - final riseTime=parameters.riseTime, - final init=parameters.init, - final y_start=parameters.y_start, - final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, - final deltaM=parameters.deltaM, - final m_flow_nominal=parameters.m_flow_nominal, - final dpValve_nominal=parameters.dpValve_nominal, - final dpFixed_nominal=parameters.dpFixed_nominal, - final fraK=parameters.fraK, - final l=parameters.l, - final linearized={false,false}, - final R=parameters.R, - final delta0=parameters.delta0) - annotation (Placement(transformation( - extent={{-23,18},{23,-18}}, - rotation=180, - origin={-1,-36}))); IBPSA.Fluid.Actuators.Valves.ThreeWayEqualPercentageLinear threWayValFlow( redeclare package Medium = Medium, final energyDynamics=energyDynamics, @@ -96,20 +67,16 @@ model ThreeWayValveWithFlowReturn equation connect(threWayValFlow.y, uBuf) annotation (Line(points={{0,68},{0,120}}, color={0,0,127})); - connect(threWayValRet.port_2, portGen_b) - annotation (Line(points={{-24,-36},{-100,-36}}, color={0,127,255})); - connect(threWayValRet.port_3, portDHW_a) - annotation (Line(points={{-1,-54},{-1,-76},{100,-76}}, color={0,127,255})); - connect(uBuf, threWayValRet.y) annotation (Line(points={{0,120},{0,82},{-46, - 82},{-46,6},{-1,6},{-1,-14.4}}, color={0,0,127})); - connect(portBui_a, threWayValRet.port_1) annotation (Line(points={{100,40},{62, - 40},{62,-36},{22,-36}}, color={0,127,255})); connect(threWayValFlow.port_1, portBui_b) annotation (Line(points={{22,44},{ 34,44},{34,42},{56,42},{56,80},{100,80}}, color={0,127,255})); connect(threWayValFlow.port_3, portDHW_b) annotation (Line(points={{0,24},{0, 14},{84,14},{84,-36},{100,-36}}, color={0,127,255})); connect(threWayValFlow.port_2, portGen_a) annotation (Line(points={{-22,44},{ -62,44},{-62,44},{-100,44}}, color={0,127,255})); + connect(portDHW_a, portGen_b) annotation (Line(points={{100,-76},{70,-76},{70, + -36},{-100,-36}}, color={0,127,255})); + connect(portBui_a, portGen_b) annotation (Line(points={{100,40},{70,40},{70,-36}, + {-100,-36}}, color={0,127,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ Rectangle( extent={{-100,100},{100,-100}}, @@ -144,6 +111,6 @@ equation lineColor={0,0,0}, lineThickness=0.5, fillColor={28,108,200}, - fillPattern=FillPattern.Solid)}), Diagram(graphics, + fillPattern=FillPattern.Solid)}), Diagram( coordinateSystem(preserveAspectRatio=false))); end ThreeWayValveWithFlowReturn; diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestBoilerWithDHW.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestBoilerWithDHW.mo new file mode 100644 index 00000000..b554a9cd --- /dev/null +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestBoilerWithDHW.mo @@ -0,0 +1,49 @@ +within BESMod.Systems.Hydraulical.Distribution.Tests; +model TestBoilerWithDHW "Test two storages boiler with DHW" + extends PartialTest(redeclare + BESMod.Systems.Hydraulical.Distribution.TwoStoragesBoilerWithDHW + distribution( + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen, + redeclare + BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal, + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parStoBuf, + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parStoDHW, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayValBoi)); + extends Modelica.Icons.Example; + + Modelica.Blocks.Sources.Pulse pulse(period=100) annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-70,90}))); + Modelica.Blocks.Sources.Pulse pulseBoi( + width=10, + period=86400, + startTime=3600) "Boiler control signal" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-70,50}))); +equation + connect(pulse.y, sigBusDistr.uThrWayVal) annotation (Line(points={{-59,90},{ + -44,90},{-44,81},{-14,81}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(pulseBoi.y, sigBusDistr.yBoi) annotation (Line(points={{-59,50},{-14,50}, + {-14,81}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); +end TestBoilerWithDHW; diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/package.order b/BESMod/Systems/Hydraulical/Distribution/Tests/package.order index 631cb60d..dc3d4979 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/package.order @@ -4,4 +4,5 @@ TestIndirectLoading TestOnlyBuilding TestOnlyDHW TestSimpleStorages +TestBoilerWithDHW PartialTest diff --git a/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo index 1c124bb1..db8190f5 100644 --- a/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo +++ b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo @@ -1,298 +1,91 @@ -within BESMod.Systems.Hydraulical.Distribution; +within BESMod.Systems.Hydraulical.Distribution; model TwoStoragesBoilerWithDHW "Two storages with a boiler after buffer and with DHW support" - extends BESMod.Systems.Hydraulical.Distribution.BaseClasses.PartialDistribution( - final dpDem_nominal={0}, - final dpSup_nominal={2*(parThrWayVal1.dpValve_nominal + max( - parThrWayVal1.dp_nominal))}, - final dTTraDHW_nominal=parStoDHW.dTLoadingHC1, - final dTTra_nominal={parStoBuf.dTLoadingHC1}, - final m_flow_nominal=mDem_flow_nominal, - final TSup_nominal=TDem_nominal .+ dTLoss_nominal .+ dTTra_nominal, - final nParallelSup=1, - final nParallelDem=1); - - parameter Modelica.Units.SI.Power Q_nom=boiNoCtrl.paramBoiler.Q_nom - "Nominal heating power"; - - parameter Modelica.Units.SI.Volume V=boiNoCtrl.paramBoiler.volume "Volume"; - - parameter Real mSup2_flow_nominal= 10; - - parameter Modelica.Units.SI.PressureDifference dpBufHCSto_nominal=0 - "Nominal pressure difference in buffer storage heating coil"; - final parameter Modelica.Units.SI.PressureDifference dpDHWHCSto_nominal=sum( - stoDHW.heatingCoil1.pipe.res.dp_nominal) - "Nominal pressure difference in DHW storage heating coil"; - parameter Modelica.Units.SI.HeatFlowRate QHRAftBuf_flow_nominal - "Nominal heat flow rate of heating rod after DHW storage" - annotation (Dialog(enable=use_heatingRodAfterBuffer)); - parameter Boolean use_heatingRodAfterBuffer "=false to disable the Boiler after the buffer storage"; - parameter Integer discretizationStepsDWHStoHR=0 - "Number of steps to dicretize. =0 modulating, =1 resembels an on-off controller. =2 would sample 0, 0.5 and 1"; - parameter Integer discretizationStepsBufStoHR=0 - "Number of steps to dicretize. =0 modulating, =1 resembels an on-off controller. =2 would sample 0, 0.5 and 1"; - replaceable parameter - BESMod.Systems.RecordsCollection.TemperatureSensors.TemperatureSensorBaseDefinition - parTemSen - annotation (choicesAllMatching=true, Placement(transformation(extent={{126,116}, - {144,130}}))); - replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve parThrWayVal1 + extends + BESMod.Systems.Hydraulical.Distribution.BaseClasses.PartialTwoStorageParallel( + final QHC2_flow_nominal=parBoi.Q_nom, + final mHC2_flow_nominal=pumpBoiler.m_flow_nominal, + final dTLoadingHC2=dTBoiDHWLoa, + stoBuf(final useHeatingCoil1=false), + final dpBufHCSto_nominal=0, + final dTLoaHCBuf=0, + final use_secHeaCoiDHWSto=true); + parameter Modelica.Units.SI.TemperatureDifference dTBoiDHWLoa = 5 + "Temperature difference for DHW storage loading with the boiler" + annotation(Dialog(group="Component data")); + parameter Real etaTem[:,2]=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15, + 0.99] "Temperature based efficiency" + annotation(Dialog(group="Component data")); + + replaceable parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition + parBoi + "Parameters for Boiler" + annotation(Placement(transformation(extent={{44,124},{58,138}})), + choicesAllMatching=true, Dialog(group="Component data")); + replaceable parameter BESMod.Systems.RecordsCollection.Movers.DefaultMover + parPum constrainedby + BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition + annotation (Dialog(group="Component data"), + choicesAllMatching=true, Placement(transformation(extent={{22,124},{36,138}}))); + replaceable parameter BESMod.Systems.RecordsCollection.Valves.ThreeWayValve parThrWayValBoi constrainedby BESMod.Systems.RecordsCollection.Valves.ThreeWayValve( - final dp_nominal={dpBufHCSto_nominal,dpDHWHCSto_nominal}, - final m_flow_nominal=mSup_flow_nominal[1], + final m_flow_nominal=m_flow_nominal[1], + final dp_nominal={0,sum(stoDHW.heatingCoil2.pipe.res.dp_nominal)}, final fraK=1, - use_inputFilter=false) annotation (choicesAllMatching=true, Placement( - transformation(extent={{-182,110},{-162,130}}))); - -replaceable - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition - parStoBuf(discretizationStepsHR=2) - constrainedby - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( - final Q_flow_nominal=Q_flow_nominal[1]*f_design[1], - final rho=rho, - final c_p=cp, - final TAmb=TAmb, - T_m=TSup_nominal[1], - final QHC1_flow_nominal=Q_flow_nominal[1]*f_design[1], - final mHC1_flow_nominal=mSup_flow_nominal[1], - redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, - final use_HC2=stoBuf.useHeatingCoil2, - final use_HC1=stoBuf.useHeatingCoil1, - final dTLoadingHC1=0, - final dTLoadingHC2=9999999, - final fHeiHC2=1, - final fDiaHC2=1, - final QHC2_flow_nominal=9999999, - final mHC2_flow_nominal=9999999, - redeclare final AixLib.DataBase.Pipes.Copper.Copper_10x0_6 pipeHC2) - annotation (choicesAllMatching=true, Placement(transformation(extent={{18,26}, - {32,40}}))); - - replaceable + use_inputFilter=false) "Parameters for three way valve of boiler" annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{66,124},{80,138}}))); + replaceable parameter BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition - parStoDHW(redeclare final AixLib.DataBase.Pipes.Copper.Copper_28x1 - pipeHC1, redeclare final AixLib.DataBase.Pipes.Copper.Copper_28x1 pipeHC2) - constrainedby - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( + parHydSep constrainedby + RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( + final Q_flow_nominal=Q_flow_nominal[1]*f_design[1], final rho=rho, final c_p=cp, + energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.APlus, final TAmb=TAmb, - final use_HC1=stoDHW.useHeatingCoil1, + T_m=TSup_nominal[1], final QHC1_flow_nominal=Q_flow_nominal[1]*f_design[1], - final V=VDHWDay, - final Q_flow_nominal=QDHW_flow_nominal, - final VPerQ_flow=0, - T_m=TDHW_nominal, final mHC1_flow_nominal=mSup_flow_nominal[1], redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, - final use_HC2=stoDHW.useHeatingCoil2, - final dTLoadingHC2=5, + final use_HC2=stoBuf.useHeatingCoil2, + final use_HC1=stoBuf.useHeatingCoil1, + final dTLoadingHC2=9999999, + final dTLoadingHC1=9999999, final fHeiHC2=1, final fDiaHC2=1, - final mHC2_flow_nominal=pumpBoiler.m_flow_nominal, - final QHC2_flow_nominal=boiNoCtrl.paramBoiler.Q_nom, + final QHC2_flow_nominal=9999999, + final mHC2_flow_nominal=9999999, redeclare final AixLib.DataBase.Pipes.Copper.Copper_10x0_6 pipeHC2) - annotation (choicesAllMatching=true, Placement(transformation(extent={{20,-62}, - {34,-48}}))); - - Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperatureBuf(final T=parStoBuf.TAmb) annotation (Placement(transformation( - extent={{-12,-12},{12,12}}, - rotation=0, - origin={-82,2}))); - Modelica.Blocks.Sources.RealExpression T_stoDHWTop(final y(unit="K", displayUnit="degC")=stoDHW.layer[ - parStoDHW.nLayer].T) annotation (Placement(transformation( - extent={{-17,-6},{17,6}}, - rotation=0, - origin={-33,70}))); - Modelica.Blocks.Sources.RealExpression T_stoBufTop(final y(unit="K", displayUnit="degC")=stoBuf.layer[ - parStoBuf.nLayer].T) annotation (Placement(transformation( - extent={{-16,-5},{16,5}}, - rotation=0, - origin={-34,87}))); - Modelica.Blocks.Sources.RealExpression T_stoBufBot(final y(unit="K", displayUnit="degC")=stoBuf.layer[1].T) - annotation (Placement(transformation( - extent={{-16,-5},{16,5}}, - rotation=0, - origin={-34,79}))); - Modelica.Blocks.Sources.RealExpression T_stoDHWBot(final y(unit="K", displayUnit="degC")=stoDHW.layer[1].T) - annotation (Placement(transformation( - extent={{-16,-5},{16,5}}, - rotation=0, - origin={-34,95}))); - - Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixedTemperatureDHW(final T=parStoDHW.TAmb) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-72,-88}))); - - AixLib.Fluid.Storage.BufferStorage stoBuf( - redeclare final package Medium = Medium, - final energyDynamics=energyDynamics, - final p_start=p_start, - final mSenFac=1, - redeclare package MediumHC1 = MediumGen, - redeclare package MediumHC2 = MediumGen, - final m1_flow_nominal=mSup_flow_nominal[1], - final m2_flow_nominal=m_flow_nominal[1], - final mHC1_flow_nominal=parStoBuf.mHC1_flow_nominal, - final mHC2_flow_nominal=parStoBuf.mHC2_flow_nominal, - useHeatingCoil1=false, - final useHeatingCoil2=false, - final useHeatingRod=parStoBuf.use_hr, - final TStart=T_start, - redeclare final BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.bufferData - data( - final hTank=parStoBuf.h, - hHC1Low=0, - hHR=parStoBuf.nLayerHR/parStoBuf.nLayer*parStoBuf.h, - final dTank=parStoBuf.d, - final sWall=parStoBuf.sIns/2, - final sIns=parStoBuf.sIns/2, - final lambdaWall=parStoBuf.lambda_ins, - final lambdaIns=parStoBuf.lambda_ins, - final rhoIns=373000, - final cIns=1000, - pipeHC1=parStoBuf.pipeHC1, - pipeHC2=parStoBuf.pipeHC2, - lengthHC1=parStoBuf.lengthHC1, - lengthHC2=parStoBuf.lengthHC2), - final n=parStoBuf.nLayer, - final hConIn=parStoBuf.hConIn, - final hConOut=parStoBuf.hConOut, - final hConHC1=parStoBuf.hConHC1, - final hConHC2=parStoBuf.hConHC2, - upToDownHC1=true, - upToDownHC2=true, - final TStartWall=T_start, - final TStartIns=T_start, - redeclare model HeatTransfer = - AixLib.Fluid.Storage.BaseClasses.HeatTransferBuoyancyWetter, - final allowFlowReversal_layers=allowFlowReversal, - final allowFlowReversal_HC1=allowFlowReversal, - final allowFlowReversal_HC2=allowFlowReversal) - annotation (Placement(transformation(extent={{-36,14},{0,58}}))); - - AixLib.Fluid.Storage.BufferStorage stoDHW( - redeclare final package Medium = MediumDHW, - final energyDynamics=energyDynamics, - final p_start=p_start, - final mSenFac=1, - redeclare final package MediumHC1 = MediumGen, - redeclare final package MediumHC2 = MediumGen, - final m1_flow_nominal=mSup_flow_nominal[1], - final m2_flow_nominal=mDHW_flow_nominal, - final mHC1_flow_nominal=parStoDHW.mHC1_flow_nominal, - final mHC2_flow_nominal=parStoDHW.mHC2_flow_nominal, - final useHeatingCoil1=true, - final useHeatingCoil2=true, - final useHeatingRod=parStoDHW.use_hr, - final TStart=T_start, - redeclare final BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.bufferData - data( - final hTank=parStoDHW.h, - hHC1Low=0, - hHR=parStoDHW.nLayerHR/parStoDHW.nLayer*parStoDHW.h, - final dTank=parStoDHW.d, - final sWall=parStoDHW.sIns/2, - final sIns=parStoDHW.sIns/2, - final lambdaWall=parStoDHW.lambda_ins, - final lambdaIns=parStoDHW.lambda_ins, - final rhoIns=373000, - final cIns=1000, - pipeHC1=parStoDHW.pipeHC1, - pipeHC2=parStoDHW.pipeHC2, - lengthHC1=parStoDHW.lengthHC1, - lengthHC2=parStoDHW.lengthHC2), - final n=parStoDHW.nLayer, - final hConIn=parStoDHW.hConIn, - final hConOut=parStoDHW.hConOut, - final hConHC1=parStoDHW.hConHC1, - final hConHC2=parStoDHW.hConHC2, - final upToDownHC1=true, - final upToDownHC2=true, - final TStartWall=T_start, - final TStartIns=T_start, - redeclare model HeatTransfer = - AixLib.Fluid.Storage.BaseClasses.HeatTransferBuoyancyWetter, - final allowFlowReversal_layers=allowFlowReversal, - final allowFlowReversal_HC1=allowFlowReversal, - final allowFlowReversal_HC2=allowFlowReversal) - annotation (Placement(transformation(extent={{-36,-74},{0,-28}}))); - - Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow QHRStoDHWPre_flow(final - T_ref=293.15, final alpha=0) if parStoDHW.use_hr annotation ( - Placement(transformation( - extent={{-7,-7},{7,7}}, - rotation=0, - origin={-69,-51}))); - Modelica.Blocks.Math.Gain gain(k=parStoDHW.QHR_flow_nominal) -if parStoDHW.use_hr - annotation (Placement(transformation(extent={{-102,-60},{-86,-42}}))); - Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow QHRStoBufPre_flow1(final - T_ref=293.15, final alpha=0) if parStoBuf.use_hr annotation ( - Placement(transformation( - extent={{-7,-7},{7,7}}, - rotation=0, - origin={-47,35}))); - Modelica.Blocks.Math.Gain gainHRBuf(k=parStoBuf.QHR_flow_nominal) -if parStoBuf.use_hr - annotation (Placement(transformation(extent={{-80,18},{-64,36}}))); - - BESMod.Systems.Hydraulical.Distribution.Components.Valves.ThreeWayValveWithFlowReturn - threeWayValveWithFlowReturn( - redeclare package Medium = MediumGen, - final energyDynamics=energyDynamics, - final p_start=p_start, - final T_start=T_start, - final X_start=X_start, - final C_start=C_start, - final C_nominal=C_nominal, - final mSenFac=mSenFac, - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parameters=parThrWayVal1) - annotation (Placement(transformation(extent={{-84,54},{-64,74}}))); - - IBPSA.Fluid.Sensors.TemperatureTwoPort senTBuiSup( - redeclare final package Medium = Medium, - final allowFlowReversal=allowFlowReversal, - m_flow_nominal=m_flow_nominal[1], - tau=parTemSen.tau, - initType=parTemSen.initType, - T_start=T_start, - final transferHeat=parTemSen.transferHeat, - TAmb=parTemSen.TAmb, - tauHeaTra=parTemSen.tauHeaTra) - "Temperature at supply for building" annotation (Placement(transformation( - extent={{5,6},{-5,-6}}, - rotation=180, - origin={87,76}))); - - BESMod.Utilities.Electrical.ZeroLoad zeroLoad - annotation (Placement(transformation(extent={{30,-108},{50,-88}}))); - AixLib.Fluid.BoilerCHP.BoilerNoControl boiNoCtrl( - redeclare package Medium = AixLib.Media.Water, + "Parameters for hydraulic separator" annotation (choicesAllMatching=true, + Placement(transformation(extent={{82,4},{96,18}}))); + AixLib.Fluid.BoilerCHP.BoilerNoControl boi( + redeclare package Medium = Medium, final allowFlowReversal=true, final m_flow_nominal=m_flow_nominal[1], final m_flow_small=1E-4*abs(m_flow_nominal[1]), final show_T=show_T, final initType=Modelica.Blocks.Types.Init.NoInit, final transferHeat=false, + final dp_nominal=m_flow_nominal[1]^2*boi.a/(rho^2), final rho_default=rho, final p_start=p_start, final T_start=T_start, - final etaLoadBased= boiNoCtrl.paramBoiler.eta, - final G=0.003*Q_nom/50, - final C=1.5*Q_nom, - final Q_nom=boiNoCtrl.paramBoiler.Q_nom, - final V=boiNoCtrl.paramBoiler.volume, - final etaTempBased=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15,0.99], - final paramBoiler=AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_15kW()) - annotation (Placement(transformation(extent={{26,84},{48,112}}))); + final etaLoadBased=parBoi.eta, + final G=0.003*parBoi.Q_nom/50, + final C=1.5*parBoi.Q_nom, + final Q_nom=parBoi.Q_nom, + final V=parBoi.volume, + final etaTempBased=etaTem, + final paramBoiler=parBoi, + T_out(unit="K", displayUnit="degC")) + "Boiler with no control" + annotation (Placement(transformation(extent={{30,50},{48,70}}))); + BESMod.Systems.Hydraulical.Distribution.Components.Valves.ThreeWayValveWithFlowReturn - threeWayValveWithFlowReturn2( - redeclare package Medium = MediumGen, + thrWayValBoiDHW( + redeclare package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, @@ -301,9 +94,10 @@ if parStoBuf.use_hr final C_nominal=C_nominal, final mSenFac=mSenFac, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parameters(m_flow_nominal=m_flow_nominal[1], dp_nominal={0, sum(stoDHW.heatingCoil2.pipe.res.dp_nominal)})) - annotation (Placement(transformation(extent={{38,48},{58,68}}))); - AixLib.Fluid.Storage.BufferStorage HydraulischeWeiche( + parameters=parThrWayValBoi) + "Three way valve to swith the boiler between DHW and building" + annotation (Placement(transformation(extent={{20,-40},{40,-20}}))); + AixLib.Fluid.Storage.BufferStorage hydSep( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, @@ -314,30 +108,30 @@ if parStoBuf.use_hr final m2_flow_nominal=m_flow_nominal[1], final mHC1_flow_nominal=parStoBuf.mHC1_flow_nominal, final mHC2_flow_nominal=parStoBuf.mHC2_flow_nominal, - useHeatingCoil1=false, + final useHeatingCoil1=false, final useHeatingCoil2=false, final useHeatingRod=false, final TStart=T_start, redeclare final BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.bufferData data( - final hTank=hydParameters.h, + final hTank=parHydSep.h, hHC1Low=0, - hHR=hydParameters.nLayerHR/hydParameters.nLayer*parStoBuf.h, - final dTank=hydParameters.d, - final sWall=hydParameters.sIns/2, - final sIns=hydParameters.sIns/2, - final lambdaWall=hydParameters.lambda_ins, - final lambdaIns=hydParameters.lambda_ins, + hHR=parHydSep.nLayerHR/parHydSep.nLayer*parStoBuf.h, + final dTank=parHydSep.d, + final sWall=parHydSep.sIns/2, + final sIns=parHydSep.sIns/2, + final lambdaWall=parHydSep.lambda_ins, + final lambdaIns=parHydSep.lambda_ins, final rhoIns=373000, final cIns=1000, - pipeHC1=hydParameters.pipeHC1, - pipeHC2=hydParameters.pipeHC2, - lengthHC1=hydParameters.lengthHC1, - lengthHC2=hydParameters.lengthHC2), - final n=hydParameters.nLayer, - final hConIn=hydParameters.hConIn, - final hConOut=hydParameters.hConOut, + pipeHC1=parHydSep.pipeHC1, + pipeHC2=parHydSep.pipeHC2, + lengthHC1=parHydSep.lengthHC1, + lengthHC2=parHydSep.lengthHC2), + final n=parHydSep.nLayer, + final hConIn=parHydSep.hConIn, + final hConOut=parHydSep.hConOut, final hConHC1=parStoBuf.hConHC1, final hConHC2=parStoBuf.hConHC2, upToDownHC1=true, @@ -348,46 +142,21 @@ if parStoBuf.use_hr AixLib.Fluid.Storage.BaseClasses.HeatTransferBuoyancyWetter, final allowFlowReversal_layers=allowFlowReversal, final allowFlowReversal_HC1=allowFlowReversal, - final allowFlowReversal_HC2=allowFlowReversal) - "Hydraulische Weiche falls Radiator Ventil zu ist und Boiler eingeschaltet wird, (damit System nicht überhitzt)" - annotation (Placement(transformation(extent={{66,58},{78,74}}))); -replaceable - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition - hydParameters constrainedby - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition( - final Q_flow_nominal=Q_flow_nominal[1]*f_design[1], - final rho=rho, - final c_p=cp, - final TAmb=TAmb, - T_m=TSup_nominal[1], - final QHC1_flow_nominal=Q_flow_nominal[1]*f_design[1], - final mHC1_flow_nominal=mSup_flow_nominal[1], - redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, - final use_HC2=stoBuf.useHeatingCoil2, - final use_HC1=stoBuf.useHeatingCoil1, - final dTLoadingHC2=9999999, - final dTLoadingHC1=9999999, - final fHeiHC2=1, - final fDiaHC2=1, - final QHC2_flow_nominal=9999999, - final mHC2_flow_nominal=9999999, - redeclare final AixLib.DataBase.Pipes.Copper.Copper_10x0_6 pipeHC2) - annotation (choicesAllMatching=true, Placement(transformation(extent={{134,26}, - {148,40}}))); + final allowFlowReversal_HC2=allowFlowReversal) "Hydraulic seperator" + annotation (Placement(transformation(extent={{60,-2},{76,18}}))); + IBPSA.Fluid.Movers.SpeedControlled_y pumpBoiler( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, - final allowFlowReversal=false, + final allowFlowReversal=allowFlowReversal, final show_T=show_T, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( + redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData + per( final speed_rpm_nominal=parPum.speed_rpm_nominal, final m_flow_nominal=m_flow_nominal[1], - final dp_nominal=boiNoCtrl.dp_nominal + 2*(threeWayValveWithFlowReturn2.parameters.dpValve_nominal - + threeWayValveWithFlowReturn2.parameters.dp_nominal[1] + - threeWayValveWithFlowReturn2.parameters.dpFixed_nominal[1]), + final dp_nominal=boi.dp_nominal + (parThrWayValBoi.dpValve_nominal + max(parThrWayValBoi.dp_nominal)), final rho=rho, final V_flowCurve=parPum.V_flowCurve, final dpCurve=parPum.dpCurve), @@ -398,205 +167,85 @@ replaceable final riseTime=parPum.riseTimeInpFilter, final init=Modelica.Blocks.Types.Init.InitialOutput, final y_start=1) annotation (Placement(transformation( - extent={{5,5},{-5,-5}}, + extent={{10,10},{-10,-10}}, rotation=180, - origin={9,65}))); - Modelica.Blocks.Sources.Constant const4(k=1) - annotation (Placement(transformation(extent={{4,84},{10,90}}))); - parameter - BESMod.Systems.RecordsCollection.Movers.DefaultMover - parPum annotation (Dialog(group="Component data"), - choicesAllMatching=true, Placement(transformation(extent={{52,152},{74,174}}))); - parameter BESMod.Systems.RecordsCollection.Movers.DefaultMover defaultMoverBA - annotation ( - Dialog(group="Component data"), - choicesAllMatching=true, - Placement(transformation(extent={{-64,158},{-30,180}}))); - Utilities.KPIs.EnergyKPICalculator KPIBoi(use_inpCon=true) - annotation (Placement(transformation(extent={{108,164},{128,184}}))); - - Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemBuf(final T= - parStoBuf.TAmb) "Constant ambient temperature of storage"; - - Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemDHW(final T= - parStoDHW.TAmb) "Constant ambient temperature of storage"; - - Utilities.KPIs.EnergyKPICalculator eneKPICalBuf(use_inpCon=false, y=fixTemBuf.port.Q_flow) - annotation (Placement(transformation(extent={{-42,-118},{-22,-98}}))); - Utilities.KPIs.EnergyKPICalculator eneKPICalDHW(use_inpCon=false, y=fixTemDHW.port.Q_flow) - annotation (Placement(transformation(extent={{-42,-158},{-22,-138}}))); + origin={10,60}))); + Modelica.Blocks.Sources.Constant constPumAlwOn(final k=1) + "Let the pump run always" + annotation (Placement(transformation(extent={{-40,120},{-20,140}}))); + + + Utilities.KPIs.EnergyKPICalculator KPIBoi1(use_inpCon=false, y=boi.thermalPower) + "Boiler heat flow KPI" + annotation (Placement(transformation(extent={{-58,-190},{-38,-170}}))); + Utilities.KPIs.EnergyKPICalculator eneKPICalAftBufBoi(use_inpCon=false, y=boi.fuelPower) + "Boiler after buffer KPIs" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={30,-140}))); +initial algorithm + assert(use_dhw, "This system can only be simulated with use_dhw=true", AssertionLevel.error); equation - connect(T_stoDHWBot.y, sigBusDistr.TStoDHWBotMea) annotation (Line(points={{-16.4, - 95},{2.5,95},{2.5,101},{0,101}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(T_stoDHWTop.y, sigBusDistr.TStoDHWTopMea) annotation (Line(points={{-14.3, - 70},{-2,70},{-2,101},{0,101}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(T_stoBufBot.y, sigBusDistr.TStoBufBotMea) annotation (Line(points={{-16.4, - 79},{0,79},{0,101}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - connect(T_stoBufTop.y, sigBusDistr.TStoBufTopMea) annotation (Line(points={{-16.4, - 87},{0,87},{0,101}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(fixedTemperatureDHW.port, stoDHW.heatportOutside) annotation ( - Line(points={{-62,-88},{14,-88},{14,-49.62},{-0.45,-49.62}},color={191,0,0})); - connect(stoBuf.heatportOutside, fixedTemperatureBuf.port) annotation ( - Line(points={{-0.45,37.32},{12,37.32},{12,2},{-70,2}},color={191,0,0})); - connect(portDHW_in, stoDHW.fluidportBottom2) annotation (Line(points={{100, - -82},{-12,-82},{-12,-74.23},{-12.825,-74.23}}, color={0,127,255})); - connect(stoDHW.heatingRod, QHRStoDHWPre_flow.port) annotation (Line( - points={{-36,-51},{-62,-51}}, - color={191,0,0}, - pattern=LinePattern.Dash)); - connect(QHRStoDHWPre_flow.Q_flow, gain.y) annotation (Line( - points={{-76,-51},{-85.2,-51}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(QHRStoBufPre_flow1.Q_flow, gainHRBuf.y) annotation (Line( - points={{-54,35},{-58,35},{-58,27},{-63.2,27}}, - color={0,0,127}, - pattern=LinePattern.Dash)); - connect(QHRStoBufPre_flow1.port, stoBuf.heatingRod) annotation (Line( - points={{-40,35},{-40,36},{-36,36}}, - color={191,0,0}, - pattern=LinePattern.Dash)); - connect(portGen_in[1], threeWayValveWithFlowReturn.portGen_a) annotation ( - Line(points={{-100,80},{-92,80},{-92,68.4},{-84,68.4}}, color={0,127,255})); - connect(portGen_out[1], threeWayValveWithFlowReturn.portGen_b) annotation ( - Line(points={{-100,40},{-96,40},{-96,38},{-92,38},{-92,60},{-84,60},{-84,60.4}}, - color={0,127,255})); - connect(threeWayValveWithFlowReturn.portDHW_b, stoDHW.portHC1In) - annotation (Line(points={{-64,60.4},{-60,60.4},{-60,60},{-46,60},{-46,-37.89}, - {-36.45,-37.89}}, color={0,127,255})); - connect(stoDHW.portHC1Out, threeWayValveWithFlowReturn.portDHW_a) - annotation (Line(points={{-36.225,-45.02},{-52,-45.02},{-52,56.4},{-64,56.4}}, - color={0,127,255})); - connect(threeWayValveWithFlowReturn.uBuf, sigBusDistr.uThrWayVal) annotation ( - Line(points={{-74,76},{-74,101},{0,101}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); - connect(senTBuiSup.T, sigBusDistr.TBuiSupMea) annotation (Line(points={{87,82.6}, - {86,82.6},{86,96},{32,96},{32,94},{28,94},{28,92},{0,92},{0,101}}, - color={0,0, - 127}), Text( - string="%second", - index=1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); - connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( - Line( - points={{50,-98},{70,-98}}, - color={0,0,0}, - thickness=1)); - connect(stoDHW.fluidportTop2, portDHW_out) annotation (Line(points={{-12.375, - -27.77},{-12.375,-20},{100,-20},{100,-22}}, color={0,127,255})); - connect(stoBuf.fluidportTop1, threeWayValveWithFlowReturn.portBui_b) - annotation (Line(points={{-24.3,58.22},{-52,58.22},{-52,62},{-56,62},{-56,72}, - {-64,72}}, color={0,127,255})); - connect(stoBuf.fluidportBottom1, threeWayValveWithFlowReturn.portBui_a) - annotation (Line(points={{-24.075,13.56},{-24.075,6},{-42,6},{-42,68},{-64,68}}, - color={0,127,255})); - connect(threeWayValveWithFlowReturn2.portGen_b, stoBuf.fluidportBottom2) - annotation (Line(points={{38,54.4},{10,54.4},{10,4},{-12.825,4},{-12.825, - 13.78}}, color={0,127,255})); - connect(threeWayValveWithFlowReturn2.portDHW_b, stoDHW.portHC2In) - annotation (Line(points={{58,54.4},{60,54.4},{60,-18},{-48,-18},{-48,-56.75}, - {-36.225,-56.75}}, color={0,127,255})); - connect(threeWayValveWithFlowReturn2.portDHW_a, stoDHW.portHC2Out) - annotation (Line(points={{58,50.4},{64,50.4},{64,-84},{-38,-84},{-38,-78},{ - -40,-78},{-40,-64.11},{-36.225,-64.11}}, - color={0,127,255})); - connect(threeWayValveWithFlowReturn2.portBui_a, HydraulischeWeiche.fluidportBottom1) - annotation (Line(points={{58,62},{64,62},{64,54},{69.975,54},{69.975,57.84}}, - color={0,127,255})); - connect(threeWayValveWithFlowReturn2.portBui_b, HydraulischeWeiche.fluidportTop1) - annotation (Line(points={{58,66},{64,66},{64,78},{69.9,78},{69.9,74.08}}, - color={0,127,255})); - connect(stoBuf.fluidportTop2, pumpBoiler.port_a) annotation (Line(points={{-12.375, - 58.22},{-12.375,65},{4,65}}, color={0,127,255})); - connect(pumpBoiler.port_b, boiNoCtrl.port_a) - annotation (Line(points={{14,65},{26,65},{26,98}}, color={0,127,255})); - connect(const4.y, pumpBoiler.y) annotation (Line(points={{10.3,87},{10.3,80}, - {9,80},{9,71}}, color={0,0,127})); - connect(boiNoCtrl.port_b, threeWayValveWithFlowReturn2.portGen_a) annotation ( - Line(points={{48,98},{54,98},{54,68},{32,68},{32,62.4},{38,62.4}}, color={ - 0,127,255})); - connect(threeWayValveWithFlowReturn2.uBuf, sigBusDistr.uThrWayVal) - annotation (Line(points={{48,70},{50,70},{50,120},{0,120},{0,101}}, color={ - 0,0,127}), Text( + connect(thrWayValBoiDHW.portBui_a, hydSep.fluidportBottom1) annotation (Line( + points={{40,-26},{68,-26},{68,-8},{65.3,-8},{65.3,-2.2}}, color={0,127,255})); + connect(thrWayValBoiDHW.portBui_b, hydSep.fluidportTop1) annotation (Line( + points={{40,-22},{56,-22},{56,22},{66,22},{66,18.1},{65.2,18.1}}, color={0, + 127,255})); + connect(pumpBoiler.port_b, boi.port_a) + annotation (Line(points={{20,60},{30,60}}, color={0,127,255})); + connect(constPumAlwOn.y, pumpBoiler.y) annotation (Line(points={{-19,130},{10,130}, + {10,72}}, color={0,0,127})); + connect(boi.port_b, thrWayValBoiDHW.portGen_a) annotation (Line(points={{48,60}, + {50,60},{50,44},{24,44},{24,-16},{20,-16},{20,-25.6}}, color={0,127,255})); + connect(thrWayValBoiDHW.uBuf, sigBusDistr.uThrWayVal) annotation (Line(points={{ + 30,-18},{30,42},{28,42},{28,100},{0,100},{0,101}}, color={0,0,127}), + Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(portBui_in[1], HydraulischeWeiche.fluidportBottom2) annotation (Line( - points={{100,40},{73.725,40},{73.725,57.92}}, color={0,127,255})); - connect(senTBuiSup.port_b, portBui_out[1]) annotation (Line(points={{92,76},{ - 96,76},{96,80},{100,80}}, color={0,127,255})); - connect(senTBuiSup.port_a, HydraulischeWeiche.fluidportTop2) annotation (Line( - points={{82,76},{73.875,76},{73.875,74.08}}, color={0,127,255})); - connect(gain.u, sigBusDistr.uHRStoDHW) annotation (Line(points={{-103.6,-51},{ - -138,-51},{-138,120},{0,120},{0,101}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(gainHRBuf.u, sigBusDistr.uHRAftBuf) annotation (Line(points={{-81.6,27}, - {-118,27},{-118,101},{0,101}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(boiNoCtrl.T_out, sigBusDistr.TBoilerOutDistribution) annotation (Line( - points={{44.92,102.48},{68,102.48},{68,140},{0,140},{0,101}}, color={0, - 0,127}), Text( + connect(portBui_in[1], hydSep.fluidportBottom2) annotation (Line(points={{100,40}, + {86,40},{86,22},{100,22},{100,-8},{70.3,-8},{70.3,-2.1}}, + color={0,127,255})); + connect(senTBuiSup.port_b, portBui_out[1]) annotation (Line(points={{86,80},{96, + 80},{96,80},{100,80}}, color={0,127,255})); + connect(thrWayValBoiDHW.portGen_b, stoBuf.fluidportBottom2) annotation (Line( + points={{20,-33.6},{14,-33.6},{14,-6},{-29.4,-6},{-29.4,-0.2}}, color={0,127, + 255})); + connect(stoBuf.fluidportTop2, pumpBoiler.port_a) + annotation (Line(points={{-29,40.2},{-29,60},{0,60}}, color={0,127,255})); + connect(hydSep.fluidportTop2, senTBuiSup.port_a) annotation (Line(points={{70.5, + 18.1},{70.5,66},{58,66},{58,80},{66,80}}, color={0,127,255})); + connect(eneKPICalAftBufBoi.KPI, outBusDist.PBoiAftBuf) annotation (Line(points={{17.8, + -140},{0,-140},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(boiNoCtrl.thermalPower, KPIBoi.u) annotation (Line(points={{44.92, - 109.76},{44.92,108},{106.2,108},{106.2,174}}, color={0,0,127})); - connect(sigBusDistr.yBoilerDistribution, boiNoCtrl.u_rel) annotation (Line( - points={{0,101},{0,136},{30,136},{30,118},{29.3,118},{29.3,107.8}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(eneKPICalDHW.KPI, outBusDist.QDHWLos_flow) annotation (Line(points={{-19.8, - -148},{-19.8,-120},{-14,-120},{-14,-86},{0,-86},{0,-100}}, - color={135,135,135}), Text( + connect(KPIBoi1.KPI, outBusDist.QBoi_flow) annotation (Line(points={{-35.8,-180}, + {0,-180},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(eneKPICalBuf.KPI, outBusDist.QBufLos_flow) annotation (Line(points={{-19.8, - -108},{-18,-108},{-18,-86},{0,-86},{0,-100}}, - color={135,135,135}), Text( + connect(boi.T_out, sigBusDistr.TBoiOut) annotation (Line(points={{45.48,63.2},{45.48, + 66},{50,66},{50,74},{28,74},{28,101},{0,101}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIBoi.KPI, outBusDist.QBoi_Distribution_flow) annotation (Line( - points={{130.2,174},{176,174},{176,-156},{0,-156},{0,-100}}, color={135, - 135,135}), Text( + connect(boi.u_rel, sigBusDistr.yBoi) annotation (Line(points={{32.7,67},{32.7,66}, + {28,66},{28,102},{16,102},{16,101},{0,101}}, + color={0,0,127}), Text( string="%second", index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(thrWayValBoiDHW.portDHW_b, stoDHW.portHC2In) annotation (Line(points={{40, + -33.6},{46,-33.6},{46,-34},{50,-34},{50,-80},{-54,-80},{-54,-55},{-50.2, + -55}}, color={0,127,255})); + connect(stoDHW.portHC2Out, thrWayValBoiDHW.portDHW_a) annotation (Line(points={{ + -50.2,-61.4},{-50.2,-62},{-52,-62},{-52,-74},{44,-74},{44,-37.6},{40,-37.6}}, + color={0,127,255})); end TwoStoragesBoilerWithDHW; diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo index e942f22b..ba61c17e 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo @@ -32,7 +32,9 @@ model PartialHeatPumpAndGasBoiler "Partial heat pump and boiler" final Q_nom=parBoi.Q_nom, final V=parBoi.volume, final etaTempBased=etaTem, - final paramBoiler=parBoi) "Boiler with external control" + final paramBoiler=parBoi, + T_out(unit="K", displayUnit="degC")) + "Boiler with external control" annotation (Placement(transformation(extent={{20,40},{40,60}}))); Utilities.KPIs.EnergyKPICalculator KPIBoi(use_inpCon=false, y=boi.thermalPower) diff --git a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo index 41bc0263..090a3342 100644 --- a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo @@ -37,7 +37,10 @@ model GasBoiler "Just a gas boiler" final p_start=p_start, final T_start=T_start, paramBoiler=parBoi, - etaTempBased=etaTem) "Boiler with external control" + etaTempBased=etaTem, + T_out(unit="K", displayUnit="degC"), + T_in(unit="K", displayUnit="degC")) + "Boiler with external control" annotation (Placement(transformation(extent={{-66,-6},{-34,26}}))); diff --git a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo index 2e5f335e..49529d11 100644 --- a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo +++ b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo @@ -35,13 +35,15 @@ partial model PartialTransfer "Partial transfer model for BES" parameter Modelica.Units.SI.Height hBui "Height of building" annotation ( Dialog(group= "Design - Top Down: Parameters are given by the parent system")); - + parameter Real nHeaTra "Exponent of heat transfer system" + annotation (Dialog( + group="Design - Bottom Up: Parameters are defined by the subsystem")); Modelica.Fluid.Interfaces.FluidPort_b portTra_out[nParallelSup](redeclare final package Medium = Medium) "Outlet of the transfer system" annotation (Placement(transformation(extent={{-110,-52},{-90,-32}}), iconTransformation(extent={{-110,-52},{-90,-32}}))); - Modelica.Fluid.Interfaces.FluidPort_a portTra_in[nParallelSup](redeclare - final package Medium = Medium) "Inlet to the transfer system" annotation ( + Modelica.Fluid.Interfaces.FluidPort_a portTra_in[nParallelSup](redeclare final + package Medium = Medium) "Inlet to the transfer system" annotation ( Placement(transformation(extent={{-110,28},{-90,48}}), iconTransformation( extent={{-110,30},{-90,50}}))); Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPortRad[nParallelDem] diff --git a/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo index 74211424..d51d506c 100644 --- a/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo +++ b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo @@ -2,6 +2,7 @@ within BESMod.Systems.Hydraulical.Transfer; model IdealValveRadiator "Subsystem using a radiator and ideal thermostatic valves" extends BaseClasses.PartialTransfer( + final nHeaTra=radParameters.n, final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, final dTLoss_nominal=fill(0, nParallelDem), final nParallelSup=1, diff --git a/BESMod/Systems/Hydraulical/Transfer/NoHeatTransfer.mo b/BESMod/Systems/Hydraulical/Transfer/NoHeatTransfer.mo index 8712ec9f..77dd6ec6 100644 --- a/BESMod/Systems/Hydraulical/Transfer/NoHeatTransfer.mo +++ b/BESMod/Systems/Hydraulical/Transfer/NoHeatTransfer.mo @@ -1,6 +1,7 @@ within BESMod.Systems.Hydraulical.Transfer; model NoHeatTransfer "No heat tranfser to building" extends BaseClasses.PartialTransfer( + final nHeaTra=1, dp_nominal=fill(0, nParallelDem), dTTra_nominal=fill(0, nParallelDem)); Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow fixedHeatFlow[ diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index 9bc29f8f..49606de9 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -2,6 +2,7 @@ within BESMod.Systems.Hydraulical.Transfer; model RadiatorPressureBased "Pressure Based transfer system" // Abui =1 and hBui =1 to avaoid warnings, will be overwritten anyway extends BaseClasses.PartialTransfer( + nHeaTra=radParameters.n, ABui=1, hBui=1, final dp_nominal=transferDataBaseDefinition.dp_nominal, diff --git a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferControlBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferControlBaseDataDefinition.mo new file mode 100644 index 00000000..dc49fe15 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferControlBaseDataDefinition.mo @@ -0,0 +1,6 @@ +within BESMod.Systems.Hydraulical.Transfer.RecordsCollection; +record TransferControlBaseDataDefinition + "Custom transfer control data record" + extends BESMod.Systems.RecordsCollection.SubsystemControlBaseDataDefinition; + parameter Real nHeaTra "Exponent of heat transfer system"; +end TransferControlBaseDataDefinition; diff --git a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/package.order b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/package.order index 2e926428..1c937acf 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/package.order @@ -3,3 +3,4 @@ RadiatorTransferData SteelRadiatorStandardPressureLossData UFHData DefaultUFHData +TransferControlBaseDataDefinition diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index 3a16d768..28e80787 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -1,6 +1,7 @@ within BESMod.Systems.Hydraulical.Transfer; model UFHTransferSystem - extends BaseClasses.PartialTransfer(final nParallelSup=1, final dp_nominal=fill(0, nParallelDem)); + extends BaseClasses.PartialTransfer( + nHeaTra=1, final nParallelSup=1, final dp_nominal=fill(0, nParallelDem)); IBPSA.Fluid.FixedResistances.PressureDrop res[nParallelDem]( redeclare package Medium = Medium, @@ -181,4 +182,7 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); + annotation (Documentation(info=" +

According to https://www.energie-lexikon.info/heizkoerperexponent.html, the heating transfer exponent of underfloor heating systems is between 1 and 1.1.

+")); end UFHTransferSystem; diff --git a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo index decb63a7..0ba1f21d 100644 --- a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo +++ b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo @@ -78,7 +78,7 @@ equation 127})); connect(realExpression.y, QCon_flow) annotation (Line(points={{51,82},{88,82}, {88,60},{110,60}}, color={0,0,127})); - connect(const3.y, heatingCurve.TSetRoom) annotation (Line(points={{-79,-90},{ + connect(const3.y,heatingCurve.TZoneSet) annotation (Line(points={{-79,-90},{ -78,-90},{-78,-92},{-9,-92},{-9,-84.2}}, color={0,0, 127})); connect(generation.weaBus, weaBus) annotation (Line( From 93c39322fbd99633621af4588dd4b05e7057c2b7 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 9 Aug 2023 08:48:39 +0200 Subject: [PATCH 077/131] save all models --- BESMod/Examples/BAUSimStudy/PartialCase.mo | 6 +----- BESMod/Examples/HeatPumpAndBoiler.mo | 9 ++------- .../PartialModelicaConferenceUseCase.mo | 8 +------- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index c6e13b08..87b6cfeb 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -16,7 +16,6 @@ partial model PartialCase BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal /5000, @@ -30,14 +29,12 @@ partial model PartialCase redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen), - redeclare Systems.Hydraulical.Control.ConstHys_PI_ConOut_HPSController - control( + redeclare Systems.Hydraulical.Control.MonoenergeticHeatPumpSystem control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled thermostaticValveController, @@ -84,7 +81,6 @@ partial model PartialCase BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData transferDataBaseDefinition, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, diff --git a/BESMod/Examples/HeatPumpAndBoiler.mo b/BESMod/Examples/HeatPumpAndBoiler.mo index c7831ea2..d6f2948b 100644 --- a/BESMod/Examples/HeatPumpAndBoiler.mo +++ b/BESMod/Examples/HeatPumpAndBoiler.mo @@ -335,7 +335,6 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ parameterStudy.QHP_flow_biv, @@ -349,7 +348,6 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare @@ -358,6 +356,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" redeclare Systems.Hydraulical.Control.NewControlBivalentSystem_BoilerAfterBuffer control( + TSetDHW( triggerEvery(displayUnit="d") = 259200), redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled thermostaticValveController, @@ -369,22 +368,19 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" bivalentControlData(TBiv=parameterStudy.TBiv), redeclare Systems.Hydraulical.Control.Components.DHWSetControl.AntiLegionellaControl - TSet_DHW(triggerEvery(displayUnit="d") = 259200), + TSet_DHW, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl safetyControl, TCutOff=parameterStudy.TCutOff, QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, - CheckTCut_Off(threshold=parameterStudy.TCutOff)), redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithDHW distribution( designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.FullStorage, - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parThrWayVal, redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, QDHWStoLoss_flow=1, VStoDHW(displayUnit="l") = 0.1, @@ -409,7 +405,6 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 2488f5f2..16b86c9b 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -10,7 +10,6 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.Electrical.Generation.PVSystemMultiSub generation( redeclare model CellTemperature = AixLib.Electrical.PVSystem.BaseClasses.CellTemperatureMountingContactToGround, - redeclare AixLib.DataBase.SolarElectric.SchuecoSPV170SME1 pVParameters, lat=weaDat.lat, lon=weaDat.lon, @@ -18,7 +17,6 @@ partial model PartialModelicaConferenceUseCase timZon=3600, ARoo=building.ARoo/2), redeclare BESMod.Systems.Electrical.Transfer.NoElectricalTransfer transfer, - redeclare BESMod.Systems.Electrical.Control.NoControl control), redeclare BESMod.Systems.Control.DHWSuperheating control(TSetDHW= systemParameters.TSetDHW), @@ -32,7 +30,6 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=271.15, scalingFactor=scalingFactorHP, dpCon_nominal=0, @@ -48,8 +45,7 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen), - redeclare - BESMod.Systems.Hydraulical.Control.ConstHys_PI_ConOut_HPSController + redeclare BESMod.Systems.Hydraulical.Control.MonoenergeticHeatPumpSystem control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled @@ -67,7 +63,6 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW TSet_DHW, supCtrlTypeDHWSet=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal), - redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( redeclare @@ -85,7 +80,6 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare Systems.Demand.DHW.DHW DHW( energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare final BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM From 853c6e52f0ecc7d7d4ad5f4f4c8ea240958e856c Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 9 Aug 2023 08:50:05 +0200 Subject: [PATCH 078/131] rename control parameters --- .../BaseClasses/PartialHydraulicSystem.mo | 6 +++--- .../Control/BaseClasses/PartialControl.mo | 6 +++--- .../PartialHeatPumpSystemController.mo | 20 +++++++++---------- .../PartialThermostaticValveControl.mo | 2 +- .../Control/BivalentPartParallel.mo | 4 ++-- .../Systems/Hydraulical/Control/GasBoiler.mo | 14 ++++++------- .../Control/NewControlBivalentParallel.mo | 4 ++-- .../Control/NewControlBivalentSerial.mo | 4 ++-- ...ControlBivalentSystem_BoilerAfterBuffer.mo | 4 ++-- .../BaseClasses/PartialVentilationSystem.mo | 4 ++-- .../Control/BaseClasses/PartialControl.mo | 4 ++-- .../Ventilation/Control/SummerPIDByPass.mo | 4 ++-- 12 files changed, 38 insertions(+), 38 deletions(-) diff --git a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo index 80c9fed6..577e82b9 100644 --- a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo +++ b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo @@ -44,7 +44,7 @@ partial model PartialHydraulicSystem replaceable BESMod.Systems.Hydraulical.Control.BaseClasses.PartialControl control constrainedby Control.BaseClasses.PartialControl( final use_dhw=use_dhw, - final generationParameters( + final parGen( final nParallelDem=generation.nParallelDem, final nParallelSup=generation.nParallelSup, final Q_flow_nominal=generation.Q_flow_nominal, @@ -57,7 +57,7 @@ partial model PartialHydraulicSystem final dTLoss_nominal=generation.dTLoss_nominal, final f_design=generation.f_design, final QLoss_flow_nominal=generation.QLoss_flow_nominal), - final distributionParameters( + final parDis( final nParallelDem=distribution.nParallelDem, final nParallelSup=distribution.nParallelSup, final Q_flow_nominal=distribution.Q_flow_nominal, @@ -78,7 +78,7 @@ partial model PartialHydraulicSystem final dTTraDHW_nominal=distribution.dTTraDHW_nominal, final tCrit=hydraulicSystemParameters.tCrit, final QCrit=hydraulicSystemParameters.QCrit), - final transferParameters( + final parTra( final nParallelDem=transfer.nParallelDem, final nParallelSup=transfer.nParallelSup, final Q_flow_nominal=transfer.Q_flow_nominal, diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo index 36d7579f..948fe4fd 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo @@ -22,13 +22,13 @@ partial model PartialControl "Partial controller for HPS" Interfaces.TransferControlBus sigBusTra annotation (Placement(transformation(extent={{152,-124},{196,-76}}))); replaceable parameter BESMod.Systems.RecordsCollection.SubsystemControlBaseDataDefinition - generationParameters "Parameters of generation subsystem" + parGen "Parameters of generation subsystem" annotation (Placement(transformation(extent={{-194,-106},{-174,-86}}))); replaceable parameter BESMod.Systems.Hydraulical.Distribution.RecordsCollection.DistributionControlBaseDataDefinition - distributionParameters "Parameters of distribution subsystem" + parDis "Parameters of distribution subsystem" annotation (Placement(transformation(extent={{-36,-108},{-16,-88}}))); replaceable parameter BESMod.Systems.Hydraulical.Transfer.RecordsCollection.TransferControlBaseDataDefinition - transferParameters "Parameters of transfer subsystem" + parTra "Parameters of transfer subsystem" annotation (Placement(transformation(extent={{138,-108},{158,-88}}))); BESMod.Systems.Interfaces.UseProBus useProBus annotation ( Placement(transformation(extent={{-140,80},{-98,126}}), diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo index ea0d72b9..f3292739 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo @@ -24,7 +24,7 @@ partial model PartialHeatPumpSystemController BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW constrainedby BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control( - final TSetDHW_nominal=distributionParameters.TDHW_nominal) + final TSetDHW_nominal=parDis.TDHW_nominal) "DHW set temperture module" annotation (choicesAllMatching=true); replaceable BESMod.Systems.Hydraulical.Control.RecordsCollection.HeatPumpSafetyControl @@ -34,9 +34,9 @@ partial model PartialHeatPumpSystemController replaceable parameter RecordsCollection.BivalentHeatPumpControlDataDefinition bivalentControlData constrainedby RecordsCollection.BivalentHeatPumpControlDataDefinition( - final TOda_nominal=generationParameters.TOda_nominal, - TSup_nominal=generationParameters.TSup_nominal[1], - TSetRoomConst=sum(transferParameters.TDem_nominal)/transferParameters.nParallelDem) + final TOda_nominal=parGen.TOda_nominal, + TSup_nominal=parGen.TSup_nominal[1], + TSetRoomConst=sum(parTra.TDem_nominal)/parTra.nParallelDem) "Parameters for bivalent control" annotation (choicesAllMatching=true, Placement(transformation(extent={{-96,-36}, {-82,-22}}))); @@ -91,12 +91,12 @@ partial model PartialHeatPumpSystemController rotation=180, origin={170,64}))); Components.BuildingAndDHWControl buiAndDHWCtr( - final nZones=transferParameters.nParallelDem, - final TSup_nominal=max(transferParameters.TSup_nominal), - final TRet_nominal=max(transferParameters.TSup_nominal - transferParameters.dTTra_nominal), - final TOda_nominal=generationParameters.TOda_nominal, - final TSetDHW_nominal=distributionParameters.TDHW_nominal, - final nHeaTra=transferParameters.nHeaTra, + final nZones=parTra.nParallelDem, + final TSup_nominal=max(parTra.TSup_nominal), + final TRet_nominal=max(parTra.TSup_nominal - parTra.dTTra_nominal), + final TOda_nominal=parGen.TOda_nominal, + final TSetDHW_nominal=parDis.TDHW_nominal, + final nHeaTra=parTra.nHeaTra, final supCtrHeaCurTyp=supCtrHeaCurTyp, final supCtrDHWTyp=supCtrDHWTyp, redeclare final model DHWHysteresis = DHWHysteresis, diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo index 6522913e..33c86c53 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo @@ -6,7 +6,7 @@ partial model PartialThermostaticValveControl BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.BaseClasses.PartialThermostaticValveController thermostaticValveController constrainedby BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.BaseClasses.PartialThermostaticValveController( - final nZones=transferParameters.nParallelDem, final leakageOpening= + final nZones=parTra.nParallelDem, final leakageOpening= parTheVal.leakageOpening) annotation ( choicesAllMatching=true, Placement(transformation(extent={{122,-78},{138, -62}}))); diff --git a/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo b/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo index b9354f50..2814d917 100644 --- a/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo +++ b/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo @@ -16,7 +16,7 @@ model BivalentPartParallel TBiv=bivalentControlData.TBiv, TOda_nominal=bivalentControlData.TOda_nominal, TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), + QDem_flow_nominal=sum(parTra.Q_flow_nominal), QHP_flow_cutOff=QHP_flow_cutOff), redeclare BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent @@ -26,7 +26,7 @@ model BivalentPartParallel TBiv=bivalentControlData.TBiv, TOda_nominal=bivalentControlData.TOda_nominal, TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), + QDem_flow_nominal=sum(parTra.Q_flow_nominal), QHP_flow_cutOff=QHP_flow_cutOff)); parameter Modelica.Units.SI.Temperature TCutOff "Cut-off temperature"; diff --git a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo index 4e8af717..d43b353c 100644 --- a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo @@ -8,7 +8,7 @@ model GasBoiler "PI Control of gas boiler" dTOffSet_HC=monovalentControlParas.dTOffSetHeatCurve) annotation (Placement(transformation(extent={{-220,20},{-200,40}}))); BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW - TSet_DHW(TSetDHW_nominal=distributionParameters.TDHW_nominal) if use_dhw + TSet_DHW(TSetDHW_nominal=parDis.TDHW_nominal) if use_dhw annotation (Placement(transformation(extent={{-220,80},{-200,100}}))); replaceable BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController @@ -26,7 +26,7 @@ model GasBoiler "PI Control of gas boiler" monovalentControlParas.dTHysDHW, pre_y_start=true) if use_dhw "Generates the on/off signal depending on the temperature inputs" annotation (Placement(transformation(extent={{-160,40},{-140,60}}))); - Modelica.Blocks.Sources.Constant const_dT_loading(k=distributionParameters.dTTra_nominal[1]) + Modelica.Blocks.Sources.Constant const_dT_loading(k=parDis.dTTra_nominal[1]) annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=180, @@ -41,7 +41,7 @@ model GasBoiler "PI Control of gas boiler" annotation (Placement(transformation(extent={{-10,-10},{10,10}}, rotation=0, origin={10,70}))); - Modelica.Blocks.Sources.Constant const_dT_loading1(k=distributionParameters.dTTraDHW_nominal + Modelica.Blocks.Sources.Constant const_dT_loading1(k=parDis.dTTraDHW_nominal + monovalentControlParas.dTHysDHW /2) if use_dhw annotation (Placement(transformation( extent={{10,10},{-10,-10}}, @@ -52,9 +52,9 @@ model GasBoiler "PI Control of gas boiler" replaceable parameter RecordsCollection.BivalentHeatPumpControlDataDefinition monovalentControlParas constrainedby RecordsCollection.BivalentHeatPumpControlDataDefinition( - TOda_nominal=generationParameters.TOda_nominal, - TSup_nominal=generationParameters.TSup_nominal[1], - TSetRoomConst=transferParameters.TDem_nominal[1], + TOda_nominal=parGen.TOda_nominal, + TSup_nominal=parGen.TSup_nominal[1], + TSetRoomConst=parTra.TDem_nominal[1], final TBiv=monovalentControlParas.TOda_nominal) annotation (choicesAllMatching=true, Placement(transformation(extent={{-218, -36},{-204,-22}}))); @@ -67,7 +67,7 @@ model GasBoiler "PI Control of gas boiler" annotation (Placement(transformation(extent={{46,48},{66,68}}))); Modelica.Blocks.Math.BooleanToReal booleanToReal annotation (Placement(transformation(extent={{40,0},{60,20}}))); - Modelica.Blocks.Math.MinMax minMax(nu=transferParameters.nParallelDem) + Modelica.Blocks.Math.MinMax minMax(nu=parTra.nParallelDem) annotation (Placement(transformation(extent={{-240,50},{-220,70}}))); Modelica.Blocks.Logical.Not bufOn if use_dhw "buffer is charged" annotation (Placement( diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo index 9ce4703d..2da226c4 100644 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo @@ -16,7 +16,7 @@ model NewControlBivalentParallel TBiv=bivalentControlData.TBiv, TOda_nominal=bivalentControlData.TOda_nominal, TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), + QDem_flow_nominal=sum(parTra.Q_flow_nominal), QHP_flow_cutOff=QHP_flow_cutOff), redeclare BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent @@ -26,7 +26,7 @@ model NewControlBivalentParallel TBiv=bivalentControlData.TBiv, TOda_nominal=bivalentControlData.TOda_nominal, TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), + QDem_flow_nominal=sum(parTra.Q_flow_nominal), QHP_flow_cutOff=QHP_flow_cutOff)); parameter Modelica.Units.SI.Temperature TCutOff "Cut-off temperature"; diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo index 13b0859f..2e4ef2d6 100644 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo @@ -16,7 +16,7 @@ model NewControlBivalentSerial TBiv=bivalentControlData.TBiv, TOda_nominal=bivalentControlData.TOda_nominal, TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), + QDem_flow_nominal=sum(parTra.Q_flow_nominal), QHP_flow_cutOff=QHP_flow_cutOff), redeclare BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent @@ -26,7 +26,7 @@ model NewControlBivalentSerial TBiv=bivalentControlData.TBiv, TOda_nominal=bivalentControlData.TOda_nominal, TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), + QDem_flow_nominal=sum(parTra.Q_flow_nominal), QHP_flow_cutOff=QHP_flow_cutOff)); parameter Modelica.Units.SI.Temperature TCutOff "Cut-off temperature"; diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo index 7b601b50..85c19310 100644 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo @@ -16,7 +16,7 @@ model NewControlBivalentSystem_BoilerAfterBuffer TBiv=bivalentControlData.TBiv, TOda_nominal=bivalentControlData.TOda_nominal, TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), + QDem_flow_nominal=sum(parTra.Q_flow_nominal), QHP_flow_cutOff=QHP_flow_cutOff), redeclare BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent @@ -26,7 +26,7 @@ model NewControlBivalentSystem_BoilerAfterBuffer TBiv=bivalentControlData.TBiv, TOda_nominal=bivalentControlData.TOda_nominal, TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(transferParameters.Q_flow_nominal), + QDem_flow_nominal=sum(parTra.Q_flow_nominal), QHP_flow_cutOff=QHP_flow_cutOff)); parameter Modelica.Units.SI.Temperature TCutOff "Cut-off temperature"; diff --git a/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo b/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo index 1d09b092..c51eae85 100644 --- a/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo +++ b/BESMod/Systems/Ventilation/BaseClasses/PartialVentilationSystem.mo @@ -66,7 +66,7 @@ partial model PartialVentilationSystem replaceable Control.BaseClasses.PartialControl control constrainedby Control.BaseClasses.PartialControl( - final generationParameters( + final parGen( final nParallelDem=generation.nParallelDem, final nParallelSup=generation.nParallelSup, final Q_flow_nominal=generation.Q_flow_nominal, @@ -79,7 +79,7 @@ partial model PartialVentilationSystem final dTLoss_nominal=generation.dTLoss_nominal, final f_design=generation.f_design, final QLoss_flow_nominal=generation.QLoss_flow_nominal), - final distributionParameters( + final parDis( final nParallelDem=distribution.nParallelDem, final nParallelSup=distribution.nParallelSup, final Q_flow_nominal=distribution.Q_flow_nominal, diff --git a/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo index 893befce..83fcbc3f 100644 --- a/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo @@ -6,13 +6,13 @@ partial model PartialControl are not available in open modelica" annotation(Dialog(tab="Advanced")); replaceable parameter BESMod.Systems.RecordsCollection.SubsystemControlBaseDataDefinition - distributionParameters constrainedby + parDis constrainedby BESMod.Systems.RecordsCollection.SubsystemControlBaseDataDefinition annotation (Placement(transformation(extent={{-94,-100},{-74,-80}})), choicesAllMatching=true); replaceable parameter BESMod.Systems.RecordsCollection.SubsystemControlBaseDataDefinition - generationParameters constrainedby + parGen constrainedby BESMod.Systems.RecordsCollection.SubsystemControlBaseDataDefinition annotation (Placement(transformation(extent={{30,-100},{50,-80}})), choicesAllMatching=true); diff --git a/BESMod/Systems/Ventilation/Control/SummerPIDByPass.mo b/BESMod/Systems/Ventilation/Control/SummerPIDByPass.mo index 61b03579..83d13d94 100644 --- a/BESMod/Systems/Ventilation/Control/SummerPIDByPass.mo +++ b/BESMod/Systems/Ventilation/Control/SummerPIDByPass.mo @@ -10,9 +10,9 @@ model SummerPIDByPass "Bypass the HEX in summer" "Bypass is not used" annotation (Placement(transformation(extent={{-6,-54},{14,-34}}))); - Modelica.Blocks.Math.MinMax minMaxMea(final nu=distributionParameters.nParallelDem) + Modelica.Blocks.Math.MinMax minMaxMea(final nu=parDis.nParallelDem) annotation (Placement(transformation(extent={{-88,32},{-68,52}}))); - Modelica.Blocks.Math.MinMax minMaxSet(final nu=distributionParameters.nParallelDem) + Modelica.Blocks.Math.MinMax minMaxSet(final nu=parDis.nParallelDem) annotation (Placement(transformation(extent={{-78,-50},{-58,-30}}))); equation connect(summerByPass.TOda, weaBus.TDryBul) annotation (Line(points={{-35.2,26}, From 25a4437b5a9f2db0ef8d78f0bef131c76e9150c8 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Thu, 10 Aug 2023 15:47:26 +0200 Subject: [PATCH 079/131] further renaming --- ...r.mo => PartialHybridHeatPumpSystemController.mo} | 8 ++++---- .../Hydraulical/Control/BaseClasses/package.order | 2 +- .../Hydraulical/Control/BivalentPartParallel.mo | 2 +- .../BaseClasses/PartialOnOffController.mo | 4 ++-- .../OnOffController/Examples/OnOffControllerTest.mo | 12 ++++++------ .../Control/MonoenergeticHeatPumpSystem.mo | 2 +- .../Control/NewControlBivalentParallel.mo | 2 +- .../Hydraulical/Control/NewControlBivalentSerial.mo | 4 ++-- .../NewControlBivalentSystem_BoilerAfterBuffer.mo | 2 +- .../Generation/BaseClasses/PartialHeatPump.mo | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) rename BESMod/Systems/Hydraulical/Control/BaseClasses/{PartialTwoPoint_HPS_Controller_BivalentBoiler.mo => PartialHybridHeatPumpSystemController.mo} (62%) diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHybridHeatPumpSystemController.mo similarity index 62% rename from BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo rename to BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHybridHeatPumpSystemController.mo index 5070d352..f64a8491 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialTwoPoint_HPS_Controller_BivalentBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHybridHeatPumpSystemController.mo @@ -1,12 +1,12 @@ within BESMod.Systems.Hydraulical.Control.BaseClasses; -partial model PartialTwoPoint_HPS_Controller_BivalentBoiler +partial model PartialHybridHeatPumpSystemController "Partial model with replaceable blocks for rule based control of HPS using Boiler" extends BESMod.Systems.Hydraulical.Control.BaseClasses.PartialHeatPumpSystemController; Components.BoilerInHybridSystem boilerInHybridSystem - annotation (Placement(transformation(extent={{-60,-20},{-12,0}}))); + annotation (Placement(transformation(extent={{-30,-20},{-12,0}}))); equation connect(boilerInHybridSystem.secGen, buiAndDHWCtr.secGen) annotation (Line( - points={{-64.8,-6},{-110,-6},{-110,37.5},{-118,37.5}}, color={255,0,255})); -end PartialTwoPoint_HPS_Controller_BivalentBoiler; + points={{-31.8,-6},{-110,-6},{-110,37.5},{-118,37.5}}, color={255,0,255})); +end PartialHybridHeatPumpSystemController; diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order index d2523321..aa846ab1 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order @@ -1,4 +1,4 @@ PartialControl PartialThermostaticValveControl PartialHeatPumpSystemController -PartialTwoPoint_HPS_Controller_BivalentBoiler +PartialHybridHeatPumpSystemController diff --git a/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo b/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo index 2814d917..dfe276a3 100644 --- a/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo +++ b/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo @@ -34,7 +34,7 @@ model BivalentPartParallel equation connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( - Line(points={{97,61.2},{97,-56},{-152,-56},{-152,-99}}, color={0,0,127}), + Line(points={{110,80.4},{110,-56},{-152,-56},{-152,-99}},color={0,0,127}), Text( string="%second", index=1, diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/PartialOnOffController.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/PartialOnOffController.mo index 301ab975..064e266b 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/PartialOnOffController.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/PartialOnOffController.mo @@ -24,8 +24,8 @@ partial model PartialOnOffController "Partial model for an on off controller" "Turn the auxilliar heater on or off" annotation (Placement(transformation( extent={{100,-70},{120,-50}}), iconTransformation(extent={{100,-64},{ 128,-36}}))); - Modelica.Blocks.Interfaces.RealInput TOda "Ambient air temperature" annotation - (Placement(transformation( + Modelica.Blocks.Interfaces.RealInput TOda "Ambient air temperature" annotation ( + Placement(transformation( extent={{-20,-20},{20,20}}, rotation=270, origin={0,120}), iconTransformation( diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/OnOffControllerTest.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/OnOffControllerTest.mo index e3215eec..acf3ce51 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/OnOffControllerTest.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/OnOffControllerTest.mo @@ -29,13 +29,13 @@ equation 127})); connect(T_Set.y, floatingHysteresis.TSupSet) annotation (Line(points={{-122.2,-2}, {-86,-2},{-86,-94},{-5,-94},{-5,-77.9}}, color={0,0,127})); - connect(T_Set.y, constantHysteresisTimeBasedHR.TSupSet) annotation (Line(points - ={{-122.2,-2},{-112,-2},{-112,-4},{-80,-4},{-80,32},{-6,32},{-6,40}}, + connect(T_Set.y, constantHysteresisTimeBasedHR.TSupSet) annotation (Line(points= + {{-122.2,-2},{-112,-2},{-112,-4},{-80,-4},{-80,32},{-6,32},{-6,40}}, color={0,0,127})); - connect(T_Top.y, constantHysteresisTimeBasedHR.TStoTop) annotation (Line(points - ={{-120.1,63},{-44,63},{-44,76},{-30.2,76}}, color={0,0,127})); - connect(T_Top.y, constantHysteresisTimeBasedHR.TStoBot) annotation (Line(points - ={{-120.1,63},{-72,63},{-72,40},{-44,40},{-44,52},{-30.2,52}}, color={0,0, + connect(T_Top.y, constantHysteresisTimeBasedHR.TStoTop) annotation (Line(points= + {{-120.1,63},{-44,63},{-44,76},{-30.2,76}}, color={0,0,127})); + connect(T_Top.y, constantHysteresisTimeBasedHR.TStoBot) annotation (Line(points= + {{-120.1,63},{-72,63},{-72,40},{-44,40},{-44,52},{-30.2,52}}, color={0,0, 127})); connect(T_Top.y, degreeMinuteController.TStoTop) annotation (Line(points={{-120.1, 63},{-96,63},{-96,16},{-28.1,16}}, color={0,0,127})); diff --git a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo index 1463a063..6b96f560 100644 --- a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo +++ b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Control; model MonoenergeticHeatPumpSystem - "Control for HPS with on/off heating rod" + "Monoenergetic HPS with on/off heating rod" extends BaseClasses.PartialHeatPumpSystemController; Modelica.Blocks.Sources.Constant constZero(final k=0) annotation (Placement( diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo index 2da226c4..7282d15c 100644 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Control; model NewControlBivalentParallel "Bivalent Parallel Generation Control Class (Part-parallel PI controlled HPS according to condenser outflow)" - extends BaseClasses.PartialTwoPoint_HPS_Controller_BivalentBoiler( + extends BaseClasses.PartialHybridHeatPumpSystemController( redeclare BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController HP_nSet_Controller( diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo index 2e4ef2d6..a4691724 100644 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Control; model NewControlBivalentSerial "Bivalent Serial Control Class (Part-parallel PI controlled HPS according to condenser outflow)" - extends BaseClasses.PartialTwoPoint_HPS_Controller_BivalentBoiler( + extends BaseClasses.PartialHybridHeatPumpSystemController( redeclare BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController HP_nSet_Controller( @@ -43,7 +43,7 @@ model NewControlBivalentSerial annotation (choicesAllMatching=true, Placement(transformation(extent={{80,10}, {110,38}}))); Components.BoilerInHybridSystem boiInHybSys annotation (Placement( - transformation(rotation=0, extent={{-32,20},{-12,40}}))); + transformation(rotation=0, extent={{-54,12},{-34,32}}))); equation connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( Line(points={{110,80.4},{110,20},{98,20},{98,-22},{-152,-22},{-152,-99}}, diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo index 85c19310..cd5288af 100644 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo +++ b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Control; model NewControlBivalentSystem_BoilerAfterBuffer "intended use for bivalent systems with boiler after buffer (Part-parallel PI controlled HPS according to condenser outflow)" - extends BaseClasses.PartialTwoPoint_HPS_Controller_BivalentBoiler( + extends BaseClasses.PartialHybridHeatPumpSystemController( redeclare BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController HP_nSet_Controller( diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo index 9f04f141..7e05b7c3 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo @@ -80,7 +80,7 @@ model PartialHeatPump "Generation with only the heat pump" final GEvaOut=0, final GEvaIns=0, final tauSenT=parTemSen.tau, - final transferHeat=true, + final transferHeat=parTemSen.transferHeat, final allowFlowReversalEva=allowFlowReversal, final allowFlowReversalCon=allowFlowReversal, final tauHeaTraEva=parTemSen.tauHeaTra, From b5e982d572e92ca474bcdc803c6e193022ea9c40 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sat, 12 Aug 2023 01:07:28 +0200 Subject: [PATCH 080/131] continue control restructure --- BESMod/Examples/BAUSimStudy/PartialCase.mo | 6 +- BESMod/Examples/GasBoilerBuildingOnly.mo | 2 +- BESMod/Examples/HeatPumpAndBoiler.mo | 84 ++-- .../SolarThermalSystem/SolarThermalAixLib.mo | 1 - .../SolarThermalBuildings.mo | 1 - .../Examples/UseCaseDesignOptimization/BES.mo | 10 +- .../Examples/UseCaseHighOrderModel/BES_HOM.mo | 3 - .../PartialModelicaConferenceUseCase.mo | 6 +- .../PartialHeatPumpSystemController.mo | 140 +++--- .../PartialHybridHeatPumpSystemController.mo | 12 - .../PartialThermostaticValveControl.mo | 27 +- .../Control/BaseClasses/package.order | 1 - .../Control/BivalentPartParallel.mo | 25 +- .../AlternativeBivalent.mo | 55 +++ .../BaseClasses/PartialOnOffController.mo | 53 +++ .../BaseClasses/package.mo | 19 + .../BaseClasses/package.order | 1 + .../ConstantHysteresisTimeBasedHeatingRod.mo | 116 +++++ .../DegreeMinuteController.mo | 61 +++ .../Examples/OnOffControllerTest.mo | 57 +++ .../Examples/ParallelBivalentControl.mo | 17 + .../Examples/PartialOnOffController.mo | 37 ++ .../Examples/package.mo | 6 + .../Examples/package.order | 3 + .../FloatingHysteresis.mo | 96 +++++ .../PartParallelBivalent.mo | 112 +++++ .../Utilities/CountTimeBelowThreshold.mo | 15 + .../Utilities/StorageHysteresis.mo | 42 ++ .../Utilities/TriggerTime.mo | 15 + .../Utilities/package.mo | 4 + .../Utilities/package.order | 3 + .../BivalentOnOffControllers/package.mo | 12 + .../BivalentOnOffControllers/package.order | 8 + .../Components/BoilerInHybridSystem.mo | 11 +- .../Components/BuildingAndDHWControl.mo | 14 +- .../BaseClasses/PartialControler.mo | 66 +++ .../BaseClasses/PartialHPNSetController.mo | 73 ---- ...terHeatPumpController.mo => PartialPID.mo} | 41 +- .../BaseClasses/package.order | 4 +- .../HeatPumpNSetController/OnOff.mo | 28 ++ .../OnOffHeatPumpController.mo | 37 -- .../{P_InverterHeatPumpController.mo => P.mo} | 5 +- ...PI_InverterHeatPumpController.mo => PI.mo} | 11 +- .../Components/HeatPumpNSetController/PID.mo | 24 ++ .../PID_InverterHeatPumpController.mo | 29 -- .../HeatPumpNSetController/package.mo | 9 - .../HeatPumpNSetController/package.order | 8 +- .../Components/OnOffController/package.mo | 12 - .../Components/ParallelValveController.mo | 34 ++ .../BaseClasses/LimPID.mo | 400 ++++++++++++++++++ .../BaseClasses/PartialControler.mo | 66 +++ .../BaseClasses/package.mo | 5 + .../BaseClasses/package.order | 2 + .../RelativeSpeedController/OnOff.mo | 28 ++ .../Components/RelativeSpeedController/PID.mo | 57 +++ .../RelativeSpeedController/package.mo | 9 + .../RelativeSpeedController/package.order | 3 + .../Control/Components/package.order | 5 +- .../Systems/Hydraulical/Control/GasBoiler.mo | 36 +- .../Control/HybridHeatPumpSystem.mo | 103 +++++ .../Control/MonoenergeticHeatPumpSystem.mo | 2 +- .../Control/NewControlBivalentParallel.mo | 69 --- .../Control/NewControlBivalentSerial.mo | 71 ---- ...ControlBivalentSystem_BoilerAfterBuffer.mo | 66 --- .../RecordsCollection/BasicBoilerPI.mo | 13 + .../RecordsCollection/BasicHeatPumpPI.mo | 8 + .../PIDBaseDataDefinition.mo | 18 + .../Control/RecordsCollection/package.order | 3 + .../Systems/Hydraulical/Control/package.order | 4 +- .../HeatPumpAndGasBoilerParallel.mo | 2 +- 70 files changed, 1850 insertions(+), 576 deletions(-) delete mode 100644 BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHybridHeatPumpSystemController.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/AlternativeBivalent.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/PartialOnOffController.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/package.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/package.order create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/ConstantHysteresisTimeBasedHeatingRod.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/DegreeMinuteController.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/OnOffControllerTest.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/ParallelBivalentControl.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/PartialOnOffController.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/package.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/package.order create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/FloatingHysteresis.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/PartParallelBivalent.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/CountTimeBelowThreshold.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/StorageHysteresis.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/TriggerTime.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/package.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/package.order create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/package.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/package.order create mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialControler.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialHPNSetController.mo rename BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/{PartialInverterHeatPumpController.mo => PartialPID.mo} (55%) create mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/OnOff.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/OnOffHeatPumpController.mo rename BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/{P_InverterHeatPumpController.mo => P.mo} (87%) rename BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/{PI_InverterHeatPumpController.mo => PI.mo} (77%) create mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PID.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PID_InverterHeatPumpController.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/package.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/package.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/ParallelValveController.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/LimPID.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PartialControler.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order create mode 100644 BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/OnOff.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/package.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/package.order create mode 100644 BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo create mode 100644 BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicBoilerPI.mo create mode 100644 BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicHeatPumpPI.mo create mode 100644 BESMod/Systems/Hydraulical/Control/RecordsCollection/PIDBaseDataDefinition.mo diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index 87b6cfeb..64f2e33c 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -16,9 +16,9 @@ partial model PartialCase BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal - /5000, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/5000, dpCon_nominal=0, dpEva_nominal=0, use_refIne=false, @@ -37,7 +37,7 @@ partial model PartialCase redeclare Systems.Hydraulical.Control.MonoenergeticHeatPumpSystem control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - thermostaticValveController, + valCtrl, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, diff --git a/BESMod/Examples/GasBoilerBuildingOnly.mo b/BESMod/Examples/GasBoilerBuildingOnly.mo index d3109c56..caf18e1f 100644 --- a/BESMod/Examples/GasBoilerBuildingOnly.mo +++ b/BESMod/Examples/GasBoilerBuildingOnly.mo @@ -26,7 +26,7 @@ model GasBoilerBuildingOnly BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, redeclare - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController + BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PI HP_nSet_Controller, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl diff --git a/BESMod/Examples/HeatPumpAndBoiler.mo b/BESMod/Examples/HeatPumpAndBoiler.mo index d6f2948b..8426021b 100644 --- a/BESMod/Examples/HeatPumpAndBoiler.mo +++ b/BESMod/Examples/HeatPumpAndBoiler.mo @@ -50,8 +50,8 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal - /parameterStudy.QHP_flow_biv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, dpCon_nominal=0, dpEva_nominal=0, use_refIne=false, @@ -65,25 +65,38 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen), - redeclare Systems.Hydraulical.Control.NewControlBivalentSerial control( + redeclare Systems.Hydraulical.Control.HybridHeatPumpSystem control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - thermostaticValveController, + valCtrl, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, + dTHysBui=5, + dTHysDHW=5, + meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature, + + redeclare model DHWHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + + redeclare model BuildingHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + + redeclare model DHWSetTemperature = + BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW, + redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl - bivalentControlData(TBiv=parameterStudy.TBiv), - redeclare - Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW - TSet_DHW, + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI + parPIDHeaPum, + TBiv=parameterStudy.TBiv, + boiInGeneration=true, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl safetyControl, TCutOff=parameterStudy.TCutOff, - QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, - CheckTCut_Off(threshold=parameterStudy.TCutOff)), + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicBoilerPI + parPIDBoi), redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( redeclare @@ -137,9 +150,10 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal - /parameterStudy.QHP_flow_biv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, dpCon_nominal=0, dpEva_nominal=0, use_refIne=false, @@ -150,6 +164,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare @@ -160,7 +175,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - thermostaticValveController, + valCtrl, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, @@ -175,6 +190,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" safetyControl, TCutOff=parameterStudy.TCutOff, QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, + CheckTCut_Off(threshold=parameterStudy.TCutOff)), redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithoutDHW distribution( @@ -193,6 +209,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), @@ -224,16 +241,16 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerParallel generation( use_heaRod=false, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - parPum, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal - /parameterStudy.QHP_flow_biv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, dpCon_nominal=0, dpEva_nominal=0, use_refIne=false, @@ -241,13 +258,13 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, - redeclare - BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parThrWayVal, threeWayValveWithFlowReturn(redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve @@ -256,11 +273,10 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" dp_nominal={parHeaPum.dpCon_nominal,boilerNoControl.dp_nominal}, use_inputFilter=true, order=1))), - redeclare Systems.Hydraulical.Control.NewControlBivalentParallel - control( + redeclare Systems.Hydraulical.Control.NewControlBivalentParallel control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - thermostaticValveController, + valCtrl, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, @@ -275,9 +291,9 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" safetyControl, TCutOff=parameterStudy.TCutOff, QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, + CheckTCut_Off(threshold=parameterStudy.TCutOff)), - redeclare - Systems.Hydraulical.Distribution.DistributionTwoStorageParallel + redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( nParallelSup=1, dpSup_nominal={2*(hydraulic.distribution.parThrWayVal.dpValve_nominal @@ -288,8 +304,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage parStoDHW(dTLoadingHC1=10), - redeclare - BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parThrWayVal), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( redeclare @@ -298,14 +313,15 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), redeclare Systems.UserProfiles.TEASERProfiles userProfiles, redeclare UseCaseDesignOptimization.AachenSystem systemParameters( use_ventilation=true), - redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy(TCutOff= - 262.15, TBiv=276.15), + redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy( + TCutOff=262.15, TBiv=276.15), redeclare final package MediumDHW = AixLib.Media.Water, redeclare final package MediumZone = AixLib.Media.Air, redeclare final package MediumHyd = AixLib.Media.Water, @@ -335,6 +351,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ parameterStudy.QHP_flow_biv, @@ -348,6 +365,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare @@ -356,10 +374,10 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" redeclare Systems.Hydraulical.Control.NewControlBivalentSystem_BoilerAfterBuffer control( - TSetDHW( triggerEvery(displayUnit="d") = 259200), + TSetDHW(triggerEvery(displayUnit="d") = 259200), redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - thermostaticValveController, + valCtrl, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, @@ -374,13 +392,16 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" safetyControl, TCutOff=parameterStudy.TCutOff, QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, + CheckTCut_Off(threshold=parameterStudy.TCutOff)), redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithDHW distribution( designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.FullStorage, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parThrWayVal, redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, QDHWStoLoss_flow=1, VStoDHW(displayUnit="l") = 0.1, @@ -405,6 +426,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo index 84c9e650..b985f7cc 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo @@ -10,7 +10,6 @@ model SolarThermalAixLib "Solar thermal collector from AixLib" redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum(genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.Monovalent), - redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR parHeaRod, diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo index 98720b1c..6965b31e 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo @@ -11,7 +11,6 @@ model SolarThermalBuildings redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum(genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.Monovalent), - redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR parHeaRod, diff --git a/BESMod/Examples/UseCaseDesignOptimization/BES.mo b/BESMod/Examples/UseCaseDesignOptimization/BES.mo index 5a237433..714ad2e1 100644 --- a/BESMod/Examples/UseCaseDesignOptimization/BES.mo +++ b/BESMod/Examples/UseCaseDesignOptimization/BES.mo @@ -14,9 +14,10 @@ model BES BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal - /parameterStudy.QHP_flow_biv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, dpCon_nominal=0, dpEva_nominal=0, use_refIne=false, @@ -35,7 +36,7 @@ model BES redeclare Systems.Hydraulical.Control.BivalentPartParallel control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - thermostaticValveController, + valCtrl, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, @@ -50,6 +51,7 @@ model BES safetyControl, TCutOff=parameterStudy.TCutOff, QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor), + redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( redeclare @@ -58,9 +60,11 @@ model BES VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.B), + redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage parStoDHW(dTLoadingHC1=10, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.A), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parThrWayVal), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( diff --git a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo index 695be18a..73d09b81 100644 --- a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo +++ b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo @@ -13,7 +13,6 @@ model BES_HOM Type_Win, redeclare model CorrSolarGainWin = AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.CorGSimple, - redeclare BESMod.Systems.Demand.Building.Components.AixLibHighOrderOFD HOMBuiEnv), redeclare BESMod.Systems.Control.NoControl control, @@ -26,7 +25,6 @@ model BES_HOM BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal /parameterStudy.QHP_flow_biv, @@ -40,7 +38,6 @@ model BES_HOM redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 16b86c9b..3fe072b3 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -10,6 +10,7 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.Electrical.Generation.PVSystemMultiSub generation( redeclare model CellTemperature = AixLib.Electrical.PVSystem.BaseClasses.CellTemperatureMountingContactToGround, + redeclare AixLib.DataBase.SolarElectric.SchuecoSPV170SME1 pVParameters, lat=weaDat.lat, lon=weaDat.lon, @@ -17,6 +18,7 @@ partial model PartialModelicaConferenceUseCase timZon=3600, ARoo=building.ARoo/2), redeclare BESMod.Systems.Electrical.Transfer.NoElectricalTransfer transfer, + redeclare BESMod.Systems.Electrical.Control.NoControl control), redeclare BESMod.Systems.Control.DHWSuperheating control(TSetDHW= systemParameters.TSetDHW), @@ -30,6 +32,7 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=271.15, scalingFactor=scalingFactorHP, dpCon_nominal=0, @@ -49,7 +52,7 @@ partial model PartialModelicaConferenceUseCase control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - thermostaticValveController, + valCtrl, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, @@ -63,6 +66,7 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW TSet_DHW, supCtrlTypeDHWSet=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal), + redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( redeclare diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo index f3292739..d01a51eb 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo @@ -3,47 +3,67 @@ partial model PartialHeatPumpSystemController "Partial model with replaceable blocks for rule based control of heat pump systems" extends BESMod.Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl; + parameter Modelica.Units.SI.TemperatureDifference dTHysBui + "Hysteresis for building demand control" + annotation (Dialog(group="Building control")); + parameter Modelica.Units.SI.TemperatureDifference dTHysDHW + "Hysteresis for DHW demand control" annotation (Dialog(group="DHW control")); + parameter Utilities.SupervisoryControl.Types.SupervisoryControlType supCtrHeaCurTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local - "Heating curve supervisory control"; + "Heating curve supervisory control" annotation(Dialog(group="Building control")); parameter Utilities.SupervisoryControl.Types.SupervisoryControlType supCtrDHWTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local - "Supervisory control approach for DHW supply temperature "; - + "Supervisory control approach for DHW supply temperature " + annotation(Dialog(group="DHW control")); + parameter Components.MeasuredValue meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature + "Control measurement value for primary device" + annotation (Dialog(group="Component choices")); + parameter Components.MeasuredValue meaValSecGen + "Control measurement value for secondary device" + annotation (Dialog(group="Component choices")); replaceable model DHWHysteresis = - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ConstantHysteresisTimeBasedHR + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController constrainedby - BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController - "Hysteresis for DHW system" annotation (choicesAllMatching=true); + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController( + final dTHys=dTHysDHW) + "Hysteresis for DHW system" annotation (Dialog(group="Component choices"), + choicesAllMatching=true); replaceable model BuildingHysteresis = - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ConstantHysteresisTimeBasedHR + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController constrainedby - BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController - "Hysteresis for building" annotation (choicesAllMatching=true); + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController( + final dTHys=dTHysBui) + "Hysteresis for building" annotation (Dialog(group="Component choices"), + choicesAllMatching=true); replaceable model DHWSetTemperature = BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW constrainedby BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control( - final TSetDHW_nominal=parDis.TDHW_nominal) - "DHW set temperture module" annotation (choicesAllMatching=true); + final TSetDHW_nominal=parDis.TDHW_nominal) + "DHW set temperture module" annotation (Dialog(group="Component choices"), + choicesAllMatching=true); + replaceable record parPIDHeaPum = + BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition + constrainedby + BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition + "PID parameters of heat pump" + annotation (choicesAllMatching=true, + Dialog(group="Primary device"), + Placement(transformation(extent={{100,40},{120,60}}))); replaceable BESMod.Systems.Hydraulical.Control.RecordsCollection.HeatPumpSafetyControl - safetyControl + safetyControl "Parameters for safety control of heat pump" annotation (choicesAllMatching=true,Placement(transformation(extent={{204,84}, - {218,98}}))); - replaceable parameter RecordsCollection.BivalentHeatPumpControlDataDefinition - bivalentControlData constrainedby - RecordsCollection.BivalentHeatPumpControlDataDefinition( - final TOda_nominal=parGen.TOda_nominal, - TSup_nominal=parGen.TSup_nominal[1], - TSetRoomConst=sum(parTra.TDem_nominal)/parTra.nParallelDem) - "Parameters for bivalent control" - annotation (choicesAllMatching=true, Placement(transformation(extent={{-96,-36}, - {-82,-22}}))); + {218,98}})), Dialog(group="Component data")); replaceable - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.BaseClasses.PartialHPNSetController - HP_nSet_Controller annotation (choicesAllMatching=true, Placement( - transformation(extent={{102,82},{118,98}}))); + BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PID + priGenPIDCtrl(redeclare record parPID = parPIDHeaPum) constrainedby + BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.BaseClasses.PartialControler + "Control of primary generation device" annotation ( + Dialog(group="Primary device", tab="Advanced"), + choicesAllMatching=true, + Placement(transformation(extent={{102,82},{118,98}}))); AixLib.Controls.HeatPump.SafetyControls.SafetyControl safCtr( final minRunTime=safetyControl.minRunTime, @@ -73,17 +93,18 @@ partial model PartialHeatPumpSystemController rotation=0, origin={170,90}))); - Modelica.Blocks.Math.BooleanToReal booToRea "Turn pump on if any device is on" + Modelica.Blocks.Math.BooleanToReal booToRea(final realTrue=1, final realFalse=0) + "Turn pump on if any device is on" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, - origin={-170,-50}))); + origin={-150,-50}))); Modelica.Blocks.MathBoolean.Or anyGenDevIsOn(nu=2) "True if any generation device is on and pump must run" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=270, - origin={-170,-20}))); + origin={-150,-10}))); Components.HeatPumpBusPassThrough heaPumSigBusPasThr "Bus connector pass through for OpenModelica" annotation (Placement( transformation( @@ -105,12 +126,23 @@ partial model PartialHeatPumpSystemController "Control for building and DHW system" annotation (Placement(transformation(extent={{-200,20},{-120,80}}))); - Components.SetAndMeasuredValueSelector setAndMeaSelPri + Components.SetAndMeasuredValueSelector setAndMeaSelPri( + final meaVal=meaValPriGen, + final dTTraToDis_nominal=parTra.dTLoss_nominal[1], + final dTDisToGen_nominal=parDis.dTTra_nominal[1] + parGen.dTLoss_nominal[1], + final dTDHWToGen_nominal=parDis.dTTraDHW_nominal, + final dTHysDHW=dTHysDHW) "Selection of set and measured value for primary generation device" annotation (Placement(transformation(extent={{40,60},{60,80}}))); - Components.SetAndMeasuredValueSelector setAndMeaSelSec + Components.SetAndMeasuredValueSelector setAndMeaSelSec( + final meaVal=meaValSecGen, + final dTTraToDis_nominal=parTra.dTLoss_nominal[1], + final dTDisToGen_nominal=parDis.dTTra_nominal[1] + parGen.dTLoss_nominal[1], + final dTDHWToGen_nominal=parDis.dTTraDHW_nominal, + final dTHysDHW=dTHysDHW) "Selection of set and measured value for secondary generation device" annotation (Placement(transformation(extent={{40,0},{60,20}}))); + equation connect(safCtr.modeSet, heaPumHea.y) annotation (Line(points={{198.667,68},{186, @@ -121,28 +153,27 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(HP_nSet_Controller.n_Set, safCtr.nSet) annotation (Line(points={{118.8, - 90},{154,90},{154,76},{190,76},{190,72},{198.667,72}}, color={0,0,127})); + connect(priGenPIDCtrl.ySet, safCtr.nSet) annotation (Line(points={{118.8,90},{ + 154,90},{154,76},{190,76},{190,72},{198.667,72}}, + color={0,0,127})); - connect(HP_nSet_Controller.IsOn, sigBusGen.heaPumIsOn) annotation (Line( - points={{105.2,80.4},{105.2,78},{106,78},{106,48},{260,48},{260,-114},{-152, - -114},{-152,-99}}, color={255,0,255}), - Text( + connect(priGenPIDCtrl.isOn, sigBusGen.heaPumIsOn) annotation (Line(points={{105.2, + 80.4},{105.2,78},{106,78},{106,48},{260,48},{260,-114},{-152,-114},{-152, + -99}}, color={255,0,255}), Text( string="%second", index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); connect(booToRea.u, anyGenDevIsOn.y) - annotation (Line(points={{-170,-38},{-170,-31.5}}, color={255,0,255})); - connect(booToRea.y, sigBusGen.uPump) annotation (Line(points={{-170,-61},{-172, - -61},{-172,-72},{-152,-72},{-152,-99}}, color={0,0,127}), Text( + annotation (Line(points={{-150,-38},{-150,-21.5}}, color={255,0,255})); + connect(booToRea.y, sigBusGen.uPump) annotation (Line(points={{-150,-61},{-150,-70}, + {-152,-70},{-152,-99}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(heaPumSigBusPasThr.sigBusGen, sigBusGen) annotation (Line( - points={{160,64},{154,64},{154,-56},{-16,-56},{-16,-70},{-126,-70},{-126, - -68},{-152,-68},{-152,-99}}, + points={{160,64},{154,64},{154,-56},{0,-56},{0,-70},{-152,-70},{-152,-99}}, color={255,204,51}, thickness=0.5), Text( string="%second", @@ -191,26 +222,25 @@ equation extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(buiAndDHWCtr.secGen, anyGenDevIsOn.u[1]) annotation (Line(points={{-118, - 37.5},{-110,37.5},{-110,6},{-168,6},{-168,-6},{-171.75,-6},{-171.75,-10}}, + 37.5},{-118,36},{-112,36},{-112,6},{-151.75,6},{-151.75,0}}, color={255,0,255})); - connect(buiAndDHWCtr.priGren, anyGenDevIsOn.u[2]) annotation (Line(points={{ - -118,27.5},{-110,27.5},{-110,6},{-168,6},{-168,-6},{-168.25,-6},{ - -168.25,-10}}, color={255,0,255})); - connect(HP_nSet_Controller.HP_On, buiAndDHWCtr.priGren) annotation (Line(points={{100.4, - 90},{96,90},{96,40},{-80,40},{-80,27.5},{-118,27.5}}, color={ - 255,0,255})); + connect(buiAndDHWCtr.priGren, anyGenDevIsOn.u[2]) annotation (Line(points={{-118, + 27.5},{-118,26},{-112,26},{-112,6},{-148.25,6},{-148.25,0}}, + color={255,0,255})); + connect(priGenPIDCtrl.setOn, buiAndDHWCtr.priGren) annotation (Line(points={{100.4, + 90},{96,90},{96,40},{-80,40},{-80,27.5},{-118,27.5}}, color={255,0,255})); connect(setAndMeaSelPri.DHW, buiAndDHWCtr.DHW) annotation (Line(points={{39,76}, {28,76},{28,74},{-106,74},{-106,68},{-118,68}}, color={0,0,127})); connect(buiAndDHWCtr.TDHWSet, setAndMeaSelPri.TDHWSet) annotation (Line(points={ {-118,75},{-118,74},{28,74},{28,78.8},{39,78.8}}, color={0,0,127})); connect(setAndMeaSelPri.TBuiSet, buiAndDHWCtr.TBuiSet) annotation (Line(points={ {39,72.8},{38,72.8},{38,74},{-106,74},{-106,60},{-118,60}}, color={0,0,127})); - connect(setAndMeaSelPri.TSet, HP_nSet_Controller.T_Set) annotation (Line(points= - {{61,76},{94,76},{94,94.8},{100.4,94.8}}, color={0,0,127})); - connect(setAndMeaSelPri.TMea, HP_nSet_Controller.T_Meas) + connect(setAndMeaSelPri.TSet, priGenPIDCtrl.TSet) annotation (Line(points={{61,76}, + {94,76},{94,94.8},{100.4,94.8}}, color={0,0,127})); + connect(setAndMeaSelPri.TMea, priGenPIDCtrl.TMea) annotation (Line(points={{61,66},{110,66},{110,80.4}}, color={0,0,127})); connect(setAndMeaSelPri.sigBusGen, sigBusGen) annotation (Line( - points={{40,61.8},{16,61.8},{16,62},{-68,62},{-68,-99},{-152,-99}}, + points={{40,61.8},{20,61.8},{20,62},{0,62},{0,-99},{-152,-99}}, color={255,204,51}, thickness=0.5), Text( string="%second", @@ -242,7 +272,7 @@ equation extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(setAndMeaSelSec.sigBusGen, sigBusGen) annotation (Line( - points={{40,1.8},{40,-56},{-16,-56},{-16,-70},{-68,-70},{-68,-99},{-152,-99}}, + points={{40,1.8},{40,2},{0,2},{0,-70},{-152,-70},{-152,-99}}, color={255,204,51}, thickness=0.5), Text( string="%second", @@ -252,7 +282,7 @@ equation annotation (Diagram(graphics={ Rectangle( - extent={{0,100},{132,36}}, + extent={{4,100},{136,36}}, lineColor={28,108,200}, lineThickness=1), Text( @@ -261,7 +291,7 @@ equation lineThickness=1, textString="Heat Pump Control"), Rectangle( - extent={{0,32},{132,-22}}, + extent={{4,32},{136,-22}}, lineColor={162,29,33}, lineThickness=1), Text( diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHybridHeatPumpSystemController.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHybridHeatPumpSystemController.mo deleted file mode 100644 index f64a8491..00000000 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHybridHeatPumpSystemController.mo +++ /dev/null @@ -1,12 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.BaseClasses; -partial model PartialHybridHeatPumpSystemController - "Partial model with replaceable blocks for rule based control of HPS using Boiler" - extends - BESMod.Systems.Hydraulical.Control.BaseClasses.PartialHeatPumpSystemController; - - Components.BoilerInHybridSystem boilerInHybridSystem - annotation (Placement(transformation(extent={{-30,-20},{-12,0}}))); -equation - connect(boilerInHybridSystem.secGen, buiAndDHWCtr.secGen) annotation (Line( - points={{-31.8,-6},{-110,-6},{-110,37.5},{-118,37.5}}, color={255,0,255})); -end PartialHybridHeatPumpSystemController; diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo index 33c86c53..184d4c0a 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo @@ -4,35 +4,34 @@ partial model PartialThermostaticValveControl extends PartialControl; replaceable BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.BaseClasses.PartialThermostaticValveController - thermostaticValveController constrainedby + valCtrl constrainedby BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.BaseClasses.PartialThermostaticValveController( - final nZones=parTra.nParallelDem, final leakageOpening= - parTheVal.leakageOpening) annotation ( - choicesAllMatching=true, Placement(transformation(extent={{122,-78},{138, - -62}}))); + final nZones=parTra.nParallelDem, final leakageOpening=parTheVal.leakageOpening) + "Thermostatic valve controller" annotation ( + Dialog(group="Building control"), choicesAllMatching=true, + Placement(transformation(extent={{122,-78},{138,-62}}))); replaceable parameter BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal "Thermostatic valve parameters" - annotation (choicesAllMatching=true, Placement( + annotation (Dialog(group="Building control"), + choicesAllMatching=true, Placement( transformation(extent={{182,-78},{198,-62}}))); equation - connect(thermostaticValveController.opening, sigBusTra.opening) annotation ( - Line(points={{139.6,-70},{174,-70},{174,-100}}, color={0,0,127}), Text( + connect(valCtrl.opening, sigBusTra.opening) annotation (Line(points={{139.6,-70}, + {174,-70},{174,-100}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(thermostaticValveController.TZoneMea, buiMeaBus.TZoneMea) annotation ( - Line(points={{120.4,-65.2},{120.4,-66},{76,-66},{76,-116},{-250,-116},{-250, - 118},{65,118},{65,103}}, + connect(valCtrl.TZoneMea, buiMeaBus.TZoneMea) annotation (Line(points={{120.4,-65.2}, + {120.4,-66},{76,-66},{76,-116},{-250,-116},{-250,118},{65,118},{65,103}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(thermostaticValveController.TZoneSet, useProBus.TZoneSet) annotation ( - Line(points={{120.4,-74.8},{76,-74.8},{76,-116},{-250,-116},{-250,102},{-119, - 102},{-119,103}}, + connect(valCtrl.TZoneSet, useProBus.TZoneSet) annotation (Line(points={{120.4,-74.8}, + {76,-74.8},{76,-116},{-250,-116},{-250,102},{-119,102},{-119,103}}, color={0,0,127}), Text( string="%second", index=1, diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order index aa846ab1..fa58782d 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order @@ -1,4 +1,3 @@ PartialControl PartialThermostaticValveControl PartialHeatPumpSystemController -PartialHybridHeatPumpSystemController diff --git a/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo b/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo index dfe276a3..21bd48a7 100644 --- a/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo +++ b/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo @@ -3,13 +3,13 @@ model BivalentPartParallel "Part-parallel PI controlled HPS according to condenser outflow" extends BaseClasses.PartialHeatPumpSystemController( redeclare - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController - HP_nSet_Controller( + BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PI + priGenPIDCtrl( P=bivalentControlData.k, - nMin=bivalentControlData.nMin, - T_I=bivalentControlData.T_I), + yMin=bivalentControlData.nMin, + timeInt=bivalentControlData.T_I), redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.PartParallelBivalent BufferOnOffController( Hysteresis=bivalentControlData.dTHysBui, TCutOff=TCutOff, @@ -19,7 +19,7 @@ model BivalentPartParallel QDem_flow_nominal=sum(parTra.Q_flow_nominal), QHP_flow_cutOff=QHP_flow_cutOff), redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.PartParallelBivalent DHWOnOffContoller( Hysteresis=bivalentControlData.dTHysDHW, TCutOff=TCutOff, @@ -33,13 +33,12 @@ model BivalentPartParallel parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff; equation - connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( - Line(points={{110,80.4},{110,-56},{-152,-56},{-152,-99}},color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); + connect(priGenPIDCtrl.TMea, sigBusGen.THeaPumOut) annotation (Line(points={{110, + 80.4},{110,-56},{-152,-56},{-152,-99}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/AlternativeBivalent.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/AlternativeBivalent.mo new file mode 100644 index 00000000..b9ef7e1e --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/AlternativeBivalent.mo @@ -0,0 +1,55 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers; +model AlternativeBivalent + "Alternative bivalent control" + extends BaseClasses.PartialOnOffController; + parameter Modelica.Units.SI.Temperature T_biv=271.15 "Bivalent temperature"; + Utilities.StorageHysteresis storageHysteresis(final bandwidth=dTHys, + final pre_y_start=true) + annotation (Placement(transformation(extent={{-40,22},{0,62}}))); + Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualT_biv(threshold= + T_biv) annotation (Placement(transformation(extent={{20,80},{40,100}}))); + + Modelica.Blocks.Logical.And greaterEqualT_biv1 + annotation (Placement(transformation(extent={{60,60},{80,80}}))); + Modelica.Blocks.Logical.And greaterEqualT_biv2 + annotation (Placement(transformation(extent={{60,-60},{80,-40}}))); + Modelica.Blocks.Logical.Not greaterEqualT_biv3 annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={50,-10}))); + + Modelica.Blocks.Math.BooleanToReal + or3(final realTrue=1, final realFalse=0) + annotation (Placement(transformation( + extent={{-6,-6},{6,6}}, + rotation=0, + origin={82,-80}))); +equation + connect(TSupSet, storageHysteresis.T_set) annotation (Line(points={{0,-118},{-56, + -118},{-56,58},{-44,58}}, color={0,0,127})); + connect(TStoTop, storageHysteresis.T_top) annotation (Line(points={{-120,60},{-74, + 60},{-74,42},{-44,42}}, color={0,0,127})); + connect(TStoBot, storageHysteresis.T_bot) annotation (Line(points={{-120,-60},{-50, + -60},{-50,26},{-44,26}}, color={0,0,127})); + connect(TOda, greaterEqualT_biv.u) + annotation (Line(points={{0,120},{0,90},{18,90}}, color={0,0,127})); + connect(priGenOn, greaterEqualT_biv1.y) annotation (Line(points={{110,60},{96,60}, + {96,70},{81,70}}, color={255,0,255})); + connect(greaterEqualT_biv.y, greaterEqualT_biv1.u1) annotation (Line(points={ + {41,90},{52,90},{52,70},{58,70}}, color={255,0,255})); + connect(storageHysteresis.y, greaterEqualT_biv1.u2) annotation (Line(points={ + {2,42},{26.85,42},{26.85,62},{58,62}}, color={255,0,255})); + connect(secGenOn, greaterEqualT_biv2.y) annotation (Line(points={{110,-60},{96,-60}, + {96,-50},{81,-50}}, color={255,0,255})); + connect(greaterEqualT_biv.y, greaterEqualT_biv3.u) + annotation (Line(points={{41,90},{50,90},{50,2}}, color={255,0,255})); + connect(greaterEqualT_biv3.y, greaterEqualT_biv2.u1) + annotation (Line(points={{50,-21},{50,-50},{58,-50}}, color={255,0,255})); + connect(storageHysteresis.y, greaterEqualT_biv2.u2) annotation (Line(points={ + {2,42},{28,42},{28,-58},{58,-58}}, color={255,0,255})); + connect(ySecGenSet, or3.y) + annotation (Line(points={{110,-80},{88.6,-80}}, color={0,0,127})); + connect(greaterEqualT_biv2.y, or3.u) annotation (Line(points={{81,-50},{82, + -50},{82,-70},{74.8,-70},{74.8,-80}}, color={255,0,255})); +end AlternativeBivalent; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/PartialOnOffController.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/PartialOnOffController.mo new file mode 100644 index 00000000..9f45d185 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/PartialOnOffController.mo @@ -0,0 +1,53 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses; +partial model PartialOnOffController "Partial model for an on off controller" + + parameter Modelica.Units.SI.TemperatureDifference dTHys + "Hysteresis for control"; + + + Modelica.Blocks.Interfaces.RealInput TStoTop + "Top layer temperature of the storage in distribution system" annotation ( + Placement(transformation(extent={{-140,40},{-100,80}}), iconTransformation( + extent={{-120,60},{-100,80}}))); + Modelica.Blocks.Interfaces.BooleanOutput priGenOn(start=true) + "Turn the main the device on or off" annotation (Placement(transformation( + extent={{100,50},{120,70}}), iconTransformation(extent={{100,56},{128, + 84}}))); + Modelica.Blocks.Interfaces.RealInput TSupSet "Set point temperature" + annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=90, + origin={0,-118}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={0,-110}))); + Modelica.Blocks.Interfaces.RealInput TStoBot + "Supply temperature of the lower layers of the storage. Does not have to be the lowest layer, depending on comfort even the top may be selected" + annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}), + iconTransformation(extent={{-120,-60},{-100,-40}}))); + Modelica.Blocks.Interfaces.BooleanOutput secGenOn(start=true) + "Turn the auxilliar heater on or off" annotation (Placement(transformation( + extent={{100,-70},{120,-50}}), iconTransformation(extent={{100,-64},{ + 128,-36}}))); + Modelica.Blocks.Interfaces.RealInput TOda "Ambient air temperature" annotation ( + Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=270, + origin={0,120}), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={0,112}))); + Modelica.Blocks.Interfaces.RealOutput ySecGenSet(start=1) + "Setpoint of the auxilliar heater" annotation (Placement(transformation( + extent={{100,-90},{120,-70}}), iconTransformation(extent={{100,-100},{ + 128,-72}}))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid, + lineThickness=0.5)}), Diagram(graphics, + coordinateSystem(preserveAspectRatio= + false))); +end PartialOnOffController; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/package.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/package.mo new file mode 100644 index 00000000..abc41b21 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/package.mo @@ -0,0 +1,19 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers; +package BaseClasses +annotation (Icon(graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Ellipse( + extent={{-30.0,-30.0},{30.0,30.0}}, + lineColor={128,128,128}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)})); +end BaseClasses; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/package.order new file mode 100644 index 00000000..2c14283c --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/package.order @@ -0,0 +1 @@ +PartialOnOffController diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/ConstantHysteresisTimeBasedHeatingRod.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/ConstantHysteresisTimeBasedHeatingRod.mo new file mode 100644 index 00000000..30e9f2bb --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/ConstantHysteresisTimeBasedHeatingRod.mo @@ -0,0 +1,116 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers; +model ConstantHysteresisTimeBasedHeatingRod + "Const. hysteresis and time-based auxilliar heater control" + extends + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController; + + parameter Modelica.Units.SI.Time dtHeaRod(displayUnit="min")=1800 + "Seconds for regulation when hr should be activated: If lower set temperature is hurt for more than this time period"; + parameter Real addSetDelTimHeaRod=1 + "Each time dt_hr passes, the output of the heating rod is increased by this amount in percentage. Maximum and default is 100 (on-off hr)%"; + + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.Utilities.StorageHysteresis + hysSto(final bandwidth=dTHys, final pre_y_start=true) "Storage hysteresis" + annotation (Placement(transformation(extent={{-58,18},{-18,58}}))); + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.Utilities.TriggerTime + trigTime "Trigger once the hysteresis is violated" + annotation (Placement(transformation(extent={{-32,-88},{-12,-68}}))); + Modelica.Blocks.Sources.RealExpression reaExp(y=min(floor((time - trigTime.y)/ + dtHeaRod)*addSetDelTimHeaRod, 1)) + "Calculate if heating rod time has elapsed" + annotation (Placement(transformation(extent={{6,-70},{26,-50}}))); + Modelica.Blocks.Logical.GreaterThreshold greThr(threshold=Modelica.Constants.eps) + annotation (Placement(transformation(extent={{70,-68},{86,-52}}))); + + Modelica.Blocks.Logical.Switch swiOn "Switch on or off" + annotation (Placement(transformation(extent={{34,-86},{48,-72}}))); + Modelica.Blocks.Sources.Constant constOff(final k=0) + "Turn auxilliar heater off" + annotation (Placement(transformation(extent={{14,-98},{24,-88}}))); + Modelica.Blocks.Logical.OnOffController hysAuxHea(bandwidth=dTHys/2, + pre_y_start=true) + "Generates the on/off signal depending on the temperature inputs" + annotation (Placement(transformation(extent={{-62,-70},{-42,-50}}))); + Modelica.Blocks.Math.Add add1(k1=-1) + annotation (Placement(transformation(extent={{-7,-7},{7,7}}, + rotation=90, + origin={-69,-95}))); + Modelica.Blocks.Sources.Constant constdTHys(final k=dTHys/4) + "Set auxilliar heater hysteresis" + annotation (Placement(transformation(extent={{-98,-118},{-88,-108}}))); +equation + connect(TStoTop, hysSto.T_top) annotation (Line(points={{-120,60},{-86,60},{-86, + 38},{-62,38}}, color={0,0,127})); + connect(TSupSet, hysSto.T_set) annotation (Line(points={{0,-118},{0,-20},{-80,-20}, + {-80,54},{-62,54}}, color={0,0,127})); + connect(hysSto.y, priGenOn) annotation (Line(points={{-16,38},{30,38},{30,60},{110, + 60}}, color={255,0,255})); + connect(greThr.y, secGenOn) + annotation (Line(points={{86.8,-60},{110,-60}}, color={255,0,255})); + connect(constOff.y, swiOn.u3) annotation (Line(points={{24.5,-93},{28,-93},{28,-84.6}, + {32.6,-84.6}}, color={0,0,127})); + connect(swiOn.y, ySecGenSet) annotation (Line(points={{48.7,-79},{70,-79},{70,-80}, + {110,-80}}, color={0,0,127})); + connect(swiOn.y, greThr.u) annotation (Line(points={{48.7,-79},{56,-79},{56,-60}, + {68.4,-60}}, color={0,0,127})); + connect(reaExp.y, swiOn.u1) annotation (Line(points={{27,-60},{30,-60},{30,-73.4}, + {32.6,-73.4}}, color={0,0,127})); + connect(TStoTop, hysSto.T_bot) annotation (Line(points={{-120,60},{-92,60},{-92, + 22},{-62,22}}, color={0,0,127})); + connect(TStoTop, hysAuxHea.u) annotation (Line(points={{-120,60},{-92,60},{-92,-66}, + {-64,-66}}, color={0,0,127})); + connect(constdTHys.y, add1.u1) annotation (Line(points={{-87.5,-113},{-74,-113}, + {-74,-103.4},{-73.2,-103.4}}, color={0,0,127})); + connect(add1.y, hysAuxHea.reference) + annotation (Line(points={{-69,-87.3},{-69,-54},{-64,-54}}, color={0,0,127})); + connect(TSupSet, add1.u2) annotation (Line(points={{0,-118},{0,-104},{-20,-104}, + {-20,-103.4},{-64.8,-103.4}}, color={0,0,127})); + connect(hysAuxHea.y, trigTime.u) annotation (Line(points={{-41,-60},{-38,-60},{-38, + -78},{-34,-78}}, color={255,0,255})); + connect(hysAuxHea.y, swiOn.u2) annotation (Line(points={{-41,-60},{2,-60},{2,-79}, + {32.6,-79}}, color={255,0,255})); + annotation (Icon(graphics={ Polygon( + points={{-65,89},{-73,67},{-57,67},{-65,89}}, + lineColor={192,192,192}, + fillColor={192,192,192}, + fillPattern=FillPattern.Solid),Line(points={{-65,67},{-65,-81}}, + color={192,192,192}),Line(points={{-90,-70},{82,-70}}, color={192, + 192,192}),Polygon( + points={{90,-70},{68,-62},{68,-78},{90,-70}}, + lineColor={192,192,192}, + fillColor={192,192,192}, + fillPattern=FillPattern.Solid), + Text( + extent={{-65,93},{-12,75}}, + lineColor={160,160,164}, + textString="y"),Line( + points={{-80,-70},{30,-70}}, + thickness=0.5),Line( + points={{-50,10},{80,10}}, + thickness=0.5),Line( + points={{-50,10},{-50,-70}}, + thickness=0.5),Line( + points={{30,10},{30,-70}}, + thickness=0.5),Line( + points={{-10,-65},{0,-70},{-10,-75}}, + thickness=0.5),Line( + points={{-10,15},{-20,10},{-10,5}}, + thickness=0.5),Line( + points={{-55,-20},{-50,-30},{-44,-20}}, + thickness=0.5),Line( + points={{25,-30},{30,-19},{35,-30}}, + thickness=0.5),Text( + extent={{-99,2},{-70,18}}, + lineColor={160,160,164}, + textString="true"),Text( + extent={{-98,-87},{-66,-73}}, + lineColor={160,160,164}, + textString="false"),Text( + extent={{19,-87},{44,-70}}, + lineColor={0,0,0}, + textString="uHigh"),Text( + extent={{-63,-88},{-38,-71}}, + lineColor={0,0,0}, + textString="uLow"),Line(points={{-69,10},{-60,10}}, color={160, + 160,164})})); +end ConstantHysteresisTimeBasedHeatingRod; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/DegreeMinuteController.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/DegreeMinuteController.mo new file mode 100644 index 00000000..96fb3b24 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/DegreeMinuteController.mo @@ -0,0 +1,61 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers; +model DegreeMinuteController + "Based on degree minute approach" + extends BaseClasses.PartialOnOffController; + + parameter Real DegreeMinute_HP_on(unit="K.min")=-60 "Degree minute when HP is turned on"; + parameter Real DegreeMinute_HP_off(unit="K.min")=0 "Degree minute when HP is turned off"; + parameter Real DegreeMinute_AuxHeater_on(unit="K.min")=-600 "Degree minute when auxilliar heater is turned on"; + parameter Real DegreeMinuteReset(unit="K.min")=300 "Degree minute when the value is reset. Value based on additional paper, to avoid errors in summer periods"; + parameter Modelica.Units.SI.TemperatureDifference delta_T_AuxHeater_off=1 + "Temperature difference when to turn off the auxilliar heater"; + parameter Modelica.Units.SI.TemperatureDifference delta_T_reset=10 + "Temperature difference when to reset the sum to 0"; + + Real DegreeMinute(start=0) "Current degree minute value"; + Modelica.Units.SI.TemperatureDifference delta_T=TStoTop - TSupSet; + +algorithm + when DegreeMinute < DegreeMinute_HP_on then + priGenOn := true; + end when; + + when DegreeMinute > DegreeMinute_HP_off then + priGenOn := false; + end when; + + when DegreeMinute < DegreeMinute_AuxHeater_on then + secGenOn := true; + ySecGenSet := 1; + end when; + + when delta_T > delta_T_AuxHeater_off then + secGenOn := false; + ySecGenSet := 0; + end when; + +equation + // TODO: Check why the simple hys wont work?! + //HP_On = (not pre(HP_On) and DegreeMinute > DegreeMinute_HP_on) or (pre(HP_On) and DegreeMinute < DegreeMinute_HP_off); + //Auxilliar_Heater_On = (not pre(Auxilliar_Heater_On) and DegreeMinute > DegreeMinute_AuxHeater_on) or (pre(Auxilliar_Heater_On) and delta_T < delta_T_AuxHeater_off); + der(DegreeMinute) = delta_T /60; + when (delta_T > delta_T_reset) then + reinit(DegreeMinute, 0); + elsewhen (DegreeMinute > DegreeMinuteReset) then + reinit(DegreeMinute, 0); + end when; + annotation (Icon(graphics={Text( + extent={{-44,58},{40,-60}}, + lineColor={0,0,0}, + textString="°C +_______ + + minute")}), Documentation(info=" +

The method is based on the following paper: https://www.sciencedirect.com/science/article/abs/pii/S037877881300282X

+


• Turn on the heat pump when the sum is lower than −60 degree–minute.

+

• Turn off the heat pump when the sum goes back to 0 degree–minute.

+

• Turn on the electrical auxiliary heater when the sum is lower than −600 degree–minute.

+

• Turn off the electrical auxiliary heater when the supply temperature is 1 K higher than the required temperature.

+

• Reset the sum to zero whenever the supply temperature is 10 K higher than the required temperature.

+")); +end DegreeMinuteController; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/OnOffControllerTest.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/OnOffControllerTest.mo new file mode 100644 index 00000000..d07aac09 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/OnOffControllerTest.mo @@ -0,0 +1,57 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.Examples; +model OnOffControllerTest + extends Modelica.Icons.Example; + + ConstantHysteresisTimeBasedHeatingRod constantHysteresisTimeBasedHR(dtHeaRod= + 1800) annotation (Placement(transformation(extent={{-28,42},{16,82}}))); + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.DegreeMinuteController + degreeMinuteController(DegreeMinuteReset=100) annotation (Placement( + transformation( + extent={{-21,-20},{21,20}}, + rotation=0, + origin={-5,2}))); + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.FloatingHysteresis + floatingHysteresis(Hysteresis_max=15, Hysteresis_min=2) + annotation (Placement(transformation(extent={{-26,-76},{16,-38}}))); + Modelica.Blocks.Sources.Constant T_Set(k=323.15) + annotation (Placement(transformation(extent={{-160,-20},{-124,16}}))); + Modelica.Blocks.Sources.Sine T_Top( + amplitude=30, + f=1/3600, + offset=313.15) + annotation (Placement(transformation(extent={{-160,44},{-122,82}}))); + Modelica.Blocks.Sources.Constant T_Set1(k=273.15) + annotation (Placement(transformation(extent={{-152,-90},{-116,-54}}))); +equation + connect(T_Set.y, degreeMinuteController.TSupSet) annotation (Line(points={{-122.2, + -2},{-106,-2},{-106,0},{-70,0},{-70,-28},{-5,-28},{-5,-20}}, color={0,0, + 127})); + connect(T_Set.y, floatingHysteresis.TSupSet) annotation (Line(points={{-122.2,-2}, + {-86,-2},{-86,-94},{-5,-94},{-5,-77.9}}, color={0,0,127})); + connect(T_Set.y, constantHysteresisTimeBasedHR.TSupSet) annotation (Line(points= + {{-122.2,-2},{-112,-2},{-112,-4},{-80,-4},{-80,32},{-6,32},{-6,40}}, + color={0,0,127})); + connect(T_Top.y, constantHysteresisTimeBasedHR.TStoTop) annotation (Line(points= + {{-120.1,63},{-44,63},{-44,76},{-30.2,76}}, color={0,0,127})); + connect(T_Top.y, constantHysteresisTimeBasedHR.TStoBot) annotation (Line(points= + {{-120.1,63},{-72,63},{-72,40},{-44,40},{-44,52},{-30.2,52}}, color={0,0, + 127})); + connect(T_Top.y, degreeMinuteController.TStoTop) annotation (Line(points={{-120.1, + 63},{-96,63},{-96,16},{-28.1,16}}, color={0,0,127})); + connect(T_Top.y, degreeMinuteController.TStoBot) annotation (Line(points={{-120.1, + 63},{-88,63},{-88,-8},{-28.1,-8}}, color={0,0,127})); + connect(T_Top.y, floatingHysteresis.TStoTop) annotation (Line(points={{-120.1, + 63},{-92,63},{-92,-43.7},{-28.1,-43.7}}, color={0,0,127})); + connect(T_Top.y, floatingHysteresis.TStoBot) annotation (Line(points={{-120.1, + 63},{-90,63},{-90,-66.5},{-28.1,-66.5}}, color={0,0,127})); + connect(T_Set1.y, floatingHysteresis.TOda) annotation (Line(points={{-114.2,-72}, + {-60.1,-72},{-60.1,-35.72},{-5,-35.72}}, color={0,0,127})); + connect(T_Set1.y, degreeMinuteController.TOda) annotation (Line(points={{-114.2, + -72},{-58,-72},{-58,24.4},{-5,24.4}}, color={0,0,127})); + connect(T_Set1.y, constantHysteresisTimeBasedHR.TOda) annotation (Line(points={ + {-114.2,-72},{-60,-72},{-60,84.4},{-6,84.4}}, color={0,0,127})); + annotation (Icon(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, + coordinateSystem(preserveAspectRatio=false)), + experiment(StopTime=86400, Interval=1)); +end OnOffControllerTest; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/ParallelBivalentControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/ParallelBivalentControl.mo new file mode 100644 index 00000000..01fdba86 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/ParallelBivalentControl.mo @@ -0,0 +1,17 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.Examples; +model ParallelBivalentControl + extends PartialOnOffController(dTHys=onOffController.Hysteresis, redeclare + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.PartParallelBivalent + onOffController( + Hysteresis=10, + TCutOff=263.15, + TBiv=270.15, + TOda_nominal=258.15, + TRoom=293.15, + QDem_flow_nominal=12000, + QHP_flow_cutOff=3000, + secGenOn(start=false), + ySecGenSet(start=0))); + + extends Modelica.Icons.Example; +end ParallelBivalentControl; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/PartialOnOffController.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/PartialOnOffController.mo new file mode 100644 index 00000000..2d71efc2 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/PartialOnOffController.mo @@ -0,0 +1,37 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.Examples; +partial model PartialOnOffController + parameter Real TSetDef=273.15 + 50 "Constant output value"; + parameter Real dTHys "Hysterisis value"; + replaceable BaseClasses.PartialOnOffController onOffController annotation ( + choicesAllMatching=true, Placement(transformation(extent={{-18,-16},{38, + 38}}))); + Modelica.Blocks.Sources.Ramp ramp( + height=70, + duration=3600, + offset=273.15 - 30) + annotation (Placement(transformation(extent={{-78,58},{-58,78}}))); + Modelica.Blocks.Sources.Pulse pulse( + amplitude=dTHys + 2, + period=1800, + offset=TSetDef - dTHys/2 - 1) + annotation (Placement(transformation(extent={{-84,2},{-64,22}}))); + Modelica.Blocks.Sources.Constant constTSet(k=TSetDef) + annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); + +equation + connect(ramp.y, onOffController.TOda) + annotation (Line(points={{-57,68},{10,68},{10,41.24}}, color={0,0,127})); + connect(pulse.y, onOffController.TStoTop) annotation (Line(points={{-63,12},{-56, + 12},{-56,30},{-20.8,30},{-20.8,29.9}}, color={0,0,127})); + connect(pulse.y, onOffController.TStoBot) annotation (Line(points={{-63,12},{-56, + 12},{-56,-2.5},{-20.8,-2.5}}, color={0,0,127})); + connect(constTSet.y, onOffController.TSupSet) + annotation (Line(points={{-39,-50},{10,-50},{10,-18.7}}, color={0,0,127})); + annotation (Icon(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, + coordinateSystem(preserveAspectRatio=false)), + experiment( + StopTime=3600, + Interval=1, + __Dymola_Algorithm="Dassl")); +end PartialOnOffController; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/package.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/package.mo new file mode 100644 index 00000000..521c9a34 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/package.mo @@ -0,0 +1,6 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers; +package Examples + extends Modelica.Icons.ExamplesPackage; + + +end Examples; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/package.order b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/package.order new file mode 100644 index 00000000..25659c4f --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/package.order @@ -0,0 +1,3 @@ +ParallelBivalentControl +PartialOnOffController +OnOffControllerTest diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/FloatingHysteresis.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/FloatingHysteresis.mo new file mode 100644 index 00000000..8b04fe59 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/FloatingHysteresis.mo @@ -0,0 +1,96 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers; +model FloatingHysteresis + "Based on the floating hysteresis approach" + extends BaseClasses.PartialOnOffController; + + parameter Modelica.Units.SI.TemperatureDifference Hysteresis_max=dTHys + "Maximum hysteresis"; + parameter Modelica.Units.SI.TemperatureDifference Hysteresis_min=10 + "Minimum hysteresis"; + parameter Modelica.Units.SI.Time time_factor=20 + "The time which should be spent to have the floating hysteresis equal to the average of maximum and minimum hysteresis."; + parameter Modelica.Units.SI.Time dtHeaRod=20*60 + "Seconds for regulation when hr should be activated: If lower set temperature is hurt for more than this time period"; + + /******************************* Variables *******************************/ + + Modelica.Units.SI.Time t1(start=0) "Helper variable for hr algorithm"; + Modelica.Units.SI.TemperatureDifference Hysteresis_floating=Hysteresis_min + + (Hysteresis_max - Hysteresis_min)/(1 + (t1/time_factor)); + +algorithm + + // For initialisation: activate both systems + //when time > 1 then + // HP_On := true; + // Auxilliar_Heater_On :=true; + //end when; + + // When upper temperature of storage tank is lower than lower hysteresis value, activate hp + when TStoTop < TSupSet - Hysteresis_floating/2 then + priGenOn := true; + t1 :=time; // Start activation counter + end when; + // When second / lower temperature of storage tank is higher than upper hysteresis, deactivate hp + when TStoBot > TSupSet + Hysteresis_floating/2 then + priGenOn := false; + secGenOn := false; + ySecGenSet := 0; + end when; + + // Activate hr in case temperature is below lower hysteresis and critical time period is passed + when (TStoTop < TSupSet - Hysteresis_floating/2) and time > (t1 + dtHeaRod) + and priGenOn then + secGenOn := true; + ySecGenSet := 1; + end when; + + annotation (Icon(graphics={ + Line( + points={{-50,48},{80,48}}, + thickness=0.5),Line( + points={{-10,53},{-20,48},{-10,43}}, + thickness=0.5),Line( + points={{25,8},{30,19},{35,8}}, + thickness=0.5),Line( + points={{30,48},{30,-32}}, + thickness=0.5),Line( + points={{-10,-27},{0,-32},{-10,-37}}, + thickness=0.5), Line( + points={{-80,-32},{30,-32}}, + thickness=0.5),Line( + points={{-50,48},{-50,-32}}, + thickness=0.5),Line( + points={{-55,18},{-50,8},{-44,18}}, + thickness=0.5),Text( + extent={{-99,40},{-70,56}}, + lineColor={160,160,164}, + textString="true"),Text( + extent={{-98,-49},{-66,-35}}, + lineColor={160,160,164}, + textString="false"), Line(points={{-64,86},{-65,-43}}, + color={192,192,192}),Line(points={{-69,48},{-60,48}}, color={160, + 160,164}),Polygon( + points={{90,-32},{68,-24},{68,-40},{90,-32}}, + lineColor={192,192,192}, + fillColor={192,192,192}, + fillPattern=FillPattern.Solid), + Line(points={{-90,-32},{82,-32}}, color={192, + 192,192}), Text( + extent={{19,-49},{44,-32}}, + lineColor={0,0,0}, + textString="uHigh"),Text( + extent={{-63,-50},{-38,-33}}, + lineColor={0,0,0}, + textString="uLow"), + Polygon( + points={{11,0},{-11,8},{-11,-8},{11,0}}, + lineColor={192,192,192}, + fillColor={192,192,192}, + fillPattern=FillPattern.Solid, + origin={-65,84}, + rotation=90), Text( + extent={{-87,-84},{84,-54}}, + lineColor={0,0,0}, + textString="uLow, uHigh=f(h_max, h_min, time)")})); +end FloatingHysteresis; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/PartParallelBivalent.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/PartParallelBivalent.mo new file mode 100644 index 00000000..2312bf32 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/PartParallelBivalent.mo @@ -0,0 +1,112 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers; +model PartParallelBivalent "Part-parallel bivalent control" + extends + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController; + + parameter Modelica.Units.SI.Temperature TCutOff "Cut-off temperature"; + parameter Modelica.Units.SI.Temperature TBiv "Bivalence temperature"; + parameter Modelica.Units.SI.Temperature TOda_nominal "Nominal temperature "; + parameter Modelica.Units.SI.Temperature TRoom "Room set temperature"; + parameter Modelica.Units.SI.HeatFlowRate QDem_flow_nominal; + parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff; + + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.Utilities.StorageHysteresis + hysSto(final bandwidth=dTHys, final pre_y_start=true) "Storage hysteresis" + annotation (Placement(transformation(extent={{-58,18},{-18,58}}))); + + Modelica.Blocks.Logical.GreaterEqualThreshold greEquTCutOff(threshold=TCutOff) + "Check if greater than cut off temperature" + annotation (Placement(transformation(extent={{12,54},{36,78}}))); + Modelica.Blocks.Logical.And and1 + annotation (Placement(transformation(extent={{60,46},{80,66}}))); + +protected + parameter Real phiBiv = (TRoom - TBiv)/(TRoom - TOda_nominal) "Part load at bivalence temperature"; + parameter Real partLoadHeaPumAtCutOff(min=0, max=1)=QHP_flow_cutOff/QDem_flow_nominal "Percentage of nominal heat demand supplied by heat pump at cut-off temperature"; + + Real partLoadAuxHea=min(1, (TRoom - TOda)/(TRoom - TOda_nominal)); + +equation + + if TOda < TCutOff then + // Only auxilliar device is active + secGenOn =hysSto.y; + ySecGenSet = partLoadAuxHea; + elseif TOda < TBiv then + // Both devices are active + secGenOn =hysSto.y; + ySecGenSet = max(0, partLoadAuxHea - (partLoadHeaPumAtCutOff + (phiBiv - + partLoadHeaPumAtCutOff)*(TOda - TCutOff)/(TBiv - TCutOff))); + else + // Only heat pump is active + secGenOn = false; + ySecGenSet = 0; + end if; + + connect(TStoTop, hysSto.T_top) annotation (Line(points={{-120,60},{-86,60},{-86, + 38},{-62,38}}, color={0,0,127})); + connect(TSupSet, hysSto.T_set) annotation (Line(points={{0,-118},{0,-20},{-80,-20}, + {-80,54},{-62,54}}, color={0,0,127})); + connect(TStoTop, hysSto.T_bot) annotation (Line(points={{-120,60},{-92,60},{-92, + 22},{-62,22}}, color={0,0,127})); + connect(greEquTCutOff.y, and1.u1) annotation (Line(points={{37.2,66},{42,66},{ + 42,56},{58,56}}, color={255,0,255})); + connect(hysSto.y, and1.u2) annotation (Line(points={{-16,38},{42,38},{42,48},{ + 58,48}}, color={255,0,255})); + connect(and1.y, priGenOn) annotation (Line(points={{81,56},{92,56},{92,60},{110, + 60}}, color={255,0,255})); + connect(TOda, greEquTCutOff.u) + annotation (Line(points={{0,120},{0,66},{9.6,66}}, color={0,0,127})); + annotation (Icon(graphics={ Polygon( + points={{-65,89},{-73,67},{-57,67},{-65,89}}, + lineColor={192,192,192}, + fillColor={192,192,192}, + fillPattern=FillPattern.Solid),Line(points={{-65,67},{-65,-81}}, + color={192,192,192}),Line(points={{-90,-70},{82,-70}}, color={192, + 192,192}),Polygon( + points={{90,-70},{68,-62},{68,-78},{90,-70}}, + lineColor={192,192,192}, + fillColor={192,192,192}, + fillPattern=FillPattern.Solid), + Text( + extent={{-65,93},{-12,75}}, + lineColor={160,160,164}, + textString="y"),Line( + points={{-80,-70},{30,-70}}, + thickness=0.5),Line( + points={{-50,10},{80,10}}, + thickness=0.5),Line( + points={{-50,10},{-50,-70}}, + thickness=0.5),Line( + points={{30,10},{30,-70}}, + thickness=0.5),Line( + points={{-10,-65},{0,-70},{-10,-75}}, + thickness=0.5),Line( + points={{-10,15},{-20,10},{-10,5}}, + thickness=0.5),Line( + points={{-55,-20},{-50,-30},{-44,-20}}, + thickness=0.5),Line( + points={{25,-30},{30,-19},{35,-30}}, + thickness=0.5),Text( + extent={{-99,2},{-70,18}}, + lineColor={160,160,164}, + textString="true"),Text( + extent={{-98,-87},{-66,-73}}, + lineColor={160,160,164}, + textString="false"),Text( + extent={{19,-87},{44,-70}}, + lineColor={0,0,0}, + textString="uHigh"),Text( + extent={{-63,-88},{-38,-71}}, + lineColor={0,0,0}, + textString="uLow"),Line(points={{-69,10},{-60,10}}, color={160, + 160,164})}), Diagram(graphics={Rectangle( + extent={{100,-40},{20,-100}}, + lineColor={28,108,200}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), Text( + extent={{20,-50},{94,-84}}, + lineColor={28,108,200}, + textString="Internal +(see equations)")})); +end PartParallelBivalent; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/CountTimeBelowThreshold.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/CountTimeBelowThreshold.mo new file mode 100644 index 00000000..151a8a63 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/CountTimeBelowThreshold.mo @@ -0,0 +1,15 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.Utilities; +block CountTimeBelowThreshold + Modelica.Blocks.Interfaces.RealOutput y + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Interfaces.BooleanInput u + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + +algorithm + when edge(u) then + y:=time; + end when; + annotation (Icon(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, + coordinateSystem(preserveAspectRatio=false))); +end CountTimeBelowThreshold; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/StorageHysteresis.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/StorageHysteresis.mo new file mode 100644 index 00000000..a8fb0f3b --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/StorageHysteresis.mo @@ -0,0 +1,42 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.Utilities; +block StorageHysteresis "On-off controller for a storage control." + extends Modelica.Blocks.Icons.PartialBooleanBlock; + Modelica.Blocks.Interfaces.RealInput T_set "Set temperature" + annotation (Placement(transformation(extent={{-140,100},{-100,60}}))); + Modelica.Blocks.Interfaces.RealInput T_top + "Connector of Real input signal used as measurement signal of upper level storage temperature" + annotation (Placement(transformation(extent={{-140,20},{-100,-20}}))); + Modelica.Blocks.Interfaces.BooleanOutput y + "Connector of Real output signal used as actuator signal" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + + parameter Real bandwidth(start=0.1) "Bandwidth around reference signal"; + parameter Boolean pre_y_start=false "Value of pre(y) at initial time"; + + Modelica.Blocks.Interfaces.RealInput T_bot + "Connector of Real input signal used as measurement signal of bottom temperature of storage" + annotation (Placement(transformation(extent={{-140,-60},{-100,-100}}))); +initial equation + pre(y) = pre_y_start; +equation + y = pre(y) and (T_bot < T_set + bandwidth/2) or (T_top < T_set - bandwidth/2); + annotation (Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100, + -100},{100,100}}), graphics={ + Text( + extent={{-92,74},{44,44}}, + textString="reference"), + Text( + extent={{-94,-52},{-34,-74}}, + textString="u"), + Line(points={{-76,-32},{-68,-6},{-50,26},{-24,40},{-2,42},{16,36},{32,28},{48,12},{58,-6},{68,-28}}, + color={0,0,127}), + Line(points={{-78,-2},{-6,18},{82,-12}}, + color={255,0,0}), + Line(points={{-78,12},{-6,30},{82,0}}), + Line(points={{-78,-16},{-6,4},{82,-26}}), + Line(points={{-82,-18},{-56,-18},{-56,-40},{64,-40},{64,-20},{90,-20}}, + color={255,0,255})}), Documentation(info=" +

The block StorageHysteresis sets the output signal y to true when the input signal T_top falls below the T_set signal minus half of the bandwidth and sets the output signal y to false when the input signal T_bot exceeds the T_set signal plus half of the bandwidth.

+

This control ensure that the whole storage has the required temperature. If you just want to control one layer, apply the same Temperature to both T_top and T_bot.

+")); +end StorageHysteresis; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/TriggerTime.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/TriggerTime.mo new file mode 100644 index 00000000..646eef01 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/TriggerTime.mo @@ -0,0 +1,15 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.Utilities; +block TriggerTime + Modelica.Blocks.Interfaces.RealOutput y + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Interfaces.BooleanInput u(start=false, fixed=true) + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + +algorithm + when edge(u) then + y:=time; + end when; + annotation (Icon(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, + coordinateSystem(preserveAspectRatio=false))); +end TriggerTime; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/package.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/package.mo new file mode 100644 index 00000000..01ba2401 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/package.mo @@ -0,0 +1,4 @@ +within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers; +package Utilities + +end Utilities; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/package.order b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/package.order new file mode 100644 index 00000000..9445d5a9 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/package.order @@ -0,0 +1,3 @@ +TriggerTime +CountTimeBelowThreshold +StorageHysteresis diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/package.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/package.mo new file mode 100644 index 00000000..d9cd9a46 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/package.mo @@ -0,0 +1,12 @@ +within BESMod.Systems.Hydraulical.Control.Components; +package BivalentOnOffControllers "Package with models to decide wich bivalent device to use" + + + + + + + + + +end BivalentOnOffControllers; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/package.order b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/package.order new file mode 100644 index 00000000..a1cce53a --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/package.order @@ -0,0 +1,8 @@ +AlternativeBivalent +ConstantHysteresisTimeBasedHeatingRod +DegreeMinuteController +FloatingHysteresis +PartParallelBivalent +Examples +Utilities +BaseClasses diff --git a/BESMod/Systems/Hydraulical/Control/Components/BoilerInHybridSystem.mo b/BESMod/Systems/Hydraulical/Control/Components/BoilerInHybridSystem.mo index de755151..f2287626 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BoilerInHybridSystem.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BoilerInHybridSystem.mo @@ -1,6 +1,11 @@ within BESMod.Systems.Hydraulical.Control.Components; -model BoilerInHybridSystem - Modelica.Blocks.Logical.LessThreshold lesTBiv(threshold=bivalentControlData.TBiv) +model BoilerInHybridSystem "Decides when to use the boiler" + + parameter Modelica.Units.SI.Temperature TBiv "Bivalence temperature"; + parameter Modelica.Units.SI.Temperature TCutOff "Cutoff temperature"; + + + Modelica.Blocks.Logical.LessThreshold lesTBiv(threshold=TBiv) "Checks, if Toda is below Tbiv" annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); Modelica.Blocks.Logical.Or or1 @@ -12,7 +17,7 @@ model BoilerInHybridSystem Modelica.Blocks.Logical.Or or2 "if Toda is smaller than TCutOff, activate Boiler" annotation (Placement(transformation(extent={{72,-10},{92,10}}))); - Modelica.Blocks.Logical.LessThreshold lesTCutOff(threshold=bivalentControlData.TCutOff) + Modelica.Blocks.Logical.LessThreshold lesTCutOff(threshold=TCutOff) "Checks if Toda is below TCutOff" annotation (Placement(transformation(extent={{-60,50},{-40,70}}))); Modelica.Blocks.Logical.And safCtrOn diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo index 671a44e7..4917d102 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo @@ -1,6 +1,7 @@ within BESMod.Systems.Hydraulical.Control.Components; model BuildingAndDHWControl "Control model to control both building and DHW systems" + parameter Integer nZones "Number of heated zones"; parameter Modelica.Units.SI.Temperature TSup_nominal "Nominal supply temperature"; @@ -20,16 +21,19 @@ model BuildingAndDHWControl replaceable model DHWHysteresis = - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ConstantHysteresisTimeBasedHR - constrainedby BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod + constrainedby + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController "Hysteresis for DHW system" annotation (choicesAllMatching=true); replaceable model BuildingHysteresis = - BESMod.Systems.Hydraulical.Control.Components.OnOffController.ConstantHysteresisTimeBasedHR - constrainedby BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod + constrainedby + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController "Hysteresis for building" annotation (choicesAllMatching=true); replaceable model DHWSetTemperature = BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW - constrainedby BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control + constrainedby + BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control "DHW set temperture module" annotation (choicesAllMatching=true); diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialControler.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialControler.mo new file mode 100644 index 00000000..af7bd1d9 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialControler.mo @@ -0,0 +1,66 @@ +within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.BaseClasses; +partial model PartialControler "Partial controller model" + Modelica.Blocks.Interfaces.BooleanInput setOn + "True if the device is set to turn on" +annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Interfaces.RealOutput ySet "Relative set value" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Interfaces.RealInput TSet(unit="K", displayUnit="degC") + "Current set temperature" + annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); + Modelica.Blocks.Interfaces.RealInput TMea(displayUnit="degC", unit="K") + "Current measured temperature" annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=90, + origin={0,-120}))); + Modelica.Blocks.Math.Feedback feedback +annotation (Placement(transformation(extent={{4,90},{24,110}}))); + Modelica.Blocks.Continuous.Integrator intAbs "Integrator of absolute error" + annotation (Placement(transformation(extent={{70,104},{90,124}}))); + Modelica.Blocks.Interfaces.RealOutput IAE "Integral Absolute Error" +annotation (Placement(transformation(extent={{100,90},{120,110}}), + iconTransformation(extent={{100,80},{120,100}}))); + Modelica.Blocks.Interfaces.RealOutput ISE "Integral Square Error" annotation ( + Placement(transformation(extent={{100,40},{120,60}}), iconTransformation( + extent={{100,40},{120,60}}))); + Modelica.Blocks.Math.Abs abs1 +annotation (Placement(transformation(extent={{36,104},{56,124}}))); + Modelica.Blocks.Continuous.Integrator intSqu "Integrator of squared error" + annotation (Placement(transformation(extent={{70,70},{90,90}}))); + Modelica.Blocks.Math.Product pro "Square the difference" + annotation (Placement(transformation(extent={{38,70},{58,90}}))); + Modelica.Blocks.Interfaces.BooleanInput usOn(start=true) + "True if the device is actually on" + annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=90, + origin={-60,-120}))); +equation + connect(TSet, feedback.u1) annotation (Line(points={{-120,60},{-100,60},{-100, + 100},{6,100}}, color={0,0,127})); + connect(TMea, feedback.u2) annotation (Line(points={{0,-120},{0,-84},{-88,-84}, + {-88,88},{14,88},{14,92}}, color={0,0,127})); + connect( + feedback.y, abs1.u) annotation (Line(points={{23,100},{24,100},{24,114},{34, + 114}}, color={0,0,127})); + connect(abs1.y, intAbs.u) + annotation (Line(points={{57,114},{68,114}}, color={0,0,127})); + connect(intAbs.y, IAE) annotation (Line(points={{91,114},{96,114},{96,98},{110, + 98},{110,100}}, color={0,0,127})); + connect(ISE, intSqu.y) annotation (Line(points={{110,50},{100,50},{100,80},{91, + 80}}, color={0,0,127})); + connect(feedback.y, pro.u1) annotation (Line(points={{23,100},{30,100},{30,86}, + {36,86}}, color={0,0,127})); + connect(intSqu.u, pro.y) + annotation (Line(points={{68,80},{59,80}}, color={0,0,127})); + connect(feedback.y, pro.u2) annotation (Line(points={{23,100},{30,100},{30,74}, + {36,74}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid, + lineThickness=0.5)}), Diagram(graphics, + coordinateSystem(preserveAspectRatio=false))); +end PartialControler; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialHPNSetController.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialHPNSetController.mo deleted file mode 100644 index fd6ede1b..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialHPNSetController.mo +++ /dev/null @@ -1,73 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.BaseClasses; -partial model PartialHPNSetController "Partial HP Controller model" - Modelica.Blocks.Interfaces.BooleanInput HP_On - "True if heat pump is turned on according to two point controller" -annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - Modelica.Blocks.Interfaces.RealOutput n_Set "Relative compressor set value" -annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - Modelica.Blocks.Interfaces.RealInput T_Set "Current set temperature" -annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); - Modelica.Blocks.Interfaces.RealInput T_Meas "Current measured temperature" -annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=90, - origin={0,-120}))); - Modelica.Blocks.Math.Feedback feedback -annotation (Placement(transformation(extent={{4,90},{24,110}}))); - Modelica.Blocks.Continuous.Integrator integrator -annotation (Placement(transformation(extent={{70,104},{90,124}}))); - Modelica.Blocks.Interfaces.RealOutput IAE "Integral Absolute Error" -annotation (Placement(transformation(extent={{100,90},{120,110}}), - iconTransformation(extent={{100,80},{120,100}}))); - Modelica.Blocks.Interfaces.RealOutput ISE "Integral Square Error" annotation ( - Placement(transformation(extent={{100,40},{120,60}}), iconTransformation( - extent={{100,40},{120,60}}))); - Modelica.Blocks.Math.Abs abs1 -annotation (Placement(transformation(extent={{36,104},{56,124}}))); - Modelica.Blocks.Continuous.Integrator integrator1 -annotation (Placement(transformation(extent={{70,70},{90,90}}))); - Modelica.Blocks.Math.Product product "Square the difference" -annotation (Placement(transformation(extent={{38,70},{58,90}}))); - Modelica.Blocks.Interfaces.BooleanInput IsOn(start=true) - "True if heat pump is actually on" annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=90, - origin={-60,-120}))); -equation - connect( - T_Set, feedback.u1) annotation (Line(points={{-120,60},{-100,60},{ - -100,100},{6,100}}, color={0,0,127})); - connect( - T_Meas, feedback.u2) annotation (Line(points={{0,-120},{0,-84},{-88, - -84},{-88,88},{14,88},{14,92}}, color={0,0,127})); - connect( - feedback.y, abs1.u) annotation (Line(points={{23,100},{24,100},{24, - 114},{34,114}}, color={0,0,127})); - connect( - abs1.y, integrator.u) -annotation (Line(points={{57,114},{68,114}}, color={0,0,127})); - connect( - integrator.y, IAE) annotation (Line(points={{91,114},{96,114},{96,98}, - {110,98},{110,100}}, color={0,0,127})); - connect( - ISE, integrator1.y) -annotation (Line(points={{110,50},{100,50},{100,80},{91,80}}, - color={0,0,127})); - connect( - feedback.y, product.u1) annotation (Line(points={{23,100},{30,100},{ - 30,86},{36,86}}, color={0,0,127})); - connect( - integrator1.u, product.y) -annotation (Line(points={{68,80},{59,80}}, color={0,0,127})); - connect( - feedback.y, product.u2) annotation (Line(points={{23,100},{30,100},{ - 30,74},{36,74}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.Solid, - lineThickness=0.5)}), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false))); -end PartialHPNSetController; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialInverterHeatPumpController.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialPID.mo similarity index 55% rename from BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialInverterHeatPumpController.mo rename to BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialPID.mo index 1f7b1259..35f18673 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialInverterHeatPumpController.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialPID.mo @@ -1,17 +1,16 @@ within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.BaseClasses; -model PartialInverterHeatPumpController - "Partial controller for inverter controlled heat pumps" - extends BaseClasses.PartialHPNSetController(HP_On(start=true)); +model PartialPID "Partial PID controller for inverter controlled devices" + extends PartialControler( setOn(start=true)); parameter Real P "Gain of PID-controller"; parameter Real yMax=1 "Upper limit of output"; parameter Real yOff=0 "Constant output value if device is turned off"; parameter Real y_start=0 "Initial value of output"; - parameter Real nMin=0.5 "Lower limit of compressor frequency - default 0.5"; + parameter Real yMin "Lower limit of relative speed"; BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.LimPID PID( final k=P, final yMax=yMax, - final yMin=nMin, + final yMin=yMin, final wp=1, final wd=0, final initType=Modelica.Blocks.Types.Init.InitialState, @@ -23,9 +22,7 @@ model PartialInverterHeatPumpController final limitsAtInit=true) annotation (Placement(transformation(extent={{-30,22},{6,58}}))); - - - Modelica.Blocks.Logical.Switch onOffSwitch + Modelica.Blocks.Logical.Switch onOffSwi "Switch on off" annotation (Placement(transformation(extent={{38,-14},{68,16}}))); Modelica.Blocks.Sources.Constant const(final k=yOff) "HP turned off" annotation (Placement(transformation(extent={{-6,-36},{10,-20}}))); @@ -33,22 +30,22 @@ model PartialInverterHeatPumpController annotation (Placement(transformation(extent={{-52,-64},{-32,-44}}))); equation - connect(HP_On, onOffSwitch.u2) annotation (Line(points={{-120,0},{34,0},{34,1}, - {35,1}}, color={255,0,255})); - connect(onOffSwitch.y, n_Set) annotation (Line(points={{69.5,1},{74,1},{74,0}, - {110,0}}, color={0,0,127})); - connect(const.y, onOffSwitch.u3) + connect(setOn, onOffSwi.u2) + annotation (Line(points={{-120,0},{34,0},{34,1},{35,1}}, color={255,0,255})); + connect(onOffSwi.y, ySet) + annotation (Line(points={{69.5,1},{74,1},{74,0},{110,0}}, color={0,0,127})); + connect(const.y, onOffSwi.u3) annotation (Line(points={{10.8,-28},{35,-28},{35,-11}}, color={0,0,127})); - connect(PID.y, onOffSwitch.u1) annotation (Line(points={{7.8,40},{14,40},{14, - 13},{35,13}}, color={0,0,127})); - connect(T_Set, PID.u_s) annotation (Line(points={{-120,60},{-70,60},{-70,40}, - {-33.6,40}}, color={0,0,127})); - connect(T_Meas, PID.u_m) annotation (Line(points={{0,-120},{0,-54},{-12,-54}, - {-12,18.4}}, color={0,0,127})); + connect(PID.y, onOffSwi.u1) annotation (Line(points={{7.8,40},{14,40},{14,13},{35, + 13}}, color={0,0,127})); + connect(TSet, PID.u_s) annotation (Line(points={{-120,60},{-70,60},{-70,40},{-33.6, + 40}}, color={0,0,127})); + connect(TMea, PID.u_m) annotation (Line(points={{0,-120},{0,-54},{-12,-54},{-12, + 18.4}}, color={0,0,127})); connect(and1.y, PID.IsOn) annotation (Line(points={{-31,-54},{-22.8,-54},{ -22.8,18.4}}, color={255,0,255})); - connect(HP_On, and1.u1) annotation (Line(points={{-120,0},{-72,0},{-72,-54},{ + connect(setOn, and1.u1) annotation (Line(points={{-120,0},{-72,0},{-72,-54},{ -54,-54}}, color={255,0,255})); - connect(IsOn, and1.u2) annotation (Line(points={{-60,-120},{-60,-62},{-54,-62}}, + connect(usOn, and1.u2) annotation (Line(points={{-60,-120},{-60,-62},{-54,-62}}, color={255,0,255})); -end PartialInverterHeatPumpController; +end PartialPID; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/package.order index a2ecf8a0..e0fdce0e 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/package.order @@ -1,2 +1,2 @@ -PartialHPNSetController -PartialInverterHeatPumpController +PartialControler +PartialPID diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/OnOff.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/OnOff.mo new file mode 100644 index 00000000..7f164bc7 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/OnOff.mo @@ -0,0 +1,28 @@ +within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController; +model OnOff "On off controller" + extends BaseClasses.PartialHPNSetController; + + Modelica.Blocks.Math.BooleanToReal booToRea(final realTrue=yMax, final + realFalse=0) "Convert boolean signal to real" annotation (Placement( + transformation(extent={{12,-12},{-12,12}}, rotation=180))); +equation + connect(setOn, booToRea.u) annotation (Line(points={{-120,0},{-67.1,0},{-67.1, + 2.10942e-15},{-14.4,2.10942e-15}}, color={255,0,255})); + connect(booToRea.y, ySet) annotation (Line(points={{13.2,-1.33227e-15},{60.55, + -1.33227e-15},{60.55,0},{110,0}}, color={0,0,127})); + annotation (Icon(graphics={ + Line(points={{-100.0,0.0},{-45.0,0.0}}, + color={0,0,127}), + Ellipse(lineColor={0,0,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + extent={{-45.0,-10.0},{-25.0,10.0}}), + Line(points={{-35.0,0.0},{30.0,35.0}}, + color={0,0,127}), + Line(points={{45.0,0.0},{100.0,0.0}}, + color={0,0,127}), + Ellipse(lineColor={0,0,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + extent={{25.0,-10.0},{45.0,10.0}})})); +end OnOff; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/OnOffHeatPumpController.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/OnOffHeatPumpController.mo deleted file mode 100644 index a290ba33..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/OnOffHeatPumpController.mo +++ /dev/null @@ -1,37 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController; -model OnOffHeatPumpController - "Controller for a on off heat pump, either zero or one" - extends BaseClasses.PartialHPNSetController; - - parameter Real n_opt "Frequency of the heat pump map with an optimal isentropic efficiency. Necessary, as on-off HP will be optimized for this frequency and only used there."; - - Modelica.Blocks.Math.BooleanToReal hp_on_to_n_hp - annotation (Placement(transformation(extent={{22,-22},{-22,22}}, - rotation=180, - origin={-4,3.55271e-15}))); - Modelica.Blocks.Math.Gain gain(final k=n_opt) - annotation (Placement(transformation(extent={{56,-10},{76,10}}))); -equation - connect(HP_On, hp_on_to_n_hp.u) annotation (Line(points={{-120,0},{-76,0},{ - -76,7.54952e-15},{-30.4,7.54952e-15}}, color={255,0,255})); - connect(hp_on_to_n_hp.y, gain.u) annotation (Line(points={{20.2,1.55431e-15}, - {28,1.55431e-15},{28,0},{54,0}}, - color={0,0,127})); - connect(gain.y, n_Set) annotation (Line(points={{77,0},{110,0}}, - color={0,0,127})); - annotation (Icon(graphics={ - Line(points={{-100.0,0.0},{-45.0,0.0}}, - color={0,0,127}), - Ellipse(lineColor={0,0,127}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - extent={{-45.0,-10.0},{-25.0,10.0}}), - Line(points={{-35.0,0.0},{30.0,35.0}}, - color={0,0,127}), - Line(points={{45.0,0.0},{100.0,0.0}}, - color={0,0,127}), - Ellipse(lineColor={0,0,127}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - extent={{25.0,-10.0},{45.0,10.0}})})); -end OnOffHeatPumpController; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/P_InverterHeatPumpController.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/P.mo similarity index 87% rename from BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/P_InverterHeatPumpController.mo rename to BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/P.mo index 30666469..c40542e2 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/P_InverterHeatPumpController.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/P.mo @@ -1,6 +1,5 @@ within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController; -model P_InverterHeatPumpController - "P-Controller for inverter controlled heat pumps" +model P "P-Controller for inverter controlled devices" extends BaseClasses.PartialInverterHeatPumpController(PID(controllerType= Modelica.Blocks.Types.SimpleController.P)); @@ -18,4 +17,4 @@ model P_InverterHeatPumpController fillPattern=FillPattern.Solid), Line(points={{-90,-80},{82,-80}}, color={192,192,192}), Line(points={{-80,-80},{-80,-20},{-80,2},{76,2}}, color={0,0,127})})); -end P_InverterHeatPumpController; +end P; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PI_InverterHeatPumpController.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PI.mo similarity index 77% rename from BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PI_InverterHeatPumpController.mo rename to BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PI.mo index e2734be2..262d3b4e 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PI_InverterHeatPumpController.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PI.mo @@ -1,12 +1,11 @@ within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController; -model PI_InverterHeatPumpController - "PI-Controller for inverter controlled heat pumps" +model PI "PI-Controller for inverter controlled devices" extends HeatPumpNSetController.BaseClasses.PartialInverterHeatPumpController( - PID( + PID( controllerType=Modelica.Blocks.Types.SimpleController.PI, - Ti=T_I, + final Ti=timeInt, final Ni=Ni)); - parameter Modelica.Units.SI.Time T_I "Time constant of Integrator block"; + parameter Modelica.Units.SI.Time timeInt "Time constant of Integrator block"; parameter Real Ni=0.9 "Ni*Ti is time constant of anti-windup compensation"; annotation (Icon(graphics={ Polygon( @@ -23,4 +22,4 @@ model PI_InverterHeatPumpController Line(points={{-90,-80},{82,-80}}, color={192,192,192}), Line(points={{-80,-80},{-80,-20},{-80,-20},{52,80}}, color={0,0,127})})); -end PI_InverterHeatPumpController; +end PI; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PID.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PID.mo new file mode 100644 index 00000000..528a30eb --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PID.mo @@ -0,0 +1,24 @@ +within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController; +model PID "PID-Controller for inverter controlled devices" + extends HeatPumpNSetController.PI(PID( + controllerType=Modelica.Blocks.Types.SimpleController.PID, + final Td=timeDer, + final Nd=Nd)); + parameter Modelica.Units.SI.Time timeDer "Time constant of Derivative block"; + parameter Real Nd=10 "The higher Nd, the more ideal the derivative block"; + annotation (Icon(graphics={ + Line(points={{-78,-80},{-78,52},{-78,-18},{-78,-80}}, + color={0,0,127}), + Polygon( + points={{-80,90},{-88,68},{-72,68},{-80,90}}, + lineColor={192,192,192}, + fillColor={192,192,192}, + fillPattern=FillPattern.Solid), + Line(points={{-80,78},{-80,-90}}, color={192,192,192}), + Polygon( + points={{90,-80},{68,-72},{68,-88},{90,-80}}, + lineColor={192,192,192}, + fillColor={192,192,192}, + fillPattern=FillPattern.Solid), + Line(points={{-90,-80},{82,-80}}, color={192,192,192})})); +end PID; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PID_InverterHeatPumpController.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PID_InverterHeatPumpController.mo deleted file mode 100644 index 89229c53..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PID_InverterHeatPumpController.mo +++ /dev/null @@ -1,29 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController; -model PID_InverterHeatPumpController - "PID-Controller for inverter controlled heat pumps" - extends HeatPumpNSetController.BaseClasses.PartialInverterHeatPumpController( - PID( - controllerType=Modelica.Blocks.Types.SimpleController.PID, - final Ti=T_I, - final Td=T_D, - final Ni=Ni, - final Nd=Nd)); - parameter Modelica.Units.SI.Time T_I "Time constant of Integrator block"; - parameter Modelica.Units.SI.Time T_D "Time constant of Derivative block"; - parameter Real Ni=0.9 "Ni*Ti is time constant of anti-windup compensation"; - parameter Real Nd=10 "The higher Nd, the more ideal the derivative block"; - annotation (Icon(graphics={ - Line(points={{-78,-80},{-78,52},{-76,-52},{68,76}},color={0,0,127}), - Polygon( - points={{-80,90},{-88,68},{-72,68},{-80,90}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid), - Line(points={{-80,78},{-80,-90}}, color={192,192,192}), - Polygon( - points={{90,-80},{68,-72},{68,-88},{90,-80}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid), - Line(points={{-90,-80},{82,-80}}, color={192,192,192})})); -end PID_InverterHeatPumpController; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/package.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/package.mo deleted file mode 100644 index ec5eae19..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/package.mo +++ /dev/null @@ -1,9 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components; -package HeatPumpNSetController "Models for calculating the relative compressor speed n_set" - - - - - - -end HeatPumpNSetController; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/package.order b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/package.order index 3a183811..141c9121 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/package.order @@ -1,6 +1,6 @@ BaseClasses -OnOffHeatPumpController -P_InverterHeatPumpController -PI_InverterHeatPumpController -PID_InverterHeatPumpController +OnOff +P +PI +PID LimPID diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/package.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/package.mo deleted file mode 100644 index bcfe81df..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/package.mo +++ /dev/null @@ -1,12 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components; -package OnOffController "Package for models of simple on off controls" - - - - - - - - - -end OnOffController; diff --git a/BESMod/Systems/Hydraulical/Control/Components/ParallelValveController.mo b/BESMod/Systems/Hydraulical/Control/Components/ParallelValveController.mo new file mode 100644 index 00000000..dfeef1f5 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/ParallelValveController.mo @@ -0,0 +1,34 @@ +within BESMod.Systems.Hydraulical.Control.Components; +model ParallelValveController + "Model to switch a three way valve based on device usage" + Modelica.Blocks.Interfaces.BooleanInput priGen + "=true if primary generator should be on" + annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}))); + Modelica.Blocks.Interfaces.BooleanInput secGen + "=true if secondary generator should be used" + annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); + Modelica.Blocks.Interfaces.RealOutput uThrWayVal + "1 for primary device, 0 for secondary device" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + +equation + if secGen and not priGen then + uThrWayVal = 0; + elseif priGen and not secGen then + uThrWayVal = 1; + else + uThrWayVal = 0.5; + end if; + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +

+ Model to controla three way valve in a + parallel configuration of two heating devives. +

+

+ If only one device is running, switch fully to that side. + Else, let the valve half open. +

+")); +end ParallelValveController; diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/LimPID.mo b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/LimPID.mo new file mode 100644 index 00000000..0e0ac6b5 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/LimPID.mo @@ -0,0 +1,400 @@ +within BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.BaseClasses; +block LimPID + "P, PI, PD, and PID controller with limited output, anti-windup compensation, setpoint weighting and optional feed-forward" + import InitPID = + Modelica.Blocks.Types.Init; + import Modelica.Blocks.Types.Init; + import Modelica.Blocks.Types.SimpleController; + extends Modelica.Blocks.Interfaces.SVcontrol; + output Real controlError = u_s - u_m + "Control error (set point - measurement)"; + parameter .Modelica.Blocks.Types.SimpleController controllerType= + .Modelica.Blocks.Types.SimpleController.PID "Type of controller"; + parameter Real k(min=0, unit="1") = 1 "Gain of controller"; + parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 + "Time constant of Integrator block" annotation (Dialog(enable= + controllerType == .Modelica.Blocks.Types.SimpleController.PI or + controllerType == .Modelica.Blocks.Types.SimpleController.PID)); + parameter Modelica.Units.SI.Time Td(min=0) = 0.1 + "Time constant of Derivative block" annotation (Dialog(enable= + controllerType == .Modelica.Blocks.Types.SimpleController.PD or + controllerType == .Modelica.Blocks.Types.SimpleController.PID)); + parameter Real yMax(start=1) "Upper limit of output"; + parameter Real yMin=-yMax "Lower limit of output"; + parameter Real wp(min=0) = 1 + "Set-point weight for Proportional block (0..1)"; + parameter Real wd(min=0) = 0 "Set-point weight for Derivative block (0..1)" + annotation(Dialog(enable=controllerType==.Modelica.Blocks.Types.SimpleController.PD or + controllerType==.Modelica.Blocks.Types.SimpleController.PID)); + parameter Real Ni(min=100*Modelica.Constants.eps) = 0.9 + "Ni*Ti is time constant of anti-windup compensation" + annotation(Dialog(enable=controllerType==.Modelica.Blocks.Types.SimpleController.PI or + controllerType==.Modelica.Blocks.Types.SimpleController.PID)); + parameter Real Nd(min=100*Modelica.Constants.eps) = 10 + "The higher Nd, the more ideal the derivative block" + annotation(Dialog(enable=controllerType==.Modelica.Blocks.Types.SimpleController.PD or + controllerType==.Modelica.Blocks.Types.SimpleController.PID)); + parameter Boolean withFeedForward=false "Use feed-forward input?" + annotation(Evaluate=true, choices(checkBox=true)); + parameter Real kFF=1 "Gain of feed-forward input" + annotation(Dialog(enable=withFeedForward)); + parameter .Modelica.Blocks.Types.Init initType=.Modelica.Blocks.Types.Init.InitialState + "Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)" + annotation (Evaluate=true, Dialog(group="Initialization")); + parameter Real xi_start=0 + "Initial or guess value for integrator output (= integrator state)" + annotation (Dialog(group="Initialization", + enable=controllerType==.Modelica.Blocks.Types.SimpleController.PI or + controllerType==.Modelica.Blocks.Types.SimpleController.PID)); + parameter Real xd_start=0 + "Initial or guess value for state of derivative block" + annotation (Dialog(group="Initialization", + enable=controllerType==.Modelica.Blocks.Types.SimpleController.PD or + controllerType==.Modelica.Blocks.Types.SimpleController.PID)); + parameter Real y_start=0 "Initial value of output" + annotation(Dialog(enable=initType == .Modelica.Blocks.Types.Init.InitialOutput, group= + "Initialization")); + parameter Modelica.Blocks.Types.LimiterHomotopy homotopyType = Modelica.Blocks.Types.LimiterHomotopy.Linear + "Simplified model for homotopy-based initialization" + annotation (Evaluate=true, Dialog(group="Initialization")); + parameter Boolean strict=false "= true, if strict limits with noEvent(..)" + annotation (Evaluate=true, choices(checkBox=true), Dialog(tab="Advanced")); + parameter Boolean limitsAtInit=true + "Has no longer an effect and is only kept for backwards compatibility (the implementation uses now the homotopy operator)" + annotation (Dialog(tab="Dummy"),Evaluate=true, choices(checkBox=true)); + constant Modelica.Units.SI.Time unitTime=1 annotation (HideResult=true); + Modelica.Blocks.Interfaces.RealInput u_ff if withFeedForward + "Optional connector of feed-forward input signal" + annotation (Placement( + transformation( + origin={60,-120}, + extent={{20,-20},{-20,20}}, + rotation=270))); + Modelica.Blocks.Math.Add addP(k1=wp, k2=-1) + annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); + Modelica.Blocks.Math.Add addD(k1=wd, k2=-1) if with_D + annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); + Modelica.Blocks.Math.Gain P(k=1) + annotation (Placement(transformation(extent={{-50,40},{-30,60}}))); + Modelica.Blocks.Continuous.Integrator I( + k=unitTime/Ti, + use_reset=true, + y_start=xi_start, + initType=if initType == InitPID.SteadyState then Init.SteadyState else if + initType == InitPID.InitialState or initType == InitPID.InitialState + then Init.InitialState else Init.NoInit) if with_I + annotation (Placement(transformation(extent={{-50,-60},{-30,-40}}))); + Modelica.Blocks.Continuous.Derivative D( + k=Td/unitTime, + T=max([Td/Nd,1.e-14]), + x_start=xd_start, + initType=if initType ==InitPID.SteadyState or initType ==InitPID.InitialOutput + then Init.SteadyState else if initType ==InitPID.InitialState then + Init.InitialState else Init.NoInit) if with_D + annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); + Modelica.Blocks.Math.Gain gainPID(k=k) + annotation (Placement(transformation(extent={{20,-10},{40,10}}))); + Modelica.Blocks.Math.Add3 addPID + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + Modelica.Blocks.Math.Add3 addI(k2=-1) if with_I + annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); + Modelica.Blocks.Math.Add addSat(k1=+1, k2=-1) if with_I annotation (Placement( + transformation( + origin={80,-50}, + extent={{-10,-10},{10,10}}, + rotation=270))); + Modelica.Blocks.Math.Gain gainTrack(k=1/(k*Ni)) if with_I + annotation (Placement(transformation(extent={{0,-80},{-20,-60}}))); + Modelica.Blocks.Nonlinear.Limiter limiter( + uMax=yMax, + uMin=yMin, + strict=strict, + homotopyType=homotopyType) + annotation (Placement(transformation(extent={{70,-10},{90,10}}))); +protected + parameter Boolean with_I = controllerType==SimpleController.PI or + Ti - Modelica.Constants.inf < 0 or + controllerType==SimpleController.PID annotation(Evaluate=true, HideResult=true); + parameter Boolean with_D = controllerType==SimpleController.PD or + Td > 0 or + controllerType==SimpleController.PID annotation(Evaluate=true, HideResult=true); +public + Modelica.Blocks.Sources.Constant Dzero(k=0) if not with_D + annotation (Placement(transformation(extent={{-40,20},{-30,30}}))); + Modelica.Blocks.Sources.Constant Izero(k=0) if not with_I + annotation (Placement(transformation(extent={{0,-55},{-10,-45}}))); + Modelica.Blocks.Sources.Constant FFzero(k=0) if not withFeedForward + annotation (Placement(transformation(extent={{30,-35},{40,-25}}))); + Modelica.Blocks.Math.Add addFF(k1=1, k2=kFF) + annotation (Placement(transformation(extent={{48,-6},{60,6}}))); + Modelica.Blocks.Interfaces.BooleanInput IsOn(start=true) + "True if heat pump is actually on" annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=90, + origin={-60,-120}))); +initial equation + if initType==InitPID.InitialOutput then + gainPID.y = y_start; + end if; +equation + if initType ==InitPID.InitialOutput and (y_start < yMin or y_start > yMax) then + Modelica.Utilities.Streams.error("LimPID: Start value y_start (=" + String(y_start) + + ") is outside of the limits of yMin (=" + String(yMin) +") and yMax (=" + String(yMax) + ")"); + end if; + + connect(u_s, addP.u1) annotation (Line(points={{-120,0},{-96,0},{-96,56},{ + -82,56}}, color={0,0,127})); + connect(u_s, addD.u1) annotation (Line(points={{-120,0},{-96,0},{-96,6},{ + -82,6}}, color={0,0,127})); + connect(u_s, addI.u1) annotation (Line(points={{-120,0},{-96,0},{-96,-42},{ + -82,-42}}, color={0,0,127})); + connect(addP.y, P.u) annotation (Line(points={{-59,50},{-52,50}}, color={0, + 0,127})); + connect(addD.y, D.u) + annotation (Line(points={{-59,0},{-52,0}}, color={0,0,127})); + connect(addI.y, I.u) annotation (Line(points={{-59,-50},{-52,-50}}, color={ + 0,0,127})); + connect(P.y, addPID.u1) annotation (Line(points={{-29,50},{-20,50},{-20,8},{-12, + 8}}, color={0,0,127})); + connect(D.y, addPID.u2) + annotation (Line(points={{-29,0},{-12,0}},color={0,0,127})); + connect(I.y, addPID.u3) annotation (Line(points={{-29,-50},{-20,-50},{-20,-8}, + {-12,-8}}, color={0,0,127})); + connect(limiter.y, addSat.u1) annotation (Line(points={{91,0},{94,0},{94, + -20},{86,-20},{86,-38}}, color={0,0,127})); + connect(limiter.y, y) + annotation (Line(points={{91,0},{110,0}}, color={0,0,127})); + connect(addSat.y, gainTrack.u) annotation (Line(points={{80,-61},{80,-70},{2,-70}}, + color={0,0,127})); + connect(gainTrack.y, addI.u3) annotation (Line(points={{-21,-70},{-88,-70},{-88, + -58},{-82,-58}}, color={0,0,127})); + connect(u_m, addP.u2) annotation (Line( + points={{0,-120},{0,-92},{-92,-92},{-92,44},{-82,44}}, + color={0,0,127}, + thickness=0.5)); + connect(u_m, addD.u2) annotation (Line( + points={{0,-120},{0,-92},{-92,-92},{-92,-6},{-82,-6}}, + color={0,0,127}, + thickness=0.5)); + connect(u_m, addI.u2) annotation (Line( + points={{0,-120},{0,-92},{-92,-92},{-92,-50},{-82,-50}}, + color={0,0,127}, + thickness=0.5)); + connect(Dzero.y, addPID.u2) annotation (Line(points={{-29.5,25},{-24,25},{-24, + 0},{-12,0}}, color={0,0,127})); + connect(Izero.y, addPID.u3) annotation (Line(points={{-10.5,-50},{-20,-50},{-20, + -8},{-12,-8}}, color={0,0,127})); + connect(addPID.y, gainPID.u) + annotation (Line(points={{11,0},{18,0}}, color={0,0,127})); + connect(addFF.y, limiter.u) + annotation (Line(points={{60.6,0},{68,0}}, color={0,0,127})); + connect(gainPID.y, addFF.u1) annotation (Line(points={{41,0},{44,0},{44,3.6}, + {46.8,3.6}},color={0,0,127})); + connect(FFzero.y, addFF.u2) annotation (Line(points={{40.5,-30},{44,-30},{44, + -3.6},{46.8,-3.6}}, + color={0,0,127})); + connect(addFF.u2, u_ff) annotation (Line(points={{46.8,-3.6},{44,-3.6},{44, + -92},{60,-92},{60,-120}}, + color={0,0,127})); + connect(addFF.y, addSat.u2) annotation (Line(points={{60.6,0},{64,0},{64,-20}, + {74,-20},{74,-38}}, color={0,0,127})); + connect(IsOn, I.reset) annotation (Line(points={{-60,-120},{-60,-80},{-34,-80}, + {-34,-62}}, color={255,0,255})); + annotation (defaultComponentName="PID", + Icon(coordinateSystem( + preserveAspectRatio=true, + extent={{-100,-100},{100,100}}), graphics={ + Line(points={{-80,78},{-80,-90}}, color={192,192,192}), + Polygon( + points={{-80,90},{-88,68},{-72,68},{-80,90}}, + lineColor={192,192,192}, + fillColor={192,192,192}, + fillPattern=FillPattern.Solid), + Line(points={{-90,-80},{82,-80}}, color={192,192,192}), + Polygon( + points={{90,-80},{68,-72},{68,-88},{90,-80}}, + lineColor={192,192,192}, + fillColor={192,192,192}, + fillPattern=FillPattern.Solid), + Line(points={{-80,-80},{-80,-20},{30,60},{80,60}}, color={0,0,127}), + Text( + extent={{-20,-20},{80,-60}}, + lineColor={192,192,192}, + textString="%controllerType"), + Line( + visible=strict, + points={{30,60},{81,60}}, + color={255,0,0})}), + Diagram(graphics={Text( + extent={{79,-112},{129,-102}}, + lineColor={0,0,255}, + textString=" (feed-forward)")}), + Documentation(info=" +

+Via parameter controllerType either P, PI, PD, +or PID can be selected. If, e.g., PI is selected, all components belonging to the +D-part are removed from the block (via conditional declarations). +The example model +Modelica.Blocks.Examples.PID_Controller +demonstrates the usage of this controller. +Several practical aspects of PID controller design are incorporated +according to chapter 3 of the book: +

+ +
+
Åström K.J., and Hägglund T.:
+
PID Controllers: Theory, Design, and Tuning. + Instrument Society of America, 2nd edition, 1995. +
+
+ +

+Besides the additive proportional, integral and derivative +part of this controller, the following features are present: +

+
    +
  • The output of this controller is limited. If the controller is + in its limits, anti-windup compensation is activated to drive + the integrator state to zero.
  • +
  • The high-frequency gain of the derivative part is limited + to avoid excessive amplification of measurement noise.
  • +
  • Setpoint weighting is present, which allows to weight + the setpoint in the proportional and the derivative part + independently from the measurement. The controller will respond + to load disturbances and measurement noise independently of this setting + (parameters wp, wd). However, setpoint changes will depend on this + setting. For example, it is useful to set the setpoint weight wd + for the derivative part to zero, if steps may occur in the + setpoint signal.
  • +
  • Optional feed-forward. It is possible to add a feed-forward signal. + The feed-forward signal is added before limitation.
  • +
+ +

+The parameters of the controller can be manually adjusted by performing +simulations of the closed loop system (= controller + plant connected +together) and using the following strategy: +

+ +
    +
  1. Set very large limits, e.g., yMax = Modelica.Constants.inf
  2. +
  3. Select a P-controller and manually enlarge parameter k + (the total gain of the controller) until the closed-loop response + cannot be improved any more.
  4. +
  5. Select a PI-controller and manually adjust parameters + k and Ti (the time constant of the integrator). + The first value of Ti can be selected, such that it is in the + order of the time constant of the oscillations occurring with + the P-controller. If, e.g., vibrations in the order of T=10 ms + occur in the previous step, start with Ti=0.01 s.
  6. +
  7. If you want to make the reaction of the control loop faster + (but probably less robust against disturbances and measurement noise) + select a PID-Controller and manually adjust parameters + k, Ti, Td (time constant of derivative block).
  8. +
  9. Set the limits yMax and yMin according to your specification.
  10. +
  11. Perform simulations such that the output of the PID controller + goes in its limits. Tune Ni (Ni*Ti is the time constant of + the anti-windup compensation) such that the input to the limiter + block (= limiter.u) goes quickly enough back to its limits. + If Ni is decreased, this happens faster. If Ni=infinity, the + anti-windup compensation is switched off and the controller works bad.
  12. +
+ +

+Initialization +

+ +

+This block can be initialized in different +ways controlled by parameter initType. The possible +values of initType are defined in +Modelica.Blocks.Types.InitPID. +This type is identical to +Types.Init, +with the only exception that the additional option +DoNotUse_InitialIntegratorState is added for +backward compatibility reasons (= integrator is initialized with +InitialState whereas differential part is initialized with +NoInit which was the initialization in version 2.2 of the Modelica +standard library). +

+ +

+Based on the setting of initType, the integrator (I) and derivative (D) +blocks inside the PID controller are initialized according to the following table: +

+ + + + + + + + + + + + + + + + + + + + + + + + + +
initTypeI.initTypeD.initType
NoInitNoInitNoInit
SteadyStateSteadyStateSteadyState
InitialStateInitialStateInitialState
InitialOutput
+ and initial equation: y = y_start
NoInitSteadyState
DoNotUse_InitialIntegratorStateInitialStateNoInit
+ +

+In many cases, the most useful initial condition is +SteadyState because initial transients are then no longer +present. If initType = InitPID.SteadyState, then in some +cases difficulties might occur. The reason is the +equation of the integrator: +

+ +
+   der(y) = k*u;
+
+ +

+The steady state equation \"der(x)=0\" leads to the condition that the input u to the +integrator is zero. If the input u is already (directly or indirectly) defined +by another initial condition, then the initialization problem is singular +(has none or infinitely many solutions). This situation occurs often +for mechanical systems, where, e.g., u = desiredSpeed - measuredSpeed and +since speed is both a state and a derivative, it is natural to +initialize it with zero. As sketched this is, however, not possible. +The solution is to not initialize u_m or the variable that is used +to compute u_m by an algebraic equation. +

+ +

+When initializing in steady-state, homotopy-based initialization can help the convergence of the solver, +by using a simplified model a the beginning of the solution process. Different options are available. +

+ +
    +
  • homotopyType=Linear (default): the limitations are removed from the simplified model, +making it linear. Use this if you know that the controller will not be saturated at steady state.
  • +
  • homotopyType=UpperLimit: if it is known a priori the controller will be stuck at the upper +limit yMax, this option assumes y = yMax as a simplified model.
  • +
  • homotopyType=LowerLimit: if it is known a priori the controller will be stuck at the lower +limit yMin, this option assumes y = yMin as a simplified model.
  • +
  • homotopyType=NoHomotopy: this option does not apply any simplification and keeps the +limiter active throughout the homotopy transformation. Use this if it is unknown whether the controller +is saturated or not at initialization and if the limitations on the output must be enforced throughout +the entire homotopy transformation.
  • +
+ +

+The parameter limitAtInit is obsolete since MSL 3.2.2 and only kept for backwards compatibility. +

+")); +end LimPID; diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PartialControler.mo b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PartialControler.mo new file mode 100644 index 00000000..f08b3426 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PartialControler.mo @@ -0,0 +1,66 @@ +within BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.BaseClasses; +partial model PartialControler "Partial controller model" + Modelica.Blocks.Interfaces.BooleanInput setOn(final start=true) + "True if the device is set to turn on" +annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Interfaces.RealOutput ySet "Relative set value" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Interfaces.RealInput TSet(unit="K", displayUnit="degC") + "Current set temperature" + annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); + Modelica.Blocks.Interfaces.RealInput TMea(displayUnit="degC", unit="K") + "Current measured temperature" annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=90, + origin={0,-120}))); + Modelica.Blocks.Math.Feedback feedback +annotation (Placement(transformation(extent={{4,90},{24,110}}))); + Modelica.Blocks.Continuous.Integrator intAbs "Integrator of absolute error" + annotation (Placement(transformation(extent={{70,104},{90,124}}))); + Modelica.Blocks.Interfaces.RealOutput IAE "Integral Absolute Error" +annotation (Placement(transformation(extent={{100,90},{120,110}}), + iconTransformation(extent={{100,80},{120,100}}))); + Modelica.Blocks.Interfaces.RealOutput ISE "Integral Square Error" annotation ( + Placement(transformation(extent={{100,40},{120,60}}), iconTransformation( + extent={{100,40},{120,60}}))); + Modelica.Blocks.Math.Abs abs1 +annotation (Placement(transformation(extent={{36,104},{56,124}}))); + Modelica.Blocks.Continuous.Integrator intSqu "Integrator of squared error" + annotation (Placement(transformation(extent={{70,70},{90,90}}))); + Modelica.Blocks.Math.Product pro "Square the difference" + annotation (Placement(transformation(extent={{38,70},{58,90}}))); + Modelica.Blocks.Interfaces.BooleanInput isOn(final start=true) + "True if the device is actually on" + annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=90, + origin={-60,-120}))); +equation + connect(TSet, feedback.u1) annotation (Line(points={{-120,60},{-100,60},{-100, + 100},{6,100}}, color={0,0,127})); + connect(TMea, feedback.u2) annotation (Line(points={{0,-120},{0,-84},{-88,-84}, + {-88,88},{14,88},{14,92}}, color={0,0,127})); + connect( + feedback.y, abs1.u) annotation (Line(points={{23,100},{24,100},{24,114},{34, + 114}}, color={0,0,127})); + connect(abs1.y, intAbs.u) + annotation (Line(points={{57,114},{68,114}}, color={0,0,127})); + connect(intAbs.y, IAE) annotation (Line(points={{91,114},{96,114},{96,98},{110, + 98},{110,100}}, color={0,0,127})); + connect(ISE, intSqu.y) annotation (Line(points={{110,50},{100,50},{100,80},{91, + 80}}, color={0,0,127})); + connect(feedback.y, pro.u1) annotation (Line(points={{23,100},{30,100},{30,86}, + {36,86}}, color={0,0,127})); + connect(intSqu.u, pro.y) + annotation (Line(points={{68,80},{59,80}}, color={0,0,127})); + connect(feedback.y, pro.u2) annotation (Line(points={{23,100},{30,100},{30,74}, + {36,74}}, color={0,0,127})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid, + lineThickness=0.5)}), Diagram(graphics, + coordinateSystem(preserveAspectRatio=false))); +end PartialControler; diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.mo b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.mo new file mode 100644 index 00000000..e1c063e8 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.mo @@ -0,0 +1,5 @@ +within BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController; +package BaseClasses + extends Modelica.Icons.BasesPackage; + +end BaseClasses; diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order new file mode 100644 index 00000000..033605dc --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order @@ -0,0 +1,2 @@ +PartialControler +LimPID diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/OnOff.mo b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/OnOff.mo new file mode 100644 index 00000000..de7408c7 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/OnOff.mo @@ -0,0 +1,28 @@ +within BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController; +model OnOff "On off controller" + extends BaseClasses.PartialControler; + + Modelica.Blocks.Math.BooleanToReal booToRea(final realTrue=yMax, final + realFalse=0) "Convert boolean signal to real" annotation (Placement( + transformation(extent={{12,-12},{-12,12}}, rotation=180))); +equation + connect(setOn, booToRea.u) annotation (Line(points={{-120,0},{-67.1,0},{-67.1, + 2.10942e-15},{-14.4,2.10942e-15}}, color={255,0,255})); + connect(booToRea.y, ySet) annotation (Line(points={{13.2,-1.33227e-15},{60.55, + -1.33227e-15},{60.55,0},{110,0}}, color={0,0,127})); + annotation (Icon(graphics={ + Line(points={{-100.0,0.0},{-45.0,0.0}}, + color={0,0,127}), + Ellipse(lineColor={0,0,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + extent={{-45.0,-10.0},{-25.0,10.0}}), + Line(points={{-35.0,0.0},{30.0,35.0}}, + color={0,0,127}), + Line(points={{45.0,0.0},{100.0,0.0}}, + color={0,0,127}), + Ellipse(lineColor={0,0,127}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + extent={{25.0,-10.0},{45.0,10.0}})})); +end OnOff; diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo new file mode 100644 index 00000000..e3383e80 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo @@ -0,0 +1,57 @@ +within BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController; +model PID "PID controller for inverter controlled devices" + extends BaseClasses.PartialControler; + + BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.BaseClasses.LimPID + PID( + controllerType=Modelica.Blocks.Types.SimpleController.PID, + final k=parPID.P, + Ti=parPID.timeInt, + Td=parPID.timeDer, + final yMax=parPID.yMax, + final yMin=parPID.yMin, + final wp=1, + final wd=0, + Ni=parPID.Ni, + Nd=parPID.Nd, + final initType=Modelica.Blocks.Types.Init.InitialState, + homotopyType=Modelica.Blocks.Types.LimiterHomotopy.NoHomotopy, + final strict=false, + final xi_start=0, + final xd_start=0, + final y_start=parPID.y_start, + final limitsAtInit=true) + annotation (Placement(transformation(extent={{-30,22},{6,58}}))); + + Modelica.Blocks.Logical.Switch onOffSwi "Switch on off" + annotation (Placement(transformation(extent={{38,-14},{68,16}}))); + Modelica.Blocks.Sources.Constant const(final k=parPID.yOff) "HP turned off" + annotation (Placement(transformation(extent={{-6,-36},{10,-20}}))); + Modelica.Blocks.Logical.And and1 + annotation (Placement(transformation(extent={{-52,-64},{-32,-44}}))); + + replaceable record parPID= + BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition + constrainedby BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition "PID parameters" + annotation (choicesAllMatching=true, + Placement(transformation(extent={{80,-100},{100,-80}}))); +equation + connect(setOn, onOffSwi.u2) + annotation (Line(points={{-120,0},{34,0},{34,1},{35,1}}, color={255,0,255})); + connect(onOffSwi.y, ySet) + annotation (Line(points={{69.5,1},{74,1},{74,0},{110,0}}, color={0,0,127})); + connect(const.y, onOffSwi.u3) + annotation (Line(points={{10.8,-28},{35,-28},{35,-11}}, color={0,0,127})); + connect(PID.y, onOffSwi.u1) annotation (Line(points={{7.8,40},{14,40},{14,13},{35, + 13}}, color={0,0,127})); + connect(TSet, PID.u_s) annotation (Line(points={{-120,60},{-70,60},{-70,40},{-33.6, + 40}}, color={0,0,127})); + connect(TMea, PID.u_m) annotation (Line(points={{0,-120},{0,-54},{-12,-54},{-12, + 18.4}}, color={0,0,127})); + connect(and1.y, PID.IsOn) annotation (Line(points={{-31,-54},{-22.8,-54},{ + -22.8,18.4}}, color={255,0,255})); + connect(setOn, and1.u1) annotation (Line(points={{-120,0},{-72,0},{-72,-54},{ + -54,-54}}, color={255,0,255})); + connect(isOn, and1.u2) annotation (Line(points={{-60,-120},{-60,-62},{-54,-62}}, + color={255,0,255})); +end PID; diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/package.mo b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/package.mo new file mode 100644 index 00000000..38c4cbbc --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/package.mo @@ -0,0 +1,9 @@ +within BESMod.Systems.Hydraulical.Control.Components; +package RelativeSpeedController "Models for calculating the relative speed or power of a device" + + + + + + +end RelativeSpeedController; diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/package.order b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/package.order new file mode 100644 index 00000000..db36f7c8 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/package.order @@ -0,0 +1,3 @@ +BaseClasses +OnOff +PID diff --git a/BESMod/Systems/Hydraulical/Control/Components/package.order b/BESMod/Systems/Hydraulical/Control/Components/package.order index 954402b6..d2c2a270 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/package.order @@ -1,11 +1,12 @@ HeatingCurve DHWSetControl ThermostaticValveController -OnOffController -HeatPumpNSetController +BivalentOnOffControllers +RelativeSpeedController HeatPumpBusPassThrough BuildingAndDHWControl ConstantAdd BoilerInHybridSystem SetAndMeasuredValueSelector MeasuredValue +ParallelValveController diff --git a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo index d43b353c..1e6988f5 100644 --- a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo @@ -11,13 +11,13 @@ model GasBoiler "PI Control of gas boiler" TSet_DHW(TSetDHW_nominal=parDis.TDHW_nominal) if use_dhw annotation (Placement(transformation(extent={{-220,80},{-200,100}}))); replaceable - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController + BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PI HP_nSet_Controller( P=monovalentControlParas.k, - nMin=monovalentControlParas.nMin, - T_I=monovalentControlParas.T_I, - Ni=monovalentControlParas.Ni) annotation (choicesAllMatching=true, - Placement(transformation(extent={{102,42},{138,78}}))); + yMin=monovalentControlParas.nMin, + timeInt=monovalentControlParas.T_I, + Ni=monovalentControlParas.Ni) annotation (choicesAllMatching=true, Placement( + transformation(extent={{102,42},{138,78}}))); Modelica.Blocks.Logical.OnOffController BoilerOnOffBuf(bandwidth= monovalentControlParas.dTHysBui, pre_y_start=true) "Generates the on/off signal depending on the temperature inputs" @@ -111,7 +111,7 @@ equation 127})); connect(const_dT_loading.y, add_dT_LoadingBuf.u2) annotation (Line(points={{-99,-10}, {-88,-10},{-88,4},{-82,4}}, color={0,0,127})); - connect(BoiOn.y, HP_nSet_Controller.HP_On) annotation (Line(points={{1,30},{4, + connect(BoiOn.y,HP_nSet_Controller.setOn) annotation (Line(points={{1,30},{4, 30},{4,46},{98.4,46},{98.4,60}}, color={255,0,255})); connect(boilerOnOffDHW.y, BoiOn.u1) annotation (Line(points={{-139,50},{-134,50}, {-134,46},{-30,46},{-30,36},{-28,36},{-28,30},{-22,30}}, @@ -121,17 +121,16 @@ equation connect(boilerOnOffDHW.y, switch1.u2) annotation (Line(points={{-139,50},{-134, 50},{-134,46},{-28,46},{-28,66},{-8,66},{-8,70},{-2,70}}, color={255,0,255})); - connect(HP_nSet_Controller.T_Meas, sigBusGen.TBoiOut) annotation (Line( - points={{120,38.4},{116,38.4},{116,30},{28,30},{28,-26},{-152,-26},{-152, - -99}}, color={0,0,127}), - Text( + connect(HP_nSet_Controller.TMea, sigBusGen.TBoiOut) annotation (Line(points={{ + 120,38.4},{116,38.4},{116,30},{28,30},{28,-26},{-152,-26},{-152,-99}}, + color={0,0,127}), Text( string="%second", index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(HP_nSet_Controller.n_Set, sigBusGen.uBoiSet) annotation (Line( - points={{139.8,60},{146,60},{146,-30},{-152,-30},{-152,-99}}, - color={0,0,127}), Text( + connect(HP_nSet_Controller.ySet, sigBusGen.uBoiSet) annotation (Line(points={{ + 139.8,60},{146,60},{146,-30},{-152,-30},{-152,-99}}, color={0,0,127}), + Text( string="%second", index=1, extent={{6,3},{6,3}}, @@ -146,9 +145,8 @@ equation {-72,90},{-72,76},{-62,76}}, color={0,0,127})); connect(TSet_DHW.TSetDHW, add_dT_LoadingDHW.u1) annotation (Line(points={{-199, 90},{-194,90},{-194,72},{-70,72},{-70,64},{-62,64}}, color={0,0,127})); - connect(switch1.y, HP_nSet_Controller.T_Set) annotation (Line(points={{21,70}, - {40,70},{40,74},{84,74},{84,70.8},{98.4,70.8}}, - color={0,0,127})); + connect(switch1.y, HP_nSet_Controller.TSet) annotation (Line(points={{21,70},{ + 40,70},{40,74},{84,74},{84,70.8},{98.4,70.8}}, color={0,0,127})); connect(add_dT_LoadingBuf.y, switch1.u3) annotation (Line(points={{-59,10},{-44, 10},{-44,54},{-8,54},{-8,62},{-2,62}}, color={0,0,127})); @@ -158,13 +156,13 @@ equation connect(heatingCurve.TSet, add_dT_LoadingBuf.u1) annotation (Line(points={{-199,30}, {-88,30},{-88,16},{-82,16}}, color={0, 0,127})); - connect(BoiOn.y, HP_nSet_Controller.IsOn) annotation (Line(points={{1,30},{4,30}, + connect(BoiOn.y,HP_nSet_Controller.usOn) annotation (Line(points={{1,30},{4,30}, {4,46},{90,46},{90,28},{109.2,28},{109.2,38.4}}, color={255,0,255})); connect(booleanConstant.y, BoiOn.u1) annotation (Line(points={{-19,-10},{-14,-10}, {-14,14},{-28,14},{-28,30},{-22,30}}, color={255,0,255})); - connect(realPassThrough.y, HP_nSet_Controller.T_Set) annotation (Line(points={ - {67,58},{84,58},{84,70.8},{98.4,70.8}}, color={0,0,127})); + connect(realPassThrough.y, HP_nSet_Controller.TSet) annotation (Line(points={{ + 67,58},{84,58},{84,70.8},{98.4,70.8}}, color={0,0,127})); connect(realPassThrough.u, add_dT_LoadingBuf.y) annotation (Line(points={{44, 58},{26,58},{26,52},{-26,52},{-26,54},{-44,54},{-44,10},{-59,10}}, diff --git a/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo b/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo new file mode 100644 index 00000000..2e965ef6 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo @@ -0,0 +1,103 @@ +within BESMod.Systems.Hydraulical.Control; +model HybridHeatPumpSystem + "Hybrid HPS with PID controlled boiler" + extends + BESMod.Systems.Hydraulical.Control.BaseClasses.PartialHeatPumpSystemController( + final meaValSecGen= + if boiInGeneration then BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature + else BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.DistributionTemperature); + parameter Modelica.Units.SI.Temperature TBiv "Bivalence temperature"; + parameter Modelica.Units.SI.Temperature TCutOff "Cutoff temperature"; + parameter Boolean boiInGeneration + "=true for boiler in generation system, false for distribution"; + replaceable BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PID boiPIDCtrl( + final parPID=parPIDBoi) + constrainedby + BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.BaseClasses.PartialControler + "PID control of boiler" annotation (choicesAllMatching=true, + Dialog(group="Boiler control", tab="Advanced"), Placement( + transformation(extent={{100,10},{120,28}}))); + + Components.BoilerInHybridSystem boiInHybSys(final TBiv=TBiv, final TCutOff= + TCutOff) + "Check whether the boiler can turn on" + annotation (Placement(transformation(extent={{-30,-20},{-12,0}}))); + + BESMod.Systems.Hydraulical.Control.Components.ParallelValveController priOrSecDevValCtrl + "Control the valve to switch between primary and secondary device" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={-190,-30}))); + replaceable parameter RecordsCollection.PIDBaseDataDefinition parPIDBoi + constrainedby RecordsCollection.PIDBaseDataDefinition + "PID parameters of boiler" annotation ( + choicesAllMatching=true, + Dialog(group="Primary device control"), + Placement(transformation(extent={{100,-20},{120,0}}))); +equation + connect(boiInHybSys.secGen, buiAndDHWCtr.secGen) annotation (Line(points={{-31.8, + -6},{-110,-6},{-110,37.5},{-118,37.5}}, color={255,0,255})); + connect(boiInHybSys.secGenOn,boiPIDCtrl.setOn) annotation (Line(points={{-9,-10}, + {76,-10},{76,19},{98,19}}, + color={255,0,255})); + connect(boiInHybSys.secGenOn,boiPIDCtrl.isOn) + annotation (Line(points={{-9,-10},{76,-10},{76,4},{104,4},{104,8.2}}, + color={255,0,255})); + if boiInGeneration then + connect(boiPIDCtrl.ySet, sigBusGen.yBoi) annotation (Line(points={{121,19},{188, + 19},{188,10},{256,10},{256,-110},{-152,-110},{-152,-99}},color={0,0,127}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + else + connect(boiPIDCtrl.ySet, sigBusDistr.yBoi) annotation (Line(points={{121,19},{ + 256,19},{256,-120},{1,-120},{1,-100}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + end if; + connect(boiPIDCtrl.TMea, setAndMeaSelSec.TMea) annotation (Line(points={{110,8.2}, + {110,6},{61,6}}, color={0,0,127})); + connect(boiPIDCtrl.TSet, setAndMeaSelSec.TSet) annotation (Line(points={{98,24.4}, + {96,24.4},{96,16},{61,16}}, color={0,0,127})); + connect(boiInHybSys.priGenIsOn, sigBusGen.heaPumIsOn) annotation (Line(points={{ + -31.8,-16},{-54,-16},{-54,-70},{-152,-70},{-152,-99}}, color={255,0,255}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(boiInHybSys.priGenSetOn, buiAndDHWCtr.priGren) annotation (Line(points={ + {-32,-12.4},{-72,-12.4},{-72,-12},{-110,-12},{-110,26},{-118,26},{-118,27.5}}, + color={255,0,255})); + connect(boiInHybSys.TOda, weaBus.TDryBul) annotation (Line(points={{-32,-2},{-237, + -2},{-237,2}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(boiInHybSys.ySetPriGen, sigBusGen.yHeaPumSet) annotation (Line(points={{ + -32,-9},{-54,-9},{-54,-70},{-152,-70},{-152,-99}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(priOrSecDevValCtrl.secGen, boiInHybSys.secGenOn) annotation (Line( + points={{-184,-18},{-184,12},{-2,12},{-2,-10},{-9,-10}}, color={255,0,255})); + connect(priOrSecDevValCtrl.priGen, buiAndDHWCtr.priGren) annotation (Line( + points={{-196,-18},{-196,12},{-112,12},{-112,26},{-118,26},{-118,27.5}}, + color={255,0,255})); + connect(priOrSecDevValCtrl.uThrWayVal, sigBusGen.uPriOrSecGen) annotation (Line( + points={{-190,-41},{-190,-70},{-152,-70},{-152,-99}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); +end HybridHeatPumpSystem; diff --git a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo index 6b96f560..c8a0bc34 100644 --- a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo +++ b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Control; model MonoenergeticHeatPumpSystem "Monoenergetic HPS with on/off heating rod" - extends BaseClasses.PartialHeatPumpSystemController; + extends BaseClasses.PartialHeatPumpSystemController(final meaValSecGen=BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature); Modelica.Blocks.Sources.Constant constZero(final k=0) annotation (Placement( transformation( diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo deleted file mode 100644 index 7282d15c..00000000 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentParallel.mo +++ /dev/null @@ -1,69 +0,0 @@ -within BESMod.Systems.Hydraulical.Control; -model NewControlBivalentParallel - "Bivalent Parallel Generation Control Class (Part-parallel PI controlled HPS according to condenser outflow)" - extends BaseClasses.PartialHybridHeatPumpSystemController( - redeclare - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController - HP_nSet_Controller( - P=bivalentControlData.k, - nMin=bivalentControlData.nMin, - T_I=bivalentControlData.T_I), - redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent - BufferOnOffController( - Hysteresis=bivalentControlData.dTHysBui, - TCutOff=TCutOff, - TBiv=bivalentControlData.TBiv, - TOda_nominal=bivalentControlData.TOda_nominal, - TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(parTra.Q_flow_nominal), - QHP_flow_cutOff=QHP_flow_cutOff), - redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent - DHWOnOffContoller( - Hysteresis=bivalentControlData.dTHysDHW, - TCutOff=TCutOff, - TBiv=bivalentControlData.TBiv, - TOda_nominal=bivalentControlData.TOda_nominal, - TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(parTra.Q_flow_nominal), - QHP_flow_cutOff=QHP_flow_cutOff)); - - parameter Modelica.Units.SI.Temperature TCutOff "Cut-off temperature"; - parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff; - - replaceable - Components.HeatPumpNSetController.PI_InverterHeatPumpController - Boiler_uRel_Controller( - P=2, - nMin=0, - T_I=1200, - Ni=0.9) constrainedby - Components.HeatPumpNSetController.PI_InverterHeatPumpController - annotation (choicesAllMatching=true, Placement(transformation(extent={{74,12}, - {104,40}}))); -equation - connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( - Line(points={{110,80.4},{110,56},{98,56},{98,50},{138,50},{138,-36},{-152, - -36},{-152,-99}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - - connect(switch1.y, Boiler_uRel_Controller.T_Set) annotation (Line(points={{68.5,73}, - {68.5,72},{72,72},{72,48},{58,48},{58,34.4},{71,34.4}}, - color={0,0,127})); - connect(Boiler_uRel_Controller.T_Meas, sigBusGen.TBoilerOut) annotation (Line( - points={{89,9.2},{82,9.2},{82,-60},{-150,-60},{-150,-68},{-152,-68},{-152, - -99}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); -end NewControlBivalentParallel; diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo deleted file mode 100644 index a4691724..00000000 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSerial.mo +++ /dev/null @@ -1,71 +0,0 @@ -within BESMod.Systems.Hydraulical.Control; -model NewControlBivalentSerial - "Bivalent Serial Control Class (Part-parallel PI controlled HPS according to condenser outflow)" - extends BaseClasses.PartialHybridHeatPumpSystemController( - redeclare - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController - HP_nSet_Controller( - P=bivalentControlData.k, - nMin=bivalentControlData.nMin, - T_I=bivalentControlData.T_I), - redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent - BufferOnOffController( - Hysteresis=bivalentControlData.dTHysBui, - TCutOff=TCutOff, - TBiv=bivalentControlData.TBiv, - TOda_nominal=bivalentControlData.TOda_nominal, - TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(parTra.Q_flow_nominal), - QHP_flow_cutOff=QHP_flow_cutOff), - redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent - DHWOnOffContoller( - Hysteresis=bivalentControlData.dTHysDHW, - TCutOff=TCutOff, - TBiv=bivalentControlData.TBiv, - TOda_nominal=bivalentControlData.TOda_nominal, - TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(parTra.Q_flow_nominal), - QHP_flow_cutOff=QHP_flow_cutOff)); - - parameter Modelica.Units.SI.Temperature TCutOff "Cut-off temperature"; - parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff; - - replaceable - Components.HeatPumpNSetController.PI_InverterHeatPumpController - Boiler_uRel_Controller( - P=2, - nMin=0, - T_I=1200, - Ni=0.9) constrainedby - Components.HeatPumpNSetController.PI_InverterHeatPumpController - annotation (choicesAllMatching=true, Placement(transformation(extent={{80,10}, - {110,38}}))); - Components.BoilerInHybridSystem boiInHybSys annotation (Placement( - transformation(rotation=0, extent={{-54,12},{-34,32}}))); -equation - connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( - Line(points={{110,80.4},{110,20},{98,20},{98,-22},{-152,-22},{-152,-99}}, - color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - - connect(switch1.y, Boiler_uRel_Controller.T_Set) annotation (Line(points={{68.5,73}, - {68.5,72},{72,72},{72,38},{70,38},{70,32.4},{77,32.4}}, - color={0,0,127})); - connect(Boiler_uRel_Controller.T_Meas, sigBusGen.TBoiOut) annotation (Line( - points={{95,7.2},{96,7.2},{96,-74},{-152,-74},{-152,-99}}, - color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); -end NewControlBivalentSerial; diff --git a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo b/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo deleted file mode 100644 index cd5288af..00000000 --- a/BESMod/Systems/Hydraulical/Control/NewControlBivalentSystem_BoilerAfterBuffer.mo +++ /dev/null @@ -1,66 +0,0 @@ -within BESMod.Systems.Hydraulical.Control; -model NewControlBivalentSystem_BoilerAfterBuffer - "intended use for bivalent systems with boiler after buffer (Part-parallel PI controlled HPS according to condenser outflow)" - extends BaseClasses.PartialHybridHeatPumpSystemController( - redeclare - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.PI_InverterHeatPumpController - HP_nSet_Controller( - P=bivalentControlData.k, - nMin=bivalentControlData.nMin, - T_I=bivalentControlData.T_I), - redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent - BufferOnOffController( - Hysteresis=bivalentControlData.dTHysBui, - TCutOff=TCutOff, - TBiv=bivalentControlData.TBiv, - TOda_nominal=bivalentControlData.TOda_nominal, - TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(parTra.Q_flow_nominal), - QHP_flow_cutOff=QHP_flow_cutOff), - redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent - DHWOnOffContoller( - Hysteresis=bivalentControlData.dTHysDHW, - TCutOff=TCutOff, - TBiv=bivalentControlData.TBiv, - TOda_nominal=bivalentControlData.TOda_nominal, - TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(parTra.Q_flow_nominal), - QHP_flow_cutOff=QHP_flow_cutOff)); - - parameter Modelica.Units.SI.Temperature TCutOff "Cut-off temperature"; - parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff; - - replaceable - Components.HeatPumpNSetController.PI_InverterHeatPumpController - Boiler_uRel_Controller( - P=2, - nMin=0, - T_I=1200, - Ni=0.9) constrainedby - Components.HeatPumpNSetController.PI_InverterHeatPumpController - annotation (choicesAllMatching=true, Placement(transformation(extent={{74,12}, - {104,40}}))); -equation - connect(HP_nSet_Controller.T_Meas, sigBusGen.THeaPumOut) annotation ( - Line(points={{110,80.4},{110,50},{146,50},{146,-36},{-152,-36},{-152,-99}}, - color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - - connect(Boiler_uRel_Controller.T_Meas, sigBusDistr.TBoilerOutDistribution) - annotation (Line(points={{89,9.2},{88,9.2},{88,-60},{1,-60},{1,-100}}, - color={0,0, - 127}), Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); -end NewControlBivalentSystem_BoilerAfterBuffer; diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicBoilerPI.mo b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicBoilerPI.mo new file mode 100644 index 00000000..754ed8f7 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicBoilerPI.mo @@ -0,0 +1,13 @@ +within BESMod.Systems.Hydraulical.Control.RecordsCollection; +record BasicBoilerPI "Currently used PI values for a boiler" + extends PIDBaseDataDefinition( + Nd=10, + timeDer=0, + Ni=0.9, + timeInt=1200, + P=2, + y_start=0, + yOff=0, + yMax=1, + yMin=0.2); +end BasicBoilerPI; diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicHeatPumpPI.mo b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicHeatPumpPI.mo new file mode 100644 index 00000000..fec51e48 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicHeatPumpPI.mo @@ -0,0 +1,8 @@ +within BESMod.Systems.Hydraulical.Control.RecordsCollection; +record BasicHeatPumpPI "Typically good PI values for a heat pump" + extends PIDBaseDataDefinition( + y_start=0, + yOff=0, + yMax=1, + yMin=0.3); +end BasicHeatPumpPI; diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/PIDBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Control/RecordsCollection/PIDBaseDataDefinition.mo new file mode 100644 index 00000000..f675c8f3 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/PIDBaseDataDefinition.mo @@ -0,0 +1,18 @@ +within BESMod.Systems.Hydraulical.Control.RecordsCollection; +partial record PIDBaseDataDefinition "Record for a PID controller" + extends Modelica.Icons.Record; + + parameter Real yMax=1 "Upper limit of output"; + parameter Real yOff=0 "Constant output value if device is turned off"; + parameter Real y_start=0 "Initial value of output"; + parameter Real yMin "Lower limit of relative speed"; + parameter Real P "Gain of PID-controller"; + parameter Modelica.Units.SI.Time timeInt "Time constant of Integrator block"; + parameter Real Ni=0.9 "Ni*Ti is time constant of anti-windup compensation"; + parameter Modelica.Units.SI.Time timeDer "Time constant of Derivative block"; + parameter Real Nd=10 "The higher Nd, the more ideal the derivative block"; + + annotation (Documentation(info=" +

Contains parameters to tune the PID control used in BESMod.

+")); +end PIDBaseDataDefinition; diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order b/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order index e3a273ad..51086b01 100644 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order @@ -3,3 +3,6 @@ DefaultSafetyControl BivalentHeatPumpControlDataDefinition DefaultBivHPControl ThermostaticValveDataDefinition +PIDBaseDataDefinition +BasicHeatPumpPI +BasicBoilerPI diff --git a/BESMod/Systems/Hydraulical/Control/package.order b/BESMod/Systems/Hydraulical/Control/package.order index ecd089cb..1759ec1b 100644 --- a/BESMod/Systems/Hydraulical/Control/package.order +++ b/BESMod/Systems/Hydraulical/Control/package.order @@ -1,3 +1,4 @@ +HybridHeatPumpSystem MonoenergeticHeatPumpSystem NoControl GasBoiler @@ -5,6 +6,3 @@ BivalentPartParallel Components BaseClasses RecordsCollection -NewControlBivalentSerial -NewControlBivalentSystem_BoilerAfterBuffer -NewControlBivalentParallel diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo index 44ad8a6f..e46b3e06 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndGasBoilerParallel.mo @@ -39,7 +39,7 @@ equation -70},{-6,-70},{-6,-34},{50,-34},{50,6},{40,6},{40,5.6}}, color={0,127,255})); connect(thrWayVal.portBui_b, heatPump.port_a1) annotation (Line(points={{20,2},{ -6,2},{-6,-7},{-30.5,-7}}, color={0,127,255})); - connect(thrWayVal.uBuf, sigBusGen.uBoiOrHeaPum) annotation (Line(points={{30,-2}, + connect(thrWayVal.uBuf, sigBusGen.uPriOrSecGen) annotation (Line(points={{30,-2}, {30,-16},{2,-16},{2,98}}, color={0,0,127}), Text( string="%second", index=1, From 008e45cd059f3b1d79e963499413e6f98af016ff Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 14 Aug 2023 12:12:32 +0200 Subject: [PATCH 081/131] fix tests --- BESMod/Examples/BAUSimStudy/PartialCase.mo | 17 +- BESMod/Examples/HeatPumpAndBoiler.mo | 388 ++++++------------ .../PartialSolarThermalHPS.mo | 18 +- .../Examples/UseCaseDesignOptimization/BES.mo | 35 +- .../ParametersToChange.mo | 3 +- .../Examples/UseCaseHighOrderModel/BES_HOM.mo | 27 +- .../PartialModelicaConferenceUseCase.mo | 24 +- .../PartialBuildingEnergySystem.mo | 43 +- BESMod/Systems/Control/DHWSuperheating.mo | 30 +- .../Demand/Building/AixLibHighOrder.mo | 4 +- .../BaseClasses/PartialAixLibHighOrder.mo | 8 +- .../Building/BaseClasses/PartialDemand.mo | 10 +- .../Demand/Building/BuildingsRoomCase600FF.mo | 34 +- .../BaseClasses/PartialAixLibHighOrder.mo | 8 +- .../Demand/Building/TEASERThermalZone.mo | 21 +- BESMod/Systems/Demand/DHW/DHW.mo | 3 +- .../BaseClasses/PartialElectricalSystem.mo | 4 +- .../BaseClasses/PartialHydraulicSystem.mo | 4 + .../HeatingRodWithSecurityControl.mo | 4 +- .../PartialHeatPumpSystemController.mo | 32 +- .../BaseClasses/PIDParameters.mo | 7 + .../BaseClasses/package.order | 1 + .../Components/RelativeSpeedController/PID.mo | 35 +- .../Systems/Hydraulical/Control/GasBoiler.mo | 24 +- .../Control/HybridHeatPumpSystem.mo | 23 +- .../RecordsCollection/BasicHeatPumpPI.mo | 3 + .../BivalentHeatPumpControlDataDefinition.mo | 22 - .../RecordsCollection/DefaultBivHPControl.mo | 15 - .../PIDBaseDataDefinition.mo | 1 - .../Control/RecordsCollection/package.order | 2 - .../BaseClasses/PartialTwoStorageParallel.mo | 22 +- .../PartialTwoStorageParallelWithHeaters.mo | 6 +- .../Distribution/TwoStoragesBoilerWithDHW.mo | 9 +- .../Generation/BaseClasses/PartialHeatPump.mo | 3 +- .../DetailedSolarThermalWithHeatPump.mo | 9 +- .../Generation/HeatPumpAndHeatingRod.mo | 15 +- .../SimpleSolarThermalWithHeatPump.mo | 5 + .../Ventilation/Control/SummerPIDByPass.mo | 4 +- BESMod/Tutorial/MyOwnModule.mo | 4 +- BESMod/Utilities/KPIs/DeviceKPICalculator.mo | 12 +- BESMod/package.mo | 13 +- 41 files changed, 443 insertions(+), 509 deletions(-) create mode 100644 BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PIDParameters.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/RecordsCollection/BivalentHeatPumpControlDataDefinition.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/RecordsCollection/DefaultBivHPControl.mo diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index 64f2e33c..9e4d10ec 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -16,7 +16,6 @@ partial model PartialCase BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/5000, dpCon_nominal=0, @@ -41,12 +40,17 @@ partial model PartialCase redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, + dTHysBui=10, + dTHysDHW=10, + redeclare model DHWHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + + redeclare model BuildingHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl - bivalentControlData(TBiv=TBiv), - redeclare - Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW - TSet_DHW, + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI + parPIDHeaPum, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl safetyControl), @@ -54,7 +58,6 @@ partial model PartialCase BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading distribution( QHRAftBuf_flow_nominal=0, - use_heatingRodAfterBuffer=false, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, diff --git a/BESMod/Examples/HeatPumpAndBoiler.mo b/BESMod/Examples/HeatPumpAndBoiler.mo index 8426021b..cd9581eb 100644 --- a/BESMod/Examples/HeatPumpAndBoiler.mo +++ b/BESMod/Examples/HeatPumpAndBoiler.mo @@ -34,15 +34,11 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" end AachenSystem; - model Serial "Bivalent Heat Pump Systems with serial heat generation" - extends Systems.BaseClasses.PartialBuildingEnergySystem( - redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, - redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare - BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( - heaLoadFacGrd=0, heaLoadFacOut=0)), - redeclare BESMod.Systems.Control.NoControl control, + model Parallel + "Bivalent Heat Pump Systems with parallel heat generation" + extends BaseClasses.PartialHybridSystem( redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerSerial + redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerParallel generation( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare @@ -64,39 +60,9 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen), - redeclare Systems.Hydraulical.Control.HybridHeatPumpSystem control( - redeclare - BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - valCtrl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - parTheVal, - dTHysBui=5, - dTHysDHW=5, - meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature, - - redeclare model DHWHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - - redeclare model BuildingHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - - redeclare model DHWSetTemperature = - BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW, - - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI - parPIDHeaPum, - TBiv=parameterStudy.TBiv, - boiInGeneration=true, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl - safetyControl, - TCutOff=parameterStudy.TCutOff, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicBoilerPI - parPIDBoi), + parTemSen, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal), redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( redeclare @@ -106,25 +72,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage parStoDHW(dTLoadingHC1=10), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal), - redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( - redeclare - BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare Systems.Demand.DHW.DHW DHW( - redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic - calcmFlow), - redeclare Systems.UserProfiles.TEASERProfiles userProfiles, - redeclare UseCaseDesignOptimization.AachenSystem systemParameters( - use_ventilation=true), - redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy, - redeclare final package MediumDHW = AixLib.Media.Water, - redeclare final package MediumZone = AixLib.Media.Air, - redeclare final package MediumHyd = AixLib.Media.Water, - redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + parThrWayVal))); extends Modelica.Icons.Example; @@ -132,25 +80,18 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" StopTime=31536000, Interval=600, __Dymola_Algorithm="Dassl")); - end Serial; + end Parallel; - model BoilerAfterBufferWithoutDHW - "Bivalent Heat Pump System with boiler integration after buffer tank without DHW support" - extends Systems.BaseClasses.PartialBuildingEnergySystem( - redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, - redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare - BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( - heaLoadFacGrd=0, heaLoadFacOut=0)), - redeclare BESMod.Systems.Control.NoControl control, + model Serial "Bivalent Heat Pump Systems with serial heat generation" + extends BaseClasses.PartialHybridSystem( redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.HeatPump generation( + redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerSerial + generation( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ parameterStudy.QHP_flow_biv, @@ -158,41 +99,16 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" dpEva_nominal=0, use_refIne=false, refIneFre_constant=0), - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRod, + redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen), - redeclare - Systems.Hydraulical.Control.NewControlBivalentSystem_BoilerAfterBuffer - control( - redeclare - BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - valCtrl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - parTheVal, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl - bivalentControlData(TBiv=parameterStudy.TBiv), - redeclare - Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW - TSet_DHW, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl - safetyControl, - TCutOff=parameterStudy.TCutOff, - QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, - - CheckTCut_Off(threshold=parameterStudy.TCutOff)), - redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithoutDHW + redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage @@ -201,26 +117,7 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage parStoDHW(dTLoadingHC1=10), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal), - redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( - redeclare - BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare Systems.Demand.DHW.DHW DHW( - redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic - calcmFlow), - redeclare Systems.UserProfiles.TEASERProfiles userProfiles, - redeclare UseCaseDesignOptimization.AachenSystem systemParameters( - use_ventilation=true), - redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy, - redeclare final package MediumDHW = AixLib.Media.Water, - redeclare final package MediumZone = AixLib.Media.Air, - redeclare final package MediumHyd = AixLib.Media.Water, - redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + parThrWayVal))); extends Modelica.Icons.Example; @@ -228,26 +125,19 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" StopTime=31536000, Interval=600, __Dymola_Algorithm="Dassl")); - end BoilerAfterBufferWithoutDHW; + end Serial; - model Parallel "Bivalent Heat Pump System with parallel heat generation" - extends Systems.BaseClasses.PartialBuildingEnergySystem( - redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, - redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare - BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( - heaLoadFacGrd=0, heaLoadFacOut=0)), - redeclare BESMod.Systems.Control.NoControl control, + model AfterBufferWithDHW + "Bivalent Heat Pump System with boiler integration after buffer tank without DHW support" + extends BaseClasses.PartialHybridSystem( redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerParallel + redeclare Systems.Hydraulical.Generation.HeatPump generation( - use_heaRod=false, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ parameterStudy.QHP_flow_biv, @@ -258,74 +148,33 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen, - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal, - threeWayValveWithFlowReturn(redeclare - BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parameters( - m_flow_nominal=2*m_flow_nominal[1], - dp_nominal={parHeaPum.dpCon_nominal,boilerNoControl.dp_nominal}, - use_inputFilter=true, - order=1))), - redeclare Systems.Hydraulical.Control.NewControlBivalentParallel control( - redeclare - BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - valCtrl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - parTheVal, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl - bivalentControlData(TBiv=parameterStudy.TBiv), - redeclare - Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW - TSet_DHW, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl - safetyControl, - TCutOff=parameterStudy.TCutOff, - QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, - - CheckTCut_Off(threshold=parameterStudy.TCutOff)), - redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel + parTemSen), + control(boiInGeneration=false), + redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithDHW distribution( - nParallelSup=1, - dpSup_nominal={2*(hydraulic.distribution.parThrWayVal.dpValve_nominal - + max(hydraulic.distribution.parThrWayVal.dp_nominal))}, redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen, redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow), + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage parStoDHW(dTLoadingHC1=10), redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal), - redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( - redeclare - BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare Systems.Demand.DHW.DHW DHW( - redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic - calcmFlow), - redeclare Systems.UserProfiles.TEASERProfiles userProfiles, - redeclare UseCaseDesignOptimization.AachenSystem systemParameters( - use_ventilation=true), - redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy( - TCutOff=262.15, TBiv=276.15), - redeclare final package MediumDHW = AixLib.Media.Water, - redeclare final package MediumZone = AixLib.Media.Air, - redeclare final package MediumHyd = AixLib.Media.Water, - redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + parThrWayVal, + dTBoiDHWLoa=10, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayValBoi, + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parHydSep, + redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi))); extends Modelica.Icons.Example; @@ -333,25 +182,19 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" StopTime=31536000, Interval=600, __Dymola_Algorithm="Dassl")); - end Parallel; + end AfterBufferWithDHW; - model BoilerAfterBufferWithDHW - "Bivalent Heat Pump System with boiler integration after buffer tank with DHW support" - extends Systems.BaseClasses.PartialBuildingEnergySystem( - redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, - redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare - BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( - heaLoadFacGrd=0, heaLoadFacOut=0)), - redeclare BESMod.Systems.Control.NoControl control, + model AfterBufferWithoutDHW + "Bivalent Heat Pump System with boiler integration after buffer tank without DHW support" + extends BaseClasses.PartialHybridSystem( redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.HeatPump generation( + redeclare Systems.Hydraulical.Generation.HeatPump + generation( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ parameterStudy.QHP_flow_biv, @@ -359,86 +202,30 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" dpEva_nominal=0, use_refIne=false, refIneFre_constant=0), - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRod, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen), - redeclare - Systems.Hydraulical.Control.NewControlBivalentSystem_BoilerAfterBuffer - control( - TSetDHW(triggerEvery(displayUnit="d") = 259200), - redeclare - BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - valCtrl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - parTheVal, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl - bivalentControlData(TBiv=parameterStudy.TBiv), - redeclare - Systems.Hydraulical.Control.Components.DHWSetControl.AntiLegionellaControl - TSet_DHW, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl - safetyControl, - TCutOff=parameterStudy.TCutOff, - QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor, - - CheckTCut_Off(threshold=parameterStudy.TCutOff)), - redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithDHW + control(boiInGeneration=false), + redeclare Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading distribution( - designType=BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.FullStorage, - - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal, - redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, - - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - QDHWStoLoss_flow=1, - VStoDHW(displayUnit="l") = 0.1, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayValBoi, redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition - parStoBuf, + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow), redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage parStoDHW(dTLoadingHC1=10), - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.BufferStorageBaseDataDefinition - parHydSep), - redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( - redeclare - BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare Systems.Demand.DHW.DHW DHW( - redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic - calcmFlow), - redeclare Systems.UserProfiles.TEASERProfiles userProfiles, - redeclare UseCaseDesignOptimization.AachenSystem systemParameters( - use_ventilation=true), - redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy( - TCutOff=262.15, TBiv=276.15), - redeclare final package MediumDHW = AixLib.Media.Water, - redeclare final package MediumZone = AixLib.Media.Air, - redeclare final package MediumHyd = AixLib.Media.Water, - redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal, + heaAftBufTyp=BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler, + redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi))); extends Modelica.Icons.Example; @@ -446,6 +233,69 @@ package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" StopTime=31536000, Interval=600, __Dymola_Algorithm="Dassl")); - end BoilerAfterBufferWithDHW; - + end AfterBufferWithoutDHW; + + package BaseClasses "Contains partial example case" + extends Modelica.Icons.BasesPackage; + partial model PartialHybridSystem "Partial bivalent heat pump system" + extends Systems.BaseClasses.PartialBuildingEnergySystem( + redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, + redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare + BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( + heaLoadFacGrd=0, heaLoadFacOut=0)), + redeclare BESMod.Systems.Control.NoControl control, + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Control.HybridHeatPumpSystem control( + redeclare + BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled + valCtrl, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition + parTheVal, + dTHysBui=5, + dTHysDHW=5, + meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature, + redeclare model DHWHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare model BuildingHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare model DHWSetTemperature = + BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI + parPIDHeaPum, + TBiv=parameterStudy.TBiv, + boiInGeneration=true, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl + safetyControl, + TCutOff=parameterStudy.TCutOff, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicBoilerPI + parPIDBoi), + redeclare final Systems.Hydraulical.Transfer.IdealValveRadiator transfer( + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + radParameters, redeclare + BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), + redeclare Systems.Demand.DHW.DHW DHW( + redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic + calcmFlow), + redeclare Systems.UserProfiles.TEASERProfiles userProfiles, + redeclare UseCaseDesignOptimization.AachenSystem systemParameters( + use_ventilation=true), + redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy, + redeclare final package MediumDHW = AixLib.Media.Water, + redeclare final package MediumZone = AixLib.Media.Air, + redeclare final package MediumHyd = AixLib.Media.Water, + redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); + end PartialHybridSystem; + end BaseClasses; end HeatPumpAndBoiler; diff --git a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo index 0147342b..25c80600 100644 --- a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo +++ b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo @@ -12,20 +12,26 @@ partial model PartialSolarThermalHPS redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( redeclare hydGeneration generation, - redeclare BESMod.Systems.Hydraulical.Control.Biv_PI_ConFlow_HPSController + redeclare BESMod.Systems.Hydraulical.Control.MonoenergeticHeatPumpSystem control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - thermostaticValveController, + valCtrl, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, + redeclare model DHWHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + + redeclare model BuildingHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl - safetyControl, + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI + parPIDHeaPum, redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl - bivalentControlData), + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl + safetyControl), redeclare BESMod.Systems.Hydraulical.Distribution.CombiStorage distribution(redeclare BESMod.Examples.SolarThermalSystem.CombiStorage parameters( diff --git a/BESMod/Examples/UseCaseDesignOptimization/BES.mo b/BESMod/Examples/UseCaseDesignOptimization/BES.mo index 714ad2e1..506fe2df 100644 --- a/BESMod/Examples/UseCaseDesignOptimization/BES.mo +++ b/BESMod/Examples/UseCaseDesignOptimization/BES.mo @@ -14,7 +14,6 @@ model BES BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ parameterStudy.QHP_flow_biv, @@ -33,25 +32,37 @@ model BES redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen), - redeclare Systems.Hydraulical.Control.BivalentPartParallel control( + redeclare Systems.Hydraulical.Control.MonoenergeticHeatPumpSystem control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled valCtrl, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, + redeclare model DHWHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.PartParallelBivalent + ( + TCutOff=parameterStudy.TCutOff, + TBiv=parameterStudy.TBiv, + TOda_nominal=systemParameters.TOda_nominal, + TRoom=systemParameters.TSetZone_nominal[1], + QDem_flow_nominal=systemParameters.QBui_flow_nominal[1], + QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff), + redeclare model BuildingHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.PartParallelBivalent + ( + TCutOff=parameterStudy.TCutOff, + TBiv=parameterStudy.TBiv, + TOda_nominal=systemParameters.TOda_nominal, + TRoom=systemParameters.TSetZone_nominal[1], + QDem_flow_nominal=systemParameters.QBui_flow_nominal[1], + QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff), redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl - bivalentControlData(TBiv=parameterStudy.TBiv), - redeclare - Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW - TSet_DHW, + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI + parPIDHeaPum, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl - safetyControl, - TCutOff=parameterStudy.TCutOff, - QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff*hydraulic.generation.parHeaPum.scalingFactor), - + safetyControl), redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( redeclare @@ -60,11 +71,9 @@ model BES VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.B), - redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage parStoDHW(dTLoadingHC1=10, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.A), - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parThrWayVal), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( diff --git a/BESMod/Examples/UseCaseDesignOptimization/ParametersToChange.mo b/BESMod/Examples/UseCaseDesignOptimization/ParametersToChange.mo index b799f94d..cf1bb5ff 100644 --- a/BESMod/Examples/UseCaseDesignOptimization/ParametersToChange.mo +++ b/BESMod/Examples/UseCaseDesignOptimization/ParametersToChange.mo @@ -11,7 +11,8 @@ record ParametersToChange annotation (Evaluate=false); parameter Modelica.Units.SI.Temperature TBiv=268.15 "Bivalence temperature" annotation (Evaluate=false); - parameter Real VPerQFlow=23.5 "Litre of storage volume per kilowatt thermal power demand" annotation(Evaluate=false); + parameter Real VPerQFlow=23.5 "Litre of storage volume per kilowatt thermal power demand" + annotation(Evaluate=false); parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff=3000 annotation (Evaluate=false); parameter Modelica.Units.SI.HeatFlowRate QHP_flow_biv=4000 diff --git a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo index 73d09b81..0e6de4f5 100644 --- a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo +++ b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo @@ -20,14 +20,14 @@ model BES_HOM redeclare BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal - /parameterStudy.QHP_flow_biv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, dpCon_nominal=0, dpEva_nominal=0, use_refIne=false, @@ -43,23 +43,26 @@ model BES_HOM redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen), - redeclare BESMod.Systems.Hydraulical.Control.ConstHys_OnOff_HPSControll + redeclare BESMod.Systems.Hydraulical.Control.MonoenergeticHeatPumpSystem control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - thermostaticValveController, + valCtrl, + redeclare model DHWHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + + redeclare model BuildingHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI + parPIDHeaPum, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl - safetyControl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl - bivalentControlData, - redeclare - BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW - TSet_DHW), + safetyControl), redeclare BESMod.Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 3fe072b3..7b2706b8 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -10,7 +10,6 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.Electrical.Generation.PVSystemMultiSub generation( redeclare model CellTemperature = AixLib.Electrical.PVSystem.BaseClasses.CellTemperatureMountingContactToGround, - redeclare AixLib.DataBase.SolarElectric.SchuecoSPV170SME1 pVParameters, lat=weaDat.lat, lon=weaDat.lon, @@ -18,7 +17,6 @@ partial model PartialModelicaConferenceUseCase timZon=3600, ARoo=building.ARoo/2), redeclare BESMod.Systems.Electrical.Transfer.NoElectricalTransfer transfer, - redeclare BESMod.Systems.Electrical.Control.NoControl control), redeclare BESMod.Systems.Control.DHWSuperheating control(TSetDHW= systemParameters.TSetDHW), @@ -32,7 +30,6 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=271.15, scalingFactor=scalingFactorHP, dpCon_nominal=0, @@ -56,17 +53,20 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, + supCtrDHWTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal, + + redeclare model DHWHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + + redeclare model BuildingHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl - safetyControl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl - bivalentControlData(dTOffSetHeatCurve=8), + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI + parPIDHeaPum, redeclare - BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW - TSet_DHW, - supCtrlTypeDHWSet=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal), - + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl + safetyControl), redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel distribution( redeclare diff --git a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo index cc83418c..7cd283cf 100644 --- a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo +++ b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo @@ -41,6 +41,7 @@ partial model PartialBuildingEnergySystem "Partial BES" BESMod.Systems.Demand.Building.BaseClasses.PartialDemand( redeclare final package MediumZone = MediumZone, final nZones=systemParameters.nZones, + final TOda_nominal=systemParameters.TOda_nominal, final TSetZone_nominal=systemParameters.TSetZone_nominal, final use_hydraulic=systemParameters.use_hydraulic, final use_ventilation=systemParameters.use_ventilation, @@ -82,8 +83,8 @@ partial model PartialBuildingEnergySystem "Partial BES" final hBui=building.hBui), final use_openModelica=use_openModelica) annotation (Placement( transformation(extent={{-198,40},{-42,136}})), choicesAllMatching=true); - replaceable BESMod.Systems.Hydraulical.BaseClasses.PartialHydraulicSystem hydraulic if - systemParameters.use_hydraulic constrainedby + replaceable BESMod.Systems.Hydraulical.BaseClasses.PartialHydraulicSystem hydraulic + if systemParameters.use_hydraulic constrainedby Hydraulical.BaseClasses.PartialHydraulicSystem( redeclare package Medium = MediumHyd, final subsystemDisabled=not systemParameters.use_hydraulic, @@ -153,12 +154,12 @@ partial model PartialBuildingEnergySystem "Partial BES" Placement(transformation(extent={{270,40},{300,76}}), iconTransformation( extent={{270,40},{300,76}}))); protected - BESMod.Utilities.Electrical.ZeroLoad hydraulicZeroElecLoad if - not systemParameters.use_hydraulic "Internal helper"; - BESMod.Utilities.Electrical.ZeroLoad ventilationZeroElecLoad if - not systemParameters.use_ventilation "Internal helper"; - BESMod.Utilities.Electrical.ZeroLoad dhwZeroElecLoad if - not systemParameters.use_dhw "Internal helper"; + BESMod.Utilities.Electrical.ZeroLoad hydraulicZeroElecLoad + if not systemParameters.use_hydraulic "Internal helper"; + BESMod.Utilities.Electrical.ZeroLoad ventilationZeroElecLoad + if not systemParameters.use_ventilation "Internal helper"; + BESMod.Utilities.Electrical.ZeroLoad dhwZeroElecLoad + if not systemParameters.use_dhw "Internal helper"; equation connect(building.weaBus, weaDat.weaBus) annotation (Line( @@ -190,8 +191,8 @@ equation color={255,204,51}, thickness=0.5)); connect(hydraulic.outBusHyd, outputs.hydraulic) annotation (Line( - points={{-124.516,-98.6857},{-124.516,-100},{-124,-100},{-124,-124},{ - 244,-124},{244,0},{285,0}}, + points={{-124.516,-98.6857},{-124.516,-100},{-124,-100},{-124,-124},{244, + -124},{244,0},{285,0}}, color={175,175,175}, thickness=0.5), Text( string="%second", @@ -206,8 +207,8 @@ equation points={{-42,-23.2571},{-42,-24},{-20,-24},{-20,62.8},{2,62.8}},color= {191,0,0})); connect(userProfiles.useProBus, hydraulic.useProBus) annotation (Line( - points={{-225.167,150.775},{-214,150.775},{-214,16},{-157.358,16},{ - -157.358,-2}}, + points={{-225.167,150.775},{-214,150.775},{-214,16},{-157.358,16},{-157.358, + -2}}, color={0,127,0}, thickness=0.5)); connect(control.sigBusHyd, hydraulic.sigBusHyd) annotation (Line( @@ -219,15 +220,13 @@ equation points={{-225.167,150.775},{-32,150.775},{-32,-36},{60.9,-36},{60.9,-42}}, color={0,127,0}, thickness=0.5)); - connect(hydraulic.portDHW_out, DHW.port_a) annotation (Line(points={{ - -42.8211,-72.6286},{-2,-72.6286},{-2,-57.2},{2,-57.2}}, - color={0,127,255})); - connect(hydraulic.portDHW_in, DHW.port_b) annotation (Line(points={{ - -42.8211,-86.3429},{-2,-86.3429},{-2,-102.8},{2,-102.8}}, - color={0,127,255})); + connect(hydraulic.portDHW_out, DHW.port_a) annotation (Line(points={{-42.8211, + -72.6286},{-2,-72.6286},{-2,-57.2},{2,-57.2}}, color={0,127,255})); + connect(hydraulic.portDHW_in, DHW.port_b) annotation (Line(points={{-42.8211, + -86.3429},{-2,-86.3429},{-2,-102.8},{2,-102.8}}, color={0,127,255})); connect(DHW.internalElectricalPin, electrical.internalElectricalPin[3]) annotation (Line( - points={{66.6,-117.24},{66.6,-126},{72,-126},{72,-140},{-210,-140},{-210, - 118},{-198,118},{-198,118.171}}, + points={{66.6,-117.24},{66.6,-126},{72,-126},{72,-140},{-210,-140},{-210,118}, + {-198,118},{-198,118.171}}, color={0,0,0}, thickness=1)); connect(DHW.outBusDHW, outputs.DHW) annotation (Line( @@ -241,8 +240,8 @@ equation connect(electrical.internalElectricalPin[1], hydraulic.internalElectricalPin) annotation (Line( - points={{-198,118.171},{-198,118},{-210,118},{-210,-140},{-56,-140},{-56, - -124},{-54.3158,-124},{-54.3158,-98}}, + points={{-198,118.171},{-198,118},{-210,118},{-210,-140},{-56,-140},{-56,-124}, + {-54.3158,-124},{-54.3158,-98}}, color={0,0,0}, thickness=1)); else diff --git a/BESMod/Systems/Control/DHWSuperheating.mo b/BESMod/Systems/Control/DHWSuperheating.mo index 92e0b6d6..d698386b 100644 --- a/BESMod/Systems/Control/DHWSuperheating.mo +++ b/BESMod/Systems/Control/DHWSuperheating.mo @@ -1,11 +1,13 @@ within BESMod.Systems.Control; model DHWSuperheating "Increase the DHW set temperature at 12 pm for 1 h" extends BaseClasses.PartialControl; - Modelica.Blocks.Sources.RealExpression realExpression(y=mod(time, 86400)) + Modelica.Blocks.Sources.RealExpression reaExp(y=mod(time, 86400)) "Time of day" annotation (Placement(transformation(extent={{-92,-44},{-72,-24}}))); - Modelica.Blocks.Logical.OnOffController onOffController(bandwidth=dtOveHea) + Modelica.Blocks.Logical.OnOffController hys(bandwidth=dtOveHea) + "Hysteresis for overwriting" annotation (Placement(transformation(extent={{-58,-28},{-38,-8}}))); Modelica.Blocks.Sources.Constant const(k=houOveHea) + "Constant hour of overheating" annotation (Placement(transformation(extent={{-92,-10},{-72,10}}))); parameter Modelica.Units.SI.Time houOveHea(displayUnit="h") = 43200 "Time of the day where overheating of DHW starts"; @@ -15,25 +17,27 @@ model DHWSuperheating "Increase the DHW set temperature at 12 pm for 1 h" parameter Modelica.Units.SI.TemperatureDifference dTDHW=5 "Temperature added to DHW setpoint on overheating"; - Modelica.Blocks.Sources.Constant const1(k=TSetDHW + dTDHW) - annotation (Placement(transformation(extent={{-94,24},{-74,44}}))); + Modelica.Blocks.Sources.Constant constTSetDHW(k=TSetDHW + dTDHW) + "Constant set temperature" + annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); Electrical.Interfaces.SystemControlBus systemControlBus annotation (Placement( transformation(extent={{-14,-118},{18,-84}}), iconTransformation(extent= {{-14,-118},{18,-84}}))); equation - connect(realExpression.y, onOffController.u) annotation (Line(points={{-71,-34}, - {-66,-34},{-66,-24},{-60,-24}}, color={0,0,127})); - connect(onOffController.y, sigBusHyd.overwriteTSetDHW) annotation (Line( - points={{-37,-18},{-26,-18},{-26,-86},{-79,-86},{-79,-101}}, color={255, - 0,255}), Text( + connect(reaExp.y, hys.u) annotation (Line(points={{-71,-34},{-66,-34},{-66,-24}, + {-60,-24}}, color={0,0,127})); + connect(hys.reference, const.y) annotation (Line(points={{-60,-12},{-66,-12},{-66, + 0},{-71,0}}, color={0,0,127})); + connect(constTSetDHW.y, sigBusHyd.TSetDHWOve) annotation (Line(points={{-59,30}, + {-54,30},{-54,-4},{-68,-4},{-68,-20},{-96,-20},{-96,-84},{-79,-84},{-79, + -101}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(onOffController.reference, const.y) annotation (Line(points={{-60,-12}, - {-66,-12},{-66,0},{-71,0}}, color={0,0,127})); - connect(const1.y, sigBusHyd.TSetDHW) annotation (Line(points={{-73,34},{-26,34}, - {-26,-86},{-79,-86},{-79,-101}}, color={0,0,127}), Text( + connect(hys.y, sigBusHyd.oveTSetDHW) annotation (Line(points={{-37,-18},{-26,-18}, + {-26,-86},{-80,-86},{-80,-94},{-79,-94},{-79,-101}}, color={255,0,255}), + Text( string="%second", index=1, extent={{6,3},{6,3}}, diff --git a/BESMod/Systems/Demand/Building/AixLibHighOrder.mo b/BESMod/Systems/Demand/Building/AixLibHighOrder.mo index 271bf16b..898f42aa 100644 --- a/BESMod/Systems/Demand/Building/AixLibHighOrder.mo +++ b/BESMod/Systems/Demand/Building/AixLibHighOrder.mo @@ -64,8 +64,8 @@ model AixLibHighOrder "High order building model from AixLib library" each WeatherFormat=1) annotation(Placement(transformation(extent={{18,42},{42, 64}}))); - Modelica.Blocks.Sources.Constant constVentRate[nZones](final k=ventRate) if - useConstVentRate annotation (Placement(transformation( + Modelica.Blocks.Sources.Constant constVentRate[nZones](final k=ventRate) + if useConstVentRate annotation (Placement(transformation( extent={{10,-10},{-10,10}}, rotation=180, origin={-90,10}))); Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow InternalGains[nZones] diff --git a/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo b/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo index 1fb4ab6d..55e1d455 100644 --- a/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo +++ b/BESMod/Systems/Demand/Building/BaseClasses/PartialAixLibHighOrder.mo @@ -20,14 +20,14 @@ partial model PartialAixLibHighOrder Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a groundTemp annotation (Placement(transformation(extent={{-10,-110},{10,-90}}))); Modelica.Fluid.Interfaces.FluidPort_a portVent_in[nZones](redeclare final - package Medium = MediumZone) if - use_ventilation + package Medium = MediumZone) + if use_ventilation "Inlet for the demand of ventilation" annotation (Placement(transformation(extent={{90,-76},{110,-56}}), iconTransformation(extent={{90,-74},{110,-54}}))); Modelica.Fluid.Interfaces.FluidPort_b portVent_out[nZones](redeclare final - package Medium = MediumZone) if - use_ventilation + package Medium = MediumZone) + if use_ventilation "Outlet of the demand of Ventilation" annotation (Placement(transformation(extent={{90,-102},{110,-82}}), iconTransformation(extent={{90,-98},{110,-78}}))); diff --git a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo index 2e09a37f..c2014c20 100644 --- a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo +++ b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo @@ -20,6 +20,8 @@ partial model PartialDemand "Partial demand model for HPS" annotation (Dialog(group="Geometry")); parameter Boolean use_hydraulic=true "=false to disable hydraulic supply"; parameter Boolean use_ventilation=true "=false to disable ventilation supply"; + parameter Modelica.Units.SI.Temperature TOda_nominal "Nominal outdoor air temperature" + annotation(Dialog(group="Design - Top Down: Parameters are given by the parent system")); replaceable package MediumZone = IBPSA.Media.Air constrainedby Modelica.Media.Interfaces.PartialMedium annotation (choices( @@ -43,14 +45,14 @@ partial model PartialDemand "Partial demand model for HPS" BESMod.Systems.Interfaces.DemandOutputs outBusDem if not use_openModelica annotation (Placement(transformation(extent={{88,-12},{108,8}}))); Modelica.Fluid.Interfaces.FluidPort_a portVent_in[nZones]( - redeclare final package Medium = MediumZone) if - use_ventilation + redeclare final package Medium = MediumZone) + if use_ventilation "Inlet for the demand of ventilation" annotation (Placement(transformation(extent={{90,28},{110,48}}), iconTransformation(extent={{90,28},{110,48}}))); Modelica.Fluid.Interfaces.FluidPort_b portVent_out[nZones]( - redeclare final package Medium = MediumZone) if - use_ventilation + redeclare final package Medium = MediumZone) + if use_ventilation "Outlet of the demand of Ventilation" annotation (Placement(transformation(extent={{90,-50},{110,-30}}), iconTransformation(extent={{90,-50},{110,-30}}))); diff --git a/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo b/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo index a05ba162..de78c9f3 100644 --- a/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo +++ b/BESMod/Systems/Demand/Building/BuildingsRoomCase600FF.mo @@ -163,9 +163,9 @@ model BuildingsRoomCase600FF origin={8.5,-46}))); Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TRooAir "Room air temperature" - annotation (Placement(transformation(extent={{9,-9},{-9,9}}, + annotation (Placement(transformation(extent={{10,-10},{-10,10}}, rotation=270, - origin={-1,59}))); + origin={10,50}))); replaceable parameter Buildings.ThermalZones.Detailed.Validation.BESTEST.Data.StandardResultsFreeFloating staRes( @@ -213,6 +213,11 @@ model BuildingsRoomCase600FF BESMod.Utilities.KPIs.ComfortCalculator comfortCalculatorCool[nZones](TComBou= TSetZone_nominal .+ dTComfort, each for_heating=false) annotation (Placement(transformation(extent={{66,-18},{80,-4}}))); + Modelica.Blocks.Routing.RealPassThrough reaPasThrTMea[nZones] + "Enable array bus connector" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-30,70}))); equation connect(roo.uSha, replicator.y) annotation (Line( points={{32.8,32.7},{32.8,38},{48,38},{48,59.6}}, @@ -227,7 +232,7 @@ equation color={191,0,0}, smooth=Smooth.None)); connect(roo.heaPorAir, TRooAir.port) annotation (Line( - points={{-3.25,3},{-3.25,2},{-2,2},{-2,44},{-1,44},{-1,50}}, + points={{-3.25,3},{-3.25,2},{-44,2},{-44,40},{10,40}}, color={191,0,0}, smooth=Smooth.None)); connect(roo.qGai_flow, useProBus.intGains) annotation (Line(points={{32.8, @@ -243,12 +248,6 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(TRooAir.T, buiMeaBus.TZoneMea[1]) annotation (Line(points={{-1,68.9}, - {-1,83.5},{0,83.5},{0,99}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); connect(heatPortCon[1], roo.heaPorAir) annotation (Line(points={{-100,60},{-94, 60},{-94,58},{-86,58},{-86,3},{-3.25,3}}, color={191,0,0})); connect(roo.heaPorRad, heatPortRad[1]) annotation (Line(points={{-3.25,-3.27}, @@ -315,12 +314,21 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(TRooAir.T, comfortCalculatorHea[1].TZone) annotation (Line(points={{-1,68.9}, - {40,68.9},{40,7},{64.6,7}}, color={0,0,127})); - connect(TRooAir.T, comfortCalculatorCool[1].TZone) annotation (Line(points={{-1,68.9}, - {-2,68.9},{-2,70},{0,70},{0,68},{40,68},{40,-11},{64.6,-11}}, color= + connect(TRooAir.T, comfortCalculatorHea[1].TZone) annotation (Line(points={{10,61}, + {10,66},{42,66},{42,7},{64.6,7}}, + color={0,0,127})); + connect(TRooAir.T, comfortCalculatorCool[1].TZone) annotation (Line(points={{10,61}, + {10,66},{42,66},{42,6},{58,6},{58,-11},{64.6,-11}}, color= {0,0,127})); + connect(reaPasThrTMea[1].u, TRooAir.T) + annotation (Line(points={{-18,70},{10,70},{10,61}}, color={0,0,127})); + connect(reaPasThrTMea.y, buiMeaBus.TZoneMea) annotation (Line(points={{-41,70}, + {-46,70},{-46,84},{0,84},{0,99}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); annotation ( experiment(Tolerance=1e-06, StopTime=3.1536e+07), __Dymola_Commands(file="modelica://Buildings/Resources/Scripts/Dymola/ThermalZones/Detailed/Validation/BESTEST/Cases6xx/Case600FF.mos" diff --git a/BESMod/Systems/Demand/Building/Components/BaseClasses/PartialAixLibHighOrder.mo b/BESMod/Systems/Demand/Building/Components/BaseClasses/PartialAixLibHighOrder.mo index e3fcfe7f..38ddba99 100644 --- a/BESMod/Systems/Demand/Building/Components/BaseClasses/PartialAixLibHighOrder.mo +++ b/BESMod/Systems/Demand/Building/Components/BaseClasses/PartialAixLibHighOrder.mo @@ -21,14 +21,14 @@ partial model PartialAixLibHighOrder Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a groundTemp annotation (Placement(transformation(extent={{-10,-110},{10,-90}}))); Modelica.Fluid.Interfaces.FluidPort_a portVent_in[nZones](redeclare final - package Medium = MediumZone) if - use_ventilation + package Medium = MediumZone) + if use_ventilation "Inlet for the demand of ventilation" annotation (Placement(transformation(extent={{90,-76},{110,-56}}), iconTransformation(extent={{90,-74},{110,-54}}))); Modelica.Fluid.Interfaces.FluidPort_b portVent_out[nZones](redeclare final - package Medium = MediumZone) if - use_ventilation + package Medium = MediumZone) + if use_ventilation "Outlet of the demand of Ventilation" annotation (Placement(transformation(extent={{90,-102},{110,-82}}), iconTransformation(extent={{90,-98},{110,-78}}))); diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index 9b412909..57150255 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -30,7 +30,6 @@ model TEASERThermalZone zoneParam[i].heaLoadFacGrd*(TSetZone_nominal[i] - zoneParam[i].TSoil) for i in 1:nZones} "Nominal heat flow rate according to record at TOda_nominal"; - parameter Modelica.Units.SI.Temperature TOda_nominal "Nominal outdoor air temperature"; AixLib.ThermalZones.ReducedOrder.ThermalZone.ThermalZone thermalZone[nZones]( redeclare each final package Medium = MediumZone, @@ -99,14 +98,14 @@ model TEASERThermalZone 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 + 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 + 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}))); @@ -129,12 +128,12 @@ model TEASERThermalZone rotation=0, origin={-30,-186}))); Modelica.Blocks.Nonlinear.Limiter limAirExcUp[nZones](each final - uMax=Modelica.Constants.inf, each final uMin=0) if - use_verboseEnergyBalance + 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 + 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] @@ -143,8 +142,8 @@ model TEASERThermalZone nZones] annotation (Placement(transformation(extent={{-86,50},{-66,70}}))); Modelica.Blocks.Math.Add addTra - [nZones] if - use_hydraulic and use_verboseEnergyBalance + [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) diff --git a/BESMod/Systems/Demand/DHW/DHW.mo b/BESMod/Systems/Demand/DHW/DHW.mo index 369f6898..88ba57ec 100644 --- a/BESMod/Systems/Demand/DHW/DHW.mo +++ b/BESMod/Systems/Demand/DHW/DHW.mo @@ -8,8 +8,7 @@ model DHW "Standard DHW subsystem" VDHWDay=if use_dhwCalc then V_dhwCalc_day else DHWProfile.VDHWDay, mDHW_flow_nominal=DHWProfile.m_flow_nominal); replaceable parameter Systems.Demand.DHW.RecordsCollection.ProfileM - DHWProfile constrainedby Systems.Demand.DHW.RecordsCollection.PartialDHWTap - annotation (choicesAllMatching=true, Dialog( + DHWProfile constrainedby Systems.Demand.DHW.RecordsCollection.PartialDHWTap annotation (choicesAllMatching=true, Dialog( enable=not use_dhwCalc and use_dhw)); parameter Boolean use_dhwCalc=false "=true to use the tables in DHWCalc. Will slow down the simulation, but represents DHW tapping more in a more realistic way." annotation (Dialog(enable=use_dhw)); diff --git a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo index a07c596d..00d02321 100644 --- a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo +++ b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo @@ -57,8 +57,8 @@ partial model PartialElectricalSystem "Partial model for electrical system" BESMod.Systems.Interfaces.BuiMeaBus buiMeaBus annotation ( Placement(transformation(extent={{48,124},{92,156}}), iconTransformation( extent={{48,124},{92,156}}))); - BESMod.Systems.Interfaces.ElectricalOutputs outBusElect if - not use_openModelica + BESMod.Systems.Interfaces.ElectricalOutputs outBusElect + if not use_openModelica annotation (Placement(transformation(extent={{-22,-160},{24,-120}}), iconTransformation(extent={{-22,-160},{24,-120}}))); Interfaces.ExternalElectricalPin externalElectricalPin1 diff --git a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo index 577e82b9..1d58ad9b 100644 --- a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo +++ b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo @@ -91,6 +91,10 @@ partial model PartialHydraulicSystem final dTLoss_nominal=transfer.dTLoss_nominal, final f_design=transfer.f_design, final QLoss_flow_nominal=transfer.QLoss_flow_nominal, + final TTra_nominal=transfer.TTra_nominal, + final QSup_flow_nominal=transfer.QSup_flow_nominal, + final dpSup_nominal=transfer.dpSup_nominal, + final mSup_flow_nominal=transfer.mSup_flow_nominal, final nHeaTra=transfer.nHeaTra), final use_openModelica=use_openModelica) annotation (choicesAllMatching=true, Placement(transformation(extent={{-132,54}, diff --git a/BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo b/BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo index 1cb7c5e7..981ed532 100644 --- a/BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo +++ b/BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo @@ -32,8 +32,8 @@ model HeatingRodWithSecurityControl final y_start=0) if use_countNumSwi "To count on-off cycles" annotation (Placement(transformation(extent={{68,-68},{86,-52}}))); - Modelica.Blocks.Sources.IntegerConstant integerConstant(final k=1) if - use_countNumSwi + Modelica.Blocks.Sources.IntegerConstant integerConstant(final k=1) + if use_countNumSwi annotation (Placement(transformation(extent={{38,-68},{54,-52}}))); Modelica.Blocks.Interfaces.IntegerOutput numSwi if use_countNumSwi "Number of on switches " diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo index d01a51eb..e107085e 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo @@ -3,10 +3,10 @@ partial model PartialHeatPumpSystemController "Partial model with replaceable blocks for rule based control of heat pump systems" extends BESMod.Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl; - parameter Modelica.Units.SI.TemperatureDifference dTHysBui + parameter Modelica.Units.SI.TemperatureDifference dTHysBui=10 "Hysteresis for building demand control" annotation (Dialog(group="Building control")); - parameter Modelica.Units.SI.TemperatureDifference dTHysDHW + parameter Modelica.Units.SI.TemperatureDifference dTHysDHW=10 "Hysteresis for DHW demand control" annotation (Dialog(group="DHW control")); parameter Utilities.SupervisoryControl.Types.SupervisoryControlType @@ -43,9 +43,8 @@ partial model PartialHeatPumpSystemController final TSetDHW_nominal=parDis.TDHW_nominal) "DHW set temperture module" annotation (Dialog(group="Component choices"), choicesAllMatching=true); - replaceable record parPIDHeaPum = - BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition - constrainedby + replaceable parameter BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition + parPIDHeaPum constrainedby BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition "PID parameters of heat pump" annotation (choicesAllMatching=true, @@ -58,7 +57,16 @@ partial model PartialHeatPumpSystemController {218,98}})), Dialog(group="Component data")); replaceable BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PID - priGenPIDCtrl(redeclare record parPID = parPIDHeaPum) constrainedby + priGenPIDCtrl( + final yMax=parPIDHeaPum.yMax, + final yOff=parPIDHeaPum.yOff, + final y_start=parPIDHeaPum.y_start, + final yMin=parPIDHeaPum.yMin, + final P=parPIDHeaPum.P, + final timeInt=parPIDHeaPum.timeInt, + final Ni=parPIDHeaPum.Ni, + final timeDer=parPIDHeaPum.timeDer, + final Nd=parPIDHeaPum.Nd) constrainedby BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.BaseClasses.PartialControler "Control of primary generation device" annotation ( Dialog(group="Primary device", tab="Advanced"), @@ -114,7 +122,7 @@ partial model PartialHeatPumpSystemController Components.BuildingAndDHWControl buiAndDHWCtr( final nZones=parTra.nParallelDem, final TSup_nominal=max(parTra.TSup_nominal), - final TRet_nominal=max(parTra.TSup_nominal - parTra.dTTra_nominal), + final TRet_nominal=max(parTra.TTra_nominal .- parTra.dTTra_nominal), final TOda_nominal=parGen.TOda_nominal, final TSetDHW_nominal=parDis.TDHW_nominal, final nHeaTra=parTra.nHeaTra, @@ -224,9 +232,6 @@ equation connect(buiAndDHWCtr.secGen, anyGenDevIsOn.u[1]) annotation (Line(points={{-118, 37.5},{-118,36},{-112,36},{-112,6},{-151.75,6},{-151.75,0}}, color={255,0,255})); - connect(buiAndDHWCtr.priGren, anyGenDevIsOn.u[2]) annotation (Line(points={{-118, - 27.5},{-118,26},{-112,26},{-112,6},{-148.25,6},{-148.25,0}}, - color={255,0,255})); connect(priGenPIDCtrl.setOn, buiAndDHWCtr.priGren) annotation (Line(points={{100.4, 90},{96,90},{96,40},{-80,40},{-80,27.5},{-118,27.5}}, color={255,0,255})); connect(setAndMeaSelPri.DHW, buiAndDHWCtr.DHW) annotation (Line(points={{39,76}, @@ -280,6 +285,13 @@ equation extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); + connect(anyGenDevIsOn.u[2], sigBusGen.heaPumIsOn) annotation (Line(points={{-148.25, + 0},{-148,0},{-148,6},{-168,6},{-168,-99},{-152,-99}}, color={255,0,255}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); annotation (Diagram(graphics={ Rectangle( extent={{4,100},{136,36}}, diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PIDParameters.mo b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PIDParameters.mo new file mode 100644 index 00000000..1978da39 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PIDParameters.mo @@ -0,0 +1,7 @@ +within BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.BaseClasses; +model PIDParameters + + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end PIDParameters; diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order index 033605dc..b3d7ae3c 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order @@ -1,2 +1,3 @@ PartialControler LimPID +PIDParameters diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo index e3383e80..cf257e4e 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo @@ -1,40 +1,43 @@ within BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController; model PID "PID controller for inverter controlled devices" extends BaseClasses.PartialControler; - + parameter Real yMax=1 "Upper limit of output"; + parameter Real yOff=0 "Constant output value if device is turned off"; + parameter Real y_start=0 "Initial value of output"; + parameter Real yMin "Lower limit of relative speed"; + parameter Real P "Gain of PID-controller"; + parameter Modelica.Units.SI.Time timeInt "Time constant of Integrator block"; + parameter Real Ni=0.9 "Ni*Ti is time constant of anti-windup compensation"; + parameter Modelica.Units.SI.Time timeDer "Time constant of Derivative block"; + parameter Real Nd=10 "The higher Nd, the more ideal the derivative block"; BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.BaseClasses.LimPID PID( controllerType=Modelica.Blocks.Types.SimpleController.PID, - final k=parPID.P, - Ti=parPID.timeInt, - Td=parPID.timeDer, - final yMax=parPID.yMax, - final yMin=parPID.yMin, + final k=P, + final Ti=timeInt, + final Td=timeDer, + final yMax=yMax, + final yMin=yMin, final wp=1, final wd=0, - Ni=parPID.Ni, - Nd=parPID.Nd, + final Ni=Ni, + final Nd=Nd, final initType=Modelica.Blocks.Types.Init.InitialState, - homotopyType=Modelica.Blocks.Types.LimiterHomotopy.NoHomotopy, + final homotopyType=Modelica.Blocks.Types.LimiterHomotopy.NoHomotopy, final strict=false, final xi_start=0, final xd_start=0, - final y_start=parPID.y_start, + final y_start=y_start, final limitsAtInit=true) annotation (Placement(transformation(extent={{-30,22},{6,58}}))); Modelica.Blocks.Logical.Switch onOffSwi "Switch on off" annotation (Placement(transformation(extent={{38,-14},{68,16}}))); - Modelica.Blocks.Sources.Constant const(final k=parPID.yOff) "HP turned off" + Modelica.Blocks.Sources.Constant const(final k=yOff) "HP turned off" annotation (Placement(transformation(extent={{-6,-36},{10,-20}}))); Modelica.Blocks.Logical.And and1 annotation (Placement(transformation(extent={{-52,-64},{-32,-44}}))); - replaceable record parPID= - BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition - constrainedby BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition "PID parameters" - annotation (choicesAllMatching=true, - Placement(transformation(extent={{80,-100},{100,-80}}))); equation connect(setOn, onOffSwi.u2) annotation (Line(points={{-120,0},{34,0},{34,1},{35,1}}, color={255,0,255})); diff --git a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo index 1e6988f5..18a1151f 100644 --- a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo @@ -1,6 +1,12 @@ within BESMod.Systems.Hydraulical.Control; model GasBoiler "PI Control of gas boiler" extends BaseClasses.PartialThermostaticValveControl; + parameter Modelica.Units.SI.TemperatureDifference dTHysBui + "Hysteresis for building demand control" + annotation (Dialog(group="Building control")); + parameter Modelica.Units.SI.TemperatureDifference dTHysDHW + "Hysteresis for DHW demand control" annotation (Dialog(group="DHW control")); + BESMod.Systems.Hydraulical.Control.Components.HeatingCurve heatingCurve( GraHeaCurve=monovalentControlParas.gradientHeatCurve, @@ -11,12 +17,17 @@ model GasBoiler "PI Control of gas boiler" TSet_DHW(TSetDHW_nominal=parDis.TDHW_nominal) if use_dhw annotation (Placement(transformation(extent={{-220,80},{-200,100}}))); replaceable - BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PI + BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PID HP_nSet_Controller( - P=monovalentControlParas.k, - yMin=monovalentControlParas.nMin, - timeInt=monovalentControlParas.T_I, - Ni=monovalentControlParas.Ni) annotation (choicesAllMatching=true, Placement( + yMax=parPID.yMax, + yOff=parPID.yOff, + y_start=parPID.y_start, + P=parPID.P, + yMin=parPID.yMin, + timeInt=parPID.timeInt, + Ni=parPID.Ni, + timeDer=parPID.timeDer, + Nd=parPID.Nd) annotation (choicesAllMatching=true, Placement( transformation(extent={{102,42},{138,78}}))); Modelica.Blocks.Logical.OnOffController BoilerOnOffBuf(bandwidth= monovalentControlParas.dTHysBui, pre_y_start=true) @@ -81,6 +92,9 @@ model GasBoiler "PI Control of gas boiler" extent={{-10,-10},{10,10}}, rotation=0, origin={-30,-50}))); + replaceable RecordsCollection.PIDBaseDataDefinition parPID + "PID parameters for boiler" + annotation (Placement(transformation(extent={{142,84},{162,104}}))); equation connect(sigBusDistr,TSet_DHW. sigBusDistr) annotation (Line( points={{1,-100},{10,-100},{10,-146},{-280,-146},{-280,89.9},{-220,89.9}}, diff --git a/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo b/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo index 2e965ef6..dd37401b 100644 --- a/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo +++ b/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo @@ -10,8 +10,23 @@ model HybridHeatPumpSystem parameter Modelica.Units.SI.Temperature TCutOff "Cutoff temperature"; parameter Boolean boiInGeneration "=true for boiler in generation system, false for distribution"; + replaceable parameter BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition parPIDBoi + constrainedby + BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition + "PID parameters of boiler" annotation ( + choicesAllMatching=true, + Dialog(group="Primary device control"), + Placement(transformation(extent={{100,-20},{120,0}}))); replaceable BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PID boiPIDCtrl( - final parPID=parPIDBoi) + final yMax=parPIDBoi.yMax, + final yOff=parPIDBoi.yOff, + final y_start=parPIDBoi.y_start, + final yMin=parPIDBoi.yMin, + final P=parPIDBoi.P, + final timeInt=parPIDBoi.timeInt, + final Ni=parPIDBoi.Ni, + final timeDer=parPIDBoi.timeDer, + final Nd=parPIDBoi.Nd) constrainedby BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.BaseClasses.PartialControler "PID control of boiler" annotation (choicesAllMatching=true, @@ -29,12 +44,6 @@ model HybridHeatPumpSystem extent={{-10,-10},{10,10}}, rotation=270, origin={-190,-30}))); - replaceable parameter RecordsCollection.PIDBaseDataDefinition parPIDBoi - constrainedby RecordsCollection.PIDBaseDataDefinition - "PID parameters of boiler" annotation ( - choicesAllMatching=true, - Dialog(group="Primary device control"), - Placement(transformation(extent={{100,-20},{120,0}}))); equation connect(boiInHybSys.secGen, buiAndDHWCtr.secGen) annotation (Line(points={{-31.8, -6},{-110,-6},{-110,37.5},{-118,37.5}}, color={255,0,255})); diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicHeatPumpPI.mo b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicHeatPumpPI.mo index fec51e48..731e2d38 100644 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicHeatPumpPI.mo +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicHeatPumpPI.mo @@ -1,6 +1,9 @@ within BESMod.Systems.Hydraulical.Control.RecordsCollection; record BasicHeatPumpPI "Typically good PI values for a heat pump" extends PIDBaseDataDefinition( + timeDer=0, + timeInt=1200, + P=0.3, y_start=0, yOff=0, yMax=1, diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/BivalentHeatPumpControlDataDefinition.mo b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BivalentHeatPumpControlDataDefinition.mo deleted file mode 100644 index 78cc9777..00000000 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/BivalentHeatPumpControlDataDefinition.mo +++ /dev/null @@ -1,22 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.RecordsCollection; -partial record BivalentHeatPumpControlDataDefinition - extends Modelica.Icons.Record; - - parameter Modelica.Units.SI.TemperatureDifference dTHysBui - "Hysteresis for building demand control" - annotation (Dialog(group="General")); - parameter Modelica.Units.SI.TemperatureDifference dTHysDHW - "Hysteresis for DHW demand control" annotation (Dialog(group="General")); - parameter Real k "Proportional gain of Primary PID Controller" - annotation(Dialog(group="Primary PID Control")); - parameter Modelica.Units.SI.Time T_I - "Time constant of Integrator block of PI control" annotation (Dialog(group= - "Primary PID Control")); - - parameter Modelica.Units.SI.Time Ni "Anti wind up constant of PID control" - annotation (Dialog(group="Primary PID Control")); - parameter Real nMin - "Minimum relative input signal of primary device PID control" - annotation (Dialog(group="Primary PID Control")); - -end BivalentHeatPumpControlDataDefinition; diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/DefaultBivHPControl.mo b/BESMod/Systems/Hydraulical/Control/RecordsCollection/DefaultBivHPControl.mo deleted file mode 100644 index 5abdaee7..00000000 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/DefaultBivHPControl.mo +++ /dev/null @@ -1,15 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.RecordsCollection; -record DefaultBivHPControl - extends BivalentHeatPumpControlDataDefinition( - addSet_dtHeaRodDHW=1, - dtHeaRodDHW=30*60, - addSet_dtHeaRodBui=1, - dtHeaRodBui=30*60, - dTHysDHW=10, - dTHysBui=10, - nMin=0.3, - dTOffSetHeatCurve=2, - Ni=0.9, - T_I=1200, - k=0.3); -end DefaultBivHPControl; diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/PIDBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Control/RecordsCollection/PIDBaseDataDefinition.mo index f675c8f3..9dbac604 100644 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/PIDBaseDataDefinition.mo +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/PIDBaseDataDefinition.mo @@ -1,7 +1,6 @@ within BESMod.Systems.Hydraulical.Control.RecordsCollection; partial record PIDBaseDataDefinition "Record for a PID controller" extends Modelica.Icons.Record; - parameter Real yMax=1 "Upper limit of output"; parameter Real yOff=0 "Constant output value if device is turned off"; parameter Real y_start=0 "Initial value of output"; diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order b/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order index 51086b01..334d1515 100644 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order @@ -1,7 +1,5 @@ HeatPumpSafetyControl DefaultSafetyControl -BivalentHeatPumpControlDataDefinition -DefaultBivHPControl ThermostaticValveDataDefinition PIDBaseDataDefinition BasicHeatPumpPI diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo index a7dce526..4e0d7b50 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo @@ -171,6 +171,15 @@ partial model PartialTwoStorageParallel "Partial model to later extent" upToDownHC2=true, final TStartWall=T_start, final TStartIns=T_start, + nLowerPortSupply=1, + nUpperPortSupply=parStoBuf.nLayer, + nLowerPortDemand=1, + nUpperPortDemand=parStoBuf.nLayer, + nTS1=1, + nTS2=parStoBuf.nLayer, + nHC1Up=parStoBuf.nLayer, + nHC1Low=1, + nHR=parStoBuf.nLayerHR, redeclare model HeatTransfer = AixLib.Fluid.Storage.BaseClasses.HeatTransferBuoyancyWetter, final allowFlowReversal_layers=allowFlowReversal, @@ -217,6 +226,15 @@ partial model PartialTwoStorageParallel "Partial model to later extent" final upToDownHC2=true, final TStartWall=T_start, final TStartIns=T_start, + nLowerPortSupply=1, + nUpperPortSupply=parStoDHW.nLayer, + nLowerPortDemand=1, + nUpperPortDemand=parStoDHW.nLayer, + nTS1=1, + nTS2=parStoDHW.nLayer, + nHC1Up=parStoDHW.nLayer, + nHC1Low=1, + nHR=parStoDHW.nLayerHR, redeclare model HeatTransfer = AixLib.Fluid.Storage.BaseClasses.HeatTransferBuoyancyWetter, final allowFlowReversal_layers=allowFlowReversal, @@ -289,8 +307,8 @@ partial model PartialTwoStorageParallel "Partial model to later extent" QHRStoBufPre_flow.Q_flow) if parStoBuf.use_hr annotation (Placement(transformation(extent={{-100,-180},{-80,-160}}))); - AixLib.Fluid.Interfaces.PassThroughMedium pasThrNoDHW(redeclare package Medium = - Medium, allowFlowReversal=allowFlowReversal) if not use_dhw + AixLib.Fluid.Interfaces.PassThroughMedium pasThrNoDHW(redeclare package Medium + = Medium, allowFlowReversal=allowFlowReversal) if not use_dhw "Pass through if DHW is disabled" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo index 41d0b46f..9493fda2 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo @@ -3,14 +3,14 @@ partial model PartialTwoStorageParallelWithHeaters "Partial two storage model with heaters" extends BaseClasses.PartialTwoStorageParallel( final use_secHeaCoiDHWSto=false); - parameter Modelica.Units.SI.HeatFlowRate QHRAftBuf_flow_nominal + parameter Modelica.Units.SI.HeatFlowRate QHRAftBuf_flow_nominal=0 "Nominal heat flow rate of heating rod after DHW storage" annotation (Dialog(group="Component data", enable=heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod)); parameter BESMod.Systems.Hydraulical.Distribution.Types.HeaterType heaAftBufTyp=BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.No "Type of heater after the buffer storage" annotation(Dialog(group="Component choices")); - replaceable parameter Generation.RecordsCollection.HeatingRodBaseDataDefinition + replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR parHeaRodAftBuf if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod "Parameters for heating rod after buffer storage" annotation ( Dialog(group="Component data", enable=heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod), @@ -22,7 +22,7 @@ partial model PartialTwoStorageParallelWithHeaters parameter Real etaTem[:,2]=[293.15,1.09; 303.15,1.08; 313.15,1.05; 323.15,1.; 373.15, 0.99] if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler "Temperature based efficiency" - annotation(Dialog(group="Component data")); + annotation(Dialog(group="Component data", enable=heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler)); replaceable parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition parBoi if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler diff --git a/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo index db8190f5..59ba40bc 100644 --- a/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo +++ b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo @@ -9,7 +9,8 @@ model TwoStoragesBoilerWithDHW stoBuf(final useHeatingCoil1=false), final dpBufHCSto_nominal=0, final dTLoaHCBuf=0, - final use_secHeaCoiDHWSto=true); + final use_secHeaCoiDHWSto=true, + stoDHW(nHC2Up=parStoDHW.nLayer, nHC2Low=1)); parameter Modelica.Units.SI.TemperatureDifference dTBoiDHWLoa = 5 "Temperature difference for DHW storage loading with the boiler" annotation(Dialog(group="Component data")); @@ -248,4 +249,10 @@ equation connect(stoDHW.portHC2Out, thrWayValBoiDHW.portDHW_a) annotation (Line(points={{ -50.2,-61.4},{-50.2,-62},{-52,-62},{-52,-74},{44,-74},{44,-37.6},{40,-37.6}}, color={0,127,255})); + connect(stoBuf.fluidportTop1, threeWayValveWithFlowReturn.portBui_b) + annotation (Line(points={{-39.6,40.2},{-39.6,58},{-52,58},{-52,78},{-60,78}}, + color={0,127,255})); + connect(threeWayValveWithFlowReturn.portBui_a, stoBuf.fluidportBottom1) + annotation (Line(points={{-60,74},{-56,74},{-56,-10},{-39.4,-10},{-39.4,-0.4}}, + color={0,127,255})); end TwoStoragesBoilerWithDHW; diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo index 7e05b7c3..9ee9cadb 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo @@ -162,7 +162,8 @@ model PartialHeatPump "Generation with only the heat pump" rotation=0, origin={-170,50}))); - Utilities.KPIs.EnergyKPICalculator KPIQHP(use_inpCon=false, y=heatPump.con.QFlow_in) + Utilities.KPIs.EnergyKPICalculator KPIQHP(use_inpCon=false, final y=heatPump.con.QFlow_in) + if false annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); IBPSA.Fluid.Sources.Boundary_pT bouPum( diff --git a/BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo index c30e85fa..bedd15bd 100644 --- a/BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo @@ -97,7 +97,8 @@ model DetailedSolarThermalWithHeatPump rotation=0, origin={-190,-150}))); - Utilities.KPIs.EnergyKPICalculator KPIWel1(use_inpCon=false, y=sum(solCol.vol.heatPort.Q_flow)) + Utilities.KPIs.EnergyKPICalculator KPIQSol(use_inpCon=false, y=sum(solCol.vol.heatPort.Q_flow)) + "Solar thermal KPI" annotation (Placement(transformation(extent={{-60,-120},{-40,-100}}))); Modelica.Blocks.Logical.Switch switch3 annotation (Placement(transformation( @@ -161,6 +162,12 @@ equation horizontalAlignment=TextAlignment.Right)); connect(AirOrSoil1.y, switch3.u1) annotation (Line(points={{-179,-150},{-170, -150},{-170,-162}}, color={0,0,127})); + connect(KPIQSol.KPI, outBusGen.QSolThe_flow) annotation (Line(points={{-37.8, + -110},{0,-110},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); annotation (Diagram(coordinateSystem(extent={{-220,-200},{100,100}}), graphics={Text( extent={{-216,-122},{-152,-140}}, diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index 8e633640..740a716a 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -36,7 +36,8 @@ model HeatPumpAndHeatingRod "Heat pump with heating rod in series" use_reaInp=true, calc_singleOnTime=true, calc_totalOnTime=true, - calc_numSwi=true) "Heating rod KPIs" + calc_numSwi=true) if use_heaRod + "Heating rod KPIs" annotation (Placement(transformation(extent={{-120,-120},{-100,-100}}))); Utilities.KPIs.EnergyKPICalculator KPIQHeaRod_flow(use_inpCon=false, y=hea.vol.heatPort.Q_flow) if use_heaRod "Heating rod heat flow rate" @@ -62,12 +63,6 @@ equation connect(heatPump.port_b1,hea. port_a) annotation (Line(points={{-30.5,37},{-30.5, 36},{-30,36},{-30,50},{20,50}}, color={0,127,255})); - connect(KPIHeaPum.KPI, outBusGen.heaRod) annotation (Line(points={{-97.8,-50},{ - -76,-50},{-76,-100},{0,-100}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(hea.u, sigBusGen.uHeaRod) annotation (Line(points={{18,56},{2,56},{2,98}}, color={0,0,127}), Text( string="%second", @@ -92,4 +87,10 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); + connect(KPIHeaRod.KPI, outBusGen.heaRod) annotation (Line(points={{-97.8,-110},{ + -56,-110},{-56,-100},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); end HeatPumpAndHeatingRod; diff --git a/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo index 19782d05..bbc1c61b 100644 --- a/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo @@ -34,6 +34,11 @@ model SimpleSolarThermalWithHeatPump final transferHeat=parTemSen.transferHeat, final TAmb=parTemSen.TAmb, final tauHeaTra=parTemSen.tauHeaTra, + dp_start=solThe.pressureDropCoeff*(solThe.m_flow_start/solThe.Medium.density( + solThe.Medium.setState_pTX( + solThe.p_start, + solThe.T_start, + solThe.Medium.reference_X)))^2, final p_start=p_start, final dp_nominal=dpST_nominal, final rho_default=rho, diff --git a/BESMod/Systems/Ventilation/Control/SummerPIDByPass.mo b/BESMod/Systems/Ventilation/Control/SummerPIDByPass.mo index 83d13d94..5ffb389b 100644 --- a/BESMod/Systems/Ventilation/Control/SummerPIDByPass.mo +++ b/BESMod/Systems/Ventilation/Control/SummerPIDByPass.mo @@ -3,8 +3,8 @@ model SummerPIDByPass "Bypass the HEX in summer" extends BaseClasses.PartialControl; parameter Boolean use_bypass = true "=false to disable the bypass"; - Components.SummerByPass summerByPass if - use_bypass + Components.SummerByPass summerByPass + if use_bypass annotation (Placement(transformation(extent={{-30,-14},{22,36}}))); Modelica.Blocks.Sources.Constant constZero(k=0) if not use_bypass "Bypass is not used" diff --git a/BESMod/Tutorial/MyOwnModule.mo b/BESMod/Tutorial/MyOwnModule.mo index f49d92ab..6b7cf6f6 100644 --- a/BESMod/Tutorial/MyOwnModule.mo +++ b/BESMod/Tutorial/MyOwnModule.mo @@ -18,8 +18,8 @@ model MyOwnModule "My module can do this and that" startTime=myComponentParameters.startTime) annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); Modelica.Blocks.Nonlinear.Limiter - limiter(final uMax=yMax, final uMin=-yMax) if - use_lim + limiter(final uMax=yMax, final uMin=-yMax) + if use_lim annotation (Placement(transformation(extent={{6,4},{26,24}}))); Modelica.Blocks.Interfaces.RealOutput y "Output signal connector" annotation (Placement(transformation(extent={{100,-10},{120,10}}))); diff --git a/BESMod/Utilities/KPIs/DeviceKPICalculator.mo b/BESMod/Utilities/KPIs/DeviceKPICalculator.mo index 3c3aee65..9540df25 100644 --- a/BESMod/Utilities/KPIs/DeviceKPICalculator.mo +++ b/BESMod/Utilities/KPIs/DeviceKPICalculator.mo @@ -26,20 +26,20 @@ model DeviceKPICalculator "KPI useful for the analysis of a device" annotation (Placement(transformation(extent={{-42,10},{-22,30}}))); Modelica.Blocks.Sources.Constant const1(k=0) if calc_singleOnTime annotation (Placement(transformation(extent={{-42,-30},{-22,-10}}))); - Modelica.Blocks.Continuous.Integrator integrator3(use_reset=true, y(unit="s")) if - calc_singleOnTime + Modelica.Blocks.Continuous.Integrator integrator3(use_reset=true, y(unit="s")) + if calc_singleOnTime annotation (Placement(transformation(extent={{26,-40},{46,-20}}))); Modelica.Blocks.Logical.Not not1 if calc_singleOnTime annotation (Placement(transformation(extent={{-34,-60},{-14,-40}}))); - Modelica.Blocks.Sources.IntegerConstant integerConstant(final k=1) if - calc_numSwi + Modelica.Blocks.Sources.IntegerConstant integerConstant(final k=1) + if calc_numSwi annotation (Placement(transformation(extent={{-34,60},{-14,80}}))); Modelica.Blocks.MathInteger.TriggeredAdd triggeredAdd(final use_reset=false, final y_start=0) if calc_numSwi "To count on-off cycles" annotation (Placement(transformation(extent={{6,60},{26,80}}))); - Modelica.Blocks.Continuous.Integrator integrator1(y(unit="s")) if - calc_totalOnTime + Modelica.Blocks.Continuous.Integrator integrator1(y(unit="s")) + if calc_totalOnTime annotation (Placement(transformation(extent={{26,20},{46,40}}))); BaseClasses.KPIDevice KPI annotation (Placement(transformation(extent={{102,-20},{142,20}}), diff --git a/BESMod/package.mo b/BESMod/package.mo index 3df60e0a..91ed8c81 100644 --- a/BESMod/package.mo +++ b/BESMod/package.mo @@ -11,15 +11,14 @@ package BESMod AixLib(version="1.3.1"), IBPSA(version="4.0.0")), conversion( - from( - version="0.2.2", + from( + version="0.2.2", script="modelica://BESMod/Resources/Scripts/ConvertBESMod_from_0.2.2_to_0.3.0.mos", to="0.3.0"), - from( - version="0.3.1", - script="modelica://BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos", - to="0.3.2") - ), + from( + version="0.3.1", + script="modelica://BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos", + to="0.3.2")), Icon(graphics={Bitmap(extent={{-100,-100},{100,100}}, fileName="modelica://BESMod/Resources/Images/BESMod_icon.png")})); end BESMod; From 3082026e9f3d2ea9d40d2cff87463891f183cea1 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 14 Aug 2023 12:31:06 +0200 Subject: [PATCH 082/131] Further fix tests --- BESMod/Examples/GasBoilerBuildingOnly.mo | 15 ++-- .../PartialHeatPumpSystemController.mo | 2 +- .../Control/BivalentPartParallel.mo | 46 ------------- .../Examples/OnOffControllerTest.mo | 11 +-- .../Examples/ParallelBivalentControl.mo | 2 +- .../Components/BuildingAndDHWControl.mo | 4 +- .../BaseClasses/PartialControler.mo | 2 + .../Systems/Hydraulical/Control/GasBoiler.mo | 69 ++++++++----------- .../Systems/Hydraulical/Control/package.order | 1 - .../TransferControlBaseDataDefinition.mo | 17 +++++ 10 files changed, 66 insertions(+), 103 deletions(-) delete mode 100644 BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo diff --git a/BESMod/Examples/GasBoilerBuildingOnly.mo b/BESMod/Examples/GasBoilerBuildingOnly.mo index caf18e1f..2187ecca 100644 --- a/BESMod/Examples/GasBoilerBuildingOnly.mo +++ b/BESMod/Examples/GasBoilerBuildingOnly.mo @@ -12,25 +12,24 @@ model GasBoilerBuildingOnly redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( redeclare BESMod.Systems.Hydraulical.Generation.GasBoiler generation( dTTra_nominal={10}, - redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW - paramBoiler, + redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum), - redeclare BESMod.Systems.Hydraulical.Control.MonovalentGasBoiler control( + redeclare BESMod.Systems.Hydraulical.Control.GasBoiler control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - thermostaticValveController, + valCtrl, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, redeclare - BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PI - HP_nSet_Controller, + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicBoilerPI + parPID, redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl - monovalentControlParas), + BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PID + PIDCtrl), redeclare BESMod.Systems.Hydraulical.Distribution.BuildingOnly distribution(nParallelDem=1), redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo index e107085e..e68fc746 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo @@ -121,7 +121,7 @@ partial model PartialHeatPumpSystemController origin={170,64}))); Components.BuildingAndDHWControl buiAndDHWCtr( final nZones=parTra.nParallelDem, - final TSup_nominal=max(parTra.TSup_nominal), + final TSup_nominal=max(parTra.TTra_nominal), final TRet_nominal=max(parTra.TTra_nominal .- parTra.dTTra_nominal), final TOda_nominal=parGen.TOda_nominal, final TSetDHW_nominal=parDis.TDHW_nominal, diff --git a/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo b/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo deleted file mode 100644 index 21bd48a7..00000000 --- a/BESMod/Systems/Hydraulical/Control/BivalentPartParallel.mo +++ /dev/null @@ -1,46 +0,0 @@ -within BESMod.Systems.Hydraulical.Control; -model BivalentPartParallel - "Part-parallel PI controlled HPS according to condenser outflow" - extends BaseClasses.PartialHeatPumpSystemController( - redeclare - BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PI - priGenPIDCtrl( - P=bivalentControlData.k, - yMin=bivalentControlData.nMin, - timeInt=bivalentControlData.T_I), - redeclare - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.PartParallelBivalent - BufferOnOffController( - Hysteresis=bivalentControlData.dTHysBui, - TCutOff=TCutOff, - TBiv=bivalentControlData.TBiv, - TOda_nominal=bivalentControlData.TOda_nominal, - TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(parTra.Q_flow_nominal), - QHP_flow_cutOff=QHP_flow_cutOff), - redeclare - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.PartParallelBivalent - DHWOnOffContoller( - Hysteresis=bivalentControlData.dTHysDHW, - TCutOff=TCutOff, - TBiv=bivalentControlData.TBiv, - TOda_nominal=bivalentControlData.TOda_nominal, - TRoom=bivalentControlData.TSetRoomConst, - QDem_flow_nominal=sum(parTra.Q_flow_nominal), - QHP_flow_cutOff=QHP_flow_cutOff)); - - parameter Modelica.Units.SI.Temperature TCutOff "Cut-off temperature"; - parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff; - -equation - connect(priGenPIDCtrl.TMea, sigBusGen.THeaPumOut) annotation (Line(points={{110, - 80.4},{110,-56},{-152,-56},{-152,-99}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-3,-6},{-3,-6}}, - horizontalAlignment=TextAlignment.Right)); - - annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false))); -end BivalentPartParallel; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/OnOffControllerTest.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/OnOffControllerTest.mo index d07aac09..3f472cea 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/OnOffControllerTest.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/OnOffControllerTest.mo @@ -2,16 +2,19 @@ within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.Ex model OnOffControllerTest extends Modelica.Icons.Example; - ConstantHysteresisTimeBasedHeatingRod constantHysteresisTimeBasedHR(dtHeaRod= - 1800) annotation (Placement(transformation(extent={{-28,42},{16,82}}))); + ConstantHysteresisTimeBasedHeatingRod constantHysteresisTimeBasedHR(dTHys=10, + dtHeaRod=1800) + annotation (Placement(transformation(extent={{-28,42},{16,82}}))); BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.DegreeMinuteController - degreeMinuteController(DegreeMinuteReset=100) annotation (Placement( + degreeMinuteController(dTHys=10, + DegreeMinuteReset=100) annotation (Placement( transformation( extent={{-21,-20},{21,20}}, rotation=0, origin={-5,2}))); BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.FloatingHysteresis - floatingHysteresis(Hysteresis_max=15, Hysteresis_min=2) + floatingHysteresis( + dTHys=10, Hysteresis_max=15, Hysteresis_min=2) annotation (Placement(transformation(extent={{-26,-76},{16,-38}}))); Modelica.Blocks.Sources.Constant T_Set(k=323.15) annotation (Placement(transformation(extent={{-160,-20},{-124,16}}))); diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/ParallelBivalentControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/ParallelBivalentControl.mo index 01fdba86..84a3617e 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/ParallelBivalentControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/ParallelBivalentControl.mo @@ -3,7 +3,7 @@ model ParallelBivalentControl extends PartialOnOffController(dTHys=onOffController.Hysteresis, redeclare BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.PartParallelBivalent onOffController( - Hysteresis=10, + dTHys=10, TCutOff=263.15, TBiv=270.15, TOda_nominal=258.15, diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo index 4917d102..d484f377 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo @@ -37,10 +37,10 @@ model BuildingAndDHWControl "DHW set temperture module" annotation (choicesAllMatching=true); - DHWHysteresis hysDHW + DHWHysteresis hysDHW(dTHys=10) "Hysteresis for DHW system" annotation (Placement( transformation(extent={{62,62},{78,78}}))); - BuildingHysteresis hysBui + BuildingHysteresis hysBui(dTHys=10) "Hysteresis for building" annotation (Placement( transformation(extent={{42,-78},{58,-62}}))); DHWSetTemperature TSetDHW "DHW set temperature module" annotation ( diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PartialControler.mo b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PartialControler.mo index f08b3426..a23ad535 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PartialControler.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PartialControler.mo @@ -1,5 +1,7 @@ within BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.BaseClasses; partial model PartialControler "Partial controller model" + parameter Real yMax=1 "Upper limit of output"; + Modelica.Blocks.Interfaces.BooleanInput setOn(final start=true) "True if the device is set to turn on" annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); diff --git a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo index 18a1151f..d409a6c7 100644 --- a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo @@ -1,24 +1,26 @@ within BESMod.Systems.Hydraulical.Control; model GasBoiler "PI Control of gas boiler" extends BaseClasses.PartialThermostaticValveControl; - parameter Modelica.Units.SI.TemperatureDifference dTHysBui + parameter Modelica.Units.SI.TemperatureDifference dTHysBui=10 "Hysteresis for building demand control" annotation (Dialog(group="Building control")); - parameter Modelica.Units.SI.TemperatureDifference dTHysDHW + parameter Modelica.Units.SI.TemperatureDifference dTHysDHW=10 "Hysteresis for DHW demand control" annotation (Dialog(group="DHW control")); - + replaceable parameter RecordsCollection.PIDBaseDataDefinition parPID + "PID parameters for boiler" + annotation (choicesAllMatching=true, Placement(transformation(extent={{142,84},{162,104}}))); BESMod.Systems.Hydraulical.Control.Components.HeatingCurve heatingCurve( - GraHeaCurve=monovalentControlParas.gradientHeatCurve, - THeaThres=monovalentControlParas.TSetRoomConst, - dTOffSet_HC=monovalentControlParas.dTOffSetHeatCurve) + TSup_nominal=max(parTra.TTra_nominal), + TRet_nominal=max(parTra.TTra_nominal - parTra.dTTra_nominal), + TOda_nominal=parGen.TOda_nominal, + nHeaTra=parTra.nHeaTra) annotation (Placement(transformation(extent={{-220,20},{-200,40}}))); BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW TSet_DHW(TSetDHW_nominal=parDis.TDHW_nominal) if use_dhw annotation (Placement(transformation(extent={{-220,80},{-200,100}}))); replaceable - BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PID - HP_nSet_Controller( + BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PID PIDCtrl( yMax=parPID.yMax, yOff=parPID.yOff, y_start=parPID.y_start, @@ -27,14 +29,14 @@ model GasBoiler "PI Control of gas boiler" timeInt=parPID.timeInt, Ni=parPID.Ni, timeDer=parPID.timeDer, - Nd=parPID.Nd) annotation (choicesAllMatching=true, Placement( + Nd=parPID.Nd) "PID control" annotation (choicesAllMatching=true, Placement( transformation(extent={{102,42},{138,78}}))); - Modelica.Blocks.Logical.OnOffController BoilerOnOffBuf(bandwidth= - monovalentControlParas.dTHysBui, pre_y_start=true) + Modelica.Blocks.Logical.OnOffController BoilerOnOffBuf(bandwidth=dTHysBui, + pre_y_start=true) "Generates the on/off signal depending on the temperature inputs" annotation (Placement(transformation(extent={{-160,0},{-140,20}}))); - Modelica.Blocks.Logical.OnOffController boilerOnOffDHW(bandwidth= - monovalentControlParas.dTHysDHW, pre_y_start=true) if use_dhw + Modelica.Blocks.Logical.OnOffController boilerOnOffDHW(bandwidth=dTHysDHW, + pre_y_start=true) if use_dhw "Generates the on/off signal depending on the temperature inputs" annotation (Placement(transformation(extent={{-160,40},{-140,60}}))); Modelica.Blocks.Sources.Constant const_dT_loading(k=parDis.dTTra_nominal[1]) @@ -60,15 +62,6 @@ model GasBoiler "PI Control of gas boiler" origin={-90,90}))); Modelica.Blocks.Math.Add add_dT_LoadingDHW if use_dhw annotation (Placement(transformation(extent={{-60,80},{-40,60}}))); - replaceable parameter RecordsCollection.BivalentHeatPumpControlDataDefinition - monovalentControlParas constrainedby - RecordsCollection.BivalentHeatPumpControlDataDefinition( - TOda_nominal=parGen.TOda_nominal, - TSup_nominal=parGen.TSup_nominal[1], - TSetRoomConst=parTra.TDem_nominal[1], - final TBiv=monovalentControlParas.TOda_nominal) - annotation (choicesAllMatching=true, Placement(transformation(extent={{-218, - -36},{-204,-22}}))); Modelica.Blocks.Sources.BooleanConstant booleanConstant(k=false) if not use_dhw annotation (Placement(transformation( extent={{10,10},{-10,-10}}, @@ -92,9 +85,7 @@ model GasBoiler "PI Control of gas boiler" extent={{-10,-10},{10,10}}, rotation=0, origin={-30,-50}))); - replaceable RecordsCollection.PIDBaseDataDefinition parPID - "PID parameters for boiler" - annotation (Placement(transformation(extent={{142,84},{162,104}}))); + equation connect(sigBusDistr,TSet_DHW. sigBusDistr) annotation (Line( points={{1,-100},{10,-100},{10,-146},{-280,-146},{-280,89.9},{-220,89.9}}, @@ -125,8 +116,8 @@ equation 127})); connect(const_dT_loading.y, add_dT_LoadingBuf.u2) annotation (Line(points={{-99,-10}, {-88,-10},{-88,4},{-82,4}}, color={0,0,127})); - connect(BoiOn.y,HP_nSet_Controller.setOn) annotation (Line(points={{1,30},{4, - 30},{4,46},{98.4,46},{98.4,60}}, color={255,0,255})); + connect(BoiOn.y, PIDCtrl.setOn) annotation (Line(points={{1,30},{4,30},{4,46},{98.4, + 46},{98.4,60}}, color={255,0,255})); connect(boilerOnOffDHW.y, BoiOn.u1) annotation (Line(points={{-139,50},{-134,50}, {-134,46},{-30,46},{-30,36},{-28,36},{-28,30},{-22,30}}, color={255,0,255})); @@ -135,16 +126,15 @@ equation connect(boilerOnOffDHW.y, switch1.u2) annotation (Line(points={{-139,50},{-134, 50},{-134,46},{-28,46},{-28,66},{-8,66},{-8,70},{-2,70}}, color={255,0,255})); - connect(HP_nSet_Controller.TMea, sigBusGen.TBoiOut) annotation (Line(points={{ - 120,38.4},{116,38.4},{116,30},{28,30},{28,-26},{-152,-26},{-152,-99}}, - color={0,0,127}), Text( + connect(PIDCtrl.TMea, sigBusGen.TBoiOut) annotation (Line(points={{120,38.4},{116, + 38.4},{116,30},{28,30},{28,-26},{-152,-26},{-152,-99}}, color={0,0,127}), + Text( string="%second", index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(HP_nSet_Controller.ySet, sigBusGen.uBoiSet) annotation (Line(points={{ - 139.8,60},{146,60},{146,-30},{-152,-30},{-152,-99}}, color={0,0,127}), - Text( + connect(PIDCtrl.ySet, sigBusGen.uBoiSet) annotation (Line(points={{139.8,60},{146, + 60},{146,-30},{-152,-30},{-152,-99}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, @@ -159,8 +149,8 @@ equation {-72,90},{-72,76},{-62,76}}, color={0,0,127})); connect(TSet_DHW.TSetDHW, add_dT_LoadingDHW.u1) annotation (Line(points={{-199, 90},{-194,90},{-194,72},{-70,72},{-70,64},{-62,64}}, color={0,0,127})); - connect(switch1.y, HP_nSet_Controller.TSet) annotation (Line(points={{21,70},{ - 40,70},{40,74},{84,74},{84,70.8},{98.4,70.8}}, color={0,0,127})); + connect(switch1.y, PIDCtrl.TSet) annotation (Line(points={{21,70},{40,70},{40,74}, + {84,74},{84,70.8},{98.4,70.8}}, color={0,0,127})); connect(add_dT_LoadingBuf.y, switch1.u3) annotation (Line(points={{-59,10},{-44, 10},{-44,54},{-8,54},{-8,62},{-2,62}}, color={0,0,127})); @@ -170,13 +160,12 @@ equation connect(heatingCurve.TSet, add_dT_LoadingBuf.u1) annotation (Line(points={{-199,30}, {-88,30},{-88,16},{-82,16}}, color={0, 0,127})); - connect(BoiOn.y,HP_nSet_Controller.usOn) annotation (Line(points={{1,30},{4,30}, - {4,46},{90,46},{90,28},{109.2,28},{109.2,38.4}}, - color={255,0,255})); + connect(BoiOn.y, PIDCtrl.isOn) annotation (Line(points={{1,30},{4,30},{4,46},{90, + 46},{90,28},{109.2,28},{109.2,38.4}}, color={255,0,255})); connect(booleanConstant.y, BoiOn.u1) annotation (Line(points={{-19,-10},{-14,-10}, {-14,14},{-28,14},{-28,30},{-22,30}}, color={255,0,255})); - connect(realPassThrough.y, HP_nSet_Controller.TSet) annotation (Line(points={{ - 67,58},{84,58},{84,70.8},{98.4,70.8}}, color={0,0,127})); + connect(realPassThrough.y, PIDCtrl.TSet) annotation (Line(points={{67,58},{84,58}, + {84,70.8},{98.4,70.8}}, color={0,0,127})); connect(realPassThrough.u, add_dT_LoadingBuf.y) annotation (Line(points={{44, 58},{26,58},{26,52},{-26,52},{-26,54},{-44,54},{-44,10},{-59,10}}, diff --git a/BESMod/Systems/Hydraulical/Control/package.order b/BESMod/Systems/Hydraulical/Control/package.order index 1759ec1b..73684011 100644 --- a/BESMod/Systems/Hydraulical/Control/package.order +++ b/BESMod/Systems/Hydraulical/Control/package.order @@ -2,7 +2,6 @@ HybridHeatPumpSystem MonoenergeticHeatPumpSystem NoControl GasBoiler -BivalentPartParallel Components BaseClasses RecordsCollection diff --git a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferControlBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferControlBaseDataDefinition.mo index dc49fe15..6f240592 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferControlBaseDataDefinition.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/TransferControlBaseDataDefinition.mo @@ -2,5 +2,22 @@ within BESMod.Systems.Hydraulical.Transfer.RecordsCollection; record TransferControlBaseDataDefinition "Custom transfer control data record" extends BESMod.Systems.RecordsCollection.SubsystemControlBaseDataDefinition; + + parameter Modelica.Units.SI.HeatFlowRate QSup_flow_nominal[nParallelSup]=fill(sum( + Q_flow_nominal .* f_design), nParallelSup) + "Nominal heat flow rate at supply ports to transfer system" annotation (Dialog(group= + "Design - Bottom Up: Parameters are defined by the subsystem")); + parameter Modelica.Units.SI.Temperature TTra_nominal[nParallelDem] "Nominal supply temperature to transfer systems" + annotation(Dialog(group="Design - Top Down: Parameters are given by the parent system")); + parameter Modelica.Units.SI.MassFlowRate mSup_flow_nominal[nParallelSup]=fill(sum( + m_flow_nominal), nParallelSup) + "Nominal mass flow rate of the supply ports to the transfer system" annotation (Dialog( + group="Design - Bottom Up: Parameters are defined by the subsystem")); + + parameter Modelica.Units.SI.PressureDifference dpSup_nominal[nParallelSup] + "Nominal pressure loss of resistances in the supply system of the distribution" + annotation (Dialog(group= + "Design - Top Down: Parameters are given by the parent system")); + parameter Real nHeaTra "Exponent of heat transfer system"; end TransferControlBaseDataDefinition; From 1bb3e707845a1f7151fbf39f6a905065d77856d3 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 14 Aug 2023 13:50:42 +0200 Subject: [PATCH 083/131] fix tests --- .../BaseClasses/PartialHydraulicSystem.mo | 3 +- .../BaseClasses/PartialOnOffController.mo | 1 - .../Examples/ParallelBivalentControl.mo | 2 +- .../Components/BoilerInHybridSystem.mo | 1 - .../Components/BuildingAndDHWControl.mo | 6 +- .../BaseClasses/PartialControler.mo | 66 --- .../BaseClasses/PartialPID.mo | 51 --- .../BaseClasses/package.mo | 4 - .../BaseClasses/package.order | 2 - .../HeatPumpNSetController/LimPID.mo | 398 ------------------ .../HeatPumpNSetController/OnOff.mo | 28 -- .../Components/HeatPumpNSetController/P.mo | 20 - .../Components/HeatPumpNSetController/PI.mo | 25 -- .../Components/HeatPumpNSetController/PID.mo | 24 -- .../HeatPumpNSetController/package.order | 6 - .../OnOffController/AlternativeBivalent.mo | 54 --- .../BaseClasses/PartialOnOffController.mo | 48 --- .../OnOffController/BaseClasses/package.mo | 19 - .../OnOffController/BaseClasses/package.order | 1 - .../ConstantHysteresisTimeBasedHR.mo | 113 ----- .../OnOffController/DegreeMinuteController.mo | 61 --- .../Examples/OnOffControllerTest.mo | 58 --- .../Examples/ParallelBivalentControl.mo | 17 - .../Examples/PartialOnOffController.mo | 37 -- .../OnOffController/Examples/package.mo | 6 - .../OnOffController/Examples/package.order | 3 - .../OnOffController/FloatingHysteresis.mo | 96 ----- .../OnOffController/PartParallelBivalent.mo | 113 ----- .../Utilities/CountTimeBelowThreshold.mo | 15 - .../Utilities/StorageHysteresis.mo | 42 -- .../OnOffController/Utilities/TriggerTime.mo | 15 - .../OnOffController/Utilities/package.mo | 4 - .../OnOffController/Utilities/package.order | 3 - .../Components/OnOffController/package.order | 8 - .../HeatGeneration/GetHeatPumpCurveVCLib.mo | 3 - .../PartialGetHeatGenerationCurve.mo | 15 +- 36 files changed, 11 insertions(+), 1357 deletions(-) delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialControler.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialPID.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/package.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/package.order delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/LimPID.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/OnOff.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/P.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PI.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PID.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/package.order delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/AlternativeBivalent.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/PartialOnOffController.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/package.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/package.order delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/ConstantHysteresisTimeBasedHR.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/DegreeMinuteController.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/OnOffControllerTest.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/ParallelBivalentControl.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/PartialOnOffController.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/package.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/package.order delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/FloatingHysteresis.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/PartParallelBivalent.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/CountTimeBelowThreshold.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/StorageHysteresis.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/TriggerTime.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/package.mo delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/package.order delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/OnOffController/package.order diff --git a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo index 1d58ad9b..bd71532d 100644 --- a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo +++ b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo @@ -142,7 +142,8 @@ partial model PartialHydraulicSystem Placement(transformation(extent={{-12,-104},{90,28}}))); replaceable BESMod.Systems.Hydraulical.Transfer.BaseClasses.PartialTransfer - transfer(dp_nominal=fill(0, transfer.nParallelDem)) constrainedby + transfer(dp_nominal=fill(0, transfer.nParallelDem), nHeaTra=1) + constrainedby Transfer.BaseClasses.PartialTransfer( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/PartialOnOffController.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/PartialOnOffController.mo index 9f45d185..cfd9fcb8 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/PartialOnOffController.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/BaseClasses/PartialOnOffController.mo @@ -4,7 +4,6 @@ partial model PartialOnOffController "Partial model for an on off controller" parameter Modelica.Units.SI.TemperatureDifference dTHys "Hysteresis for control"; - Modelica.Blocks.Interfaces.RealInput TStoTop "Top layer temperature of the storage in distribution system" annotation ( Placement(transformation(extent={{-140,40},{-100,80}}), iconTransformation( diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/ParallelBivalentControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/ParallelBivalentControl.mo index 84a3617e..34b8d922 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/ParallelBivalentControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/ParallelBivalentControl.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.Examples; model ParallelBivalentControl - extends PartialOnOffController(dTHys=onOffController.Hysteresis, redeclare + extends PartialOnOffController(dTHys=onOffController.dTHys, redeclare BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.PartParallelBivalent onOffController( dTHys=10, diff --git a/BESMod/Systems/Hydraulical/Control/Components/BoilerInHybridSystem.mo b/BESMod/Systems/Hydraulical/Control/Components/BoilerInHybridSystem.mo index f2287626..43bdcac4 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BoilerInHybridSystem.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BoilerInHybridSystem.mo @@ -4,7 +4,6 @@ model BoilerInHybridSystem "Decides when to use the boiler" parameter Modelica.Units.SI.Temperature TBiv "Bivalence temperature"; parameter Modelica.Units.SI.Temperature TCutOff "Cutoff temperature"; - Modelica.Blocks.Logical.LessThreshold lesTBiv(threshold=TBiv) "Checks, if Toda is below Tbiv" annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo index d484f377..6dca3f64 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo @@ -22,11 +22,13 @@ model BuildingAndDHWControl replaceable model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod + (dTHys=10) constrainedby BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController "Hysteresis for DHW system" annotation (choicesAllMatching=true); replaceable model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod + (dTHys=10) constrainedby BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController "Hysteresis for building" annotation (choicesAllMatching=true); @@ -37,10 +39,10 @@ model BuildingAndDHWControl "DHW set temperture module" annotation (choicesAllMatching=true); - DHWHysteresis hysDHW(dTHys=10) + DHWHysteresis hysDHW "Hysteresis for DHW system" annotation (Placement( transformation(extent={{62,62},{78,78}}))); - BuildingHysteresis hysBui(dTHys=10) + BuildingHysteresis hysBui "Hysteresis for building" annotation (Placement( transformation(extent={{42,-78},{58,-62}}))); DHWSetTemperature TSetDHW "DHW set temperature module" annotation ( diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialControler.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialControler.mo deleted file mode 100644 index af7bd1d9..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialControler.mo +++ /dev/null @@ -1,66 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.BaseClasses; -partial model PartialControler "Partial controller model" - Modelica.Blocks.Interfaces.BooleanInput setOn - "True if the device is set to turn on" -annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - Modelica.Blocks.Interfaces.RealOutput ySet "Relative set value" - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - Modelica.Blocks.Interfaces.RealInput TSet(unit="K", displayUnit="degC") - "Current set temperature" - annotation (Placement(transformation(extent={{-140,40},{-100,80}}))); - Modelica.Blocks.Interfaces.RealInput TMea(displayUnit="degC", unit="K") - "Current measured temperature" annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=90, - origin={0,-120}))); - Modelica.Blocks.Math.Feedback feedback -annotation (Placement(transformation(extent={{4,90},{24,110}}))); - Modelica.Blocks.Continuous.Integrator intAbs "Integrator of absolute error" - annotation (Placement(transformation(extent={{70,104},{90,124}}))); - Modelica.Blocks.Interfaces.RealOutput IAE "Integral Absolute Error" -annotation (Placement(transformation(extent={{100,90},{120,110}}), - iconTransformation(extent={{100,80},{120,100}}))); - Modelica.Blocks.Interfaces.RealOutput ISE "Integral Square Error" annotation ( - Placement(transformation(extent={{100,40},{120,60}}), iconTransformation( - extent={{100,40},{120,60}}))); - Modelica.Blocks.Math.Abs abs1 -annotation (Placement(transformation(extent={{36,104},{56,124}}))); - Modelica.Blocks.Continuous.Integrator intSqu "Integrator of squared error" - annotation (Placement(transformation(extent={{70,70},{90,90}}))); - Modelica.Blocks.Math.Product pro "Square the difference" - annotation (Placement(transformation(extent={{38,70},{58,90}}))); - Modelica.Blocks.Interfaces.BooleanInput usOn(start=true) - "True if the device is actually on" - annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=90, - origin={-60,-120}))); -equation - connect(TSet, feedback.u1) annotation (Line(points={{-120,60},{-100,60},{-100, - 100},{6,100}}, color={0,0,127})); - connect(TMea, feedback.u2) annotation (Line(points={{0,-120},{0,-84},{-88,-84}, - {-88,88},{14,88},{14,92}}, color={0,0,127})); - connect( - feedback.y, abs1.u) annotation (Line(points={{23,100},{24,100},{24,114},{34, - 114}}, color={0,0,127})); - connect(abs1.y, intAbs.u) - annotation (Line(points={{57,114},{68,114}}, color={0,0,127})); - connect(intAbs.y, IAE) annotation (Line(points={{91,114},{96,114},{96,98},{110, - 98},{110,100}}, color={0,0,127})); - connect(ISE, intSqu.y) annotation (Line(points={{110,50},{100,50},{100,80},{91, - 80}}, color={0,0,127})); - connect(feedback.y, pro.u1) annotation (Line(points={{23,100},{30,100},{30,86}, - {36,86}}, color={0,0,127})); - connect(intSqu.u, pro.y) - annotation (Line(points={{68,80},{59,80}}, color={0,0,127})); - connect(feedback.y, pro.u2) annotation (Line(points={{23,100},{30,100},{30,74}, - {36,74}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.Solid, - lineThickness=0.5)}), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false))); -end PartialControler; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialPID.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialPID.mo deleted file mode 100644 index 35f18673..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/PartialPID.mo +++ /dev/null @@ -1,51 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.BaseClasses; -model PartialPID "Partial PID controller for inverter controlled devices" - extends PartialControler( setOn(start=true)); - parameter Real P "Gain of PID-controller"; - parameter Real yMax=1 "Upper limit of output"; - parameter Real yOff=0 "Constant output value if device is turned off"; - parameter Real y_start=0 "Initial value of output"; - parameter Real yMin "Lower limit of relative speed"; - BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController.LimPID - PID( - final k=P, - final yMax=yMax, - final yMin=yMin, - final wp=1, - final wd=0, - final initType=Modelica.Blocks.Types.Init.InitialState, - homotopyType=Modelica.Blocks.Types.LimiterHomotopy.NoHomotopy, - final strict=false, - final xi_start=0, - final xd_start=0, - final y_start=y_start, - final limitsAtInit=true) - annotation (Placement(transformation(extent={{-30,22},{6,58}}))); - - Modelica.Blocks.Logical.Switch onOffSwi "Switch on off" - annotation (Placement(transformation(extent={{38,-14},{68,16}}))); - Modelica.Blocks.Sources.Constant const(final k=yOff) "HP turned off" - annotation (Placement(transformation(extent={{-6,-36},{10,-20}}))); - Modelica.Blocks.Logical.And and1 - annotation (Placement(transformation(extent={{-52,-64},{-32,-44}}))); - -equation - connect(setOn, onOffSwi.u2) - annotation (Line(points={{-120,0},{34,0},{34,1},{35,1}}, color={255,0,255})); - connect(onOffSwi.y, ySet) - annotation (Line(points={{69.5,1},{74,1},{74,0},{110,0}}, color={0,0,127})); - connect(const.y, onOffSwi.u3) - annotation (Line(points={{10.8,-28},{35,-28},{35,-11}}, color={0,0,127})); - connect(PID.y, onOffSwi.u1) annotation (Line(points={{7.8,40},{14,40},{14,13},{35, - 13}}, color={0,0,127})); - connect(TSet, PID.u_s) annotation (Line(points={{-120,60},{-70,60},{-70,40},{-33.6, - 40}}, color={0,0,127})); - connect(TMea, PID.u_m) annotation (Line(points={{0,-120},{0,-54},{-12,-54},{-12, - 18.4}}, color={0,0,127})); - connect(and1.y, PID.IsOn) annotation (Line(points={{-31,-54},{-22.8,-54},{ - -22.8,18.4}}, color={255,0,255})); - connect(setOn, and1.u1) annotation (Line(points={{-120,0},{-72,0},{-72,-54},{ - -54,-54}}, color={255,0,255})); - connect(usOn, and1.u2) annotation (Line(points={{-60,-120},{-60,-62},{-54,-62}}, - color={255,0,255})); -end PartialPID; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/package.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/package.mo deleted file mode 100644 index 4443b3fc..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/package.mo +++ /dev/null @@ -1,4 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController; -package BaseClasses - -end BaseClasses; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/package.order deleted file mode 100644 index e0fdce0e..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/BaseClasses/package.order +++ /dev/null @@ -1,2 +0,0 @@ -PartialControler -PartialPID diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/LimPID.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/LimPID.mo deleted file mode 100644 index 20521f3a..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/LimPID.mo +++ /dev/null @@ -1,398 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController; -block LimPID - "P, PI, PD, and PID controller with limited output, anti-windup compensation, setpoint weighting and optional feed-forward" - import InitPID = - Modelica.Blocks.Types.Init; - import Modelica.Blocks.Types.Init; - import Modelica.Blocks.Types.SimpleController; - extends Modelica.Blocks.Interfaces.SVcontrol; - output Real controlError = u_s - u_m - "Control error (set point - measurement)"; - parameter .Modelica.Blocks.Types.SimpleController controllerType= - .Modelica.Blocks.Types.SimpleController.PID "Type of controller"; - parameter Real k(min=0, unit="1") = 1 "Gain of controller"; - parameter Modelica.Units.SI.Time Ti(min=Modelica.Constants.small) = 0.5 - "Time constant of Integrator block" annotation (Dialog(enable= - controllerType == .Modelica.Blocks.Types.SimpleController.PI or - controllerType == .Modelica.Blocks.Types.SimpleController.PID)); - parameter Modelica.Units.SI.Time Td(min=0) = 0.1 - "Time constant of Derivative block" annotation (Dialog(enable= - controllerType == .Modelica.Blocks.Types.SimpleController.PD or - controllerType == .Modelica.Blocks.Types.SimpleController.PID)); - parameter Real yMax(start=1) "Upper limit of output"; - parameter Real yMin=-yMax "Lower limit of output"; - parameter Real wp(min=0) = 1 - "Set-point weight for Proportional block (0..1)"; - parameter Real wd(min=0) = 0 "Set-point weight for Derivative block (0..1)" - annotation(Dialog(enable=controllerType==.Modelica.Blocks.Types.SimpleController.PD or - controllerType==.Modelica.Blocks.Types.SimpleController.PID)); - parameter Real Ni(min=100*Modelica.Constants.eps) = 0.9 - "Ni*Ti is time constant of anti-windup compensation" - annotation(Dialog(enable=controllerType==.Modelica.Blocks.Types.SimpleController.PI or - controllerType==.Modelica.Blocks.Types.SimpleController.PID)); - parameter Real Nd(min=100*Modelica.Constants.eps) = 10 - "The higher Nd, the more ideal the derivative block" - annotation(Dialog(enable=controllerType==.Modelica.Blocks.Types.SimpleController.PD or - controllerType==.Modelica.Blocks.Types.SimpleController.PID)); - parameter Boolean withFeedForward=false "Use feed-forward input?" - annotation(Evaluate=true, choices(checkBox=true)); - parameter Real kFF=1 "Gain of feed-forward input" - annotation(Dialog(enable=withFeedForward)); - parameter .Modelica.Blocks.Types.Init initType=.Modelica.Blocks.Types.Init.InitialState - "Type of initialization (1: no init, 2: steady state, 3: initial state, 4: initial output)" - annotation (Evaluate=true, Dialog(group="Initialization")); - parameter Real xi_start=0 - "Initial or guess value for integrator output (= integrator state)" - annotation (Dialog(group="Initialization", - enable=controllerType==.Modelica.Blocks.Types.SimpleController.PI or - controllerType==.Modelica.Blocks.Types.SimpleController.PID)); - parameter Real xd_start=0 - "Initial or guess value for state of derivative block" - annotation (Dialog(group="Initialization", - enable=controllerType==.Modelica.Blocks.Types.SimpleController.PD or - controllerType==.Modelica.Blocks.Types.SimpleController.PID)); - parameter Real y_start=0 "Initial value of output" - annotation(Dialog(enable=initType == .Modelica.Blocks.Types.Init.InitialOutput, group= - "Initialization")); - parameter Modelica.Blocks.Types.LimiterHomotopy homotopyType = Modelica.Blocks.Types.LimiterHomotopy.Linear - "Simplified model for homotopy-based initialization" - annotation (Evaluate=true, Dialog(group="Initialization")); - parameter Boolean strict=false "= true, if strict limits with noEvent(..)" - annotation (Evaluate=true, choices(checkBox=true), Dialog(tab="Advanced")); - parameter Boolean limitsAtInit=true - "Has no longer an effect and is only kept for backwards compatibility (the implementation uses now the homotopy operator)" - annotation (Dialog(tab="Dummy"),Evaluate=true, choices(checkBox=true)); - constant Modelica.Units.SI.Time unitTime=1 annotation (HideResult=true); - Modelica.Blocks.Interfaces.RealInput u_ff if withFeedForward - "Optional connector of feed-forward input signal" - annotation (Placement( - transformation( - origin={60,-120}, - extent={{20,-20},{-20,20}}, - rotation=270))); - Modelica.Blocks.Math.Add addP(k1=wp, k2=-1) - annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); - Modelica.Blocks.Math.Add addD(k1=wd, k2=-1) if with_D - annotation (Placement(transformation(extent={{-80,-10},{-60,10}}))); - Modelica.Blocks.Math.Gain P(k=1) - annotation (Placement(transformation(extent={{-50,40},{-30,60}}))); - Modelica.Blocks.Continuous.Integrator I( - k=unitTime/Ti, - use_reset=true, - y_start=xi_start, - initType=if initType == InitPID.SteadyState then Init.SteadyState else if - initType == InitPID.InitialState or initType == InitPID.InitialState - then Init.InitialState else Init.NoInit) if with_I - annotation (Placement(transformation(extent={{-50,-60},{-30,-40}}))); - Modelica.Blocks.Continuous.Derivative D( - k=Td/unitTime, - T=max([Td/Nd,1.e-14]), - x_start=xd_start, - initType=if initType ==InitPID.SteadyState or initType ==InitPID.InitialOutput - then Init.SteadyState else if initType ==InitPID.InitialState then - Init.InitialState else Init.NoInit) if with_D - annotation (Placement(transformation(extent={{-50,-10},{-30,10}}))); - Modelica.Blocks.Math.Gain gainPID(k=k) - annotation (Placement(transformation(extent={{20,-10},{40,10}}))); - Modelica.Blocks.Math.Add3 addPID - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - Modelica.Blocks.Math.Add3 addI(k2=-1) if with_I - annotation (Placement(transformation(extent={{-80,-60},{-60,-40}}))); - Modelica.Blocks.Math.Add addSat(k1=+1, k2=-1) if with_I annotation (Placement( - transformation( - origin={80,-50}, - extent={{-10,-10},{10,10}}, - rotation=270))); - Modelica.Blocks.Math.Gain gainTrack(k=1/(k*Ni)) if with_I - annotation (Placement(transformation(extent={{0,-80},{-20,-60}}))); - Modelica.Blocks.Nonlinear.Limiter limiter( - uMax=yMax, - uMin=yMin, - strict=strict, - homotopyType=homotopyType) - annotation (Placement(transformation(extent={{70,-10},{90,10}}))); -protected - parameter Boolean with_I = controllerType==SimpleController.PI or - controllerType==SimpleController.PID annotation(Evaluate=true, HideResult=true); - parameter Boolean with_D = controllerType==SimpleController.PD or - controllerType==SimpleController.PID annotation(Evaluate=true, HideResult=true); -public - Modelica.Blocks.Sources.Constant Dzero(k=0) if not with_D - annotation (Placement(transformation(extent={{-40,20},{-30,30}}))); - Modelica.Blocks.Sources.Constant Izero(k=0) if not with_I - annotation (Placement(transformation(extent={{0,-55},{-10,-45}}))); - Modelica.Blocks.Sources.Constant FFzero(k=0) if not withFeedForward - annotation (Placement(transformation(extent={{30,-35},{40,-25}}))); - Modelica.Blocks.Math.Add addFF(k1=1, k2=kFF) - annotation (Placement(transformation(extent={{48,-6},{60,6}}))); - Modelica.Blocks.Interfaces.BooleanInput IsOn(start=true) - "True if heat pump is actually on" annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=90, - origin={-60,-120}))); -initial equation - if initType==InitPID.InitialOutput then - gainPID.y = y_start; - end if; -equation - if initType ==InitPID.InitialOutput and (y_start < yMin or y_start > yMax) then - Modelica.Utilities.Streams.error("LimPID: Start value y_start (=" + String(y_start) + - ") is outside of the limits of yMin (=" + String(yMin) +") and yMax (=" + String(yMax) + ")"); - end if; - - connect(u_s, addP.u1) annotation (Line(points={{-120,0},{-96,0},{-96,56},{ - -82,56}}, color={0,0,127})); - connect(u_s, addD.u1) annotation (Line(points={{-120,0},{-96,0},{-96,6},{ - -82,6}}, color={0,0,127})); - connect(u_s, addI.u1) annotation (Line(points={{-120,0},{-96,0},{-96,-42},{ - -82,-42}}, color={0,0,127})); - connect(addP.y, P.u) annotation (Line(points={{-59,50},{-52,50}}, color={0, - 0,127})); - connect(addD.y, D.u) - annotation (Line(points={{-59,0},{-52,0}}, color={0,0,127})); - connect(addI.y, I.u) annotation (Line(points={{-59,-50},{-52,-50}}, color={ - 0,0,127})); - connect(P.y, addPID.u1) annotation (Line(points={{-29,50},{-20,50},{-20,8},{-12, - 8}}, color={0,0,127})); - connect(D.y, addPID.u2) - annotation (Line(points={{-29,0},{-12,0}},color={0,0,127})); - connect(I.y, addPID.u3) annotation (Line(points={{-29,-50},{-20,-50},{-20,-8}, - {-12,-8}}, color={0,0,127})); - connect(limiter.y, addSat.u1) annotation (Line(points={{91,0},{94,0},{94, - -20},{86,-20},{86,-38}}, color={0,0,127})); - connect(limiter.y, y) - annotation (Line(points={{91,0},{110,0}}, color={0,0,127})); - connect(addSat.y, gainTrack.u) annotation (Line(points={{80,-61},{80,-70},{2,-70}}, - color={0,0,127})); - connect(gainTrack.y, addI.u3) annotation (Line(points={{-21,-70},{-88,-70},{-88, - -58},{-82,-58}}, color={0,0,127})); - connect(u_m, addP.u2) annotation (Line( - points={{0,-120},{0,-92},{-92,-92},{-92,44},{-82,44}}, - color={0,0,127}, - thickness=0.5)); - connect(u_m, addD.u2) annotation (Line( - points={{0,-120},{0,-92},{-92,-92},{-92,-6},{-82,-6}}, - color={0,0,127}, - thickness=0.5)); - connect(u_m, addI.u2) annotation (Line( - points={{0,-120},{0,-92},{-92,-92},{-92,-50},{-82,-50}}, - color={0,0,127}, - thickness=0.5)); - connect(Dzero.y, addPID.u2) annotation (Line(points={{-29.5,25},{-24,25},{-24, - 0},{-12,0}}, color={0,0,127})); - connect(Izero.y, addPID.u3) annotation (Line(points={{-10.5,-50},{-20,-50},{-20, - -8},{-12,-8}}, color={0,0,127})); - connect(addPID.y, gainPID.u) - annotation (Line(points={{11,0},{18,0}}, color={0,0,127})); - connect(addFF.y, limiter.u) - annotation (Line(points={{60.6,0},{68,0}}, color={0,0,127})); - connect(gainPID.y, addFF.u1) annotation (Line(points={{41,0},{44,0},{44,3.6}, - {46.8,3.6}},color={0,0,127})); - connect(FFzero.y, addFF.u2) annotation (Line(points={{40.5,-30},{44,-30},{44, - -3.6},{46.8,-3.6}}, - color={0,0,127})); - connect(addFF.u2, u_ff) annotation (Line(points={{46.8,-3.6},{44,-3.6},{44, - -92},{60,-92},{60,-120}}, - color={0,0,127})); - connect(addFF.y, addSat.u2) annotation (Line(points={{60.6,0},{64,0},{64,-20}, - {74,-20},{74,-38}}, color={0,0,127})); - connect(IsOn, I.reset) annotation (Line(points={{-60,-120},{-60,-80},{-34,-80}, - {-34,-62}}, color={255,0,255})); - annotation (defaultComponentName="PID", - Icon(coordinateSystem( - preserveAspectRatio=true, - extent={{-100,-100},{100,100}}), graphics={ - Line(points={{-80,78},{-80,-90}}, color={192,192,192}), - Polygon( - points={{-80,90},{-88,68},{-72,68},{-80,90}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid), - Line(points={{-90,-80},{82,-80}}, color={192,192,192}), - Polygon( - points={{90,-80},{68,-72},{68,-88},{90,-80}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid), - Line(points={{-80,-80},{-80,-20},{30,60},{80,60}}, color={0,0,127}), - Text( - extent={{-20,-20},{80,-60}}, - lineColor={192,192,192}, - textString="%controllerType"), - Line( - visible=strict, - points={{30,60},{81,60}}, - color={255,0,0})}), - Diagram(graphics={Text( - extent={{79,-112},{129,-102}}, - lineColor={0,0,255}, - textString=" (feed-forward)")}), - Documentation(info=" -

-Via parameter controllerType either P, PI, PD, -or PID can be selected. If, e.g., PI is selected, all components belonging to the -D-part are removed from the block (via conditional declarations). -The example model -Modelica.Blocks.Examples.PID_Controller -demonstrates the usage of this controller. -Several practical aspects of PID controller design are incorporated -according to chapter 3 of the book: -

- -
-
Åström K.J., and Hägglund T.:
-
PID Controllers: Theory, Design, and Tuning. - Instrument Society of America, 2nd edition, 1995. -
-
- -

-Besides the additive proportional, integral and derivative -part of this controller, the following features are present: -

-
    -
  • The output of this controller is limited. If the controller is - in its limits, anti-windup compensation is activated to drive - the integrator state to zero.
  • -
  • The high-frequency gain of the derivative part is limited - to avoid excessive amplification of measurement noise.
  • -
  • Setpoint weighting is present, which allows to weight - the setpoint in the proportional and the derivative part - independently from the measurement. The controller will respond - to load disturbances and measurement noise independently of this setting - (parameters wp, wd). However, setpoint changes will depend on this - setting. For example, it is useful to set the setpoint weight wd - for the derivative part to zero, if steps may occur in the - setpoint signal.
  • -
  • Optional feed-forward. It is possible to add a feed-forward signal. - The feed-forward signal is added before limitation.
  • -
- -

-The parameters of the controller can be manually adjusted by performing -simulations of the closed loop system (= controller + plant connected -together) and using the following strategy: -

- -
    -
  1. Set very large limits, e.g., yMax = Modelica.Constants.inf
  2. -
  3. Select a P-controller and manually enlarge parameter k - (the total gain of the controller) until the closed-loop response - cannot be improved any more.
  4. -
  5. Select a PI-controller and manually adjust parameters - k and Ti (the time constant of the integrator). - The first value of Ti can be selected, such that it is in the - order of the time constant of the oscillations occurring with - the P-controller. If, e.g., vibrations in the order of T=10 ms - occur in the previous step, start with Ti=0.01 s.
  6. -
  7. If you want to make the reaction of the control loop faster - (but probably less robust against disturbances and measurement noise) - select a PID-Controller and manually adjust parameters - k, Ti, Td (time constant of derivative block).
  8. -
  9. Set the limits yMax and yMin according to your specification.
  10. -
  11. Perform simulations such that the output of the PID controller - goes in its limits. Tune Ni (Ni*Ti is the time constant of - the anti-windup compensation) such that the input to the limiter - block (= limiter.u) goes quickly enough back to its limits. - If Ni is decreased, this happens faster. If Ni=infinity, the - anti-windup compensation is switched off and the controller works bad.
  12. -
- -

-Initialization -

- -

-This block can be initialized in different -ways controlled by parameter initType. The possible -values of initType are defined in -Modelica.Blocks.Types.InitPID. -This type is identical to -Types.Init, -with the only exception that the additional option -DoNotUse_InitialIntegratorState is added for -backward compatibility reasons (= integrator is initialized with -InitialState whereas differential part is initialized with -NoInit which was the initialization in version 2.2 of the Modelica -standard library). -

- -

-Based on the setting of initType, the integrator (I) and derivative (D) -blocks inside the PID controller are initialized according to the following table: -

- - - - - - - - - - - - - - - - - - - - - - - - - -
initTypeI.initTypeD.initType
NoInitNoInitNoInit
SteadyStateSteadyStateSteadyState
InitialStateInitialStateInitialState
InitialOutput
- and initial equation: y = y_start
NoInitSteadyState
DoNotUse_InitialIntegratorStateInitialStateNoInit
- -

-In many cases, the most useful initial condition is -SteadyState because initial transients are then no longer -present. If initType = InitPID.SteadyState, then in some -cases difficulties might occur. The reason is the -equation of the integrator: -

- -
-   der(y) = k*u;
-
- -

-The steady state equation \"der(x)=0\" leads to the condition that the input u to the -integrator is zero. If the input u is already (directly or indirectly) defined -by another initial condition, then the initialization problem is singular -(has none or infinitely many solutions). This situation occurs often -for mechanical systems, where, e.g., u = desiredSpeed - measuredSpeed and -since speed is both a state and a derivative, it is natural to -initialize it with zero. As sketched this is, however, not possible. -The solution is to not initialize u_m or the variable that is used -to compute u_m by an algebraic equation. -

- -

-When initializing in steady-state, homotopy-based initialization can help the convergence of the solver, -by using a simplified model a the beginning of the solution process. Different options are available. -

- -
    -
  • homotopyType=Linear (default): the limitations are removed from the simplified model, -making it linear. Use this if you know that the controller will not be saturated at steady state.
  • -
  • homotopyType=UpperLimit: if it is known a priori the controller will be stuck at the upper -limit yMax, this option assumes y = yMax as a simplified model.
  • -
  • homotopyType=LowerLimit: if it is known a priori the controller will be stuck at the lower -limit yMin, this option assumes y = yMin as a simplified model.
  • -
  • homotopyType=NoHomotopy: this option does not apply any simplification and keeps the -limiter active throughout the homotopy transformation. Use this if it is unknown whether the controller -is saturated or not at initialization and if the limitations on the output must be enforced throughout -the entire homotopy transformation.
  • -
- -

-The parameter limitAtInit is obsolete since MSL 3.2.2 and only kept for backwards compatibility. -

-")); -end LimPID; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/OnOff.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/OnOff.mo deleted file mode 100644 index 7f164bc7..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/OnOff.mo +++ /dev/null @@ -1,28 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController; -model OnOff "On off controller" - extends BaseClasses.PartialHPNSetController; - - Modelica.Blocks.Math.BooleanToReal booToRea(final realTrue=yMax, final - realFalse=0) "Convert boolean signal to real" annotation (Placement( - transformation(extent={{12,-12},{-12,12}}, rotation=180))); -equation - connect(setOn, booToRea.u) annotation (Line(points={{-120,0},{-67.1,0},{-67.1, - 2.10942e-15},{-14.4,2.10942e-15}}, color={255,0,255})); - connect(booToRea.y, ySet) annotation (Line(points={{13.2,-1.33227e-15},{60.55, - -1.33227e-15},{60.55,0},{110,0}}, color={0,0,127})); - annotation (Icon(graphics={ - Line(points={{-100.0,0.0},{-45.0,0.0}}, - color={0,0,127}), - Ellipse(lineColor={0,0,127}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - extent={{-45.0,-10.0},{-25.0,10.0}}), - Line(points={{-35.0,0.0},{30.0,35.0}}, - color={0,0,127}), - Line(points={{45.0,0.0},{100.0,0.0}}, - color={0,0,127}), - Ellipse(lineColor={0,0,127}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid, - extent={{25.0,-10.0},{45.0,10.0}})})); -end OnOff; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/P.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/P.mo deleted file mode 100644 index c40542e2..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/P.mo +++ /dev/null @@ -1,20 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController; -model P "P-Controller for inverter controlled devices" - extends BaseClasses.PartialInverterHeatPumpController(PID(controllerType= - Modelica.Blocks.Types.SimpleController.P)); - - annotation (Icon(graphics={ - Polygon( - points={{-80,90},{-88,68},{-72,68},{-80,90}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid), - Line(points={{-80,78},{-80,-90}}, color={192,192,192}), - Polygon( - points={{90,-80},{68,-72},{68,-88},{90,-80}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid), - Line(points={{-90,-80},{82,-80}}, color={192,192,192}), - Line(points={{-80,-80},{-80,-20},{-80,2},{76,2}}, color={0,0,127})})); -end P; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PI.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PI.mo deleted file mode 100644 index 262d3b4e..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PI.mo +++ /dev/null @@ -1,25 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController; -model PI "PI-Controller for inverter controlled devices" - extends HeatPumpNSetController.BaseClasses.PartialInverterHeatPumpController( - PID( - controllerType=Modelica.Blocks.Types.SimpleController.PI, - final Ti=timeInt, - final Ni=Ni)); - parameter Modelica.Units.SI.Time timeInt "Time constant of Integrator block"; - parameter Real Ni=0.9 "Ni*Ti is time constant of anti-windup compensation"; - annotation (Icon(graphics={ - Polygon( - points={{-80,90},{-88,68},{-72,68},{-80,90}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid), - Line(points={{-80,78},{-80,-90}}, color={192,192,192}), - Polygon( - points={{90,-80},{68,-72},{68,-88},{90,-80}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid), - Line(points={{-90,-80},{82,-80}}, color={192,192,192}), - Line(points={{-80,-80},{-80,-20},{-80,-20},{52,80}}, - color={0,0,127})})); -end PI; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PID.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PID.mo deleted file mode 100644 index 528a30eb..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/PID.mo +++ /dev/null @@ -1,24 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.HeatPumpNSetController; -model PID "PID-Controller for inverter controlled devices" - extends HeatPumpNSetController.PI(PID( - controllerType=Modelica.Blocks.Types.SimpleController.PID, - final Td=timeDer, - final Nd=Nd)); - parameter Modelica.Units.SI.Time timeDer "Time constant of Derivative block"; - parameter Real Nd=10 "The higher Nd, the more ideal the derivative block"; - annotation (Icon(graphics={ - Line(points={{-78,-80},{-78,52},{-78,-18},{-78,-80}}, - color={0,0,127}), - Polygon( - points={{-80,90},{-88,68},{-72,68},{-80,90}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid), - Line(points={{-80,78},{-80,-90}}, color={192,192,192}), - Polygon( - points={{90,-80},{68,-72},{68,-88},{90,-80}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid), - Line(points={{-90,-80},{82,-80}}, color={192,192,192})})); -end PID; diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/package.order b/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/package.order deleted file mode 100644 index 141c9121..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpNSetController/package.order +++ /dev/null @@ -1,6 +0,0 @@ -BaseClasses -OnOff -P -PI -PID -LimPID diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/AlternativeBivalent.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/AlternativeBivalent.mo deleted file mode 100644 index b360283d..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/AlternativeBivalent.mo +++ /dev/null @@ -1,54 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController; -model AlternativeBivalent - "Alternative bivalent control" - extends BaseClasses.PartialOnOffController; - Utilities.StorageHysteresis storageHysteresis(final bandwidth=hysteresis, - final pre_y_start=true) - annotation (Placement(transformation(extent={{-40,22},{0,62}}))); - Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualT_biv(threshold= - T_biv) annotation (Placement(transformation(extent={{20,80},{40,100}}))); - parameter Modelica.Units.SI.Temperature T_biv=271.15 "Bivalent temperature"; - Modelica.Blocks.Logical.And greaterEqualT_biv1 - annotation (Placement(transformation(extent={{60,60},{80,80}}))); - Modelica.Blocks.Logical.And greaterEqualT_biv2 - annotation (Placement(transformation(extent={{60,-60},{80,-40}}))); - Modelica.Blocks.Logical.Not greaterEqualT_biv3 annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={50,-10}))); - parameter Real hysteresis=10 "Bandwidth around reference signal"; - Modelica.Blocks.Math.BooleanToReal - or3(final realTrue=1, final realFalse=0) - annotation (Placement(transformation( - extent={{-6,-6},{6,6}}, - rotation=0, - origin={82,-80}))); -equation - connect(TSupSet, storageHysteresis.T_set) annotation (Line(points={{0,-118},{-56, - -118},{-56,58},{-44,58}}, color={0,0,127})); - connect(TStoTop, storageHysteresis.T_top) annotation (Line(points={{-120,60},{-74, - 60},{-74,42},{-44,42}}, color={0,0,127})); - connect(TStoBot, storageHysteresis.T_bot) annotation (Line(points={{-120,-60},{-50, - -60},{-50,26},{-44,26}}, color={0,0,127})); - connect(TOda, greaterEqualT_biv.u) - annotation (Line(points={{0,120},{0,90},{18,90}}, color={0,0,127})); - connect(priGenOn, greaterEqualT_biv1.y) annotation (Line(points={{110,60},{96,60}, - {96,70},{81,70}}, color={255,0,255})); - connect(greaterEqualT_biv.y, greaterEqualT_biv1.u1) annotation (Line(points={ - {41,90},{52,90},{52,70},{58,70}}, color={255,0,255})); - connect(storageHysteresis.y, greaterEqualT_biv1.u2) annotation (Line(points={ - {2,42},{26.85,42},{26.85,62},{58,62}}, color={255,0,255})); - connect(secGenOn, greaterEqualT_biv2.y) annotation (Line(points={{110,-60},{96,-60}, - {96,-50},{81,-50}}, color={255,0,255})); - connect(greaterEqualT_biv.y, greaterEqualT_biv3.u) - annotation (Line(points={{41,90},{50,90},{50,2}}, color={255,0,255})); - connect(greaterEqualT_biv3.y, greaterEqualT_biv2.u1) - annotation (Line(points={{50,-21},{50,-50},{58,-50}}, color={255,0,255})); - connect(storageHysteresis.y, greaterEqualT_biv2.u2) annotation (Line(points={ - {2,42},{28,42},{28,-58},{58,-58}}, color={255,0,255})); - connect(ySecGenSet, or3.y) - annotation (Line(points={{110,-80},{88.6,-80}}, color={0,0,127})); - connect(greaterEqualT_biv2.y, or3.u) annotation (Line(points={{81,-50},{82, - -50},{82,-70},{74.8,-70},{74.8,-80}}, color={255,0,255})); -end AlternativeBivalent; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/PartialOnOffController.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/PartialOnOffController.mo deleted file mode 100644 index 064e266b..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/PartialOnOffController.mo +++ /dev/null @@ -1,48 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses; -partial model PartialOnOffController "Partial model for an on off controller" - Modelica.Blocks.Interfaces.RealInput TStoTop - "Top layer temperature of the storage in distribution system" annotation ( - Placement(transformation(extent={{-140,40},{-100,80}}), iconTransformation( - extent={{-120,60},{-100,80}}))); - Modelica.Blocks.Interfaces.BooleanOutput priGenOn(start=true) - "Turn the main the device on or off" annotation (Placement(transformation( - extent={{100,50},{120,70}}), iconTransformation(extent={{100,56},{128, - 84}}))); - Modelica.Blocks.Interfaces.RealInput TSupSet "Set point temperature" - annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=90, - origin={0,-118}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={0,-110}))); - Modelica.Blocks.Interfaces.RealInput TStoBot - "Supply temperature of the lower layers of the storage. Does not have to be the lowest layer, depending on comfort even the top may be selected" - annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}), - iconTransformation(extent={{-120,-60},{-100,-40}}))); - Modelica.Blocks.Interfaces.BooleanOutput secGenOn(start=true) - "Turn the auxilliar heater on or off" annotation (Placement(transformation( - extent={{100,-70},{120,-50}}), iconTransformation(extent={{100,-64},{ - 128,-36}}))); - Modelica.Blocks.Interfaces.RealInput TOda "Ambient air temperature" annotation ( - Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=270, - origin={0,120}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={0,112}))); - Modelica.Blocks.Interfaces.RealOutput ySecGenSet(start=1) - "Setpoint of the auxilliar heater" annotation (Placement(transformation( - extent={{100,-90},{120,-70}}), iconTransformation(extent={{100,-100},{ - 128,-72}}))); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.Solid, - lineThickness=0.5)}), Diagram(graphics, - coordinateSystem(preserveAspectRatio= - false))); -end PartialOnOffController; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/package.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/package.mo deleted file mode 100644 index 0788851f..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/package.mo +++ /dev/null @@ -1,19 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController; -package BaseClasses -annotation (Icon(graphics={ - Rectangle( - lineColor={200,200,200}, - fillColor={248,248,248}, - fillPattern=FillPattern.HorizontalCylinder, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Rectangle( - lineColor={128,128,128}, - extent={{-100.0,-100.0},{100.0,100.0}}, - radius=25.0), - Ellipse( - extent={{-30.0,-30.0},{30.0,30.0}}, - lineColor={128,128,128}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid)})); -end BaseClasses; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/package.order deleted file mode 100644 index 2c14283c..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/BaseClasses/package.order +++ /dev/null @@ -1 +0,0 @@ -PartialOnOffController diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/ConstantHysteresisTimeBasedHR.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/ConstantHysteresisTimeBasedHR.mo deleted file mode 100644 index da2c0d76..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/ConstantHysteresisTimeBasedHR.mo +++ /dev/null @@ -1,113 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController; -model ConstantHysteresisTimeBasedHR - "Const. hysteresis and time-based auxilliar heater control" - extends - BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController; - - parameter Modelica.Units.SI.TemperatureDifference Hysteresis=10; - parameter Modelica.Units.SI.Time dt_hr - "Seconds for regulation when hr should be activated: If lower set temperature is hurt for more than this time period"; - parameter Real addSet_dt_hr=1 "Each time dt_hr passes, the output of the heating rod is increased by this amount in percentage. Maximum and default is 100 (on-off hr)%"; - - BESMod.Systems.Hydraulical.Control.Components.OnOffController.Utilities.StorageHysteresis - storageHysteresis(final bandwidth=Hysteresis, final pre_y_start=true) - annotation (Placement(transformation(extent={{-58,18},{-18,58}}))); - BESMod.Systems.Hydraulical.Control.Components.OnOffController.Utilities.TriggerTime - triggerTime - annotation (Placement(transformation(extent={{-32,-88},{-12,-68}}))); - Modelica.Blocks.Sources.RealExpression realExpression(y=min(floor((time - - triggerTime.y)/dt_hr)*addSet_dt_hr, 1)) - annotation (Placement(transformation(extent={{6,-70},{26,-50}}))); - Modelica.Blocks.Logical.GreaterThreshold greaterThreshold(threshold=Modelica.Constants.eps) - annotation (Placement(transformation(extent={{70,-68},{86,-52}}))); - - Modelica.Blocks.Logical.Switch switch1 - annotation (Placement(transformation(extent={{34,-86},{48,-72}}))); - Modelica.Blocks.Sources.Constant const(final k=0) - annotation (Placement(transformation(extent={{14,-98},{24,-88}}))); - Modelica.Blocks.Logical.OnOffController AuxilliarHeaterHys(bandwidth= - Hysteresis/2, pre_y_start=true) - "Generates the on/off signal depending on the temperature inputs" - annotation (Placement(transformation(extent={{-62,-70},{-42,-50}}))); - Modelica.Blocks.Math.Add add1(k1=-1) - annotation (Placement(transformation(extent={{-7,-7},{7,7}}, - rotation=90, - origin={-69,-95}))); - Modelica.Blocks.Sources.Constant const2(final k=Hysteresis/4) - annotation (Placement(transformation(extent={{-98,-118},{-88,-108}}))); -equation - connect(TStoTop, storageHysteresis.T_top) annotation (Line(points={{-120,60},{-86, - 60},{-86,38},{-62,38}}, color={0,0,127})); - connect(TSupSet, storageHysteresis.T_set) annotation (Line(points={{0,-118},{0,-20}, - {-80,-20},{-80,54},{-62,54}}, color={0,0,127})); - connect(storageHysteresis.y, priGenOn) annotation (Line(points={{-16,38},{30,38}, - {30,60},{110,60}}, color={255,0,255})); - connect(greaterThreshold.y, secGenOn) - annotation (Line(points={{86.8,-60},{110,-60}}, color={255,0,255})); - connect(const.y, switch1.u3) annotation (Line(points={{24.5,-93},{28,-93},{28, - -84.6},{32.6,-84.6}}, color={0,0,127})); - connect(switch1.y, ySecGenSet) annotation (Line(points={{48.7,-79},{70,-79},{70, - -80},{110,-80}}, color={0,0,127})); - connect(switch1.y, greaterThreshold.u) annotation (Line(points={{48.7,-79},{ - 56,-79},{56,-60},{68.4,-60}}, color={0,0,127})); - connect(realExpression.y, switch1.u1) annotation (Line(points={{27,-60},{30, - -60},{30,-73.4},{32.6,-73.4}}, color={0,0,127})); - connect(TStoTop, storageHysteresis.T_bot) annotation (Line(points={{-120,60},{-92, - 60},{-92,22},{-62,22}}, color={0,0,127})); - connect(TStoTop, AuxilliarHeaterHys.u) annotation (Line(points={{-120,60},{-92,60}, - {-92,-66},{-64,-66}}, color={0,0,127})); - connect(const2.y, add1.u1) annotation (Line(points={{-87.5,-113},{-74,-113},{ - -74,-103.4},{-73.2,-103.4}}, color={0,0,127})); - connect(add1.y, AuxilliarHeaterHys.reference) annotation (Line(points={{-69, - -87.3},{-69,-54},{-64,-54}}, color={0,0,127})); - connect(TSupSet, add1.u2) annotation (Line(points={{0,-118},{0,-104},{-20,-104}, - {-20,-103.4},{-64.8,-103.4}}, color={0,0,127})); - connect(AuxilliarHeaterHys.y, triggerTime.u) annotation (Line(points={{-41,-60}, - {-38,-60},{-38,-78},{-34,-78}}, color={255,0,255})); - connect(AuxilliarHeaterHys.y, switch1.u2) annotation (Line(points={{-41,-60}, - {2,-60},{2,-79},{32.6,-79}}, color={255,0,255})); - annotation (Icon(graphics={ Polygon( - points={{-65,89},{-73,67},{-57,67},{-65,89}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid),Line(points={{-65,67},{-65,-81}}, - color={192,192,192}),Line(points={{-90,-70},{82,-70}}, color={192, - 192,192}),Polygon( - points={{90,-70},{68,-62},{68,-78},{90,-70}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid), - Text( - extent={{-65,93},{-12,75}}, - lineColor={160,160,164}, - textString="y"),Line( - points={{-80,-70},{30,-70}}, - thickness=0.5),Line( - points={{-50,10},{80,10}}, - thickness=0.5),Line( - points={{-50,10},{-50,-70}}, - thickness=0.5),Line( - points={{30,10},{30,-70}}, - thickness=0.5),Line( - points={{-10,-65},{0,-70},{-10,-75}}, - thickness=0.5),Line( - points={{-10,15},{-20,10},{-10,5}}, - thickness=0.5),Line( - points={{-55,-20},{-50,-30},{-44,-20}}, - thickness=0.5),Line( - points={{25,-30},{30,-19},{35,-30}}, - thickness=0.5),Text( - extent={{-99,2},{-70,18}}, - lineColor={160,160,164}, - textString="true"),Text( - extent={{-98,-87},{-66,-73}}, - lineColor={160,160,164}, - textString="false"),Text( - extent={{19,-87},{44,-70}}, - lineColor={0,0,0}, - textString="uHigh"),Text( - extent={{-63,-88},{-38,-71}}, - lineColor={0,0,0}, - textString="uLow"),Line(points={{-69,10},{-60,10}}, color={160, - 160,164})})); -end ConstantHysteresisTimeBasedHR; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/DegreeMinuteController.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/DegreeMinuteController.mo deleted file mode 100644 index 4934af73..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/DegreeMinuteController.mo +++ /dev/null @@ -1,61 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController; -model DegreeMinuteController - "Based on degree minute approach" - extends BaseClasses.PartialOnOffController; - - parameter Real DegreeMinute_HP_on(unit="K.min")=-60 "Degree minute when HP is turned on"; - parameter Real DegreeMinute_HP_off(unit="K.min")=0 "Degree minute when HP is turned off"; - parameter Real DegreeMinute_AuxHeater_on(unit="K.min")=-600 "Degree minute when auxilliar heater is turned on"; - parameter Real DegreeMinuteReset(unit="K.min")=300 "Degree minute when the value is reset. Value based on additional paper, to avoid errors in summer periods"; - parameter Modelica.Units.SI.TemperatureDifference delta_T_AuxHeater_off=1 - "Temperature difference when to turn off the auxilliar heater"; - parameter Modelica.Units.SI.TemperatureDifference delta_T_reset=10 - "Temperature difference when to reset the sum to 0"; - - Real DegreeMinute(start=0) "Current degree minute value"; - Modelica.Units.SI.TemperatureDifference delta_T=TStoTop - TSupSet; - -algorithm - when DegreeMinute < DegreeMinute_HP_on then - priGenOn := true; - end when; - - when DegreeMinute > DegreeMinute_HP_off then - priGenOn := false; - end when; - - when DegreeMinute < DegreeMinute_AuxHeater_on then - secGenOn := true; - ySecGenSet := 1; - end when; - - when delta_T > delta_T_AuxHeater_off then - secGenOn := false; - ySecGenSet := 0; - end when; - -equation - // TODO: Check why the simple hys wont work?! - //HP_On = (not pre(HP_On) and DegreeMinute > DegreeMinute_HP_on) or (pre(HP_On) and DegreeMinute < DegreeMinute_HP_off); - //Auxilliar_Heater_On = (not pre(Auxilliar_Heater_On) and DegreeMinute > DegreeMinute_AuxHeater_on) or (pre(Auxilliar_Heater_On) and delta_T < delta_T_AuxHeater_off); - der(DegreeMinute) = delta_T /60; - when (delta_T > delta_T_reset) then - reinit(DegreeMinute, 0); - elsewhen (DegreeMinute > DegreeMinuteReset) then - reinit(DegreeMinute, 0); - end when; - annotation (Icon(graphics={Text( - extent={{-44,58},{40,-60}}, - lineColor={0,0,0}, - textString="°C -_______ - - minute")}), Documentation(info=" -

The method is based on the following paper: https://www.sciencedirect.com/science/article/abs/pii/S037877881300282X

-


• Turn on the heat pump when the sum is lower than −60 degree–minute.

-

• Turn off the heat pump when the sum goes back to 0 degree–minute.

-

• Turn on the electrical auxiliary heater when the sum is lower than −600 degree–minute.

-

• Turn off the electrical auxiliary heater when the supply temperature is 1 K higher than the required temperature.

-

• Reset the sum to zero whenever the supply temperature is 10 K higher than the required temperature.

-")); -end DegreeMinuteController; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/OnOffControllerTest.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/OnOffControllerTest.mo deleted file mode 100644 index acf3ce51..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/OnOffControllerTest.mo +++ /dev/null @@ -1,58 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController.Examples; -model OnOffControllerTest - extends Modelica.Icons.Example; - - OnOffController.ConstantHysteresisTimeBasedHR - constantHysteresisTimeBasedHR(dt_hr=1800) - annotation (Placement(transformation(extent={{-28,42},{16,82}}))); - BESMod.Systems.Hydraulical.Control.Components.OnOffController.DegreeMinuteController - degreeMinuteController(DegreeMinuteReset=100) annotation (Placement( - transformation( - extent={{-21,-20},{21,20}}, - rotation=0, - origin={-5,2}))); - BESMod.Systems.Hydraulical.Control.Components.OnOffController.FloatingHysteresis - floatingHysteresis(Hysteresis_max=15, Hysteresis_min=2) - annotation (Placement(transformation(extent={{-26,-76},{16,-38}}))); - Modelica.Blocks.Sources.Constant T_Set(k=323.15) - annotation (Placement(transformation(extent={{-160,-20},{-124,16}}))); - Modelica.Blocks.Sources.Sine T_Top( - amplitude=30, - f=1/3600, - offset=313.15) - annotation (Placement(transformation(extent={{-160,44},{-122,82}}))); - Modelica.Blocks.Sources.Constant T_Set1(k=273.15) - annotation (Placement(transformation(extent={{-152,-90},{-116,-54}}))); -equation - connect(T_Set.y, degreeMinuteController.TSupSet) annotation (Line(points={{-122.2, - -2},{-106,-2},{-106,0},{-70,0},{-70,-28},{-5,-28},{-5,-20}}, color={0,0, - 127})); - connect(T_Set.y, floatingHysteresis.TSupSet) annotation (Line(points={{-122.2,-2}, - {-86,-2},{-86,-94},{-5,-94},{-5,-77.9}}, color={0,0,127})); - connect(T_Set.y, constantHysteresisTimeBasedHR.TSupSet) annotation (Line(points= - {{-122.2,-2},{-112,-2},{-112,-4},{-80,-4},{-80,32},{-6,32},{-6,40}}, - color={0,0,127})); - connect(T_Top.y, constantHysteresisTimeBasedHR.TStoTop) annotation (Line(points= - {{-120.1,63},{-44,63},{-44,76},{-30.2,76}}, color={0,0,127})); - connect(T_Top.y, constantHysteresisTimeBasedHR.TStoBot) annotation (Line(points= - {{-120.1,63},{-72,63},{-72,40},{-44,40},{-44,52},{-30.2,52}}, color={0,0, - 127})); - connect(T_Top.y, degreeMinuteController.TStoTop) annotation (Line(points={{-120.1, - 63},{-96,63},{-96,16},{-28.1,16}}, color={0,0,127})); - connect(T_Top.y, degreeMinuteController.TStoBot) annotation (Line(points={{-120.1, - 63},{-88,63},{-88,-8},{-28.1,-8}}, color={0,0,127})); - connect(T_Top.y, floatingHysteresis.TStoTop) annotation (Line(points={{-120.1, - 63},{-92,63},{-92,-43.7},{-28.1,-43.7}}, color={0,0,127})); - connect(T_Top.y, floatingHysteresis.TStoBot) annotation (Line(points={{-120.1, - 63},{-90,63},{-90,-66.5},{-28.1,-66.5}}, color={0,0,127})); - connect(T_Set1.y, floatingHysteresis.TOda) annotation (Line(points={{-114.2,-72}, - {-60.1,-72},{-60.1,-35.72},{-5,-35.72}}, color={0,0,127})); - connect(T_Set1.y, degreeMinuteController.TOda) annotation (Line(points={{-114.2, - -72},{-58,-72},{-58,24.4},{-5,24.4}}, color={0,0,127})); - connect(T_Set1.y, constantHysteresisTimeBasedHR.TOda) annotation (Line(points={ - {-114.2,-72},{-60,-72},{-60,84.4},{-6,84.4}}, color={0,0,127})); - annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false)), - experiment(StopTime=86400, Interval=1)); -end OnOffControllerTest; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/ParallelBivalentControl.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/ParallelBivalentControl.mo deleted file mode 100644 index 187303e7..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/ParallelBivalentControl.mo +++ /dev/null @@ -1,17 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController.Examples; -model ParallelBivalentControl - extends PartialOnOffController(dTHys=onOffController.Hysteresis, redeclare - BESMod.Systems.Hydraulical.Control.Components.OnOffController.PartParallelBivalent - onOffController( - Hysteresis=10, - TCutOff=263.15, - TBiv=270.15, - TOda_nominal=258.15, - TRoom=293.15, - QDem_flow_nominal=12000, - QHP_flow_cutOff=3000, - secGenOn(start=false), - ySecGenSet(start=0))); - - extends Modelica.Icons.Example; -end ParallelBivalentControl; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/PartialOnOffController.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/PartialOnOffController.mo deleted file mode 100644 index a40e3817..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/PartialOnOffController.mo +++ /dev/null @@ -1,37 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController.Examples; -partial model PartialOnOffController - parameter Real TSetDef=273.15 + 50 "Constant output value"; - parameter Real dTHys "Hysterisis value"; - replaceable BaseClasses.PartialOnOffController onOffController annotation ( - choicesAllMatching=true, Placement(transformation(extent={{-18,-16},{38, - 38}}))); - Modelica.Blocks.Sources.Ramp ramp( - height=70, - duration=3600, - offset=273.15 - 30) - annotation (Placement(transformation(extent={{-78,58},{-58,78}}))); - Modelica.Blocks.Sources.Pulse pulse( - amplitude=dTHys + 2, - period=1800, - offset=TSetDef - dTHys/2 - 1) - annotation (Placement(transformation(extent={{-84,2},{-64,22}}))); - Modelica.Blocks.Sources.Constant constTSet(k=TSetDef) - annotation (Placement(transformation(extent={{-60,-60},{-40,-40}}))); - -equation - connect(ramp.y, onOffController.TOda) - annotation (Line(points={{-57,68},{10,68},{10,41.24}}, color={0,0,127})); - connect(pulse.y, onOffController.TStoTop) annotation (Line(points={{-63,12},{-56, - 12},{-56,30},{-20.8,30},{-20.8,29.9}}, color={0,0,127})); - connect(pulse.y, onOffController.TStoBot) annotation (Line(points={{-63,12},{-56, - 12},{-56,-2.5},{-20.8,-2.5}}, color={0,0,127})); - connect(constTSet.y, onOffController.TSupSet) - annotation (Line(points={{-39,-50},{10,-50},{10,-18.7}}, color={0,0,127})); - annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false)), - experiment( - StopTime=3600, - Interval=1, - __Dymola_Algorithm="Dassl")); -end PartialOnOffController; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/package.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/package.mo deleted file mode 100644 index 50624fae..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/package.mo +++ /dev/null @@ -1,6 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController; -package Examples - extends Modelica.Icons.ExamplesPackage; - - -end Examples; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/package.order b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/package.order deleted file mode 100644 index 25659c4f..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Examples/package.order +++ /dev/null @@ -1,3 +0,0 @@ -ParallelBivalentControl -PartialOnOffController -OnOffControllerTest diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/FloatingHysteresis.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/FloatingHysteresis.mo deleted file mode 100644 index 2b343db8..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/FloatingHysteresis.mo +++ /dev/null @@ -1,96 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController; -model FloatingHysteresis - "Based on the floating hysteresis approach" - extends BaseClasses.PartialOnOffController; - - parameter Modelica.Units.SI.TemperatureDifference Hysteresis_max=10 - "Maximum hysteresis"; - parameter Modelica.Units.SI.TemperatureDifference Hysteresis_min=10 - "Minimum hysteresis"; - parameter Modelica.Units.SI.Time time_factor=20 - "The time which should be spent to have the floating hysteresis equal to the average of maximum and minimum hysteresis."; - parameter Modelica.Units.SI.Time dt_hr=20*60 - "Seconds for regulation when hr should be activated: If lower set temperature is hurt for more than this time period"; - - /******************************* Variables *******************************/ - - Modelica.Units.SI.Time t1(start=0) "Helper variable for hr algorithm"; - Modelica.Units.SI.TemperatureDifference Hysteresis_floating=Hysteresis_min + - (Hysteresis_max - Hysteresis_min)/(1 + (t1/time_factor)); - -algorithm - - // For initialisation: activate both systems - //when time > 1 then - // HP_On := true; - // Auxilliar_Heater_On :=true; - //end when; - - // When upper temperature of storage tank is lower than lower hysteresis value, activate hp - when TStoTop < TSupSet - Hysteresis_floating/2 then - priGenOn := true; - t1 :=time; // Start activation counter - end when; - // When second / lower temperature of storage tank is higher than upper hysteresis, deactivate hp - when TStoBot > TSupSet + Hysteresis_floating/2 then - priGenOn := false; - secGenOn := false; - ySecGenSet := 0; - end when; - - // Activate hr in case temperature is below lower hysteresis and critical time period is passed - when (TStoTop < TSupSet - Hysteresis_floating/2) and time > (t1 + dt_hr) and - priGenOn then - secGenOn := true; - ySecGenSet := 1; - end when; - - annotation (Icon(graphics={ - Line( - points={{-50,48},{80,48}}, - thickness=0.5),Line( - points={{-10,53},{-20,48},{-10,43}}, - thickness=0.5),Line( - points={{25,8},{30,19},{35,8}}, - thickness=0.5),Line( - points={{30,48},{30,-32}}, - thickness=0.5),Line( - points={{-10,-27},{0,-32},{-10,-37}}, - thickness=0.5), Line( - points={{-80,-32},{30,-32}}, - thickness=0.5),Line( - points={{-50,48},{-50,-32}}, - thickness=0.5),Line( - points={{-55,18},{-50,8},{-44,18}}, - thickness=0.5),Text( - extent={{-99,40},{-70,56}}, - lineColor={160,160,164}, - textString="true"),Text( - extent={{-98,-49},{-66,-35}}, - lineColor={160,160,164}, - textString="false"), Line(points={{-64,86},{-65,-43}}, - color={192,192,192}),Line(points={{-69,48},{-60,48}}, color={160, - 160,164}),Polygon( - points={{90,-32},{68,-24},{68,-40},{90,-32}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid), - Line(points={{-90,-32},{82,-32}}, color={192, - 192,192}), Text( - extent={{19,-49},{44,-32}}, - lineColor={0,0,0}, - textString="uHigh"),Text( - extent={{-63,-50},{-38,-33}}, - lineColor={0,0,0}, - textString="uLow"), - Polygon( - points={{11,0},{-11,8},{-11,-8},{11,0}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid, - origin={-65,84}, - rotation=90), Text( - extent={{-87,-84},{84,-54}}, - lineColor={0,0,0}, - textString="uLow, uHigh=f(h_max, h_min, time)")})); -end FloatingHysteresis; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/PartParallelBivalent.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/PartParallelBivalent.mo deleted file mode 100644 index 58b07e05..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/PartParallelBivalent.mo +++ /dev/null @@ -1,113 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController; -model PartParallelBivalent "Part-parallel bivalent control" - extends - BESMod.Systems.Hydraulical.Control.Components.OnOffController.BaseClasses.PartialOnOffController; - - parameter Modelica.Units.SI.TemperatureDifference Hysteresis=10; - parameter Modelica.Units.SI.Temperature TCutOff "Cut-off temperature"; - parameter Modelica.Units.SI.Temperature TBiv "Bivalence temperature"; - parameter Modelica.Units.SI.Temperature TOda_nominal "Nominal temperature "; - parameter Modelica.Units.SI.Temperature TRoom "Room set temperature"; - parameter Modelica.Units.SI.HeatFlowRate QDem_flow_nominal; - parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff; - - BESMod.Systems.Hydraulical.Control.Components.OnOffController.Utilities.StorageHysteresis - storageHysteresis(final bandwidth=Hysteresis, final pre_y_start=true) - annotation (Placement(transformation(extent={{-58,18},{-18,58}}))); - - Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualT_biv(threshold= - TCutOff) - annotation (Placement(transformation(extent={{12,54},{36,78}}))); - Modelica.Blocks.Logical.And and1 - annotation (Placement(transformation(extent={{60,46},{80,66}}))); - -protected - parameter Real phiBiv = (TRoom - TBiv)/(TRoom - TOda_nominal) "Part load at bivalence temperature"; - parameter Real partLoadHeaPumAtCutOff(min=0, max=1)=QHP_flow_cutOff/QDem_flow_nominal "Percentage of nominal heat demand supplied by heat pump at cut-off temperature"; - - Real partLoadAuxHea=min(1, (TRoom - TOda)/(TRoom - TOda_nominal)); - -equation - - if TOda < TCutOff then - // Only auxilliar device is active - secGenOn = storageHysteresis.y; - ySecGenSet = partLoadAuxHea; - elseif TOda < TBiv then - // Both devices are active - secGenOn = storageHysteresis.y; - ySecGenSet = max(0, partLoadAuxHea - (partLoadHeaPumAtCutOff + (phiBiv - - partLoadHeaPumAtCutOff)*(TOda - TCutOff)/(TBiv - TCutOff))); - else - // Only heat pump is active - secGenOn = false; - ySecGenSet = 0; - end if; - - connect(TStoTop, storageHysteresis.T_top) annotation (Line(points={{-120,60},{-86, - 60},{-86,38},{-62,38}}, color={0,0,127})); - connect(TSupSet, storageHysteresis.T_set) annotation (Line(points={{0,-118},{0,-20}, - {-80,-20},{-80,54},{-62,54}}, color={0,0,127})); - connect(TStoTop, storageHysteresis.T_bot) annotation (Line(points={{-120,60},{-92, - 60},{-92,22},{-62,22}}, color={0,0,127})); - connect(greaterEqualT_biv.y, and1.u1) annotation (Line(points={{37.2,66},{42,66}, - {42,56},{58,56}}, color={255,0,255})); - connect(storageHysteresis.y, and1.u2) annotation (Line(points={{-16,38},{42,38}, - {42,48},{58,48}}, color={255,0,255})); - connect(and1.y, priGenOn) annotation (Line(points={{81,56},{92,56},{92,60},{110, - 60}}, color={255,0,255})); - connect(TOda, greaterEqualT_biv.u) - annotation (Line(points={{0,120},{0,66},{9.6,66}}, color={0,0,127})); - annotation (Icon(graphics={ Polygon( - points={{-65,89},{-73,67},{-57,67},{-65,89}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid),Line(points={{-65,67},{-65,-81}}, - color={192,192,192}),Line(points={{-90,-70},{82,-70}}, color={192, - 192,192}),Polygon( - points={{90,-70},{68,-62},{68,-78},{90,-70}}, - lineColor={192,192,192}, - fillColor={192,192,192}, - fillPattern=FillPattern.Solid), - Text( - extent={{-65,93},{-12,75}}, - lineColor={160,160,164}, - textString="y"),Line( - points={{-80,-70},{30,-70}}, - thickness=0.5),Line( - points={{-50,10},{80,10}}, - thickness=0.5),Line( - points={{-50,10},{-50,-70}}, - thickness=0.5),Line( - points={{30,10},{30,-70}}, - thickness=0.5),Line( - points={{-10,-65},{0,-70},{-10,-75}}, - thickness=0.5),Line( - points={{-10,15},{-20,10},{-10,5}}, - thickness=0.5),Line( - points={{-55,-20},{-50,-30},{-44,-20}}, - thickness=0.5),Line( - points={{25,-30},{30,-19},{35,-30}}, - thickness=0.5),Text( - extent={{-99,2},{-70,18}}, - lineColor={160,160,164}, - textString="true"),Text( - extent={{-98,-87},{-66,-73}}, - lineColor={160,160,164}, - textString="false"),Text( - extent={{19,-87},{44,-70}}, - lineColor={0,0,0}, - textString="uHigh"),Text( - extent={{-63,-88},{-38,-71}}, - lineColor={0,0,0}, - textString="uLow"),Line(points={{-69,10},{-60,10}}, color={160, - 160,164})}), Diagram(graphics={Rectangle( - extent={{100,-40},{20,-100}}, - lineColor={28,108,200}, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), Text( - extent={{20,-50},{94,-84}}, - lineColor={28,108,200}, - textString="Internal -(see equations)")})); -end PartParallelBivalent; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/CountTimeBelowThreshold.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/CountTimeBelowThreshold.mo deleted file mode 100644 index eccd8ac9..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/CountTimeBelowThreshold.mo +++ /dev/null @@ -1,15 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController.Utilities; -block CountTimeBelowThreshold - Modelica.Blocks.Interfaces.RealOutput y - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - Modelica.Blocks.Interfaces.BooleanInput u - annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - -algorithm - when edge(u) then - y:=time; - end when; - annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false))); -end CountTimeBelowThreshold; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/StorageHysteresis.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/StorageHysteresis.mo deleted file mode 100644 index aa504164..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/StorageHysteresis.mo +++ /dev/null @@ -1,42 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController.Utilities; -block StorageHysteresis "On-off controller for a storage control." - extends Modelica.Blocks.Icons.PartialBooleanBlock; - Modelica.Blocks.Interfaces.RealInput T_set "Set temperature" - annotation (Placement(transformation(extent={{-140,100},{-100,60}}))); - Modelica.Blocks.Interfaces.RealInput T_top - "Connector of Real input signal used as measurement signal of upper level storage temperature" - annotation (Placement(transformation(extent={{-140,20},{-100,-20}}))); - Modelica.Blocks.Interfaces.BooleanOutput y - "Connector of Real output signal used as actuator signal" - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - - parameter Real bandwidth(start=0.1) "Bandwidth around reference signal"; - parameter Boolean pre_y_start=false "Value of pre(y) at initial time"; - - Modelica.Blocks.Interfaces.RealInput T_bot - "Connector of Real input signal used as measurement signal of bottom temperature of storage" - annotation (Placement(transformation(extent={{-140,-60},{-100,-100}}))); -initial equation - pre(y) = pre_y_start; -equation - y = pre(y) and (T_bot < T_set + bandwidth/2) or (T_top < T_set - bandwidth/2); - annotation (Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100, - -100},{100,100}}), graphics={ - Text( - extent={{-92,74},{44,44}}, - textString="reference"), - Text( - extent={{-94,-52},{-34,-74}}, - textString="u"), - Line(points={{-76,-32},{-68,-6},{-50,26},{-24,40},{-2,42},{16,36},{32,28},{48,12},{58,-6},{68,-28}}, - color={0,0,127}), - Line(points={{-78,-2},{-6,18},{82,-12}}, - color={255,0,0}), - Line(points={{-78,12},{-6,30},{82,0}}), - Line(points={{-78,-16},{-6,4},{82,-26}}), - Line(points={{-82,-18},{-56,-18},{-56,-40},{64,-40},{64,-20},{90,-20}}, - color={255,0,255})}), Documentation(info=" -

The block StorageHysteresis sets the output signal y to true when the input signal T_top falls below the T_set signal minus half of the bandwidth and sets the output signal y to false when the input signal T_bot exceeds the T_set signal plus half of the bandwidth.

-

This control ensure that the whole storage has the required temperature. If you just want to control one layer, apply the same Temperature to both T_top and T_bot.

-")); -end StorageHysteresis; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/TriggerTime.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/TriggerTime.mo deleted file mode 100644 index 83171e9c..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/TriggerTime.mo +++ /dev/null @@ -1,15 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController.Utilities; -block TriggerTime - Modelica.Blocks.Interfaces.RealOutput y - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - Modelica.Blocks.Interfaces.BooleanInput u(start=false, fixed=true) - annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - -algorithm - when edge(u) then - y:=time; - end when; - annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false))); -end TriggerTime; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/package.mo b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/package.mo deleted file mode 100644 index 53424189..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/package.mo +++ /dev/null @@ -1,4 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.OnOffController; -package Utilities - -end Utilities; diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/package.order b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/package.order deleted file mode 100644 index 9445d5a9..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/Utilities/package.order +++ /dev/null @@ -1,3 +0,0 @@ -TriggerTime -CountTimeBelowThreshold -StorageHysteresis diff --git a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/package.order b/BESMod/Systems/Hydraulical/Control/Components/OnOffController/package.order deleted file mode 100644 index afd99d86..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/OnOffController/package.order +++ /dev/null @@ -1,8 +0,0 @@ -AlternativeBivalent -ConstantHysteresisTimeBasedHR -DegreeMinuteController -FloatingHysteresis -PartParallelBivalent -Examples -Utilities -BaseClasses diff --git a/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo b/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo index 753383f5..109a714d 100644 --- a/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo +++ b/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo @@ -1,9 +1,6 @@ within BESMod.Utilities.HeatGeneration; model GetHeatPumpCurveVCLib extends PartialGetHeatGenerationCurve( - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultBivHPControl - bivalentHeatPumpControlDataDefinition, redeclare Examples.UseCaseDesignOptimization.AachenSystem systemParameters, redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( redeclare package Medium_eva = IBPSA.Media.Air, diff --git a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo index 0ba1f21d..8045bc89 100644 --- a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo +++ b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo @@ -29,10 +29,10 @@ partial model PartialGetHeatGenerationCurve rotation=180, origin={82,10}))); Systems.Hydraulical.Control.Components.HeatingCurve heatingCurve( - GraHeaCurve=bivalentHeatPumpControlDataDefinition.gradientHeatCurve, - THeaThres=systemParameters.TSetZone_nominal[1], - dTOffSet_HC=bivalentHeatPumpControlDataDefinition.dTOffSetHeatCurve - - generation.dTTra_nominal[1]) annotation (Placement(transformation( + TSup_nominal=systemParameters.THydSup_nominal[1], + TRet_nominal=systemParameters.THydSup_nominal[1] - 7, + TOda_nominal=systemParameters.TOda_nominal, + nHeaTra=1.3) annotation (Placement(transformation( extent={{-11,11},{11,-11}}, rotation=0, origin={-9,-71}))); @@ -45,13 +45,6 @@ partial model PartialGetHeatGenerationCurve Modelica.Blocks.Sources.RealExpression realExpression annotation (Placement(transformation(extent={{30,72},{50,92}}))); - replaceable - Systems.Hydraulical.Control.RecordsCollection.BivalentHeatPumpControlDataDefinition - bivalentHeatPumpControlDataDefinition( - TOda_nominal=systemParameters.TOda_nominal, - TSup_nominal=systemParameters.THydSup_nominal[1], - TSetRoomConst=systemParameters.TSetZone_nominal[1]) - annotation (choicesAllMatching=true,Placement(transformation(extent={{-100,82},{-80,102}}))); Modelica.Blocks.Sources.Constant const3(k=max(systemParameters.TSetZone_nominal)) annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); IBPSA.BoundaryConditions.WeatherData.Bus weaBus "Weather data bus" From f6f3ff3d5a3ef8cd833dba4f5e45e0ef1ee64b21 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 14 Aug 2023 14:32:06 +0200 Subject: [PATCH 084/131] save all files --- .../RelativeSpeedController/BaseClasses/PIDParameters.mo | 7 ------- .../RelativeSpeedController/BaseClasses/package.order | 1 - .../Control/Components/RelativeSpeedController/PID.mo | 1 - .../Hydraulical/Generation/HeatPumpAndHeatingRod.mo | 2 +- 4 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PIDParameters.mo diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PIDParameters.mo b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PIDParameters.mo deleted file mode 100644 index 1978da39..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/PIDParameters.mo +++ /dev/null @@ -1,7 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.BaseClasses; -model PIDParameters - - - annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); -end PIDParameters; diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order index b3d7ae3c..033605dc 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order @@ -1,3 +1,2 @@ PartialControler LimPID -PIDParameters diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo index cf257e4e..00e64b62 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo @@ -1,7 +1,6 @@ within BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController; model PID "PID controller for inverter controlled devices" extends BaseClasses.PartialControler; - parameter Real yMax=1 "Upper limit of output"; parameter Real yOff=0 "Constant output value if device is turned off"; parameter Real y_start=0 "Initial value of output"; parameter Real yMin "Lower limit of relative speed"; diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index 740a716a..8ffce976 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -2,7 +2,7 @@ within BESMod.Systems.Hydraulical.Generation; model HeatPumpAndHeatingRod "Heat pump with heating rod in series" extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialHeatPump( dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal}, - multiSum(nu=3)); + multiSum(nu=if use_heaRod then 3 else 2)); parameter Boolean use_heaRod=true "=false to disable the heating rod" annotation(Dialog(group="Component choices")); From 9ad483ca4f00eb00676062e58f6cfe7cd2b2af09 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 14 Aug 2023 15:47:51 +0200 Subject: [PATCH 085/131] Add user profiles, rm dangling file --- BESMod/Examples/HeatPumpAndBoiler.mo | 301 ------------------ .../Demand/Building/TEASERThermalZone.mo | 25 ++ .../TEASERPeopleWithAbsoluteMachineGains.mo | 70 ++++ BESMod/Systems/UserProfiles/TEASERProfiles.mo | 17 + BESMod/Systems/UserProfiles/package.order | 5 +- 5 files changed, 115 insertions(+), 303 deletions(-) delete mode 100644 BESMod/Examples/HeatPumpAndBoiler.mo create mode 100644 BESMod/Systems/UserProfiles/TEASERPeopleWithAbsoluteMachineGains.mo diff --git a/BESMod/Examples/HeatPumpAndBoiler.mo b/BESMod/Examples/HeatPumpAndBoiler.mo deleted file mode 100644 index cd9581eb..00000000 --- a/BESMod/Examples/HeatPumpAndBoiler.mo +++ /dev/null @@ -1,301 +0,0 @@ -within BESMod.Examples; -package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" - extends Modelica.Icons.ExamplesPackage; - - record ParametersToChange - extends Systems.RecordsCollection.ParameterStudy.ParameterStudyBaseDefinition; - // 1. Add parameters like this (WITH Evaluate=false)! - // parameter Modelica.SIunits.Volume V=0.5 annotation(Evaluate=false); - // 2. Overwrite the default parameter in the system simulation - // via the graphical interface, resulting in e.g. - // Distribution.parameters.V = parameterStudy.V - - parameter Modelica.Units.SI.Temperature TCutOff=263.15 "Cut off temperature" - annotation (Evaluate=false); - parameter Modelica.Units.SI.Temperature TBiv=268.15 "Bivalence temperature" - annotation (Evaluate=false); - parameter Real VPerQFlow=23.5 "Litre of storage volume per kilowatt thermal power demand" annotation(Evaluate=false); - parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff=3000 - annotation (Evaluate=false); - parameter Modelica.Units.SI.HeatFlowRate QHP_flow_biv=4000 - annotation (Evaluate=false); - end ParametersToChange; - - record AachenSystem - extends Systems.RecordsCollection.SystemParametersBaseDataDefinition( - use_elecHeating=false, - nZones=1, - filNamWea=Modelica.Utilities.Files.loadResource( - "modelica://BESMod/Resources/WeatherData/TRY2015_507931060546_Jahr_City_Aachen_Normal.mos"), - QBui_flow_nominal={10632.414942943078}, - use_ventilation=false, - THydSup_nominal={328.15}, - TOda_nominal=265.35); - - end AachenSystem; - - model Parallel - "Bivalent Heat Pump Systems with parallel heat generation" - extends BaseClasses.PartialHybridSystem( - redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerParallel - generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - parHeaPum( - genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ - parameterStudy.QHP_flow_biv, - dpCon_nominal=0, - dpEva_nominal=0, - use_refIne=false, - refIneFre_constant=0), - redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, - redeclare model PerDataMainHP = - AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", - flowsheet="VIPhaseSeparatorFlowsheet"), - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen, - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal), - redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel - distribution( - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - parStoDHW(dTLoadingHC1=10), - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal))); - - extends Modelica.Icons.Example; - - annotation (experiment( - StopTime=31536000, - Interval=600, - __Dymola_Algorithm="Dassl")); - end Parallel; - - model Serial "Bivalent Heat Pump Systems with serial heat generation" - extends BaseClasses.PartialHybridSystem( - redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerSerial - generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - parHeaPum( - genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ - parameterStudy.QHP_flow_biv, - dpCon_nominal=0, - dpEva_nominal=0, - use_refIne=false, - refIneFre_constant=0), - redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, - redeclare model PerDataMainHP = - AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", - flowsheet="VIPhaseSeparatorFlowsheet"), - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen), - redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel - distribution( - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - parStoDHW(dTLoadingHC1=10), - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal))); - - extends Modelica.Icons.Example; - - annotation (experiment( - StopTime=31536000, - Interval=600, - __Dymola_Algorithm="Dassl")); - end Serial; - - model AfterBufferWithDHW - "Bivalent Heat Pump System with boiler integration after buffer tank without DHW support" - extends BaseClasses.PartialHybridSystem( - redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.HeatPump - generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - parHeaPum( - genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ - parameterStudy.QHP_flow_biv, - dpCon_nominal=0, - dpEva_nominal=0, - use_refIne=false, - refIneFre_constant=0), - redeclare model PerDataMainHP = - AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", - flowsheet="VIPhaseSeparatorFlowsheet"), - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen), - control(boiInGeneration=false), - redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithDHW - distribution( - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen, - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow), - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - parStoDHW(dTLoadingHC1=10), - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal, - dTBoiDHWLoa=10, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayValBoi, - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - parHydSep, - redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi))); - - extends Modelica.Icons.Example; - - annotation (experiment( - StopTime=31536000, - Interval=600, - __Dymola_Algorithm="Dassl")); - end AfterBufferWithDHW; - - model AfterBufferWithoutDHW - "Bivalent Heat Pump System with boiler integration after buffer tank without DHW support" - extends BaseClasses.PartialHybridSystem( - redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.HeatPump - generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - parHeaPum( - genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ - parameterStudy.QHP_flow_biv, - dpCon_nominal=0, - dpEva_nominal=0, - use_refIne=false, - refIneFre_constant=0), - redeclare model PerDataMainHP = - AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", - flowsheet="VIPhaseSeparatorFlowsheet"), - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen), - control(boiInGeneration=false), - redeclare Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading - distribution( - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen, - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow), - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - parStoDHW(dTLoadingHC1=10), - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal, - heaAftBufTyp=BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler, - redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi))); - - extends Modelica.Icons.Example; - - annotation (experiment( - StopTime=31536000, - Interval=600, - __Dymola_Algorithm="Dassl")); - end AfterBufferWithoutDHW; - - package BaseClasses "Contains partial example case" - extends Modelica.Icons.BasesPackage; - partial model PartialHybridSystem "Partial bivalent heat pump system" - extends Systems.BaseClasses.PartialBuildingEnergySystem( - redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, - redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare - BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( - heaLoadFacGrd=0, heaLoadFacOut=0)), - redeclare BESMod.Systems.Control.NoControl control, - redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Control.HybridHeatPumpSystem control( - redeclare - BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - valCtrl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - parTheVal, - dTHysBui=5, - dTHysDHW=5, - meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature, - redeclare model DHWHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare model BuildingHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare model DHWSetTemperature = - BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI - parPIDHeaPum, - TBiv=parameterStudy.TBiv, - boiInGeneration=true, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl - safetyControl, - TCutOff=parameterStudy.TCutOff, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicBoilerPI - parPIDBoi), - redeclare final Systems.Hydraulical.Transfer.IdealValveRadiator transfer( - redeclare - BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare Systems.Demand.DHW.DHW DHW( - redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic - calcmFlow), - redeclare Systems.UserProfiles.TEASERProfiles userProfiles, - redeclare UseCaseDesignOptimization.AachenSystem systemParameters( - use_ventilation=true), - redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy, - redeclare final package MediumDHW = AixLib.Media.Water, - redeclare final package MediumZone = AixLib.Media.Air, - redeclare final package MediumHyd = AixLib.Media.Water, - redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); - - annotation (experiment( - StopTime=31536000, - Interval=600, - __Dymola_Algorithm="Dassl")); - end PartialHybridSystem; - end BaseClasses; -end HeatPumpAndBoiler; diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index 57150255..02b5870a 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -168,6 +168,12 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=180, origin={114,62}))); + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preAbsHeaGaiRad[nZones]( + final T_ref=293.15, final alpha=0) "Add absolute radiative heat gain" + annotation (Placement(transformation(extent={{142,100},{162,120}}))); + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preAbsHeaGaiCon[nZones]( + final T_ref=293.15, final alpha=0) "Add absolute radiative heat gain" + annotation (Placement(transformation(extent={{102,102},{122,122}}))); equation for i in 1:nZones loop @@ -372,6 +378,25 @@ equation 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(preAbsHeaGaiRad.port, thermalZone.intGainsRad) annotation (Line(points= + {{162,110},{170,110},{170,132},{-80,132},{-80,60},{-56,60},{-56,60.24}, + {-39.74,60.24}}, color={191,0,0})); + connect(preAbsHeaGaiCon.port, thermalZone.intGainsConv) annotation (Line(points + ={{122,112},{134,112},{134,128},{-76,128},{-76,50},{-42,50},{-42,52},{ + -39.74,52},{-39.74,49.44}}, color={191,0,0})); + connect(preAbsHeaGaiRad.Q_flow, useProBus.absIntGaiRad) annotation (Line(points + ={{142,110},{-56,110},{-56,28},{-40,28},{-40,10},{96,10},{96,101},{51,101}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(preAbsHeaGaiCon.Q_flow, useProBus.absIntGaiCon) annotation (Line(points + ={{102,112},{94,112},{94,82},{51,82},{51,101}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); 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/Systems/UserProfiles/TEASERPeopleWithAbsoluteMachineGains.mo b/BESMod/Systems/UserProfiles/TEASERPeopleWithAbsoluteMachineGains.mo new file mode 100644 index 00000000..6f63f9ed --- /dev/null +++ b/BESMod/Systems/UserProfiles/TEASERPeopleWithAbsoluteMachineGains.mo @@ -0,0 +1,70 @@ +within BESMod.Systems.UserProfiles; +model TEASERPeopleWithAbsoluteMachineGains + "Combination of absolute electrical gains and specific people as in TEASER" + extends BaseClasses.PartialUserProfiles; + parameter String fileNameIntGains=Modelica.Utilities.Files.loadResource("modelica://BESMod/Resources/InternalGains.txt") + "File where matrix is stored"; + parameter String fileNameAbsGai=Modelica.Utilities.Files.loadResource("modelica://BESMod/Resources/InternalGains.txt") + "File where matrix is stored"; + + Modelica.Blocks.Sources.CombiTimeTable tabIntGai( + final tableOnFile=true, + final extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, + final tableName="Internals", + final fileName=fileNameIntGains, + columns=2:4) "Profiles for internal gains" annotation (Placement( + transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-10,30}))); + + Modelica.Blocks.Math.Gain gainIntGai[3](k={1,0,0}) + "Gain for internal gains" + annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={30,30}))); + + Modelica.Blocks.Sources.Constant conTSetZone[nZones](k=TSetZone_nominal) + "Constant room set temperature" annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-10,-50}))); + Modelica.Blocks.Sources.CombiTimeTable tabGaiLigMach( + final tableOnFile=true, + final extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, + final tableName="MachinesAndLight", + final fileName=fileNameIntGains, + columns={2}) "Profiles for internal gains of machines and lights in W" + annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-10,-10}))); +equation + connect(tabIntGai.y, gainIntGai.u) + annotation (Line(points={{1,30},{18,30}}, color={0,0,127})); + connect(gainIntGai.y, useProBus.intGains) annotation (Line(points={{41,30},{ + 74,30},{74,-1},{115,-1}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(conTSetZone.y, useProBus.TZoneSet) annotation (Line(points={{1,-50},{ + 115,-50},{115,-1}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(tabGaiLigMach.y[1], useProBus.absIntGaiCon) annotation (Line(points={{1, + -10},{74,-10},{74,-1},{115,-1}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(tabGaiLigMach.y[2], useProBus.absIntGaiRad) annotation (Line(points={{1,-10}, + {74,-10},{74,-1},{115,-1}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); +end TEASERPeopleWithAbsoluteMachineGains; diff --git a/BESMod/Systems/UserProfiles/TEASERProfiles.mo b/BESMod/Systems/UserProfiles/TEASERProfiles.mo index 7aa3a1e4..6a96eee9 100644 --- a/BESMod/Systems/UserProfiles/TEASERProfiles.mo +++ b/BESMod/Systems/UserProfiles/TEASERProfiles.mo @@ -28,6 +28,11 @@ model TEASERProfiles "Standard TEASER Profiles" extent={{10,10},{-10,-10}}, rotation=180, origin={-10,-50}))); + Modelica.Blocks.Sources.Constant constZero[nZones](each final k=0) + "Constant zero for absolute gains" annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-10,-12}))); equation connect(tabIntGai.y, gainIntGai.u) annotation (Line(points={{1,30},{18,30}}, color={0,0,127})); @@ -43,4 +48,16 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); + connect(constZero.y, useProBus.absIntGaiRad) annotation (Line(points={{1,-12},{74, + -12},{74,-1},{115,-1}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(constZero.y, useProBus.absIntGaiCon) annotation (Line(points={{1,-12},{ + 74,-12},{74,-1},{115,-1}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); end TEASERProfiles; diff --git a/BESMod/Systems/UserProfiles/package.order b/BESMod/Systems/UserProfiles/package.order index 5ccf545e..0973db42 100644 --- a/BESMod/Systems/UserProfiles/package.order +++ b/BESMod/Systems/UserProfiles/package.order @@ -1,5 +1,6 @@ -TEASERProfiles -Case600Profiles AixLibHighOrderProfiles +Case600Profiles +TEASERProfiles +TEASERPeopleWithAbsoluteMachineGains BaseClasses Tests From f47573d0d0d3dbed297c648fe648f1a69b3ac864 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 18 Aug 2023 09:19:20 +0200 Subject: [PATCH 086/131] Add ideal heater for TEASER heat demand calculations --- .../Demand/Building/TEASERThermalZone.mo | 25 ------- .../Systems/Electrical/Control/IdealHeater.mo | 23 ++++++ .../Systems/Electrical/Control/NoControl.mo | 2 +- .../Systems/Electrical/Control/package.order | 1 + .../Electrical/Transfer/IdealHeater.mo | 66 +++++++++++++++++ .../Systems/Electrical/Transfer/package.order | 1 + .../Control/HybridHeatPumpSystem.mo | 3 +- .../BaseClasses/PartialTwoStorageParallel.mo | 4 +- .../TEASERPeopleWithAbsoluteMachineGains.mo | 70 ------------------- BESMod/Systems/UserProfiles/TEASERProfiles.mo | 17 ----- BESMod/Systems/UserProfiles/package.order | 1 - 11 files changed, 95 insertions(+), 118 deletions(-) create mode 100644 BESMod/Systems/Electrical/Control/IdealHeater.mo create mode 100644 BESMod/Systems/Electrical/Transfer/IdealHeater.mo delete mode 100644 BESMod/Systems/UserProfiles/TEASERPeopleWithAbsoluteMachineGains.mo diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index 02b5870a..57150255 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -168,12 +168,6 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=180, origin={114,62}))); - Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preAbsHeaGaiRad[nZones]( - final T_ref=293.15, final alpha=0) "Add absolute radiative heat gain" - annotation (Placement(transformation(extent={{142,100},{162,120}}))); - Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preAbsHeaGaiCon[nZones]( - final T_ref=293.15, final alpha=0) "Add absolute radiative heat gain" - annotation (Placement(transformation(extent={{102,102},{122,122}}))); equation for i in 1:nZones loop @@ -378,25 +372,6 @@ equation 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(preAbsHeaGaiRad.port, thermalZone.intGainsRad) annotation (Line(points= - {{162,110},{170,110},{170,132},{-80,132},{-80,60},{-56,60},{-56,60.24}, - {-39.74,60.24}}, color={191,0,0})); - connect(preAbsHeaGaiCon.port, thermalZone.intGainsConv) annotation (Line(points - ={{122,112},{134,112},{134,128},{-76,128},{-76,50},{-42,50},{-42,52},{ - -39.74,52},{-39.74,49.44}}, color={191,0,0})); - connect(preAbsHeaGaiRad.Q_flow, useProBus.absIntGaiRad) annotation (Line(points - ={{142,110},{-56,110},{-56,28},{-40,28},{-40,10},{96,10},{96,101},{51,101}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(preAbsHeaGaiCon.Q_flow, useProBus.absIntGaiCon) annotation (Line(points - ={{102,112},{94,112},{94,82},{51,82},{51,101}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); 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/Systems/Electrical/Control/IdealHeater.mo b/BESMod/Systems/Electrical/Control/IdealHeater.mo new file mode 100644 index 00000000..1e984174 --- /dev/null +++ b/BESMod/Systems/Electrical/Control/IdealHeater.mo @@ -0,0 +1,23 @@ +within BESMod.Systems.Electrical.Control; +model IdealHeater "Ideal heater control" + extends BESMod.Systems.Electrical.Control.BaseClasses.PartialControl; + Modelica.Blocks.Routing.RealPassThrough reaPasThr[nParallelDem] + "Pass through expandable signal" + annotation (Placement(transformation(extent={{0,0},{20,20}}))); +equation + connect(reaPasThr.u, useProBus.TZoneSet) annotation (Line(points={{-2,10},{-91,10}, + {-91,103}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(reaPasThr.y, transferControlBus.TZoneSet) annotation (Line(points={{21,10}, + {177,10},{177,-99}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + annotation (Icon(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end IdealHeater; diff --git a/BESMod/Systems/Electrical/Control/NoControl.mo b/BESMod/Systems/Electrical/Control/NoControl.mo index 5e17a7f5..22682843 100644 --- a/BESMod/Systems/Electrical/Control/NoControl.mo +++ b/BESMod/Systems/Electrical/Control/NoControl.mo @@ -2,6 +2,6 @@ within BESMod.Systems.Electrical.Control; model NoControl extends BESMod.Systems.Electrical.Control.BaseClasses.PartialControl; annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); end NoControl; diff --git a/BESMod/Systems/Electrical/Control/package.order b/BESMod/Systems/Electrical/Control/package.order index ced57e73..2fe0344c 100644 --- a/BESMod/Systems/Electrical/Control/package.order +++ b/BESMod/Systems/Electrical/Control/package.order @@ -1,3 +1,4 @@ +IdealHeater NoControl BaseClasses RecordsCollection diff --git a/BESMod/Systems/Electrical/Transfer/IdealHeater.mo b/BESMod/Systems/Electrical/Transfer/IdealHeater.mo new file mode 100644 index 00000000..020548e2 --- /dev/null +++ b/BESMod/Systems/Electrical/Transfer/IdealHeater.mo @@ -0,0 +1,66 @@ +within BESMod.Systems.Electrical.Transfer; +model IdealHeater "Ideal heater as in reduced order model" + extends BESMod.Systems.Electrical.Transfer.BaseClasses.PartialTransfer; + parameter Real KR_heater=1000 "Gain of the heating controller"; + parameter Modelica.Units.SI.Time TN_heater=1 + "Time constant of the heating controller"; + BESMod.Utilities.Electrical.ZeroLoad zeroLoad + annotation (Placement(transformation(extent={{16,64},{36,84}}))); + AixLib.Utilities.Sources.HeaterCooler.HeaterCoolerPI heaterCooler[nParallelDem]( + h_heater=Q_flow_nominal .* 1.5, + each final l_heater=0, + each final KR_heater=KR_heater, + each final TN_heater=TN_heater, + each final zoneParam=AixLib.DataBase.ThermalZones.ZoneRecordDummy(), + each recOrSep=false, + each Heater_on=true, + each Cooler_on=false, + each final staOrDyn=false) "Heater Cooler with PI control" + annotation (Placement(transformation(extent={{-62,18},{-22,58}}))); + Modelica.Blocks.Sources.BooleanConstant booCooAct[nParallelDem](each final k= + false) "Cooling active" + annotation (Placement(transformation(extent={{-98,0},{-78,20}}))); + Modelica.Blocks.Sources.BooleanConstant booHeaAct[nParallelDem](each final k= + true) "Heating active" + annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); + Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow fixHeaFlo[nParallelDem]( + each final Q_flow=0) + annotation (Placement(transformation(extent={{40,-48},{60,-28}}))); + Utilities.KPIs.EnergyKPICalculator heaKPI[nParallelDem](each final use_inpCon= + true) "Heating power KPI" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={0,-40}))); +equation + connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( + Line( + points={{36,74},{48,74},{48,100}}, + color={0,0,0}, + thickness=1)); + connect(booCooAct.y, heaterCooler.coolerActive) + annotation (Line(points={{-77,10},{-56,10},{-56,23.6}}, color={255,0,255})); + connect(heaterCooler.heaterActive, booHeaAct.y) annotation (Line(points={{-28.4, + 23.6},{-28.4,-30},{-79,-30}}, color={255,0,255})); + connect(heaterCooler.heatCoolRoom, heatPortCon) annotation (Line(points={{-24,30}, + {84,30},{84,38},{100,38}}, color={191,0,0})); + connect(fixHeaFlo.port, heatPortRad) + annotation (Line(points={{60,-38},{100,-38}}, color={191,0,0})); + connect(heaterCooler.setPointHeat, transferControlBus.TZoneSet) annotation ( + Line(points={{-37.6,23.6},{-37.6,-6},{1.77636e-15,-6},{1.77636e-15,98}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(heaKPI.KPI, transferOutputs.PHea) annotation (Line(points={{ + -2.22045e-15,-52.2},{0,-52.2},{0,-99}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(heaKPI.u, heaterCooler.heatingPower) annotation (Line(points={{ + 2.22045e-15,-28.2},{2.22045e-15,46},{-22,46}}, color={0,0,127})); + annotation (Icon(graphics, + coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end IdealHeater; diff --git a/BESMod/Systems/Electrical/Transfer/package.order b/BESMod/Systems/Electrical/Transfer/package.order index af608743..e3923f02 100644 --- a/BESMod/Systems/Electrical/Transfer/package.order +++ b/BESMod/Systems/Electrical/Transfer/package.order @@ -1,3 +1,4 @@ +IdealHeater NoElectricalTransfer BaseClasses RecordsCollection diff --git a/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo b/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo index dd37401b..48aa74b5 100644 --- a/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo +++ b/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo @@ -34,8 +34,7 @@ model HybridHeatPumpSystem transformation(extent={{100,10},{120,28}}))); Components.BoilerInHybridSystem boiInHybSys(final TBiv=TBiv, final TCutOff= - TCutOff) - "Check whether the boiler can turn on" + TCutOff) "Check whether the boiler can turn on" annotation (Placement(transformation(extent={{-30,-20},{-12,0}}))); BESMod.Systems.Hydraulical.Control.Components.ParallelValveController priOrSecDevValCtrl diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo index 4e0d7b50..86047125 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo @@ -307,8 +307,8 @@ partial model PartialTwoStorageParallel "Partial model to later extent" QHRStoBufPre_flow.Q_flow) if parStoBuf.use_hr annotation (Placement(transformation(extent={{-100,-180},{-80,-160}}))); - AixLib.Fluid.Interfaces.PassThroughMedium pasThrNoDHW(redeclare package Medium - = Medium, allowFlowReversal=allowFlowReversal) if not use_dhw + AixLib.Fluid.Interfaces.PassThroughMedium pasThrNoDHW(redeclare package Medium = + Medium, allowFlowReversal=allowFlowReversal) if not use_dhw "Pass through if DHW is disabled" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, diff --git a/BESMod/Systems/UserProfiles/TEASERPeopleWithAbsoluteMachineGains.mo b/BESMod/Systems/UserProfiles/TEASERPeopleWithAbsoluteMachineGains.mo deleted file mode 100644 index 6f63f9ed..00000000 --- a/BESMod/Systems/UserProfiles/TEASERPeopleWithAbsoluteMachineGains.mo +++ /dev/null @@ -1,70 +0,0 @@ -within BESMod.Systems.UserProfiles; -model TEASERPeopleWithAbsoluteMachineGains - "Combination of absolute electrical gains and specific people as in TEASER" - extends BaseClasses.PartialUserProfiles; - parameter String fileNameIntGains=Modelica.Utilities.Files.loadResource("modelica://BESMod/Resources/InternalGains.txt") - "File where matrix is stored"; - parameter String fileNameAbsGai=Modelica.Utilities.Files.loadResource("modelica://BESMod/Resources/InternalGains.txt") - "File where matrix is stored"; - - Modelica.Blocks.Sources.CombiTimeTable tabIntGai( - final tableOnFile=true, - final extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, - final tableName="Internals", - final fileName=fileNameIntGains, - columns=2:4) "Profiles for internal gains" annotation (Placement( - transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={-10,30}))); - - Modelica.Blocks.Math.Gain gainIntGai[3](k={1,0,0}) - "Gain for internal gains" - annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={30,30}))); - - Modelica.Blocks.Sources.Constant conTSetZone[nZones](k=TSetZone_nominal) - "Constant room set temperature" annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={-10,-50}))); - Modelica.Blocks.Sources.CombiTimeTable tabGaiLigMach( - final tableOnFile=true, - final extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic, - final tableName="MachinesAndLight", - final fileName=fileNameIntGains, - columns={2}) "Profiles for internal gains of machines and lights in W" - annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={-10,-10}))); -equation - connect(tabIntGai.y, gainIntGai.u) - annotation (Line(points={{1,30},{18,30}}, color={0,0,127})); - connect(gainIntGai.y, useProBus.intGains) annotation (Line(points={{41,30},{ - 74,30},{74,-1},{115,-1}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(conTSetZone.y, useProBus.TZoneSet) annotation (Line(points={{1,-50},{ - 115,-50},{115,-1}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(tabGaiLigMach.y[1], useProBus.absIntGaiCon) annotation (Line(points={{1, - -10},{74,-10},{74,-1},{115,-1}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(tabGaiLigMach.y[2], useProBus.absIntGaiRad) annotation (Line(points={{1,-10}, - {74,-10},{74,-1},{115,-1}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); -end TEASERPeopleWithAbsoluteMachineGains; diff --git a/BESMod/Systems/UserProfiles/TEASERProfiles.mo b/BESMod/Systems/UserProfiles/TEASERProfiles.mo index 6a96eee9..7aa3a1e4 100644 --- a/BESMod/Systems/UserProfiles/TEASERProfiles.mo +++ b/BESMod/Systems/UserProfiles/TEASERProfiles.mo @@ -28,11 +28,6 @@ model TEASERProfiles "Standard TEASER Profiles" extent={{10,10},{-10,-10}}, rotation=180, origin={-10,-50}))); - Modelica.Blocks.Sources.Constant constZero[nZones](each final k=0) - "Constant zero for absolute gains" annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={-10,-12}))); equation connect(tabIntGai.y, gainIntGai.u) annotation (Line(points={{1,30},{18,30}}, color={0,0,127})); @@ -48,16 +43,4 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(constZero.y, useProBus.absIntGaiRad) annotation (Line(points={{1,-12},{74, - -12},{74,-1},{115,-1}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(constZero.y, useProBus.absIntGaiCon) annotation (Line(points={{1,-12},{ - 74,-12},{74,-1},{115,-1}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); end TEASERProfiles; diff --git a/BESMod/Systems/UserProfiles/package.order b/BESMod/Systems/UserProfiles/package.order index 0973db42..99549144 100644 --- a/BESMod/Systems/UserProfiles/package.order +++ b/BESMod/Systems/UserProfiles/package.order @@ -1,6 +1,5 @@ AixLibHighOrderProfiles Case600Profiles TEASERProfiles -TEASERPeopleWithAbsoluteMachineGains BaseClasses Tests From 8971aeac4da096b0f74e0bdcccfca641daa8b5fb Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 22 Aug 2023 08:21:55 +0200 Subject: [PATCH 087/131] fix bad initial value --- .../Hydraulical/Generation/BaseClasses/PartialHeatPump.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo index 9ee9cadb..e92160f2 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo @@ -90,7 +90,7 @@ model PartialHeatPump "Generation with only the heat pump" final pCon_start=p_start, final TCon_start=T_start, final pEva_start=Medium_eva.p_default, - final TEva_start=Medium_eva.T_default, + final TEva_start=TOda_nominal, final energyDynamics=energyDynamics, final show_TPort=show_T, redeclare model PerDataMainHP = PerDataMainHP, From f92381507ca59dcde373d93d990ac0ffb07823c7 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 22 Aug 2023 14:50:34 +0200 Subject: [PATCH 088/131] Add autosizing boiler --- BESMod/Examples/BAUSimStudy/PartialCase.mo | 6 +++++- .../Control/RecordsCollection/BasicBoilerPI.mo | 2 +- .../PartialTwoStorageParallelWithHeaters.mo | 15 ++++++++------- .../Distribution/Tests/TestDirectLoading.mo | 5 +++-- .../Distribution/Tests/TestIndirectLoading.mo | 5 +++-- .../Distribution/TwoStoragesBoilerWithDHW.mo | 5 +++-- .../BaseClasses/PartialHeatPumpAndGasBoiler.mo | 5 +++-- .../Systems/Hydraulical/Generation/GasBoiler.mo | 5 +++-- .../RecordsCollection/AutoparameterBoiler.mo | 12 ++++++++++++ .../Generation/RecordsCollection/package.order | 1 + 10 files changed, 42 insertions(+), 19 deletions(-) create mode 100644 BESMod/Systems/Hydraulical/Generation/RecordsCollection/AutoparameterBoiler.mo diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index 9e4d10ec..bce775a3 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -16,6 +16,7 @@ partial model PartialCase BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/5000, dpCon_nominal=0, @@ -28,6 +29,7 @@ partial model PartialCase redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare @@ -57,7 +59,7 @@ partial model PartialCase redeclare BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading distribution( - QHRAftBuf_flow_nominal=0, + QHeaAftBuf_flow_nominal=0, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, @@ -84,8 +86,10 @@ partial model PartialCase BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData transferDataBaseDefinition, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), + redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicBoilerPI.mo b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicBoilerPI.mo index 754ed8f7..76912d1d 100644 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicBoilerPI.mo +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicBoilerPI.mo @@ -9,5 +9,5 @@ record BasicBoilerPI "Currently used PI values for a boiler" y_start=0, yOff=0, yMax=1, - yMin=0.2); + yMin=0.3); end BasicBoilerPI; diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo index 9493fda2..1f5dd0a0 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo @@ -3,9 +3,9 @@ partial model PartialTwoStorageParallelWithHeaters "Partial two storage model with heaters" extends BaseClasses.PartialTwoStorageParallel( final use_secHeaCoiDHWSto=false); - parameter Modelica.Units.SI.HeatFlowRate QHRAftBuf_flow_nominal=0 - "Nominal heat flow rate of heating rod after DHW storage" - annotation (Dialog(group="Component data", enable=heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod)); + parameter Modelica.Units.SI.HeatFlowRate QHeaAftBuf_flow_nominal=0 + "Nominal heat flow rate of heater after DHW storage" + annotation (Dialog(group="Component data", enable=heaAftBufTyp <> BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.No)); parameter BESMod.Systems.Hydraulical.Distribution.Types.HeaterType heaAftBufTyp=BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.No "Type of heater after the buffer storage" annotation(Dialog(group="Component choices")); @@ -24,8 +24,10 @@ partial model PartialTwoStorageParallelWithHeaters "Temperature based efficiency" annotation(Dialog(group="Component data", enable=heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler)); - replaceable parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition + replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.AutoparameterBoiler parBoi if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler + constrainedby AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition( + Q_nom=QHeaAftBuf_flow_nominal) "Parameters for Boiler" annotation(Placement(transformation(extent={{64,124},{80,140}})), choicesAllMatching=true, Dialog(group="Component data")); @@ -41,11 +43,10 @@ partial model PartialTwoStorageParallelWithHeaters final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, - final Q_flow_nominal=QHRAftBuf_flow_nominal, + final Q_flow_nominal=QHeaAftBuf_flow_nominal, final V=parHeaRodAftBuf.V_hr, final eta=parHeaRodAftBuf.eta_hr) if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod - annotation ( - Placement(transformation( + annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={50,90}))); diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo index 89c150f1..f0049d7a 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo @@ -3,7 +3,6 @@ model TestDirectLoading extends PartialTest(redeclare BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading distribution( - QHRAftBuf_flow_nominal=0, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, @@ -18,7 +17,9 @@ model TestDirectLoading parStoDHW(dTLoadingHC1=5), redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRodAftBuf)); + parHeaRodAftBuf, + QHeaAftBuf_flow_nominal= + 0)); extends Modelica.Icons.Example; Modelica.Blocks.Sources.Pulse pulse( period=100) annotation ( diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo index 0293d94d..c16b829b 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo @@ -3,7 +3,6 @@ model TestIndirectLoading extends PartialTest(redeclare BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading distribution( - QHRAftBuf_flow_nominal=0, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, @@ -19,7 +18,9 @@ model TestIndirectLoading redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR parHeaRodAftBuf, - dTLoaHCBuf=10)); + dTLoaHCBuf=10, + QHeaAftBuf_flow_nominal= + 0)); extends Modelica.Icons.Example; Modelica.Blocks.Sources.Pulse pulse( period=100) annotation ( diff --git a/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo index 59ba40bc..cc124c4d 100644 --- a/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo +++ b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo @@ -18,8 +18,9 @@ model TwoStoragesBoilerWithDHW 0.99] "Temperature based efficiency" annotation(Dialog(group="Component data")); - replaceable parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition - parBoi + replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.AutoparameterBoiler + parBoi constrainedby AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition( + Q_nom=Q_flow_nominal[1]) "Parameters for Boiler" annotation(Placement(transformation(extent={{44,124},{58,138}})), choicesAllMatching=true, Dialog(group="Component data")); diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo index ba61c17e..4e9e1f62 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo @@ -6,8 +6,9 @@ model PartialHeatPumpAndGasBoiler "Partial heat pump and boiler" 0.99] "Temperature based efficiency" annotation(Dialog(group="Component data")); - replaceable parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition - parBoi + replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.AutoparameterBoiler + parBoi constrainedby AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition( + Q_nom=parHeaPum.QSec_flow_nominal) "Parameters for Boiler" annotation(Placement(transformation(extent={{22,62},{38,78}})), choicesAllMatching=true, Dialog(group="Component data")); diff --git a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo index 090a3342..2acd6ebb 100644 --- a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo @@ -7,8 +7,9 @@ model GasBoiler "Just a gas boiler" 373.15,0.99] "Temperature based efficiency" annotation(Dialog(group="Component data")); - replaceable parameter AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition - parBoi + replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.AutoparameterBoiler + parBoi constrainedby AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition( + Q_nom=Q_flow_nominal[1]) "Parameters for Boiler" annotation(Placement(transformation(extent={{-58,44},{-42,60}})), choicesAllMatching=true, Dialog(group="Component data")); diff --git a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/AutoparameterBoiler.mo b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/AutoparameterBoiler.mo new file mode 100644 index 00000000..9c317c04 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/AutoparameterBoiler.mo @@ -0,0 +1,12 @@ +within BESMod.Systems.Hydraulical.Generation.RecordsCollection; +record AutoparameterBoiler "Boiler with automated sizing" + extends AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition( + name="Autoscaling based on Vitocal in AixLib", + volume= 2E-07 * Q_nom + 0.0041, + pressureDrop=-200983 * Q_nom + 1E+10, + Q_min=Q_nom * 0.3, + eta=[0.3,0.93; 1.0,0.93]); + annotation (Documentation(info=" +

All Vitodens boilers have the same Q_min of 30 % of Q_nom. A linear regression was used to estimate the pressure drop (R2=0,9315) and volume (R2=0,9751).

+")); +end AutoparameterBoiler; diff --git a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/package.order b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/package.order index 2b765aac..90a45fc0 100644 --- a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/package.order +++ b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/package.order @@ -5,3 +5,4 @@ DefaultSolarThermal HeatPumpBaseDataDefinition DefaultHP BivalentHeatPumpBaseDataDefinition +AutoparameterBoiler From 6d68cd3acab4ab0bd00ce09d549ad1e6da7f750c Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 22 Aug 2023 14:54:12 +0200 Subject: [PATCH 089/131] Add files again, rm parBoi declarations in most models --- BESMod/Examples/BAUSimStudy/PartialCase.mo | 6 - BESMod/Examples/GasBoilerBuildingOnly.mo | 1 - BESMod/Examples/HeatPumpAndBoiler.mo | 301 ++++++++++++++++++ .../HeatPumpAndBoiler/AachenSystem.mo | 13 + .../HeatPumpAndBoiler/AfterBufferWithDHW.mo | 56 ++++ .../AfterBufferWithoutDHW.mo | 50 +++ .../Examples/HeatPumpAndBoiler/BaseClasses.mo | 64 ++++ BESMod/Examples/HeatPumpAndBoiler/Parallel.mo | 47 +++ .../HeatPumpAndBoiler/ParametersToChange.mo | 19 ++ BESMod/Examples/HeatPumpAndBoiler/Serial.mo | 44 +++ BESMod/Examples/HeatPumpAndBoiler/package.mo | 11 + .../Examples/HeatPumpAndBoiler/package.order | 7 + .../PartialSolarThermalHPS.mo | 2 - .../Examples/UseCaseHighOrderModel/BES_HOM.mo | 3 - .../PartialModelicaConferenceUseCase.mo | 3 - .../Distribution/Tests/TestBoilerWithDHW.mo | 1 - .../Tests/HeatPumpAndGasBoilerParallel.mo | 1 - 17 files changed, 612 insertions(+), 17 deletions(-) create mode 100644 BESMod/Examples/HeatPumpAndBoiler.mo create mode 100644 BESMod/Examples/HeatPumpAndBoiler/AachenSystem.mo create mode 100644 BESMod/Examples/HeatPumpAndBoiler/AfterBufferWithDHW.mo create mode 100644 BESMod/Examples/HeatPumpAndBoiler/AfterBufferWithoutDHW.mo create mode 100644 BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo create mode 100644 BESMod/Examples/HeatPumpAndBoiler/Parallel.mo create mode 100644 BESMod/Examples/HeatPumpAndBoiler/ParametersToChange.mo create mode 100644 BESMod/Examples/HeatPumpAndBoiler/Serial.mo create mode 100644 BESMod/Examples/HeatPumpAndBoiler/package.mo create mode 100644 BESMod/Examples/HeatPumpAndBoiler/package.order diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index bce775a3..88175519 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -16,7 +16,6 @@ partial model PartialCase BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/5000, dpCon_nominal=0, @@ -29,7 +28,6 @@ partial model PartialCase redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", flowsheet="VIPhaseSeparatorFlowsheet"), redeclare @@ -46,10 +44,8 @@ partial model PartialCase dTHysDHW=10, redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, @@ -86,10 +82,8 @@ partial model PartialCase BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData transferDataBaseDefinition, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare Systems.Demand.DHW.DHW DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), diff --git a/BESMod/Examples/GasBoilerBuildingOnly.mo b/BESMod/Examples/GasBoilerBuildingOnly.mo index 2187ecca..425233e2 100644 --- a/BESMod/Examples/GasBoilerBuildingOnly.mo +++ b/BESMod/Examples/GasBoilerBuildingOnly.mo @@ -12,7 +12,6 @@ model GasBoilerBuildingOnly redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( redeclare BESMod.Systems.Hydraulical.Generation.GasBoiler generation( dTTra_nominal={10}, - redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, diff --git a/BESMod/Examples/HeatPumpAndBoiler.mo b/BESMod/Examples/HeatPumpAndBoiler.mo new file mode 100644 index 00000000..cd9581eb --- /dev/null +++ b/BESMod/Examples/HeatPumpAndBoiler.mo @@ -0,0 +1,301 @@ +within BESMod.Examples; +package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" + extends Modelica.Icons.ExamplesPackage; + + record ParametersToChange + extends Systems.RecordsCollection.ParameterStudy.ParameterStudyBaseDefinition; + // 1. Add parameters like this (WITH Evaluate=false)! + // parameter Modelica.SIunits.Volume V=0.5 annotation(Evaluate=false); + // 2. Overwrite the default parameter in the system simulation + // via the graphical interface, resulting in e.g. + // Distribution.parameters.V = parameterStudy.V + + parameter Modelica.Units.SI.Temperature TCutOff=263.15 "Cut off temperature" + annotation (Evaluate=false); + parameter Modelica.Units.SI.Temperature TBiv=268.15 "Bivalence temperature" + annotation (Evaluate=false); + parameter Real VPerQFlow=23.5 "Litre of storage volume per kilowatt thermal power demand" annotation(Evaluate=false); + parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff=3000 + annotation (Evaluate=false); + parameter Modelica.Units.SI.HeatFlowRate QHP_flow_biv=4000 + annotation (Evaluate=false); + end ParametersToChange; + + record AachenSystem + extends Systems.RecordsCollection.SystemParametersBaseDataDefinition( + use_elecHeating=false, + nZones=1, + filNamWea=Modelica.Utilities.Files.loadResource( + "modelica://BESMod/Resources/WeatherData/TRY2015_507931060546_Jahr_City_Aachen_Normal.mos"), + QBui_flow_nominal={10632.414942943078}, + use_ventilation=false, + THydSup_nominal={328.15}, + TOda_nominal=265.35); + + end AachenSystem; + + model Parallel + "Bivalent Heat Pump Systems with parallel heat generation" + extends BaseClasses.PartialHybridSystem( + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerParallel + generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, + dpCon_nominal=0, + dpEva_nominal=0, + use_refIne=false, + refIneFre_constant=0), + redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet"), + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal), + redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel + distribution( + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + parStoDHW(dTLoadingHC1=10), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal))); + + extends Modelica.Icons.Example; + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); + end Parallel; + + model Serial "Bivalent Heat Pump Systems with serial heat generation" + extends BaseClasses.PartialHybridSystem( + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerSerial + generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, + dpCon_nominal=0, + dpEva_nominal=0, + use_refIne=false, + refIneFre_constant=0), + redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet"), + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen), + redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel + distribution( + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + parStoDHW(dTLoadingHC1=10), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal))); + + extends Modelica.Icons.Example; + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); + end Serial; + + model AfterBufferWithDHW + "Bivalent Heat Pump System with boiler integration after buffer tank without DHW support" + extends BaseClasses.PartialHybridSystem( + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Generation.HeatPump + generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, + dpCon_nominal=0, + dpEva_nominal=0, + use_refIne=false, + refIneFre_constant=0), + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet"), + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen), + control(boiInGeneration=false), + redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithDHW + distribution( + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen, + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow), + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parStoDHW(dTLoadingHC1=10), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal, + dTBoiDHWLoa=10, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayValBoi, + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parHydSep, + redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi))); + + extends Modelica.Icons.Example; + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); + end AfterBufferWithDHW; + + model AfterBufferWithoutDHW + "Bivalent Heat Pump System with boiler integration after buffer tank without DHW support" + extends BaseClasses.PartialHybridSystem( + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Generation.HeatPump + generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, + dpCon_nominal=0, + dpEva_nominal=0, + use_refIne=false, + refIneFre_constant=0), + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet"), + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen), + control(boiInGeneration=false), + redeclare Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading + distribution( + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen, + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow), + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parStoDHW(dTLoadingHC1=10), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal, + heaAftBufTyp=BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler, + redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi))); + + extends Modelica.Icons.Example; + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); + end AfterBufferWithoutDHW; + + package BaseClasses "Contains partial example case" + extends Modelica.Icons.BasesPackage; + partial model PartialHybridSystem "Partial bivalent heat pump system" + extends Systems.BaseClasses.PartialBuildingEnergySystem( + redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, + redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare + BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( + heaLoadFacGrd=0, heaLoadFacOut=0)), + redeclare BESMod.Systems.Control.NoControl control, + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Control.HybridHeatPumpSystem control( + redeclare + BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled + valCtrl, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition + parTheVal, + dTHysBui=5, + dTHysDHW=5, + meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature, + redeclare model DHWHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare model BuildingHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare model DHWSetTemperature = + BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI + parPIDHeaPum, + TBiv=parameterStudy.TBiv, + boiInGeneration=true, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl + safetyControl, + TCutOff=parameterStudy.TCutOff, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicBoilerPI + parPIDBoi), + redeclare final Systems.Hydraulical.Transfer.IdealValveRadiator transfer( + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + radParameters, redeclare + BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), + redeclare Systems.Demand.DHW.DHW DHW( + redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic + calcmFlow), + redeclare Systems.UserProfiles.TEASERProfiles userProfiles, + redeclare UseCaseDesignOptimization.AachenSystem systemParameters( + use_ventilation=true), + redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy, + redeclare final package MediumDHW = AixLib.Media.Water, + redeclare final package MediumZone = AixLib.Media.Air, + redeclare final package MediumHyd = AixLib.Media.Water, + redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); + end PartialHybridSystem; + end BaseClasses; +end HeatPumpAndBoiler; diff --git a/BESMod/Examples/HeatPumpAndBoiler/AachenSystem.mo b/BESMod/Examples/HeatPumpAndBoiler/AachenSystem.mo new file mode 100644 index 00000000..f7a738b2 --- /dev/null +++ b/BESMod/Examples/HeatPumpAndBoiler/AachenSystem.mo @@ -0,0 +1,13 @@ +within BESMod.Examples.HeatPumpAndBoiler; +record AachenSystem + extends Systems.RecordsCollection.SystemParametersBaseDataDefinition( + use_elecHeating=false, + nZones=1, + filNamWea=Modelica.Utilities.Files.loadResource( + "modelica://BESMod/Resources/WeatherData/TRY2015_507931060546_Jahr_City_Aachen_Normal.mos"), + QBui_flow_nominal={10632.414942943078}, + use_ventilation=false, + THydSup_nominal={328.15}, + TOda_nominal=265.35); + +end AachenSystem; diff --git a/BESMod/Examples/HeatPumpAndBoiler/AfterBufferWithDHW.mo b/BESMod/Examples/HeatPumpAndBoiler/AfterBufferWithDHW.mo new file mode 100644 index 00000000..10fc8415 --- /dev/null +++ b/BESMod/Examples/HeatPumpAndBoiler/AfterBufferWithDHW.mo @@ -0,0 +1,56 @@ +within BESMod.Examples.HeatPumpAndBoiler; +model AfterBufferWithDHW + "Bivalent Heat Pump System with boiler integration after buffer tank without DHW support" + extends BaseClasses.PartialHybridSystem( + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Generation.HeatPump + generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, + dpCon_nominal=0, + dpEva_nominal=0, + use_refIne=false, + refIneFre_constant=0), + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet"), + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen), + control(boiInGeneration=false), + redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithDHW + distribution( + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen, + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow), + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parStoDHW(dTLoadingHC1=10), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal, + dTBoiDHWLoa=10, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayValBoi, + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parHydSep))); + + extends Modelica.Icons.Example; + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); +end AfterBufferWithDHW; diff --git a/BESMod/Examples/HeatPumpAndBoiler/AfterBufferWithoutDHW.mo b/BESMod/Examples/HeatPumpAndBoiler/AfterBufferWithoutDHW.mo new file mode 100644 index 00000000..14584d0c --- /dev/null +++ b/BESMod/Examples/HeatPumpAndBoiler/AfterBufferWithoutDHW.mo @@ -0,0 +1,50 @@ +within BESMod.Examples.HeatPumpAndBoiler; +model AfterBufferWithoutDHW + "Bivalent Heat Pump System with boiler integration after buffer tank without DHW support" + extends BaseClasses.PartialHybridSystem( + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Generation.HeatPump + generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, + dpCon_nominal=0, + dpEva_nominal=0, + use_refIne=false, + refIneFre_constant=0), + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet"), + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen), + control(boiInGeneration=false), + redeclare Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading + distribution( + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen, + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow), + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage + parStoDHW(dTLoadingHC1=10), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal, + heaAftBufTyp=BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler))); + + extends Modelica.Icons.Example; + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); +end AfterBufferWithoutDHW; diff --git a/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo b/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo new file mode 100644 index 00000000..1fbef864 --- /dev/null +++ b/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo @@ -0,0 +1,64 @@ +within BESMod.Examples.HeatPumpAndBoiler; +package BaseClasses "Contains partial example case" + extends Modelica.Icons.BasesPackage; + partial model PartialHybridSystem "Partial bivalent heat pump system" + extends Systems.BaseClasses.PartialBuildingEnergySystem( + redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, + redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare + BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( + heaLoadFacGrd=0, heaLoadFacOut=0)), + redeclare BESMod.Systems.Control.NoControl control, + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Control.HybridHeatPumpSystem control( + redeclare + BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled + valCtrl, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition + parTheVal, + dTHysBui=5, + dTHysDHW=5, + meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature, + redeclare model DHWHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare model BuildingHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare model DHWSetTemperature = + BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI + parPIDHeaPum, + TBiv=parameterStudy.TBiv, + boiInGeneration=true, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl + safetyControl, + TCutOff=parameterStudy.TCutOff, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicBoilerPI + parPIDBoi), + redeclare final Systems.Hydraulical.Transfer.IdealValveRadiator transfer( + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + radParameters, redeclare + BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), + redeclare Systems.Demand.DHW.DHW DHW( + redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic + calcmFlow), + redeclare Systems.UserProfiles.TEASERProfiles userProfiles, + redeclare UseCaseDesignOptimization.AachenSystem systemParameters( + use_ventilation=true), + redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy, + redeclare final package MediumDHW = AixLib.Media.Water, + redeclare final package MediumZone = AixLib.Media.Air, + redeclare final package MediumHyd = AixLib.Media.Water, + redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); + end PartialHybridSystem; +end BaseClasses; diff --git a/BESMod/Examples/HeatPumpAndBoiler/Parallel.mo b/BESMod/Examples/HeatPumpAndBoiler/Parallel.mo new file mode 100644 index 00000000..91ec1f21 --- /dev/null +++ b/BESMod/Examples/HeatPumpAndBoiler/Parallel.mo @@ -0,0 +1,47 @@ +within BESMod.Examples.HeatPumpAndBoiler; +model Parallel + "Bivalent Heat Pump Systems with parallel heat generation" + extends BaseClasses.PartialHybridSystem( + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerParallel + generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, + dpCon_nominal=0, + dpEva_nominal=0, + use_refIne=false, + refIneFre_constant=0), + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet"), + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen, + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal), + redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel + distribution( + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + parStoDHW(dTLoadingHC1=10), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal))); + + extends Modelica.Icons.Example; + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); +end Parallel; diff --git a/BESMod/Examples/HeatPumpAndBoiler/ParametersToChange.mo b/BESMod/Examples/HeatPumpAndBoiler/ParametersToChange.mo new file mode 100644 index 00000000..a0cef995 --- /dev/null +++ b/BESMod/Examples/HeatPumpAndBoiler/ParametersToChange.mo @@ -0,0 +1,19 @@ +within BESMod.Examples.HeatPumpAndBoiler; +record ParametersToChange + extends Systems.RecordsCollection.ParameterStudy.ParameterStudyBaseDefinition; + // 1. Add parameters like this (WITH Evaluate=false)! + // parameter Modelica.SIunits.Volume V=0.5 annotation(Evaluate=false); + // 2. Overwrite the default parameter in the system simulation + // via the graphical interface, resulting in e.g. + // Distribution.parameters.V = parameterStudy.V + + parameter Modelica.Units.SI.Temperature TCutOff=263.15 "Cut off temperature" + annotation (Evaluate=false); + parameter Modelica.Units.SI.Temperature TBiv=268.15 "Bivalence temperature" + annotation (Evaluate=false); + parameter Real VPerQFlow=23.5 "Litre of storage volume per kilowatt thermal power demand" annotation(Evaluate=false); + parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff=3000 + annotation (Evaluate=false); + parameter Modelica.Units.SI.HeatFlowRate QHP_flow_biv=4000 + annotation (Evaluate=false); +end ParametersToChange; diff --git a/BESMod/Examples/HeatPumpAndBoiler/Serial.mo b/BESMod/Examples/HeatPumpAndBoiler/Serial.mo new file mode 100644 index 00000000..da96a168 --- /dev/null +++ b/BESMod/Examples/HeatPumpAndBoiler/Serial.mo @@ -0,0 +1,44 @@ +within BESMod.Examples.HeatPumpAndBoiler; +model Serial "Bivalent Heat Pump Systems with serial heat generation" + extends BaseClasses.PartialHybridSystem( + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerSerial + generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, + dpCon_nominal=0, + dpEva_nominal=0, + use_refIne=false, + refIneFre_constant=0), + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet"), + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen), + redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel + distribution( + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), + redeclare + BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage + parStoDHW(dTLoadingHC1=10), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve + parThrWayVal))); + + extends Modelica.Icons.Example; + + annotation (experiment( + StopTime=31536000, + Interval=600, + __Dymola_Algorithm="Dassl")); +end Serial; diff --git a/BESMod/Examples/HeatPumpAndBoiler/package.mo b/BESMod/Examples/HeatPumpAndBoiler/package.mo new file mode 100644 index 00000000..17620eca --- /dev/null +++ b/BESMod/Examples/HeatPumpAndBoiler/package.mo @@ -0,0 +1,11 @@ +within BESMod.Examples; +package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" + extends Modelica.Icons.ExamplesPackage; + + + + + + + +end HeatPumpAndBoiler; diff --git a/BESMod/Examples/HeatPumpAndBoiler/package.order b/BESMod/Examples/HeatPumpAndBoiler/package.order new file mode 100644 index 00000000..a6bcf1f6 --- /dev/null +++ b/BESMod/Examples/HeatPumpAndBoiler/package.order @@ -0,0 +1,7 @@ +ParametersToChange +AachenSystem +Parallel +Serial +AfterBufferWithDHW +AfterBufferWithoutDHW +BaseClasses diff --git a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo index 25c80600..67cf18a6 100644 --- a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo +++ b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo @@ -22,10 +22,8 @@ partial model PartialSolarThermalHPS parTheVal, redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, diff --git a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo index 0e6de4f5..c533e3fe 100644 --- a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo +++ b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo @@ -24,7 +24,6 @@ model BES_HOM BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ parameterStudy.QHP_flow_biv, @@ -50,10 +49,8 @@ model BES_HOM valCtrl, redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 7b2706b8..68fffa09 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -54,13 +54,10 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, supCtrDHWTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal, - redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestBoilerWithDHW.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestBoilerWithDHW.mo index b554a9cd..0cd27a12 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestBoilerWithDHW.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestBoilerWithDHW.mo @@ -16,7 +16,6 @@ model TestBoilerWithDHW "Test two storages boiler with DHW" BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage parStoDHW, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parThrWayValBoi)); extends Modelica.Icons.Example; diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndGasBoilerParallel.mo b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndGasBoilerParallel.mo index a15b1f45..e77b0f35 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndGasBoilerParallel.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndGasBoilerParallel.mo @@ -14,7 +14,6 @@ model HeatPumpAndGasBoilerParallel parPum, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, - redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parThrWayVal)); extends Modelica.Icons.Example; From e0a9d93c3626a6d0d79476d0b63afb6ae4f610db Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 22 Aug 2023 15:06:30 +0200 Subject: [PATCH 090/131] fix min constraint for regression --- BESMod/Examples/HeatPumpAndBoiler.mo | 301 ------------------ .../PartialTwoStorageParallelWithHeaters.mo | 2 +- .../Distribution/TwoStoragesBoilerWithDHW.mo | 2 +- .../PartialHeatPumpAndGasBoiler.mo | 2 +- .../Hydraulical/Generation/GasBoiler.mo | 2 +- 5 files changed, 4 insertions(+), 305 deletions(-) delete mode 100644 BESMod/Examples/HeatPumpAndBoiler.mo diff --git a/BESMod/Examples/HeatPumpAndBoiler.mo b/BESMod/Examples/HeatPumpAndBoiler.mo deleted file mode 100644 index cd9581eb..00000000 --- a/BESMod/Examples/HeatPumpAndBoiler.mo +++ /dev/null @@ -1,301 +0,0 @@ -within BESMod.Examples; -package HeatPumpAndBoiler "Bivalent Heat Pump System with Gas Boiler" - extends Modelica.Icons.ExamplesPackage; - - record ParametersToChange - extends Systems.RecordsCollection.ParameterStudy.ParameterStudyBaseDefinition; - // 1. Add parameters like this (WITH Evaluate=false)! - // parameter Modelica.SIunits.Volume V=0.5 annotation(Evaluate=false); - // 2. Overwrite the default parameter in the system simulation - // via the graphical interface, resulting in e.g. - // Distribution.parameters.V = parameterStudy.V - - parameter Modelica.Units.SI.Temperature TCutOff=263.15 "Cut off temperature" - annotation (Evaluate=false); - parameter Modelica.Units.SI.Temperature TBiv=268.15 "Bivalence temperature" - annotation (Evaluate=false); - parameter Real VPerQFlow=23.5 "Litre of storage volume per kilowatt thermal power demand" annotation(Evaluate=false); - parameter Modelica.Units.SI.HeatFlowRate QHP_flow_cutOff=3000 - annotation (Evaluate=false); - parameter Modelica.Units.SI.HeatFlowRate QHP_flow_biv=4000 - annotation (Evaluate=false); - end ParametersToChange; - - record AachenSystem - extends Systems.RecordsCollection.SystemParametersBaseDataDefinition( - use_elecHeating=false, - nZones=1, - filNamWea=Modelica.Utilities.Files.loadResource( - "modelica://BESMod/Resources/WeatherData/TRY2015_507931060546_Jahr_City_Aachen_Normal.mos"), - QBui_flow_nominal={10632.414942943078}, - use_ventilation=false, - THydSup_nominal={328.15}, - TOda_nominal=265.35); - - end AachenSystem; - - model Parallel - "Bivalent Heat Pump Systems with parallel heat generation" - extends BaseClasses.PartialHybridSystem( - redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerParallel - generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - parHeaPum( - genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ - parameterStudy.QHP_flow_biv, - dpCon_nominal=0, - dpEva_nominal=0, - use_refIne=false, - refIneFre_constant=0), - redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, - redeclare model PerDataMainHP = - AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", - flowsheet="VIPhaseSeparatorFlowsheet"), - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen, - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal), - redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel - distribution( - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - parStoDHW(dTLoadingHC1=10), - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal))); - - extends Modelica.Icons.Example; - - annotation (experiment( - StopTime=31536000, - Interval=600, - __Dymola_Algorithm="Dassl")); - end Parallel; - - model Serial "Bivalent Heat Pump Systems with serial heat generation" - extends BaseClasses.PartialHybridSystem( - redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.HeatPumpAndGasBoilerSerial - generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - parHeaPum( - genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ - parameterStudy.QHP_flow_biv, - dpCon_nominal=0, - dpEva_nominal=0, - use_refIne=false, - refIneFre_constant=0), - redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi, - redeclare model PerDataMainHP = - AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", - flowsheet="VIPhaseSeparatorFlowsheet"), - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen), - redeclare Systems.Hydraulical.Distribution.DistributionTwoStorageParallel - distribution( - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0), - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage - parStoDHW(dTLoadingHC1=10), - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal))); - - extends Modelica.Icons.Example; - - annotation (experiment( - StopTime=31536000, - Interval=600, - __Dymola_Algorithm="Dassl")); - end Serial; - - model AfterBufferWithDHW - "Bivalent Heat Pump System with boiler integration after buffer tank without DHW support" - extends BaseClasses.PartialHybridSystem( - redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.HeatPump - generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - parHeaPum( - genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ - parameterStudy.QHP_flow_biv, - dpCon_nominal=0, - dpEva_nominal=0, - use_refIne=false, - refIneFre_constant=0), - redeclare model PerDataMainHP = - AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", - flowsheet="VIPhaseSeparatorFlowsheet"), - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen), - control(boiInGeneration=false), - redeclare Systems.Hydraulical.Distribution.TwoStoragesBoilerWithDHW - distribution( - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen, - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow), - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - parStoDHW(dTLoadingHC1=10), - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal, - dTBoiDHWLoa=10, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayValBoi, - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - parHydSep, - redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi))); - - extends Modelica.Icons.Example; - - annotation (experiment( - StopTime=31536000, - Interval=600, - __Dymola_Algorithm="Dassl")); - end AfterBufferWithDHW; - - model AfterBufferWithoutDHW - "Bivalent Heat Pump System with boiler integration after buffer tank without DHW support" - extends BaseClasses.PartialHybridSystem( - redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.HeatPump - generation( - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - parHeaPum( - genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, - scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ - parameterStudy.QHP_flow_biv, - dpCon_nominal=0, - dpEva_nominal=0, - use_refIne=false, - refIneFre_constant=0), - redeclare model PerDataMainHP = - AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( - QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, - refrigerant="Propane", - flowsheet="VIPhaseSeparatorFlowsheet"), - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen), - control(boiInGeneration=false), - redeclare Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading - distribution( - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen, - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - parStoBuf(VPerQ_flow=parameterStudy.VPerQFlow), - redeclare - BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage - parStoDHW(dTLoadingHC1=10), - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve - parThrWayVal, - heaAftBufTyp=BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler, - redeclare AixLib.DataBase.Boiler.General.Boiler_Vitogas200F_11kW parBoi))); - - extends Modelica.Icons.Example; - - annotation (experiment( - StopTime=31536000, - Interval=600, - __Dymola_Algorithm="Dassl")); - end AfterBufferWithoutDHW; - - package BaseClasses "Contains partial example case" - extends Modelica.Icons.BasesPackage; - partial model PartialHybridSystem "Partial bivalent heat pump system" - extends Systems.BaseClasses.PartialBuildingEnergySystem( - redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, - redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare - BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( - heaLoadFacGrd=0, heaLoadFacOut=0)), - redeclare BESMod.Systems.Control.NoControl control, - redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Control.HybridHeatPumpSystem control( - redeclare - BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled - valCtrl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - parTheVal, - dTHysBui=5, - dTHysDHW=5, - meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature, - redeclare model DHWHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare model BuildingHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare model DHWSetTemperature = - BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI - parPIDHeaPum, - TBiv=parameterStudy.TBiv, - boiInGeneration=true, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl - safetyControl, - TCutOff=parameterStudy.TCutOff, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicBoilerPI - parPIDBoi), - redeclare final Systems.Hydraulical.Transfer.IdealValveRadiator transfer( - redeclare - BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare Systems.Demand.DHW.DHW DHW( - redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic - calcmFlow), - redeclare Systems.UserProfiles.TEASERProfiles userProfiles, - redeclare UseCaseDesignOptimization.AachenSystem systemParameters( - use_ventilation=true), - redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy, - redeclare final package MediumDHW = AixLib.Media.Water, - redeclare final package MediumZone = AixLib.Media.Air, - redeclare final package MediumHyd = AixLib.Media.Water, - redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); - - annotation (experiment( - StopTime=31536000, - Interval=600, - __Dymola_Algorithm="Dassl")); - end PartialHybridSystem; - end BaseClasses; -end HeatPumpAndBoiler; diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo index 1f5dd0a0..d7ea3cf2 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo @@ -27,7 +27,7 @@ partial model PartialTwoStorageParallelWithHeaters replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.AutoparameterBoiler parBoi if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.Boiler constrainedby AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition( - Q_nom=QHeaAftBuf_flow_nominal) + Q_nom=max(11000, QHeaAftBuf_flow_nominal)) "Parameters for Boiler" annotation(Placement(transformation(extent={{64,124},{80,140}})), choicesAllMatching=true, Dialog(group="Component data")); diff --git a/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo index cc124c4d..43bc3cb0 100644 --- a/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo +++ b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo @@ -20,7 +20,7 @@ model TwoStoragesBoilerWithDHW replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.AutoparameterBoiler parBoi constrainedby AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition( - Q_nom=Q_flow_nominal[1]) + Q_nom=max(11000, Q_flow_nominal[1])) "Parameters for Boiler" annotation(Placement(transformation(extent={{44,124},{58,138}})), choicesAllMatching=true, Dialog(group="Component data")); diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo index 4e9e1f62..6850acb4 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPumpAndGasBoiler.mo @@ -8,7 +8,7 @@ model PartialHeatPumpAndGasBoiler "Partial heat pump and boiler" replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.AutoparameterBoiler parBoi constrainedby AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition( - Q_nom=parHeaPum.QSec_flow_nominal) + Q_nom=max(11000, parHeaPum.QSec_flow_nominal)) "Parameters for Boiler" annotation(Placement(transformation(extent={{22,62},{38,78}})), choicesAllMatching=true, Dialog(group="Component data")); diff --git a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo index 2acd6ebb..47f2743c 100644 --- a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo @@ -9,7 +9,7 @@ model GasBoiler "Just a gas boiler" replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.AutoparameterBoiler parBoi constrainedby AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition( - Q_nom=Q_flow_nominal[1]) + Q_nom=max(11000, Q_flow_nominal[1])) "Parameters for Boiler" annotation(Placement(transformation(extent={{-58,44},{-42,60}})), choicesAllMatching=true, Dialog(group="Component data")); From 2e2f28a3b1c0441b2735834afed56ed3854f53af Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sun, 27 Aug 2023 19:08:08 +0200 Subject: [PATCH 091/131] rename DHWCalc parameter --- BESMod/Systems/Demand/DHW/DHW.mo | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/BESMod/Systems/Demand/DHW/DHW.mo b/BESMod/Systems/Demand/DHW/DHW.mo index 88ba57ec..17841905 100644 --- a/BESMod/Systems/Demand/DHW/DHW.mo +++ b/BESMod/Systems/Demand/DHW/DHW.mo @@ -5,7 +5,7 @@ model DHW "Standard DHW subsystem" tCrit=DHWProfile.tCrit, TDHWCold_nominal=283.15, TDHW_nominal=323.15, - VDHWDay=if use_dhwCalc then V_dhwCalc_day else DHWProfile.VDHWDay, + VDHWDay=if use_dhwCalc then VDHWCalcDay else DHWProfile.VDHWDay, mDHW_flow_nominal=DHWProfile.m_flow_nominal); replaceable parameter Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile constrainedby Systems.Demand.DHW.RecordsCollection.PartialDHWTap annotation (choicesAllMatching=true, Dialog( @@ -18,8 +18,9 @@ model DHW "Standard DHW subsystem" "modelica://BESMod/Resources/DHWCalc.txt") "File where matrix is stored for DHWCalc" annotation (Dialog(enable=use_dhwCalc and use_dhw)); - parameter Modelica.Units.SI.Volume V_dhwCalc_day=0 - "Average daily tapping volume in DHWCalc table" annotation (Dialog(enable=use_dhwCalc)); + parameter Modelica.Units.SI.Volume VDHWCalcDay=0 + "Average daily tapping volume in DHWCalc table" annotation (Dialog(enable= + use_dhwCalc)); replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition From 743d2b343d4a8926d2aebd65389320dbe423ad17 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 28 Aug 2023 14:34:54 +0200 Subject: [PATCH 092/131] Add summer mode and custom primary generator control --- .../PartialHeatPumpSystemController.mo | 16 +-- .../Components/BuildingAndDHWControl.mo | 120 +++++++++++++----- .../Components/SummerTimeConstraint.mo | 19 +++ .../Control/Components/package.order | 1 + .../Control/HybridHeatPumpSystem.mo | 3 + .../Control/MonoenergeticHeatPumpSystem.mo | 3 + 6 files changed, 125 insertions(+), 37 deletions(-) create mode 100644 BESMod/Systems/Hydraulical/Control/Components/SummerTimeConstraint.mo diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo index e68fc746..39f307a8 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo @@ -153,16 +153,18 @@ partial model PartialHeatPumpSystemController equation - connect(safCtr.modeSet, heaPumHea.y) annotation (Line(points={{198.667,68},{186, - 68},{186,90},{181,90}}, color={255,0,255})); - connect(safCtr.nOut, sigBusGen.yHeaPumSet) annotation (Line(points={{220.833,72}, - {254,72},{254,-118},{-152,-118},{-152,-99}}, color={0,0,127}), Text( + connect(safCtr.modeSet, heaPumHea.y) annotation (Line(points={{198.667,68},{ + 186,68},{186,90},{181,90}}, + color={255,0,255})); + connect(safCtr.nOut, sigBusGen.yHeaPumSet) annotation (Line(points={{220.833, + 72},{254,72},{254,-118},{-152,-118},{-152,-99}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(priGenPIDCtrl.ySet, safCtr.nSet) annotation (Line(points={{118.8,90},{ - 154,90},{154,76},{190,76},{190,72},{198.667,72}}, + connect(priGenPIDCtrl.ySet, safCtr.nSet) annotation (Line(points={{118.8,90}, + {154,90},{154,76},{190,76},{190,72},{198.667,72}}, color={0,0,127})); connect(priGenPIDCtrl.isOn, sigBusGen.heaPumIsOn) annotation (Line(points={{105.2, @@ -232,8 +234,6 @@ equation connect(buiAndDHWCtr.secGen, anyGenDevIsOn.u[1]) annotation (Line(points={{-118, 37.5},{-118,36},{-112,36},{-112,6},{-151.75,6},{-151.75,0}}, color={255,0,255})); - connect(priGenPIDCtrl.setOn, buiAndDHWCtr.priGren) annotation (Line(points={{100.4, - 90},{96,90},{96,40},{-80,40},{-80,27.5},{-118,27.5}}, color={255,0,255})); connect(setAndMeaSelPri.DHW, buiAndDHWCtr.DHW) annotation (Line(points={{39,76}, {28,76},{28,74},{-106,74},{-106,68},{-118,68}}, color={0,0,127})); connect(buiAndDHWCtr.TDHWSet, setAndMeaSelPri.TDHWSet) annotation (Line(points={ diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo index 6dca3f64..75816917 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo @@ -37,6 +37,7 @@ model BuildingAndDHWControl constrainedby BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control "DHW set temperture module" annotation (choicesAllMatching=true); + parameter Modelica.Units.SI.Temperature THeaTrh = 273.15+15 "Heating threshold for summer mode"; DHWHysteresis hysDHW @@ -58,7 +59,7 @@ model BuildingAndDHWControl annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={170,-70}))); + origin={250,-90}))); Modelica.Blocks.MathBoolean.Or orDHW(nu=3) "If any is true, dhw is activated" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -80,7 +81,7 @@ model BuildingAndDHWControl transformation( extent={{10,-10},{-10,10}}, rotation=180, - origin={130,-34}))); + origin={210,-50}))); Interfaces.DistributionControlBus sigBusDistr "Necessary to control DHW temperatures" annotation (Placement(transformation(extent={{-110,60},{-90,80}}))); @@ -95,7 +96,7 @@ model BuildingAndDHWControl transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={130,-90}))); + origin={210,-110}))); Modelica.Blocks.Interfaces.BooleanOutput secGen "=true to activate secondary generator" annotation (Placement(transformation(extent={{300,-80},{320,-60}}))); @@ -138,14 +139,37 @@ model BuildingAndDHWControl Modelica.Blocks.Interfaces.RealOutput TBuiSet(unit="K", displayUnit="degC") "Building supply set temperature" annotation (Placement(transformation(extent={{300,10},{320,30}}))); + Modelica.Blocks.Logical.Timer timer + annotation (Placement(transformation(extent={{28,-30},{48,-10}}))); + SummerTimeConstraint notSumMod "=false if summer mode is present" + annotation (Placement(transformation(extent={{60,-30},{80,-10}}))); + Modelica.Blocks.Logical.LogicalSwitch logSwiDHW "Logical switch" + annotation (Placement(transformation(extent={{240,10},{260,30}}))); + Modelica.Blocks.Logical.Hysteresis hysSum( + uLow=THeaTrh - 0.1, + final uHigh=THeaTrh + 0.1, + final pre_y_start=false) "Summer mode" + annotation (Placement(transformation(extent={{-32,-30},{-12,-10}}))); + Modelica.Blocks.Logical.Not not1 "Not" + annotation (Placement(transformation(extent={{0,-30},{20,-10}}))); + Modelica.Blocks.Sources.BooleanConstant conSumMod(final k=true) + "Constant summer mode" + annotation (Placement(transformation(extent={{180,20},{200,40}}))); + Modelica.Blocks.Logical.LogicalSwitch logSwiSumModSecGen + "Logical switch for second heat generator" + annotation (Placement(transformation(extent={{120,-120},{140,-100}}))); + Modelica.Blocks.Logical.LogicalSwitch logSwiSumModPriGen + "Logical switch for primary heat generator" + annotation (Placement(transformation(extent={{120,-80},{140,-60}}))); + Modelica.Blocks.Sources.BooleanConstant conSumModGen(final k=false) + "Constant summer mode, generators off" + annotation (Placement(transformation(extent={{20,-140},{40,-120}}))); equation - connect(hysBui.priGenOn, priGenOn.u2) annotation (Line(points={{59.12,-64.4},{74, - -64.4},{74,-106},{152,-106},{152,-78},{158,-78}}, color={255,0,255})); connect(hysDHW.priGenOn, priGenOn.u1) annotation (Line(points={{79.12,75.6},{79.12, - 74},{106,74},{106,-62},{150,-62},{150,-70},{158,-70}}, color={255,0,255})); + 74},{108,74},{108,46},{230,46},{230,-90},{238,-90}}, color={255,0,255})); connect(TSetDHW.y, orDHW.u[1]) annotation (Line(points={{-61.2,85.36},{-54, - 85.36},{-54,50},{-48,50},{-48,34},{90,34},{90,74},{108,74},{108,67.6667}, - {120,67.6667}}, color={255,0,255})); + 85.36},{-54,50},{-48,50},{-48,34},{90,34},{90,74},{108,74},{108, + 67.6667},{120,67.6667}}, color={255,0,255})); connect(hysDHW.secGenOn, orDHW.u[2]) annotation (Line(points={{79.12,66},{90,66}, {90,50},{120,50},{120,70}}, color={255,0,255})); connect(TSetDHW.TSetDHW, supCtrDHW.uLoc) annotation (Line(points={{-61.2,90},{-10, @@ -179,27 +203,24 @@ equation connect(hysDHW.priGenOn, orDHW.u[3]) annotation (Line(points={{79.12,75.6},{ 79.12,74},{108,74},{108,72.3333},{120,72.3333}}, color={255,0,255})); - connect(priGenOn.y, priGren) annotation (Line(points={{181,-70},{208,-70},{208, + connect(priGenOn.y, priGren) annotation (Line(points={{261,-90},{294,-90},{294, -110},{310,-110}}, color={255,0,255})); - connect(secGenOn.y, secGen) annotation (Line(points={{141.5,-90},{292,-90},{292, - -70},{310,-70}}, color={255,0,255})); - connect(secGenOn.u[1], hysBui.secGenOn) annotation (Line(points={{120,-92.3333}, - {114,-92.3333},{114,-74},{59.12,-74}}, color={255,0,255})); - connect(hysDHW.secGenOn, secGenOn.u[2]) annotation (Line(points={{79.12,66},{90, - 66},{90,50},{114,50},{114,-90},{120,-90}}, color={255,0,255})); - connect(TSetDHW.y, secGenOn.u[3]) annotation (Line(points={{-61.2,85.36},{-54, - 85.36},{-54,50},{-48,50},{-48,34},{90,34},{90,50},{114,50},{114, - -87.6667},{120,-87.6667}}, + connect(secGenOn.y, secGen) annotation (Line(points={{221.5,-110},{286,-110},{ + 286,-70},{310,-70}}, color={255,0,255})); + connect(hysDHW.secGenOn, secGenOn.u[1]) annotation (Line(points={{79.12,66},{ + 90,66},{90,34},{178,34},{178,-112.333},{200,-112.333}}, + color={255,0,255})); + connect(TSetDHW.y, secGenOn.u[2]) annotation (Line(points={{-61.2,85.36},{-54, + 85.36},{-54,50},{-48,50},{-48,34},{178,34},{178,-110},{200,-110}}, color={255,0,255})); - connect(maxSecHeaGen.u[1], hysDHW.ySecGenSet) annotation (Line(points={{120, - -31.6667},{86,-31.6667},{86,8},{52,8},{52,54},{79.12,54},{79.12,63.12}}, - color={0, + connect(maxSecHeaGen.u[1], hysDHW.ySecGenSet) annotation (Line(points={{200, + -47.6667},{86,-47.6667},{86,63.12},{79.12,63.12}}, color={0, 0,127})); - connect(maxSecHeaGen.u[2], hysBui.ySecGenSet) annotation (Line(points={{120,-34}, - {86,-34},{86,-76.88},{59.12,-76.88}}, color={0,0,127})); - connect(swiAntLeg.y, maxSecHeaGen.u[3]) annotation (Line(points={{-19,50},{52, - 50},{52,8},{86,8},{86,-36.3333},{120,-36.3333}}, + connect(maxSecHeaGen.u[2], hysBui.ySecGenSet) annotation (Line(points={{200,-50}, + {66,-50},{66,-76.88},{59.12,-76.88}}, color={0,0,127})); + connect(swiAntLeg.y, maxSecHeaGen.u[3]) annotation (Line(points={{-19,50},{86, + 50},{86,-52.3333},{200,-52.3333}}, color={0,0,127})); connect(TSetDHW.y, swiAntLeg.u2) annotation (Line(points={{-61.2,85.36},{-54, 85.36},{-54,50},{-42,50}}, @@ -219,7 +240,7 @@ equation extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(maxSecHeaGen.yMax, ySecGenSet) - annotation (Line(points={{141,-40},{310,-40}}, + annotation (Line(points={{221,-56},{286,-56},{286,-40},{310,-40}}, color={0,0,127})); connect(TOda, hysDHW.TOda) annotation (Line(points={{-120,0},{-94,0},{-94,102},{ 70,102},{70,78.96}}, color={0,0,127})); @@ -256,8 +277,6 @@ equation 70}}, color={255,0,255})); connect(booToReal.u, bufOn.y) annotation (Line(points={{188,80},{171,80}}, color={255,0,255})); - connect(orDHW.y, DHW) annotation (Line(points={{141.5,70},{144,70},{144,52},{310, - 52}}, color={255,0,255})); connect(supCtrHeaCur.uSup, sigBusHyd.TBuiSupOve) annotation (Line(points={{-2,-82}, {-16,-82},{-16,12},{-106,12},{-106,132},{100,132},{100,103}}, color={0,0, 127}), Text( @@ -276,6 +295,39 @@ equation -134},{284,-134},{284,20},{310,20}}, color={0,0,127})); connect(supCtrDHW.y, TDHWSet) annotation (Line(points={{22,70},{22,42},{274,42}, {274,80},{310,80}}, color={0,0,127})); + connect(timer.y, notSumMod.u) + annotation (Line(points={{49,-20},{58,-20}}, color={0,0,127})); + connect(notSumMod.y, logSwiDHW.u2) annotation (Line(points={{81,-20},{206,-20}, + {206,20},{238,20}}, color={255,0,255})); + connect(timer.u, not1.y) + annotation (Line(points={{26,-20},{21,-20}}, color={255,0,255})); + connect(not1.u, hysSum.y) + annotation (Line(points={{-2,-20},{-11,-20}}, color={255,0,255})); + connect(hysSum.u, TOda) annotation (Line(points={{-34,-20},{-54,-20},{-54,0},{ + -120,0}}, color={0,0,127})); + connect(logSwiSumModPriGen.y, priGenOn.u2) annotation (Line(points={{141,-70}, + {164,-70},{164,-98},{238,-98}}, color={255,0,255})); + connect(notSumMod.y, logSwiSumModPriGen.u2) annotation (Line(points={{81,-20}, + {92,-20},{92,-70},{118,-70}}, color={255,0,255})); + connect(logSwiSumModSecGen.y, secGenOn.u[3]) annotation (Line(points={{141, + -110},{140,-110},{140,-126},{200,-126},{200,-107.667}}, + color={255,0,255})); + connect(logSwiSumModSecGen.u2, notSumMod.y) annotation (Line(points={{118,-110}, + {92,-110},{92,-20},{81,-20}}, color={255,0,255})); + connect(logSwiDHW.y, DHW) annotation (Line(points={{261,20},{282,20},{282,52}, + {310,52}}, color={255,0,255})); + connect(logSwiSumModSecGen.u3, conSumModGen.y) annotation (Line(points={{118, + -118},{102,-118},{102,-130},{41,-130}}, color={255,0,255})); + connect(hysBui.secGenOn, logSwiSumModSecGen.u1) annotation (Line(points={{ + 59.12,-74},{104,-74},{104,-102},{118,-102}}, color={255,0,255})); + connect(logSwiSumModPriGen.u3, conSumModGen.y) annotation (Line(points={{118, + -78},{64,-78},{64,-130},{41,-130}}, color={255,0,255})); + connect(hysBui.priGenOn, logSwiSumModPriGen.u1) annotation (Line(points={{ + 59.12,-64.4},{59.12,-62},{118,-62}}, color={255,0,255})); + connect(conSumMod.y, logSwiDHW.u3) annotation (Line(points={{201,30},{232,30}, + {232,12},{238,12}}, color={255,0,255})); + connect(logSwiDHW.u1, orDHW.y) annotation (Line(points={{238,28},{234,28},{ + 234,64},{141.5,64},{141.5,70}}, color={255,0,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140}, {300,100}})), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140},{300,100}}), graphics={ @@ -296,5 +348,15 @@ equation extent={{-100,-146},{-6,-112}}, lineColor={0,140,72}, lineThickness=1, - textString="Building Control")})); + textString="Building Control"), + Rectangle( + extent={{-40,16},{120,-40}}, + lineColor={162,29,33}, + lineThickness=1), + Text( + extent={{-44,-30},{24,-42}}, + lineColor={162,29,33}, + lineThickness=1, + fontSize=12, + textString="Summer mode")})); end BuildingAndDHWControl; diff --git a/BESMod/Systems/Hydraulical/Control/Components/SummerTimeConstraint.mo b/BESMod/Systems/Hydraulical/Control/Components/SummerTimeConstraint.mo new file mode 100644 index 00000000..02230a2c --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/SummerTimeConstraint.mo @@ -0,0 +1,19 @@ +within BESMod.Systems.Hydraulical.Control.Components; +block SummerTimeConstraint + "Output is true if summer mode is activated" + extends Modelica.Blocks.Interfaces.partialBooleanThresholdComparison(final + threshold=delTim); + parameter Integer sumTimSta= (31+28+31+30) * 86400 "Summer start time, default 01.05"; + parameter Integer sumTimEnd= (31+28+31+30+31+30+31+31+30) * 86400 "Summer end time, default 01.10"; + + parameter Modelica.Units.SI.Time delTim(displayUnit="h")=10800 + "Delay time to start winter mode"; +equation + if (time < sumTimSta or time >= sumTimEnd) then + y = true; //winter mode + else //summer mode constraint + y = u > threshold; + end if; + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end SummerTimeConstraint; diff --git a/BESMod/Systems/Hydraulical/Control/Components/package.order b/BESMod/Systems/Hydraulical/Control/Components/package.order index d2c2a270..81ef1ac4 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/package.order @@ -10,3 +10,4 @@ BoilerInHybridSystem SetAndMeasuredValueSelector MeasuredValue ParallelValveController +SummerTimeConstraint diff --git a/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo b/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo index 48aa74b5..a40249c6 100644 --- a/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo +++ b/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo @@ -108,4 +108,7 @@ equation index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); + connect(buiAndDHWCtr.priGren, priGenPIDCtrl.setOn) annotation (Line(points={{ + -118,27.5},{-118,26},{74,26},{74,74},{96,74},{96,90},{100.4,90}}, + color={255,0,255})); end HybridHeatPumpSystem; diff --git a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo index c8a0bc34..04f6769c 100644 --- a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo +++ b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo @@ -28,4 +28,7 @@ equation color={255,0,255})); connect(swiSecGen.u1, buiAndDHWCtr.ySecGenSet) annotation (Line(points={{98,18}, {90,18},{90,45},{-118,45}}, color={0,0,127})); + connect(buiAndDHWCtr.priGren, priGenPIDCtrl.setOn) annotation (Line(points={{ + -118,27.5},{-100,27.5},{-100,30},{-10,30},{-10,78},{-8,78},{-8,90},{ + 100.4,90}}, color={255,0,255})); end MonoenergeticHeatPumpSystem; From 5d8f4efc09ad9634593bda9f19013e7ce6288119 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 28 Aug 2023 18:49:54 +0200 Subject: [PATCH 093/131] Add summer mode --- .../PartialHeatPumpSystemController.mo | 20 +++--- .../Components/BuildingAndDHWControl.mo | 72 +++++++++---------- .../BaseClasses/PartialSummerMode.mo | 10 +++ .../BaseClasses}/SummerTimeConstraint.mo | 2 +- .../SummerMode/BaseClasses/package.mo | 4 ++ .../SummerMode/BaseClasses/package.order | 2 + .../Components/SummerMode/DateBased.mo | 17 +++++ .../HeatingThresholdAndDateBased.mo | 40 +++++++++++ .../Control/Components/SummerMode/No.mo | 10 +++ .../Control/Components/SummerMode/package.mo | 3 + .../Components/SummerMode/package.order | 4 ++ .../Control/Components/package.order | 2 +- 12 files changed, 139 insertions(+), 47 deletions(-) create mode 100644 BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/PartialSummerMode.mo rename BESMod/Systems/Hydraulical/Control/Components/{ => SummerMode/BaseClasses}/SummerTimeConstraint.mo (91%) create mode 100644 BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/package.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/package.order create mode 100644 BESMod/Systems/Hydraulical/Control/Components/SummerMode/DateBased.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/SummerMode/HeatingThresholdAndDateBased.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/SummerMode/No.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/SummerMode/package.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/SummerMode/package.order diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo index 39f307a8..8713bae6 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo @@ -43,6 +43,11 @@ partial model PartialHeatPumpSystemController final TSetDHW_nominal=parDis.TDHW_nominal) "DHW set temperture module" annotation (Dialog(group="Component choices"), choicesAllMatching=true); + replaceable model SummerMode = + BESMod.Systems.Hydraulical.Control.Components.SummerMode.No + constrainedby + BESMod.Systems.Hydraulical.Control.Components.SummerMode.BaseClasses.PartialSummerMode + "Summer mode model" annotation(Dialog(group="Component choices"), choicesAllMatching=true); replaceable parameter BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition parPIDHeaPum constrainedby BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition @@ -128,6 +133,7 @@ partial model PartialHeatPumpSystemController final nHeaTra=parTra.nHeaTra, final supCtrHeaCurTyp=supCtrHeaCurTyp, final supCtrDHWTyp=supCtrDHWTyp, + redeclare final model SummerMode = SummerMode, redeclare final model DHWHysteresis = DHWHysteresis, redeclare final model BuildingHysteresis = BuildingHysteresis, redeclare final model DHWSetTemperature = DHWSetTemperature) @@ -153,18 +159,16 @@ partial model PartialHeatPumpSystemController equation - connect(safCtr.modeSet, heaPumHea.y) annotation (Line(points={{198.667,68},{ - 186,68},{186,90},{181,90}}, - color={255,0,255})); - connect(safCtr.nOut, sigBusGen.yHeaPumSet) annotation (Line(points={{220.833, - 72},{254,72},{254,-118},{-152,-118},{-152,-99}}, - color={0,0,127}), Text( + connect(safCtr.modeSet, heaPumHea.y) annotation (Line(points={{198.667,68},{186, + 68},{186,90},{181,90}}, color={255,0,255})); + connect(safCtr.nOut, sigBusGen.yHeaPumSet) annotation (Line(points={{220.833,72}, + {254,72},{254,-118},{-152,-118},{-152,-99}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(priGenPIDCtrl.ySet, safCtr.nSet) annotation (Line(points={{118.8,90}, - {154,90},{154,76},{190,76},{190,72},{198.667,72}}, + connect(priGenPIDCtrl.ySet, safCtr.nSet) annotation (Line(points={{118.8,90},{ + 154,90},{154,76},{190,76},{190,72},{198.667,72}}, color={0,0,127})); connect(priGenPIDCtrl.isOn, sigBusGen.heaPumIsOn) annotation (Line(points={{105.2, diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo index 75816917..aad2d096 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo @@ -37,7 +37,15 @@ model BuildingAndDHWControl constrainedby BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control "DHW set temperture module" annotation (choicesAllMatching=true); - parameter Modelica.Units.SI.Temperature THeaTrh = 273.15+15 "Heating threshold for summer mode"; + + replaceable model SummerMode = + BESMod.Systems.Hydraulical.Control.Components.SummerMode.No + constrainedby + BESMod.Systems.Hydraulical.Control.Components.SummerMode.BaseClasses.PartialSummerMode + "Summer mode model" annotation(choicesAllMatching=true); + + SummerMode sumMod "Summer mode instance" + annotation (Placement(transformation(extent={{42,-18},{62,2}}))); DHWHysteresis hysDHW @@ -139,19 +147,8 @@ model BuildingAndDHWControl Modelica.Blocks.Interfaces.RealOutput TBuiSet(unit="K", displayUnit="degC") "Building supply set temperature" annotation (Placement(transformation(extent={{300,10},{320,30}}))); - Modelica.Blocks.Logical.Timer timer - annotation (Placement(transformation(extent={{28,-30},{48,-10}}))); - SummerTimeConstraint notSumMod "=false if summer mode is present" - annotation (Placement(transformation(extent={{60,-30},{80,-10}}))); Modelica.Blocks.Logical.LogicalSwitch logSwiDHW "Logical switch" annotation (Placement(transformation(extent={{240,10},{260,30}}))); - Modelica.Blocks.Logical.Hysteresis hysSum( - uLow=THeaTrh - 0.1, - final uHigh=THeaTrh + 0.1, - final pre_y_start=false) "Summer mode" - annotation (Placement(transformation(extent={{-32,-30},{-12,-10}}))); - Modelica.Blocks.Logical.Not not1 "Not" - annotation (Placement(transformation(extent={{0,-30},{20,-10}}))); Modelica.Blocks.Sources.BooleanConstant conSumMod(final k=true) "Constant summer mode" annotation (Placement(transformation(extent={{180,20},{200,40}}))); @@ -164,12 +161,18 @@ model BuildingAndDHWControl Modelica.Blocks.Sources.BooleanConstant conSumModGen(final k=false) "Constant summer mode, generators off" annotation (Placement(transformation(extent={{20,-140},{40,-120}}))); + + Modelica.Blocks.Logical.Not winMod "=true for winter mode" annotation ( + Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={90,-10}))); equation connect(hysDHW.priGenOn, priGenOn.u1) annotation (Line(points={{79.12,75.6},{79.12, 74},{108,74},{108,46},{230,46},{230,-90},{238,-90}}, color={255,0,255})); connect(TSetDHW.y, orDHW.u[1]) annotation (Line(points={{-61.2,85.36},{-54, - 85.36},{-54,50},{-48,50},{-48,34},{90,34},{90,74},{108,74},{108, - 67.6667},{120,67.6667}}, color={255,0,255})); + 85.36},{-54,50},{-48,50},{-48,34},{90,34},{90,74},{108,74},{108,67.6667}, + {120,67.6667}}, color={255,0,255})); connect(hysDHW.secGenOn, orDHW.u[2]) annotation (Line(points={{79.12,66},{90,66}, {90,50},{120,50},{120,70}}, color={255,0,255})); connect(TSetDHW.TSetDHW, supCtrDHW.uLoc) annotation (Line(points={{-61.2,90},{-10, @@ -208,8 +211,8 @@ equation color={255,0,255})); connect(secGenOn.y, secGen) annotation (Line(points={{221.5,-110},{286,-110},{ 286,-70},{310,-70}}, color={255,0,255})); - connect(hysDHW.secGenOn, secGenOn.u[1]) annotation (Line(points={{79.12,66},{ - 90,66},{90,34},{178,34},{178,-112.333},{200,-112.333}}, + connect(hysDHW.secGenOn, secGenOn.u[1]) annotation (Line(points={{79.12,66},{90, + 66},{90,34},{178,34},{178,-112.333},{200,-112.333}}, color={255,0,255})); connect(TSetDHW.y, secGenOn.u[2]) annotation (Line(points={{-61.2,85.36},{-54, 85.36},{-54,50},{-48,50},{-48,34},{178,34},{178,-110},{200,-110}}, @@ -273,8 +276,6 @@ equation index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(bufOn.u, orDHW.y) annotation (Line(points={{148,80},{141.5,80},{141.5, - 70}}, color={255,0,255})); connect(booToReal.u, bufOn.y) annotation (Line(points={{188,80},{171,80}}, color={255,0,255})); connect(supCtrHeaCur.uSup, sigBusHyd.TBuiSupOve) annotation (Line(points={{-2,-82}, @@ -295,25 +296,10 @@ equation -134},{284,-134},{284,20},{310,20}}, color={0,0,127})); connect(supCtrDHW.y, TDHWSet) annotation (Line(points={{22,70},{22,42},{274,42}, {274,80},{310,80}}, color={0,0,127})); - connect(timer.y, notSumMod.u) - annotation (Line(points={{49,-20},{58,-20}}, color={0,0,127})); - connect(notSumMod.y, logSwiDHW.u2) annotation (Line(points={{81,-20},{206,-20}, - {206,20},{238,20}}, color={255,0,255})); - connect(timer.u, not1.y) - annotation (Line(points={{26,-20},{21,-20}}, color={255,0,255})); - connect(not1.u, hysSum.y) - annotation (Line(points={{-2,-20},{-11,-20}}, color={255,0,255})); - connect(hysSum.u, TOda) annotation (Line(points={{-34,-20},{-54,-20},{-54,0},{ - -120,0}}, color={0,0,127})); connect(logSwiSumModPriGen.y, priGenOn.u2) annotation (Line(points={{141,-70}, {164,-70},{164,-98},{238,-98}}, color={255,0,255})); - connect(notSumMod.y, logSwiSumModPriGen.u2) annotation (Line(points={{81,-20}, - {92,-20},{92,-70},{118,-70}}, color={255,0,255})); - connect(logSwiSumModSecGen.y, secGenOn.u[3]) annotation (Line(points={{141, - -110},{140,-110},{140,-126},{200,-126},{200,-107.667}}, - color={255,0,255})); - connect(logSwiSumModSecGen.u2, notSumMod.y) annotation (Line(points={{118,-110}, - {92,-110},{92,-20},{81,-20}}, color={255,0,255})); + connect(logSwiSumModSecGen.y, secGenOn.u[3]) annotation (Line(points={{141,-110}, + {140,-110},{140,-126},{200,-126},{200,-107.667}}, color={255,0,255})); connect(logSwiDHW.y, DHW) annotation (Line(points={{261,20},{282,20},{282,52}, {310,52}}, color={255,0,255})); connect(logSwiSumModSecGen.u3, conSumModGen.y) annotation (Line(points={{118, @@ -326,8 +312,20 @@ equation 59.12,-64.4},{59.12,-62},{118,-62}}, color={255,0,255})); connect(conSumMod.y, logSwiDHW.u3) annotation (Line(points={{201,30},{232,30}, {232,12},{238,12}}, color={255,0,255})); - connect(logSwiDHW.u1, orDHW.y) annotation (Line(points={{238,28},{234,28},{ - 234,64},{141.5,64},{141.5,70}}, color={255,0,255})); + connect(logSwiDHW.u1, orDHW.y) annotation (Line(points={{238,28},{234,28},{234,62}, + {141.5,62},{141.5,70}}, color={255,0,255})); + connect(sumMod.TOda, TOda) annotation (Line(points={{40,-8},{-54,-8},{-54,0},{-120, + 0}}, color={0,0,127})); + connect(winMod.y, logSwiSumModPriGen.u2) annotation (Line(points={{101,-10},{100, + -10},{100,-70},{118,-70}}, color={255,0,255})); + connect(winMod.y, logSwiSumModSecGen.u2) annotation (Line(points={{101,-10},{100, + -10},{100,-70},{112,-70},{112,-110},{118,-110}}, color={255,0,255})); + connect(winMod.u, sumMod.sumMod) annotation (Line(points={{78,-10},{66,-10},{66, + -8},{63,-8}}, color={255,0,255})); + connect(winMod.y, logSwiDHW.u2) annotation (Line(points={{101,-10},{228,-10},{228, + 20},{238,20}}, color={255,0,255})); + connect(logSwiDHW.y, bufOn.u) annotation (Line(points={{261,20},{266,20},{266, + 66},{148,66},{148,80}}, color={255,0,255})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140}, {300,100}})), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140},{300,100}}), graphics={ diff --git a/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/PartialSummerMode.mo b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/PartialSummerMode.mo new file mode 100644 index 00000000..d40cbd3e --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/PartialSummerMode.mo @@ -0,0 +1,10 @@ +within BESMod.Systems.Hydraulical.Control.Components.SummerMode.BaseClasses; +partial model PartialSummerMode "Partial summer mode model" + Modelica.Blocks.Interfaces.RealInput TOda(unit="K", displayUnit="degC") + "Outdoor air temperature" + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Interfaces.BooleanOutput sumMod "=true for summer mode" + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end PartialSummerMode; diff --git a/BESMod/Systems/Hydraulical/Control/Components/SummerTimeConstraint.mo b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/SummerTimeConstraint.mo similarity index 91% rename from BESMod/Systems/Hydraulical/Control/Components/SummerTimeConstraint.mo rename to BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/SummerTimeConstraint.mo index 02230a2c..3cb36577 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/SummerTimeConstraint.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/SummerTimeConstraint.mo @@ -1,4 +1,4 @@ -within BESMod.Systems.Hydraulical.Control.Components; +within BESMod.Systems.Hydraulical.Control.Components.SummerMode.BaseClasses; block SummerTimeConstraint "Output is true if summer mode is activated" extends Modelica.Blocks.Interfaces.partialBooleanThresholdComparison(final diff --git a/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/package.mo b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/package.mo new file mode 100644 index 00000000..10204a44 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/package.mo @@ -0,0 +1,4 @@ +within BESMod.Systems.Hydraulical.Control.Components.SummerMode; +package BaseClasses "Contains partial summer mode models" + extends Modelica.Icons.BasesPackage; +end BaseClasses; diff --git a/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/package.order new file mode 100644 index 00000000..210ed483 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/package.order @@ -0,0 +1,2 @@ +SummerTimeConstraint +PartialSummerMode diff --git a/BESMod/Systems/Hydraulical/Control/Components/SummerMode/DateBased.mo b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/DateBased.mo new file mode 100644 index 00000000..b0782553 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/DateBased.mo @@ -0,0 +1,17 @@ +within BESMod.Systems.Hydraulical.Control.Components.SummerMode; +model DateBased "Date based summer mode" + extends BaseClasses.PartialSummerMode; + + parameter Integer sumTimSta= (31+28+31+30) * 86400 "Summer start time, default 01.05"; + parameter Integer sumTimEnd= (31+28+31+30+31+30+31+31+30) * 86400 "Summer end time, default 01.10"; +protected + parameter Integer oneYear = 365*86400 "One year in seconds"; + +equation + if (mod(time, oneYear) >= sumTimSta and mod(time, oneYear) < sumTimEnd) then + sumMod = true; //winter mode + else //summer mode constraint + sumMod = false; + end if; + +end DateBased; diff --git a/BESMod/Systems/Hydraulical/Control/Components/SummerMode/HeatingThresholdAndDateBased.mo b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/HeatingThresholdAndDateBased.mo new file mode 100644 index 00000000..77c91969 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/HeatingThresholdAndDateBased.mo @@ -0,0 +1,40 @@ +within BESMod.Systems.Hydraulical.Control.Components.SummerMode; +model HeatingThresholdAndDateBased "Heating threshold and date based summer mode" + extends BaseClasses.PartialSummerMode; + parameter Modelica.Units.SI.Temperature THeaTrh = 273.15+15 "Heating threshold for summer mode"; + + parameter Integer sumTimSta= (31+28+31+30) * 86400 "Summer start time, default 01.05"; + parameter Integer sumTimEnd= (31+28+31+30+31+30+31+31+30) * 86400 "Summer end time, default 01.10"; + parameter Modelica.Units.SI.Time delTim=10800 "Delay time to start winter mode"; + + BaseClasses.SummerTimeConstraint notSumMod( + sumTimSta=sumTimSta, + sumTimEnd=sumTimEnd, + delTim=delTim) "=false if summer mode is present" + annotation (Placement(transformation(extent={{38,-10},{58,10}}))); + Modelica.Blocks.Logical.Not not1 "Not" + annotation (Placement(transformation(extent={{-30,-10},{-10,10}}))); + Modelica.Blocks.Logical.Timer timer + annotation (Placement(transformation(extent={{2,-10},{22,10}}))); + Modelica.Blocks.Logical.Hysteresis hysSum( + uLow=THeaTrh - 0.1, + final uHigh=THeaTrh + 0.1, + final pre_y_start=false) "Summer mode" + annotation (Placement(transformation(extent={{-66,-10},{-46,10}}))); + Modelica.Blocks.Logical.Not not2 "Not" + annotation (Placement(transformation(extent={{68,-10},{88,10}}))); +equation + + connect(hysSum.u, TOda) + annotation (Line(points={{-68,0},{-120,0}}, color={0,0,127})); + connect(not1.u, hysSum.y) + annotation (Line(points={{-32,0},{-45,0}}, color={255,0,255})); + connect(not1.y, timer.u) + annotation (Line(points={{-9,0},{0,0}}, color={255,0,255})); + connect(notSumMod.u, timer.y) + annotation (Line(points={{36,0},{23,0}}, color={0,0,127})); + connect(not2.u, notSumMod.y) + annotation (Line(points={{66,0},{59,0}}, color={255,0,255})); + connect(not2.y, sumMod) + annotation (Line(points={{89,0},{110,0}}, color={255,0,255})); +end HeatingThresholdAndDateBased; diff --git a/BESMod/Systems/Hydraulical/Control/Components/SummerMode/No.mo b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/No.mo new file mode 100644 index 00000000..c1704445 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/No.mo @@ -0,0 +1,10 @@ +within BESMod.Systems.Hydraulical.Control.Components.SummerMode; +model No "No summer mode approach" + extends BaseClasses.PartialSummerMode; + Modelica.Blocks.Sources.BooleanConstant noSumMod(final k=false) + "No summer mode" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); +equation + connect(noSumMod.y, sumMod) + annotation (Line(points={{11,0},{110,0}}, color={255,0,255})); +end No; diff --git a/BESMod/Systems/Hydraulical/Control/Components/SummerMode/package.mo b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/package.mo new file mode 100644 index 00000000..48054d23 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/package.mo @@ -0,0 +1,3 @@ +within BESMod.Systems.Hydraulical.Control.Components; +package SummerMode "Models to model the summer mode" +end SummerMode; diff --git a/BESMod/Systems/Hydraulical/Control/Components/SummerMode/package.order b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/package.order new file mode 100644 index 00000000..843acacb --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/package.order @@ -0,0 +1,4 @@ +DateBased +HeatingThresholdAndDateBased +No +BaseClasses diff --git a/BESMod/Systems/Hydraulical/Control/Components/package.order b/BESMod/Systems/Hydraulical/Control/Components/package.order index 81ef1ac4..4ae76739 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/package.order @@ -10,4 +10,4 @@ BoilerInHybridSystem SetAndMeasuredValueSelector MeasuredValue ParallelValveController -SummerTimeConstraint +SummerMode From 671d834cc49f05d8c17d07af66f215382abbd294 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 29 Aug 2023 08:19:30 +0200 Subject: [PATCH 094/131] Make DHW modules actually modular by separating DHWCalc and EU profiles --- BESMod/Examples/BAUSimStudy/PartialCase.mo | 5 ++- BESMod/Examples/GasBoilerBuildingOnly.mo | 13 ++++---- .../Examples/HeatPumpAndBoiler/BaseClasses.mo | 16 ++++++---- .../PartialSolarThermalHPS.mo | 19 +++++------ .../Examples/UseCaseDesignOptimization/BES.mo | 5 ++- .../Examples/UseCaseHighOrderModel/BES_HOM.mo | 6 +++- .../PartialModelicaConferenceUseCase.mo | 8 ++++- .../ConvertBESMod_from_0.3.1_to_0.3.2.mos | 2 ++ .../PartialDHWWithBasics.mo} | 32 +++---------------- .../Demand/DHW/BaseClasses/package.order | 1 + BESMod/Systems/Demand/DHW/DHWCalc.mo | 21 ++++++++++++ .../DHW/RecordsCollection/PartialDHWTap.mo | 5 ++- BESMod/Systems/Demand/DHW/StandardProfiles.mo | 20 ++++++++++++ BESMod/Systems/Demand/DHW/package.order | 3 +- .../BaseClasses/PartialHydraulicSystem.mo | 4 +-- 15 files changed, 103 insertions(+), 57 deletions(-) rename BESMod/Systems/Demand/DHW/{DHW.mo => BaseClasses/PartialDHWWithBasics.mo} (78%) create mode 100644 BESMod/Systems/Demand/DHW/DHWCalc.mo create mode 100644 BESMod/Systems/Demand/DHW/StandardProfiles.mo diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index 88175519..d1cfd1b4 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -16,6 +16,7 @@ partial model PartialCase BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/5000, dpCon_nominal=0, @@ -44,8 +45,10 @@ partial model PartialCase dTHysDHW=10, redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, @@ -82,7 +85,7 @@ partial model PartialCase BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData transferDataBaseDefinition, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare Systems.Demand.DHW.DHW DHW( + redeclare Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic diff --git a/BESMod/Examples/GasBoilerBuildingOnly.mo b/BESMod/Examples/GasBoilerBuildingOnly.mo index 425233e2..1e173469 100644 --- a/BESMod/Examples/GasBoilerBuildingOnly.mo +++ b/BESMod/Examples/GasBoilerBuildingOnly.mo @@ -3,9 +3,9 @@ model GasBoilerBuildingOnly extends Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare BESMod.Systems.Demand.Building.TEASERThermalZone building( - hBui=sum(building.zoneParam.VAir)^(1/3), - ABui=sum(building.zoneParam.VAir)^(2/3), - redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen + hBui=sum(building.zoneParam.VAir)^(1/3), + ABui=sum(building.zoneParam.VAir)^(2/3), + redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Ventilation.NoVentilation ventilation, @@ -29,8 +29,8 @@ model GasBoilerBuildingOnly redeclare BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PID PIDCtrl), - redeclare BESMod.Systems.Hydraulical.Distribution.BuildingOnly - distribution(nParallelDem=1), + redeclare BESMod.Systems.Hydraulical.Distribution.BuildingOnly distribution( + nParallelDem=1), redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased transfer( redeclare @@ -40,10 +40,11 @@ model GasBoilerBuildingOnly redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters)), - redeclare BESMod.Systems.Demand.DHW.DHW DHW( + redeclare BESMod.Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.PassThrough calcmFlow), + redeclare BESMod.Systems.UserProfiles.TEASERProfiles userProfiles, redeclare BESMod.Systems.RecordsCollection.ParameterStudy.NoStudy parameterStudy, diff --git a/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo b/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo index 1fbef864..6785bfff 100644 --- a/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo +++ b/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo @@ -8,8 +8,8 @@ package BaseClasses "Contains partial example case" BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, - redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Control.HybridHeatPumpSystem control( + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic(redeclare + Systems.Hydraulical.Control.HybridHeatPumpSystem control( redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled valCtrl, @@ -19,12 +19,16 @@ package BaseClasses "Contains partial example case" dTHysBui=5, dTHysDHW=5, meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature, + redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare model DHWSetTemperature = BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW, + redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, @@ -36,14 +40,14 @@ package BaseClasses "Contains partial example case" TCutOff=parameterStudy.TCutOff, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicBoilerPI - parPIDBoi), - redeclare final Systems.Hydraulical.Transfer.IdealValveRadiator transfer( - redeclare + parPIDBoi), redeclare final + Systems.Hydraulical.Transfer.IdealValveRadiator transfer(redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare Systems.Demand.DHW.DHW DHW( + redeclare Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), diff --git a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo index 67cf18a6..936dba10 100644 --- a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo +++ b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo @@ -4,11 +4,10 @@ partial model PartialSolarThermalHPS extends BESMod.Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare Systems.Demand.Building.TEASERThermalZone building( - hBui=sum(building.zoneParam.VAir)^(1/3), - ABui=sum(building.zoneParam.VAir)^(2/3), - redeclare - BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( - heaLoadFacGrd=0, heaLoadFacOut=0)), + hBui=sum(building.zoneParam.VAir)^(1/3), + ABui=sum(building.zoneParam.VAir)^(2/3), + redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( redeclare hydGeneration generation, @@ -22,17 +21,18 @@ partial model PartialSolarThermalHPS parTheVal, redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl safetyControl), - redeclare BESMod.Systems.Hydraulical.Distribution.CombiStorage - distribution(redeclare BESMod.Examples.SolarThermalSystem.CombiStorage - parameters( + redeclare BESMod.Systems.Hydraulical.Distribution.CombiStorage distribution( + redeclare BESMod.Examples.SolarThermalSystem.CombiStorage parameters( V=parameterStudy.V, use_HC1=true, dTLoadingHC1=5, @@ -47,10 +47,11 @@ partial model PartialSolarThermalHPS BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData transferDataBaseDefinition, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare Systems.Demand.DHW.DHW DHW( + redeclare Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), + redeclare SolarThermalSystemParameters systemParameters, redeclare SolarThermalDesignOptimization parameterStudy( A=11, diff --git a/BESMod/Examples/UseCaseDesignOptimization/BES.mo b/BESMod/Examples/UseCaseDesignOptimization/BES.mo index 506fe2df..b045feec 100644 --- a/BESMod/Examples/UseCaseDesignOptimization/BES.mo +++ b/BESMod/Examples/UseCaseDesignOptimization/BES.mo @@ -14,6 +14,7 @@ model BES BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ parameterStudy.QHP_flow_biv, @@ -71,9 +72,11 @@ model BES VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.B), + redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage parStoDHW(dTLoadingHC1=10, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.A), + redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parThrWayVal), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( @@ -81,7 +84,7 @@ model BES BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare Systems.Demand.DHW.DHW DHW( + redeclare Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic diff --git a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo index c533e3fe..98495165 100644 --- a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo +++ b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo @@ -13,6 +13,7 @@ model BES_HOM Type_Win, redeclare model CorrSolarGainWin = AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.CorGSimple, + redeclare BESMod.Systems.Demand.Building.Components.AixLibHighOrderOFD HOMBuiEnv), redeclare BESMod.Systems.Control.NoControl control, @@ -24,6 +25,7 @@ model BES_HOM BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ parameterStudy.QHP_flow_biv, @@ -49,8 +51,10 @@ model BES_HOM valCtrl, redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, @@ -76,7 +80,7 @@ model BES_HOM BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare BESMod.Systems.Demand.DHW.DHW DHW( + redeclare BESMod.Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 68fffa09..333908f9 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -10,6 +10,7 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.Electrical.Generation.PVSystemMultiSub generation( redeclare model CellTemperature = AixLib.Electrical.PVSystem.BaseClasses.CellTemperatureMountingContactToGround, + redeclare AixLib.DataBase.SolarElectric.SchuecoSPV170SME1 pVParameters, lat=weaDat.lat, lon=weaDat.lon, @@ -17,6 +18,7 @@ partial model PartialModelicaConferenceUseCase timZon=3600, ARoo=building.ARoo/2), redeclare BESMod.Systems.Electrical.Transfer.NoElectricalTransfer transfer, + redeclare BESMod.Systems.Electrical.Control.NoControl control), redeclare BESMod.Systems.Control.DHWSuperheating control(TSetDHW= systemParameters.TSetDHW), @@ -30,6 +32,7 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=271.15, scalingFactor=scalingFactorHP, dpCon_nominal=0, @@ -54,10 +57,13 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, supCtrDHWTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal, + redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, @@ -81,7 +87,7 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData radParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), - redeclare Systems.Demand.DHW.DHW DHW( + redeclare Systems.Demand.DHW.StandardProfiles DHW( energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare final BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, diff --git a/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos b/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos index 94dc4030..40e7547e 100644 --- a/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos +++ b/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos @@ -2,6 +2,7 @@ clear convertClear(); +convertClass("BESMod.Systems.Demand.DHW.DHW", "BESMod.Systems.Demand.DHW.StandardProfiles"); convertClass("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib", "BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib"); convertClass("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib", "BESMod.Systems.Hydraulical.Generation.SimpleSolarThermalWithHeatPump"); @@ -38,3 +39,4 @@ convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoad convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "dhwParameters", "parStoDHW"); convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "threeWayValveParameters", "parThrWayVal"); convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "heatingRodAftBufParameters", "parHeaRodAftBuf"); + diff --git a/BESMod/Systems/Demand/DHW/DHW.mo b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHWWithBasics.mo similarity index 78% rename from BESMod/Systems/Demand/DHW/DHW.mo rename to BESMod/Systems/Demand/DHW/BaseClasses/PartialDHWWithBasics.mo index 17841905..3a563625 100644 --- a/BESMod/Systems/Demand/DHW/DHW.mo +++ b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHWWithBasics.mo @@ -1,26 +1,6 @@ -within BESMod.Systems.Demand.DHW; -model DHW "Standard DHW subsystem" - extends BaseClasses.PartialDHW( - QCrit=DHWProfile.QCrit, - tCrit=DHWProfile.tCrit, - TDHWCold_nominal=283.15, - TDHW_nominal=323.15, - VDHWDay=if use_dhwCalc then VDHWCalcDay else DHWProfile.VDHWDay, - mDHW_flow_nominal=DHWProfile.m_flow_nominal); - replaceable parameter Systems.Demand.DHW.RecordsCollection.ProfileM - DHWProfile constrainedby Systems.Demand.DHW.RecordsCollection.PartialDHWTap annotation (choicesAllMatching=true, Dialog( - enable=not use_dhwCalc and use_dhw)); - - parameter Boolean use_dhwCalc=false "=true to use the tables in DHWCalc. Will slow down the simulation, but represents DHW tapping more in a more realistic way." annotation (Dialog(enable=use_dhw)); - parameter String tableName="DHWCalc" "Table name on file for DHWCalc" - annotation (Dialog(enable=use_dhwCalc and use_dhw)); - parameter String fileName=Modelica.Utilities.Files.loadResource( - "modelica://BESMod/Resources/DHWCalc.txt") - "File where matrix is stored for DHWCalc" - annotation (Dialog(enable=use_dhwCalc and use_dhw)); - parameter Modelica.Units.SI.Volume VDHWCalcDay=0 - "Average daily tapping volume in DHWCalc table" annotation (Dialog(enable= - use_dhwCalc)); +within BESMod.Systems.Demand.DHW.BaseClasses; +partial model PartialDHWWithBasics "DHW module with basic models" + extends BaseClasses.PartialDHW; replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition @@ -89,10 +69,6 @@ Modelica.Blocks.Math.UnitConversions.From_degC fromDegC BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{20,-100},{40,-80}}))); Modelica.Blocks.Sources.CombiTimeTable combiTimeTableDHWInput( - final tableOnFile=use_dhwCalc, - final table=DHWProfile.table, - final tableName=tableName, - final fileName=fileName, final columns=2:5, final smoothness=Modelica.Blocks.Types.Smoothness.ConstantSegments, final extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic) @@ -142,4 +118,4 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); -end DHW; +end PartialDHWWithBasics; diff --git a/BESMod/Systems/Demand/DHW/BaseClasses/package.order b/BESMod/Systems/Demand/DHW/BaseClasses/package.order index 12f2fcd8..963b11f1 100644 --- a/BESMod/Systems/Demand/DHW/BaseClasses/package.order +++ b/BESMod/Systems/Demand/DHW/BaseClasses/package.order @@ -1 +1,2 @@ PartialDHW +PartialDHWWithBasics diff --git a/BESMod/Systems/Demand/DHW/DHWCalc.mo b/BESMod/Systems/Demand/DHW/DHWCalc.mo new file mode 100644 index 00000000..4eaa44cf --- /dev/null +++ b/BESMod/Systems/Demand/DHW/DHWCalc.mo @@ -0,0 +1,21 @@ +within BESMod.Systems.Demand.DHW; +model DHWCalc "Use DHWCalc tables" + extends BaseClasses.PartialDHWWithBasics( + QCrit=0.0172*VDHWDay/1000 + 0.1582, + tCrit=3600, + TDHWCold_nominal=283.15, + TDHW_nominal=323.15, + combiTimeTableDHWInput( + final tableOnFile=true, + final tableName=tableName, + final fileName=fileName)); + parameter String tableName="DHWCalc" "Table name on file for DHWCalc"; + parameter String fileName=Modelica.Utilities.Files.loadResource( + "modelica://BESMod/Resources/DHWCalc.txt") + "File where matrix is stored for DHWCalc"; + + annotation (Documentation(info=" +

The tool DHWCalc enables stochastic DHW profile models. It can be downloaded and used from here: https://www.uni-kassel.de/maschinenbau/institute/thermische-energietechnik/fachgebiete/solar-und-anlagentechnik/downloads

+

The columns of the file-name need to be the same as in the StandardProfiles module based on EU Regulation 812/2013.

The default values for tCrit are based on the EU profiles. As the three profiles S, M, and L have a near ideal linear fit (R2 = 0.999) for QCrit depending on the daily volume, the default regression for QCrit was added.

This should be re-considered for larger daily volumes.

+")); +end DHWCalc; diff --git a/BESMod/Systems/Demand/DHW/RecordsCollection/PartialDHWTap.mo b/BESMod/Systems/Demand/DHW/RecordsCollection/PartialDHWTap.mo index 2e786a9f..fabc05db 100644 --- a/BESMod/Systems/Demand/DHW/RecordsCollection/PartialDHWTap.mo +++ b/BESMod/Systems/Demand/DHW/RecordsCollection/PartialDHWTap.mo @@ -10,5 +10,8 @@ record PartialDHWTap parameter Real QCrit "Energy demand in kWh during critical period according to EN 15450" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem", enable=designType <> BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.NoStorage)); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false))); + coordinateSystem(preserveAspectRatio=false)), + Documentation(info=" +

These records are based on the EU Regulation 812/2013 profiles and the approach in the EN 15450 to size DHW tanks based on a critical time period.

+")); end PartialDHWTap; diff --git a/BESMod/Systems/Demand/DHW/StandardProfiles.mo b/BESMod/Systems/Demand/DHW/StandardProfiles.mo new file mode 100644 index 00000000..2b920afe --- /dev/null +++ b/BESMod/Systems/Demand/DHW/StandardProfiles.mo @@ -0,0 +1,20 @@ +within BESMod.Systems.Demand.DHW; +model StandardProfiles "DHW profiles based on EU 812/2013" + extends BaseClasses.PartialDHWWithBasics( + QCrit=DHWProfile.QCrit, + tCrit=DHWProfile.tCrit, + TDHWCold_nominal=283.15, + TDHW_nominal=323.15, + VDHWDay=DHWProfile.VDHWDay, + mDHW_flow_nominal=DHWProfile.m_flow_nominal, + combiTimeTableDHWInput(tableOnFile=false, table=DHWProfile.table)); + replaceable parameter Systems.Demand.DHW.RecordsCollection.ProfileM + DHWProfile constrainedby Systems.Demand.DHW.RecordsCollection.PartialDHWTap annotation (choicesAllMatching=true, Dialog( + enable=not use_dhwCalc and use_dhw)); + + + annotation (Documentation(info=" +

Source for EU Regulation 812/2013:

+

https://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2013:239:0083:0135:en:PDF

+")); +end StandardProfiles; diff --git a/BESMod/Systems/Demand/DHW/package.order b/BESMod/Systems/Demand/DHW/package.order index 56eebc4e..55bff724 100644 --- a/BESMod/Systems/Demand/DHW/package.order +++ b/BESMod/Systems/Demand/DHW/package.order @@ -1,4 +1,5 @@ -DHW +StandardProfiles +DHWCalc RecordsCollection Types TappingProfiles diff --git a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo index bd71532d..53319a31 100644 --- a/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo +++ b/BESMod/Systems/Hydraulical/BaseClasses/PartialHydraulicSystem.mo @@ -189,8 +189,8 @@ partial model PartialHydraulicSystem Medium = MediumDHW) "Outlet for the distribution to the DHW" annotation ( Placement(transformation(extent={{190,-70},{210,-50}}),iconTransformation( extent={{188,-76},{208,-56}}))); - Modelica.Fluid.Interfaces.FluidPort_a portDHW_in(redeclare final package - Medium = MediumDHW) "Inet for the distribution from the DHW" annotation ( + Modelica.Fluid.Interfaces.FluidPort_a portDHW_in(redeclare final package Medium + = MediumDHW) "Inet for the distribution from the DHW" annotation ( Placement(transformation(extent={{190,-130},{210,-110}}), iconTransformation( extent={{188,-116},{208,-96}}))); From c91151f32e16b45e09a1030e997e67a8aadb7ca5 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 29 Aug 2023 08:34:04 +0200 Subject: [PATCH 095/131] fix missing parameter and min attribute --- .../PartialModelicaConferenceUseCase.mo | 7 ------- BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 333908f9..f7ff5ba1 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -10,7 +10,6 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.Electrical.Generation.PVSystemMultiSub generation( redeclare model CellTemperature = AixLib.Electrical.PVSystem.BaseClasses.CellTemperatureMountingContactToGround, - redeclare AixLib.DataBase.SolarElectric.SchuecoSPV170SME1 pVParameters, lat=weaDat.lat, lon=weaDat.lon, @@ -18,7 +17,6 @@ partial model PartialModelicaConferenceUseCase timZon=3600, ARoo=building.ARoo/2), redeclare BESMod.Systems.Electrical.Transfer.NoElectricalTransfer transfer, - redeclare BESMod.Systems.Electrical.Control.NoControl control), redeclare BESMod.Systems.Control.DHWSuperheating control(TSetDHW= systemParameters.TSetDHW), @@ -32,7 +30,6 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=271.15, scalingFactor=scalingFactorHP, dpCon_nominal=0, @@ -57,13 +54,10 @@ partial model PartialModelicaConferenceUseCase BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, supCtrDHWTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal, - redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, @@ -91,7 +85,6 @@ partial model PartialModelicaConferenceUseCase energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare final BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - final use_dhwCalc=false, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), diff --git a/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo index d80155da..ab16ac62 100644 --- a/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo +++ b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo @@ -3,7 +3,7 @@ partial model PartialDHW "Partial model for domestic hot water (DHW)" extends BESMod.Systems.BaseClasses.PartialFluidSubsystem; extends BESMod.Utilities.Icons.DHWIcon; parameter Boolean subsystemDisabled "To enable the icon if the subsystem is disabled" annotation (Dialog(tab="Graphics")); - parameter Modelica.Units.SI.MassFlowRate mDHW_flow_nominal + parameter Modelica.Units.SI.MassFlowRate mDHW_flow_nominal(min=1e-60) "Nominal mass flow rate" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem")); parameter Modelica.Units.SI.Temperature TDHW_nominal From 6c2b730acad391b048d02ff887b79f7a04932950 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 29 Aug 2023 12:20:27 +0200 Subject: [PATCH 096/131] fix opening --- .../Hydraulical/Transfer/UFHTransferSystem.mo | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index 28e80787..deddcd23 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -96,6 +96,10 @@ model UFHTransferSystem {-78,98}}))); BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{32,-108},{52,-88}}))); + Modelica.Blocks.Routing.RealPassThrough reaPasThrOpe[nParallelDem] annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={0,70}))); protected parameter BESMod.Systems.Hydraulical.Components.UFH.ActiveWallBaseDataDefinition @@ -175,9 +179,16 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(gain.u, outBusTra.opening) annotation (Line(points={{-30,92},{-30,100}, - {-14,100},{-14,-2},{-12,-2},{-12,-90},{0,-90},{0,-104}}, - color={0,0,127}), Text( + connect(reaPasThrOpe.u, traControlBus.opening) annotation (Line(points={{ + 2.22045e-15,82},{2.22045e-15,91},{0,91},{0,100}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + connect(reaPasThrOpe.y, outBusTra.opening) annotation (Line(points={{ + -1.9984e-15,59},{38,59},{38,-82},{0,-82},{0,-104}}, color={0,0,127}), + Text( string="%second", index=1, extent={{6,3},{6,3}}, From 689648a1ef1bcb9f2999709d42be1d97d2f73d24 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Thu, 14 Sep 2023 07:58:53 +0200 Subject: [PATCH 097/131] fix max error --- .../Generation/RecordsCollection/HeatPumpBaseDataDefinition.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/HeatPumpBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/HeatPumpBaseDataDefinition.mo index bb042b60..46f8915d 100644 --- a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/HeatPumpBaseDataDefinition.mo +++ b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/HeatPumpBaseDataDefinition.mo @@ -41,7 +41,7 @@ partial record HeatPumpBaseDataDefinition Systems.Hydraulical.Generation.Types.GenerationDesign.Monovalent then 0 elseif genDesTyp == Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentAlternativ then QGen_flow_nominal elseif genDesTyp == Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentParallel - then QGen_flow_nominal - QPriAtTOdaNom_flow_nominal else QGen_flow_nominal + then max(0, QGen_flow_nominal - QPriAtTOdaNom_flow_nominal) else QGen_flow_nominal "Nominal heat flow rate of secondary generation component (e.g. auxilliar heater)" annotation (Dialog(group="Design")); From 4f317ffda2f76deda1606f5169bd4056c43234f3 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 18 Sep 2023 14:43:50 +0200 Subject: [PATCH 098/131] Add sup control for building and DHW --- .../Components/BuildingAndDHWControl.mo | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo index aad2d096..c8db0ee0 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo @@ -167,12 +167,16 @@ model BuildingAndDHWControl extent={{-10,-10},{10,10}}, rotation=0, origin={90,-10}))); + Modelica.Blocks.Routing.RealPassThrough + realPassThrough + "Disable secondary device if no anti legionella" + annotation (Placement(transformation(extent={{0,120},{20,140}}))); equation connect(hysDHW.priGenOn, priGenOn.u1) annotation (Line(points={{79.12,75.6},{79.12, 74},{108,74},{108,46},{230,46},{230,-90},{238,-90}}, color={255,0,255})); connect(TSetDHW.y, orDHW.u[1]) annotation (Line(points={{-61.2,85.36},{-54, - 85.36},{-54,50},{-48,50},{-48,34},{90,34},{90,74},{108,74},{108,67.6667}, - {120,67.6667}}, color={255,0,255})); + 85.36},{-54,50},{-48,50},{-48,34},{90,34},{90,74},{108,74},{108, + 67.6667},{120,67.6667}}, color={255,0,255})); connect(hysDHW.secGenOn, orDHW.u[2]) annotation (Line(points={{79.12,66},{90,66}, {90,50},{120,50},{120,70}}, color={255,0,255})); connect(TSetDHW.TSetDHW, supCtrDHW.uLoc) annotation (Line(points={{-61.2,90},{-10, @@ -211,8 +215,8 @@ equation color={255,0,255})); connect(secGenOn.y, secGen) annotation (Line(points={{221.5,-110},{286,-110},{ 286,-70},{310,-70}}, color={255,0,255})); - connect(hysDHW.secGenOn, secGenOn.u[1]) annotation (Line(points={{79.12,66},{90, - 66},{90,34},{178,34},{178,-112.333},{200,-112.333}}, + connect(hysDHW.secGenOn, secGenOn.u[1]) annotation (Line(points={{79.12,66},{ + 90,66},{90,34},{178,34},{178,-112.333},{200,-112.333}}, color={255,0,255})); connect(TSetDHW.y, secGenOn.u[2]) annotation (Line(points={{-61.2,85.36},{-54, 85.36},{-54,50},{-48,50},{-48,34},{178,34},{178,-110},{200,-110}}, @@ -298,8 +302,9 @@ equation {274,80},{310,80}}, color={0,0,127})); connect(logSwiSumModPriGen.y, priGenOn.u2) annotation (Line(points={{141,-70}, {164,-70},{164,-98},{238,-98}}, color={255,0,255})); - connect(logSwiSumModSecGen.y, secGenOn.u[3]) annotation (Line(points={{141,-110}, - {140,-110},{140,-126},{200,-126},{200,-107.667}}, color={255,0,255})); + connect(logSwiSumModSecGen.y, secGenOn.u[3]) annotation (Line(points={{141, + -110},{140,-110},{140,-126},{200,-126},{200,-107.667}}, + color={255,0,255})); connect(logSwiDHW.y, DHW) annotation (Line(points={{261,20},{282,20},{282,52}, {310,52}}, color={255,0,255})); connect(logSwiSumModSecGen.u3, conSumModGen.y) annotation (Line(points={{118, @@ -326,6 +331,26 @@ equation 20},{238,20}}, color={255,0,255})); connect(logSwiDHW.y, bufOn.u) annotation (Line(points={{261,20},{266,20},{266, 66},{148,66},{148,80}}, color={255,0,255})); + connect(heaCur.TSet, sigBusHyd.TBuiLoc) annotation (Line(points={{-19,-90},{ + -20,-90},{-20,-24},{-112,-24},{-112,103},{100,103}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(realPassThrough.y, sigBusHyd.TStoDHWTop) annotation (Line(points={{21, + 130},{21,100},{78,100},{78,84},{100,84},{100,103}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(realPassThrough.u, sigBusDistr.TStoDHWTopMea) annotation (Line(points + ={{-2,130},{-100,130},{-100,70}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140}, {300,100}})), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140},{300,100}}), graphics={ From 5837c3d3b1b235dfbbcbd054bbdb6965f8980c49 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Thu, 28 Sep 2023 11:10:48 +0200 Subject: [PATCH 099/131] fix disabled KPI --- .../Hydraulical/Generation/BaseClasses/PartialHeatPump.mo | 1 - 1 file changed, 1 deletion(-) diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo index e92160f2..9b94437f 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo @@ -163,7 +163,6 @@ model PartialHeatPump "Generation with only the heat pump" origin={-170,50}))); Utilities.KPIs.EnergyKPICalculator KPIQHP(use_inpCon=false, final y=heatPump.con.QFlow_in) - if false annotation (Placement(transformation(extent={{-140,-80},{-120,-60}}))); IBPSA.Fluid.Sources.Boundary_pT bouPum( From a4c5041510a22a294993b2e175e568c6a531dea4 Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Thu, 7 Dec 2023 13:08:44 +0100 Subject: [PATCH 100/131] use new IBPSA version with new pump models --- BESMod/Examples/BAUSimStudy/PartialCase.mo | 2 +- .../Examples/UseCaseDesignOptimization/BES.mo | 17 ++++-- .../DHW/BaseClasses/PartialDHWWithBasics.mo | 19 ++----- .../Valves/Tests/PressureReliefExample.mo | 19 ++----- .../Valves/Tests/TestThreeWayValve.mo | 12 +--- .../Distribution/TwoStoragesBoilerWithDHW.mo | 14 +---- .../Generation/BaseClasses/PartialHeatPump.mo | 17 ++---- .../DetailedSolarThermalWithHeatPump.mo | 20 ++----- .../Generation/ElectricalHeater.mo | 15 +---- .../Hydraulical/Generation/GasBoiler.mo | 35 +++++------- .../SimpleSolarThermalWithHeatPump.mo | 20 +++---- .../Transfer/IdealValveRadiator.mo | 54 +++++++++--------- .../Transfer/RadiatorPressureBased.mo | 55 ++++++++----------- .../Hydraulical/Transfer/UFHTransferSystem.mo | 31 ++++++----- .../RecordsCollection/Movers/DefaultMover.mo | 5 +- .../Movers/MoverBaseDataDefinition.mo | 6 -- .../ControlledDomesticVentilation.mo | 40 ++++---------- BESMod/package.mo | 5 +- dependencies.json | 8 +-- 19 files changed, 146 insertions(+), 248 deletions(-) diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index d1cfd1b4..9231ded5 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -83,7 +83,7 @@ partial model PartialCase radParameters, redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData - transferDataBaseDefinition, + parTra, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, diff --git a/BESMod/Examples/UseCaseDesignOptimization/BES.mo b/BESMod/Examples/UseCaseDesignOptimization/BES.mo index b045feec..25ec8ef3 100644 --- a/BESMod/Examples/UseCaseDesignOptimization/BES.mo +++ b/BESMod/Examples/UseCaseDesignOptimization/BES.mo @@ -2,9 +2,11 @@ within BESMod.Examples.UseCaseDesignOptimization; model BES extends Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, - redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare - BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( - heaLoadFacGrd=0, heaLoadFacOut=0)), + redeclare Systems.Demand.Building.TEASERThermalZone building( + ABui=sum(building.zoneParam.VAir)^(2/3), + hBui=sum(building.zoneParam.VAir)^(1/3), + redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( @@ -80,10 +82,13 @@ model BES redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parThrWayVal), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( - redeclare + redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), + parRad, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData + parTra)), redeclare Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, diff --git a/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHWWithBasics.mo b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHWWithBasics.mo index 3a563625..4511fa3f 100644 --- a/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHWWithBasics.mo +++ b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHWWithBasics.mo @@ -25,31 +25,20 @@ Modelica.Blocks.Math.UnitConversions.From_degC fromDegC Utilities.KPIs.EnergyKPICalculator integralKPICalculator(use_inpCon=false, y= -port_b.m_flow*cp*(TIs.y - TDHWCold_nominal)) annotation (Placement(transformation(extent={{60,-60},{80,-40}}))); - IBPSA.Fluid.Movers.FlowControlled_m_flow pump( + IBPSA.Fluid.Movers.Preconfigured.FlowControlled_m_flow pump( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=TDHWCold_nominal, final allowFlowReversal=allowFlowReversal, - final m_flow_nominal=mDHW_flow_nominal, final m_flow_small=1E-4*abs(mDHW_flow_nominal), final show_T=show_T, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData - per( - final speed_rpm_nominal=parPum.speed_rpm_nominal, - final m_flow_nominal=mDHW_flow_nominal, - final dp_nominal(displayUnit="Pa") = 100, - final rho=rho, - final V_flowCurve=parPum.V_flowCurve, - final dpCurve=parPum.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final m_flow_nominal=mDHW_flow_nominal, + final dp_nominal(displayUnit="Pa") = 100, final addPowerToMedium=parPum.addPowerToMedium, - final nominalValuesDefineDefaultPressureCurve=false, final tau=parPum.tau, final use_inputFilter=parPum.use_inputFilter, - final riseTime=parPum.riseTimeInpFilter, - final dp_nominal=100) annotation (Placement(transformation( + final riseTime=parPum.riseTimeInpFilter) annotation (Placement(transformation( extent={{-9.5,9.5},{9.5,-9.5}}, rotation=180, origin={-69.5,-50.5}))); diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo index 683b4956..b2ec6c36 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/PressureReliefExample.mo @@ -33,17 +33,10 @@ model PressureReliefExample extent={{-10,-10},{10,10}}, rotation=0, origin={50,30}))); - IBPSA.Fluid.Movers.SpeedControlled_y pump( + IBPSA.Fluid.Movers.Preconfigured.SpeedControlled_y pump( redeclare package Medium = Medium, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final speed_rpm_nominal=parPum.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal, - final dp_nominal=dp_nominal, - final rho(displayUnit="kg/m3") = 1000, - final V_flowCurve=parPum.V_flowCurve, - final dpCurve=parPum.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final m_flow_nominal=m_flow_nominal, + final dp_nominal=dp_nominal, final use_inputFilter=false, final y_start=1) annotation (Placement( transformation( @@ -52,11 +45,7 @@ model PressureReliefExample origin={-50,30}))); replaceable parameter BESMod.Systems.RecordsCollection.Movers.DefaultMover - parPum(V_flowCurve={0.000422526,0.28816252,0.580972823,0.868712818, - 0.94983775,1.086736074,1.190677393,1.396024878,1.499966198}, dpCurve={ - 1.587002096,1.526205451,1.375262055,1.161425577,1.07966457,0.857442348, - 0.645702306,0.224318658,0}) - annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,82}, + parPum annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,82}, {-80,98}}))); Modelica.Blocks.Sources.Constant const(final k=1) annotation (Placement(transformation(extent={{-100,40},{-80,60}}))); diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/TestThreeWayValve.mo b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/TestThreeWayValve.mo index e1326e50..3c052795 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/TestThreeWayValve.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/TestThreeWayValve.mo @@ -34,18 +34,12 @@ model TestThreeWayValve fraK=1, riseTime=50)) annotation (Placement(transformation(extent={{-46,-40},{24,20}}))); - IBPSA.Fluid.Movers.FlowControlled_m_flow + IBPSA.Fluid.Movers.Preconfigured.FlowControlled_m_flow pumpHP( redeclare final package Medium = Medium, - m_flow_nominal=m_flow_nominal, - redeclare Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final m_flow_nominal=m_flow_nominal, - final dp_nominal=2*(threeWayValveWithFlowReturn.parameters.dpValve_nominal + final m_flow_nominal=m_flow_nominal, + final dp_nominal=2*(threeWayValveWithFlowReturn.parameters.dpValve_nominal + threeWayValveWithFlowReturn.parameters.dpFixed_nominal[1]) + dpRes, - final rho(displayUnit="kg/m3") = 1000, - V_flowCurve={0,0.99,1,1.01}, - dpCurve={2,1,0.5,0}), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, final addPowerToMedium=false, final use_inputFilter=false) annotation (Placement(transformation( diff --git a/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo index 43bc3cb0..10a68907 100644 --- a/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo +++ b/BESMod/Systems/Hydraulical/Distribution/TwoStoragesBoilerWithDHW.mo @@ -147,27 +147,19 @@ model TwoStoragesBoilerWithDHW final allowFlowReversal_HC2=allowFlowReversal) "Hydraulic seperator" annotation (Placement(transformation(extent={{60,-2},{76,18}}))); - IBPSA.Fluid.Movers.SpeedControlled_y pumpBoiler( + IBPSA.Fluid.Movers.Preconfigured.SpeedControlled_y pumpBoiler( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final allowFlowReversal=allowFlowReversal, final show_T=show_T, - redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData - per( - final speed_rpm_nominal=parPum.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal[1], - final dp_nominal=boi.dp_nominal + (parThrWayValBoi.dpValve_nominal + max(parThrWayValBoi.dp_nominal)), - final rho=rho, - final V_flowCurve=parPum.V_flowCurve, - final dpCurve=parPum.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final m_flow_nominal=m_flow_nominal[1], + final dp_nominal=boi.dp_nominal + (parThrWayValBoi.dpValve_nominal + max(parThrWayValBoi.dp_nominal)), final addPowerToMedium=parPum.addPowerToMedium, final tau=parPum.tau, final use_inputFilter=parPum.use_inputFilter, final riseTime=parPum.riseTimeInpFilter, - final init=Modelica.Blocks.Types.Init.InitialOutput, final y_start=1) annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=180, diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo index 9b94437f..9922d0ad 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo @@ -130,27 +130,19 @@ model PartialHeatPump "Generation with only the heat pump" Utilities.KPIs.EnergyKPICalculator KPIWel(use_inpCon=true) annotation (Placement(transformation(extent={{-140,-40},{-120,-20}}))); - IBPSA.Fluid.Movers.SpeedControlled_y pump( + IBPSA.Fluid.Movers.Preconfigured.SpeedControlled_y pump( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final allowFlowReversal=allowFlowReversal, final show_T=show_T, - redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData - per( - final speed_rpm_nominal=parPum.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal[1], - final dp_nominal=dpDem_nominal[1] + dp_nominal[1], - final rho=rho, - final V_flowCurve=parPum.V_flowCurve, - final dpCurve=parPum.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final m_flow_nominal=m_flow_nominal[1], + final dp_nominal=dpDem_nominal[1] + dp_nominal[1], final addPowerToMedium=parPum.addPowerToMedium, final tau=parPum.tau, final use_inputFilter=parPum.use_inputFilter, final riseTime=parPum.riseTimeInpFilter, - final init=Modelica.Blocks.Types.Init.InitialOutput, final y_start=1) annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=180, @@ -267,7 +259,8 @@ equation horizontalAlignment=TextAlignment.Left)); connect(switch.u1, weaBus.TDryBul) annotation (Line(points={{-142,58},{-144,58}, - {-144,80},{-101,80}}, color={0,0,127}), Text( + {-144,80.11},{-100.895,80.11}}, + color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, diff --git a/BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo index bedd15bd..7df9fcbc 100644 --- a/BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo @@ -57,27 +57,19 @@ model DetailedSolarThermalWithHeatPump rotation=180, origin={-30,-170}))); - IBPSA.Fluid.Movers.SpeedControlled_y pumpSolThe( + IBPSA.Fluid.Movers.Preconfigured.SpeedControlled_y pumpSolThe( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final allowFlowReversal=allowFlowReversal, final show_T=show_T, - redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData - per( - final speed_rpm_nominal=parPumSolThe.speed_rpm_nominal, - final m_flow_nominal=solarThermalParas.m_flow_nominal, - final dp_nominal=dpST_nominal + dpDem_nominal[2], - final rho=rho, - final V_flowCurve=parPumSolThe.V_flowCurve, - final dpCurve=parPumSolThe.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final addPowerToMedium=parPumSolThe.addPowerToMedium, + final m_flow_nominal=solarThermalParas.m_flow_nominal, + final dp_nominal=dpST_nominal + dpDem_nominal[2], + final addPowerToMedium=parPumSolThe.addPowerToMedium, final tau=parPumSolThe.tau, final use_inputFilter=parPumSolThe.use_inputFilter, final riseTime=parPumSolThe.riseTimeInpFilter, - final init=Modelica.Blocks.Types.Init.InitialOutput, final y_start=1) "Solar thermal pump" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, @@ -153,8 +145,8 @@ equation color={0,0,127})); connect(switch3.u2, isOnHR1.y) annotation (Line(points={{-170,-170},{-199, -170}}, color={255,0,255})); - connect(isOnHR1.u, weaBus.HDirNor) annotation (Line(points={{-222,-170},{-228, - -170},{-228,28},{-101,28},{-101,80}}, + connect(isOnHR1.u, weaBus.HDirNor) annotation (Line(points={{-222,-170},{-228,-170}, + {-228,28},{-100.895,28},{-100.895,80.11}}, color={0,0,127}), Text( string="%second", index=1, diff --git a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo index b0fc17f0..cace4089 100644 --- a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo @@ -46,28 +46,19 @@ model ElectricalHeater "Only heat using a heating rod" rotation=270, origin={46,14}))); - IBPSA.Fluid.Movers.SpeedControlled_y pump( + IBPSA.Fluid.Movers.Preconfigured.SpeedControlled_y pump( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final allowFlowReversal=allowFlowReversal, final show_T=show_T, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData - per( - final speed_rpm_nominal=parPum.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal[1], - final dp_nominal=dpDem_nominal[1] + dp_nominal[1], - final rho=rho, - final V_flowCurve=parPum.V_flowCurve, - final dpCurve=parPum.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final m_flow_nominal=m_flow_nominal[1], + final dp_nominal=dpDem_nominal[1] + dp_nominal[1], final addPowerToMedium=parPum.addPowerToMedium, final tau=parPum.tau, final use_inputFilter=parPum.use_inputFilter, final riseTime=parPum.riseTimeInpFilter, - final init=Modelica.Blocks.Types.Init.InitialOutput, final y_start=1) annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=180, diff --git a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo index 47f2743c..3d79b75e 100644 --- a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo @@ -8,7 +8,8 @@ model GasBoiler "Just a gas boiler" annotation(Dialog(group="Component data")); replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.AutoparameterBoiler - parBoi constrainedby AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition( + parBoi constrainedby + AixLib.DataBase.Boiler.General.BoilerTwoPointBaseDataDefinition( Q_nom=max(11000, Q_flow_nominal[1])) "Parameters for Boiler" annotation(Placement(transformation(extent={{-58,44},{-42,60}})), @@ -48,32 +49,24 @@ model GasBoiler "Just a gas boiler" Utilities.KPIs.EnergyKPICalculator KPIQHR(use_inpCon=false, y=boi.QflowCalculation.y) annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}))); - IBPSA.Fluid.Movers.SpeedControlled_y pump( + IBPSA.Fluid.Movers.Preconfigured.SpeedControlled_y pump( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final allowFlowReversal=allowFlowReversal, final show_T=show_T, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData - per( - final speed_rpm_nominal=parPum.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal[1], - final dp_nominal=dpDem_nominal[1] + dp_nominal[1], - final rho=rho, - final V_flowCurve=parPum.V_flowCurve, - final dpCurve=parPum.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, final addPowerToMedium=parPum.addPowerToMedium, final tau=parPum.tau, final use_inputFilter=parPum.use_inputFilter, final riseTime=parPum.riseTimeInpFilter, - final init=Modelica.Blocks.Types.Init.InitialOutput, - final y_start=1) annotation (Placement(transformation( + final y_start=1, + final m_flow_nominal=m_flow_nominal[1], + final dp_nominal=dpDem_nominal[1] + dp_nominal[1]) + annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=180, - origin={46,-50}))); + origin={30,-50}))); IBPSA.Fluid.Sources.Boundary_pT bou1( redeclare package Medium = Medium, @@ -119,19 +112,19 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(portGen_in[1], pump.port_a) annotation (Line(points={{100,-2},{94,-2}, - {94,-6},{86,-6},{86,-50},{56,-50}}, color={0,127,255})); + connect(portGen_in[1], pump.port_a) annotation (Line(points={{100,-2},{94,-2},{94, + -6},{86,-6},{86,-50},{40,-50}}, color={0,127,255})); connect(boi.port_a, pump.port_b) annotation (Line(points={{-66,10},{-68,10},{-68, - -50},{36,-50},{36,-50}}, color={0,127,255})); + -50},{20,-50}}, color={0,127,255})); connect(bou1.ports[1], pump.port_a) - annotation (Line(points={{66,-36},{66,-50},{56,-50}}, color={0,127,255})); + annotation (Line(points={{66,-36},{66,-50},{40,-50}}, color={0,127,255})); connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( Line( points={{46,-98},{60,-98},{60,-100},{72,-100}}, color={0,0,0}, thickness=1)); - connect(pump.y, sigBusGen.uPump) annotation (Line(points={{46,-38},{48,-38},{ - 48,14},{2,14},{2,98}}, color={0,0,127}), Text( + connect(pump.y, sigBusGen.uPump) annotation (Line(points={{30,-38},{30,14},{2,14}, + {2,98}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, diff --git a/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo index bbc1c61b..7727d01d 100644 --- a/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo @@ -56,27 +56,19 @@ model SimpleSolarThermalWithHeatPump rotation=180, origin={-30,-148}))); - IBPSA.Fluid.Movers.SpeedControlled_y pumpSolThe( + IBPSA.Fluid.Movers.Preconfigured.SpeedControlled_y pumpSolThe( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final allowFlowReversal=allowFlowReversal, final show_T=show_T, - redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData - per( - final speed_rpm_nominal=parPumSolThe.speed_rpm_nominal, - final m_flow_nominal=parSolThe.m_flow_nominal, - final dp_nominal=dpST_nominal + dpDem_nominal[2], - final rho=rho, - final V_flowCurve=parPumSolThe.V_flowCurve, - final dpCurve=parPumSolThe.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final m_flow_nominal=parSolThe.m_flow_nominal, + final dp_nominal=dpST_nominal + dpDem_nominal[2], final addPowerToMedium=parPumSolThe.addPowerToMedium, final tau=parPumSolThe.tau, final use_inputFilter=parPumSolThe.use_inputFilter, final riseTime=parPumSolThe.riseTimeInpFilter, - final init=Modelica.Blocks.Types.Init.InitialOutput, final y_start=1) "Solar thermal pump" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, @@ -142,13 +134,15 @@ equation horizontalAlignment=TextAlignment.Left)); connect(solThe.T_air, weaBus.TDryBul) annotation (Line(points={{-24,-158},{-24,-178}, - {-194,-178},{-194,80},{-101,80}}, color={0,0,127}), Text( + {-194,-178},{-194,80.11},{-100.895,80.11}}, + color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(solThe.Irradiation, weaBus.HGloHor) annotation (Line(points={{-30,-158}, - {-30,-182},{-198,-182},{-198,80},{-101,80}}, color={0,0,127}), Text( + {-30,-182},{-198,-182},{-198,80.11},{-100.895,80.11}}, + color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, diff --git a/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo index d51d506c..e5fc4837 100644 --- a/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo +++ b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo @@ -2,11 +2,11 @@ within BESMod.Systems.Hydraulical.Transfer; model IdealValveRadiator "Subsystem using a radiator and ideal thermostatic valves" extends BaseClasses.PartialTransfer( - final nHeaTra=radParameters.n, + final nHeaTra=parRad.n, final QLoss_flow_nominal=f_design .* Q_flow_nominal .- Q_flow_nominal, final dTLoss_nominal=fill(0, nParallelDem), final nParallelSup=1, - final dp_nominal= fill(0, nParallelDem)); + final dp_nominal=parTra.dp_nominal); IBPSA.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad[nParallelDem]( each final allowFlowReversal=allowFlowReversal, @@ -14,26 +14,25 @@ model IdealValveRadiator each final show_T=show_T, each final energyDynamics=energyDynamics, each final p_start=p_start, - each final nEle=radParameters.nEle, - each final fraRad=radParameters.fraRad, + each final nEle=parRad.nEle, + each final fraRad=parRad.fraRad, final Q_flow_nominal=Q_flow_nominal .* f_design, final T_a_nominal=TTra_nominal, final T_b_nominal=TTra_nominal - dTTra_nominal, final TAir_nominal=TDem_nominal, final TRad_nominal=TDem_nominal, - each final n=radParameters.n, + each final n=parRad.n, each final deltaM=0.3, - each final dp_nominal=0, + final dp_nominal=parTra.dpRad_nominal, redeclare package Medium = Medium, - each final T_start=T_start) "Radiator" annotation ( - Placement(transformation( + each final T_start=T_start) "Radiator" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=90, origin={-10,-30}))); IBPSA.Fluid.FixedResistances.PressureDrop res[nParallelDem]( redeclare package Medium = Medium, - each final dp_nominal=1, + each final dp_nominal=parTra.dpHeaDistr_nominal, final m_flow_nominal=m_flow_nominal) "Hydraulic resistance of supply" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -45,14 +44,14 @@ model IdealValveRadiator rotation=270, origin={10,30}))); - replaceable parameter BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters annotation ( - choicesAllMatching=true, - Placement(transformation(extent={{-100,-98},{-80,-78}}))); + replaceable parameter + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData parRad + "Radiator parameters" annotation (choicesAllMatching=true, Placement( + transformation(extent={{-100,-98},{-80,-78}}))); Utilities.KPIs.EnergyKPICalculator intKPICalHeaFlo(final use_inpCon=false, final y=sum(-heatPortRad.Q_flow) + sum(-heatPortCon.Q_flow)) annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}))); - IBPSA.Fluid.Movers.FlowControlled_m_flow pumFixMFlo[nParallelDem]( + IBPSA.Fluid.Movers.Preconfigured.FlowControlled_m_flow pumFixMFlo[nParallelDem]( redeclare final package Medium = Medium, each final energyDynamics=energyDynamics, each final p_start=p_start, @@ -61,20 +60,11 @@ model IdealValveRadiator each final C_start=C_start, each final C_nominal=C_nominal, each final allowFlowReversal=allowFlowReversal, - final m_flow_nominal=m_flow_nominal, final m_flow_small=1E-4*abs(m_flow_nominal), each final show_T=show_T, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - each final speed_rpm_nominal=parPum.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal, - final dp_nominal=dp_nominal, - each final rho=rho, - each final V_flowCurve=parPum.V_flowCurve, - each final dpCurve=parPum.dpCurve), - each final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final m_flow_nominal=m_flow_nominal, + final dp_nominal=dp_nominal, each final addPowerToMedium=parPum.addPowerToMedium, - each final nominalValuesDefineDefaultPressureCurve=true, each final tau=parPum.tau, each final use_inputFilter=false, final m_flow_start=m_flow_nominal) annotation (Placement(transformation( @@ -83,13 +73,25 @@ model IdealValveRadiator origin={-10,10}))); replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition - parPum annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,78},{-78,98}}))); + parPum "Pump assumptions" + annotation (choicesAllMatching=true, Placement(transformation(extent={{-98,78},{-78,98}}))); BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{30,-106},{50,-86}}))); Modelica.Blocks.Routing.RealPassThrough reaPasThrOpe[nParallelDem] annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, origin={0,70}))); + replaceable parameter RecordsCollection.TransferDataBaseDefinition parTra + constrainedby RecordsCollection.TransferDataBaseDefinition( + final Q_flow_nominal=Q_flow_nominal .* f_design, + final nZones=nParallelDem, + final AFloor=ABui, + final heiBui=hBui, + mRad_flow_nominal=m_flow_nominal, + mHeaCir_flow_nominal=mSup_flow_nominal[1]) "Transfer parameters" annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{-70,-98},{-50,-78}}))); equation connect(rad.heatPortRad, heatPortRad) annotation (Line(points={{-2.8,-32},{40, -32},{40,-40},{100,-40}}, color={191,0,0})); diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index 49606de9..4693edc2 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -5,25 +5,24 @@ model RadiatorPressureBased "Pressure Based transfer system" nHeaTra=radParameters.n, ABui=1, hBui=1, - final dp_nominal=transferDataBaseDefinition.dp_nominal, + final dp_nominal=parTra.dp_nominal, final nParallelSup=1); parameter Boolean use_preRelVal=false "=false to disable pressure relief valve" annotation(Dialog(group="Component choices")); parameter Real perPreRelValOpens=0.99 "Percentage of nominal pressure difference at which the pressure relief valve starts to open" annotation(Dialog(group="Component choices", enable=use_preRelVal)); - replaceable parameter RecordsCollection.TransferDataBaseDefinition - transferDataBaseDefinition constrainedby - RecordsCollection.TransferDataBaseDefinition( + replaceable parameter RecordsCollection.TransferDataBaseDefinition parTra + constrainedby RecordsCollection.TransferDataBaseDefinition( final Q_flow_nominal=Q_flow_nominal .* f_design, final nZones=nParallelDem, final AFloor=ABui, final heiBui=hBui, mRad_flow_nominal=m_flow_nominal, - mHeaCir_flow_nominal=mSup_flow_nominal[1]) - annotation (Dialog(group="Component data"), - choicesAllMatching=true, - Placement(transformation(extent={{-62,-98},{-42,-78}}))); + mHeaCir_flow_nominal=mSup_flow_nominal[1]) "Transfer parameters" annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{-62,-98},{-42,-78}}))); replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition @@ -43,24 +42,23 @@ model RadiatorPressureBased "Pressure Based transfer system" each final p_start=p_start, each final nEle=radParameters.nEle, each final fraRad=radParameters.fraRad, - final Q_flow_nominal=Q_flow_nominal.*f_design, + final Q_flow_nominal=Q_flow_nominal .* f_design, final T_a_nominal=TTra_nominal, final T_b_nominal=TTra_nominal .- dTTra_nominal, final TAir_nominal=TDem_nominal, final TRad_nominal=TDem_nominal, each final n=radParameters.n, each final deltaM=0.3, - final dp_nominal=transferDataBaseDefinition.dpRad_nominal, + final dp_nominal=parTra.dpRad_nominal, redeclare package Medium = Medium, - each final T_start=T_start) "Radiator" - annotation (Placement(transformation( + each final T_start=T_start) "Radiator" annotation (Placement(transformation( extent={{11,11},{-11,-11}}, rotation=90, origin={-13,-25}))); IBPSA.Fluid.FixedResistances.PressureDrop res[nParallelDem]( redeclare package Medium = Medium, - each final dp_nominal=transferDataBaseDefinition.dpHeaDistr_nominal, + each final dp_nominal=parTra.dpHeaDistr_nominal, final m_flow_nominal=m_flow_nominal) "Hydraulic resistance of supply" annotation (Placement(transformation( extent={{-12.5,-13.5},{12.5,13.5}}, @@ -72,11 +70,10 @@ model RadiatorPressureBased "Pressure Based transfer system" final m_flow_nominal=m_flow_nominal, each final show_T=show_T, each final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, - final dpValve_nominal=transferDataBaseDefinition.dpHeaSysValve_nominal, + final dpValve_nominal=parTra.dpHeaSysValve_nominal, each final use_inputFilter=false, - final dpFixed_nominal=transferDataBaseDefinition.dpHeaSysPreValve_nominal, - each final l=transferDataBaseDefinition.leakageOpening) - annotation (Placement(transformation( + final dpFixed_nominal=parTra.dpHeaSysPreValve_nominal, + each final l=parTra.leakageOpening) annotation (Placement(transformation( extent={{-10,-11},{10,11}}, rotation=270, origin={-12,1}))); @@ -90,34 +87,26 @@ model RadiatorPressureBased "Pressure Based transfer system" final m_flow_nominal=sum(rad.m_flow_nominal), final m_flow_small=1E-4*abs(sum(rad.m_flow_nominal)), final allowFlowReversal=allowFlowReversal, - final V(displayUnit="l") = transferDataBaseDefinition.vol, + final V(displayUnit="l") = parTra.vol, final use_C_flow=false, nPorts=1 + nParallelDem) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={-58,18}))); - IBPSA.Fluid.Movers.SpeedControlled_y pump( + IBPSA.Fluid.Movers.Preconfigured.SpeedControlled_y pump( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final allowFlowReversal=allowFlowReversal, final show_T=show_T, - redeclare BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData per( - final speed_rpm_nominal=parPum.speed_rpm_nominal, - final m_flow_nominal=sum(m_flow_nominal), - final dp_nominal=transferDataBaseDefinition.dpPumpHeaCir_nominal + dpSup_nominal[1], - final rho=rho, - final V_flowCurve=parPum.V_flowCurve, - final dpCurve=parPum.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final m_flow_nominal=sum(m_flow_nominal), + final dp_nominal=parTra.dpPumpHeaCir_nominal + dpSup_nominal[1], final addPowerToMedium=parPum.addPowerToMedium, final tau=parPum.tau, final use_inputFilter=parPum.use_inputFilter, final riseTime=parPum.riseTimeInpFilter, - final init=Modelica.Blocks.Types.Init.InitialOutput, - final y_start=1) annotation (Placement( - transformation( + final y_start=1) annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-74,38}))); @@ -135,9 +124,9 @@ model RadiatorPressureBased "Pressure Based transfer system" m_flow_nominal=mSup_flow_nominal[1], final dpFullOpen_nominal=dp_nominal[1], final dpThreshold_nominal=perPreRelValOpens*dp_nominal[1], - final facDpValve_nominal=transferDataBaseDefinition.valveAutho[1], - final l=transferDataBaseDefinition.leakageOpening) if use_preRelVal - annotation (Placement(transformation( + final facDpValve_nominal=parTra.valveAutho[1], + final l=parTra.leakageOpening) if use_preRelVal annotation (Placement( + transformation( extent={{10,-10},{-10,10}}, rotation=90, origin={-90,-10}))); diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index deddcd23..d6a5cf18 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -1,11 +1,13 @@ within BESMod.Systems.Hydraulical.Transfer; model UFHTransferSystem extends BaseClasses.PartialTransfer( - nHeaTra=1, final nParallelSup=1, final dp_nominal=fill(0, nParallelDem)); + nHeaTra=1, + final nParallelSup=1, + final dp_nominal=parTra.dp_nominal); IBPSA.Fluid.FixedResistances.PressureDrop res[nParallelDem]( redeclare package Medium = Medium, - each final dp_nominal=1, + each final dp_nominal=parTra.dpHeaDistr_nominal, final m_flow_nominal=m_flow_nominal) "Hydraulic resistance of supply" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -59,7 +61,7 @@ model UFHTransferSystem Utilities.KPIs.EnergyKPICalculator integralKPICalculator[nParallelDem] annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}))); - IBPSA.Fluid.Movers.FlowControlled_m_flow pumpFix_m_flow[nParallelDem]( + IBPSA.Fluid.Movers.Preconfigured.FlowControlled_m_flow pumpFix_m_flow[nParallelDem]( redeclare package Medium = Medium, each final energyDynamics=energyDynamics, each final p_start=p_start, @@ -71,18 +73,8 @@ model UFHTransferSystem final m_flow_nominal=m_flow_nominal, final m_flow_small=1E-4*abs(m_flow_nominal), each final show_T=show_T, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData - per( - each final speed_rpm_nominal=parPum.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal, - final dp_nominal=dp_nominal, - each final rho=rho, - each final V_flowCurve=parPum.V_flowCurve, - each final dpCurve=parPum.dpCurve), - each final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final dp_nominal=dp_nominal, each final addPowerToMedium=parPum.addPowerToMedium, - each final nominalValuesDefineDefaultPressureCurve=true, each final tau=parPum.tau, each final use_inputFilter=false, final m_flow_start=m_flow_nominal) annotation (Placement( @@ -100,6 +92,17 @@ model UFHTransferSystem extent={{-10,-10},{10,10}}, rotation=270, origin={0,70}))); + replaceable parameter RecordsCollection.TransferDataBaseDefinition parTra + constrainedby RecordsCollection.TransferDataBaseDefinition( + final Q_flow_nominal=Q_flow_nominal .* f_design, + final nZones=nParallelDem, + final AFloor=ABui, + final heiBui=hBui, + mRad_flow_nominal=m_flow_nominal, + mHeaCir_flow_nominal=mSup_flow_nominal[1]) "Transfer parameters" annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{-100,-98},{-80,-78}}))); protected parameter BESMod.Systems.Hydraulical.Components.UFH.ActiveWallBaseDataDefinition diff --git a/BESMod/Systems/RecordsCollection/Movers/DefaultMover.mo b/BESMod/Systems/RecordsCollection/Movers/DefaultMover.mo index 50d1f974..0ac88944 100644 --- a/BESMod/Systems/RecordsCollection/Movers/DefaultMover.mo +++ b/BESMod/Systems/RecordsCollection/Movers/DefaultMover.mo @@ -4,8 +4,5 @@ record DefaultMover tau=1, riseTimeInpFilter=30, use_inputFilter=false, - addPowerToMedium=false, - speed_rpm_nominal=1500, - dpCurve={1.02,1.01,1,0.99,0}, - V_flowCurve={0,0.99,1,1.01,1.02}); + addPowerToMedium=false); end DefaultMover; diff --git a/BESMod/Systems/RecordsCollection/Movers/MoverBaseDataDefinition.mo b/BESMod/Systems/RecordsCollection/Movers/MoverBaseDataDefinition.mo index aa5c7d20..88555e57 100644 --- a/BESMod/Systems/RecordsCollection/Movers/MoverBaseDataDefinition.mo +++ b/BESMod/Systems/RecordsCollection/Movers/MoverBaseDataDefinition.mo @@ -1,12 +1,6 @@ within BESMod.Systems.RecordsCollection.Movers; partial record MoverBaseDataDefinition extends Modelica.Icons.Record; - parameter Real V_flowCurve[:]={0,0.99,1,1.01,1.02} - "Relative V_flow curve to be used"; - parameter Real dpCurve[:]={1.02,1.01,1,0.99,0} - "Relative dp curve to be used"; - parameter Modelica.Units.NonSI.AngularVelocity_rpm speed_rpm_nominal - "Nominal rotational speed for flow characteristic"; parameter Boolean addPowerToMedium "Set to false to avoid any power (=heat and flow work) being added to medium (may give simpler equations)"; parameter Boolean use_inputFilter diff --git a/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo b/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo index 0d5491f7..20480e77 100644 --- a/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo +++ b/BESMod/Systems/Ventilation/Generation/ControlledDomesticVentilation.mo @@ -26,28 +26,19 @@ model ControlledDomesticVentilation extent={{-8,-8},{8,8}}, rotation=180, origin={78,-22}))); - IBPSA.Fluid.Movers.SpeedControlled_y fanFlow( + IBPSA.Fluid.Movers.Preconfigured.SpeedControlled_y fanFlow( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final allowFlowReversal=allowFlowReversal, final show_T=show_T, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData - per( - final speed_rpm_nominal=fanData.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal[1], - final dp_nominal=dpDem_nominal[1] + dp_nominal[1], - final rho=rho, - final V_flowCurve=fanData.V_flowCurve, - final dpCurve=fanData.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, - final addPowerToMedium=fanData.addPowerToMedium, + final m_flow_nominal=m_flow_nominal[1], + final dp_nominal=dpDem_nominal[1] + dp_nominal[1], + final addPowerToMedium=fanData.addPowerToMedium, final tau=fanData.tau, final use_inputFilter=fanData.use_inputFilter, final riseTime=fanData.riseTimeInpFilter, - final init=Modelica.Blocks.Types.Init.InitialOutput, final y_start=1) annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=180, @@ -79,28 +70,19 @@ model ControlledDomesticVentilation rotation=180, origin={73,-41}))); - IBPSA.Fluid.Movers.SpeedControlled_y fanRet( + IBPSA.Fluid.Movers.Preconfigured.SpeedControlled_y fanRet( redeclare final package Medium = Medium, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final allowFlowReversal=allowFlowReversal, final show_T=show_T, - redeclare - BESMod.Systems.RecordsCollection.Movers.AutomaticConfigurationData - per( - final speed_rpm_nominal=fanData.speed_rpm_nominal, - final m_flow_nominal=m_flow_nominal[1], - final dp_nominal=dpDem_nominal [1]+ parameters.dpHex_nominal + 2*threeWayValveParas.dpValve_nominal, - final rho=rho, - final V_flowCurve=fanData.V_flowCurve, - final dpCurve=fanData.dpCurve), - final inputType=IBPSA.Fluid.Types.InputType.Continuous, + final m_flow_nominal=m_flow_nominal[1], + final dp_nominal=dpDem_nominal [1]+ parameters.dpHex_nominal + 2*threeWayValveParas.dpValve_nominal, final addPowerToMedium=fanData.addPowerToMedium, final tau=fanData.tau, final use_inputFilter=fanData.use_inputFilter, final riseTime=fanData.riseTimeInpFilter, - final init=Modelica.Blocks.Types.Init.InitialOutput, final y_start=1) annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=0, @@ -187,14 +169,14 @@ model ControlledDomesticVentilation Modelica.Blocks.Math.Add add annotation (Placement(transformation(extent={{2,-114},{22,-94}}))); equation - connect(bouSup.p_in, weaBus.pAtm) annotation (Line(points={{87.6,-28.4},{112, - -28.4},{112,92},{41,92},{41,100}}, color={0,0,127}), Text( + connect(bouSup.p_in, weaBus.pAtm) annotation (Line(points={{87.6,-28.4},{112,-28.4}, + {112,92},{41.105,92},{41.105,100.11}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(bouSup.T_in, weaBus.TDryBul) annotation (Line(points={{87.6,-25.2},{ - 112,-25.2},{112,92},{41,92},{41,100}}, color={0,0,127}), + connect(bouSup.T_in, weaBus.TDryBul) annotation (Line(points={{87.6,-25.2},{112, + -25.2},{112,92},{41.105,92},{41.105,100.11}}, color={0,0,127}), Text( string="%second", index=1, diff --git a/BESMod/package.mo b/BESMod/package.mo index 91ed8c81..4fdfdccd 100644 --- a/BESMod/package.mo +++ b/BESMod/package.mo @@ -3,12 +3,11 @@ package BESMod extends Modelica.Icons.Package; annotation ( - version="0.3.2", + version="0.4.0", uses( - BuildingSystems(version="2.0.0-beta"), Modelica(version="4.0.0"), SDF(version="0.4.2"), - AixLib(version="1.3.1"), + AixLib(version="1.3.2"), IBPSA(version="4.0.0")), conversion( from( diff --git a/dependencies.json b/dependencies.json index 39adccf8..021b5117 100644 --- a/dependencies.json +++ b/dependencies.json @@ -2,7 +2,7 @@ "required": { "IBPSA": { "url": "https://github.com/ibpsa/modelica-ibpsa", - "commit": "3eb103a9fafb0ee718661ce6a97ae4f6fc8a99c0", + "commit": "3fad3f62ccb411b2ef84f11fcfdf13f2c6c53e41", "default_branch": "master", "mo": "IBPSA//package.mo" } @@ -10,19 +10,19 @@ "optional": { "AixLib": { "url": "https://github.com/RWTH-EBC/AixLib", - "commit": "3bc1bcd9b33c8991eb50aa8fb3913b6dac6a1a1e", + "commit": "07a4c9b0e0766b5259e2a2caa660d4ab551adab4", "default_branch": "development", "mo": "AixLib//package.mo" }, "Buildings": { "url": "https://github.com/lbl-srg/modelica-buildings", - "commit": "fba63b60c75bb0285ede2081ae17dbdc9f38d9e7", + "commit": "87857396286acc419e0a704fbe028650f8863f5d", "default_branch": "master", "mo": "Buildings//package.mo" }, "BuildingSystems": { "url": "https://github.com/UdK-VPT/BuildingSystems", - "commit": "64adca47eae19d2744d86aa8d1624cbf7ad6326b", + "commit": "2787f24d35fab72fb798d92ba10489ce4346c524", "default_branch": "master", "mo": "BuildingSystems//package.mo" } From 583c8b557ac3e90809125f1f47c7ef26250e0483 Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Fri, 8 Dec 2023 08:48:16 +0100 Subject: [PATCH 101/131] fix parameter renames --- BESMod/Examples/BAUSimStudy/PartialCase.mo | 2 +- BESMod/Examples/GasBoilerBuildingOnly.mo | 4 ++-- BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo | 2 +- .../SolarThermalSystem/PartialSolarThermalHPS.mo | 4 ++-- BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo | 2 +- .../PartialModelicaConferenceUseCase.mo | 2 +- .../Hydraulical/Transfer/RadiatorPressureBased.mo | 10 +++++----- .../Transfer/Tests/TestIdealValveRadiatorSystem.mo | 7 +++++-- .../Transfer/Tests/TestPressureBasedSystem.mo | 4 ++-- .../Tests/TestPressureBasedSystemWithReliefValve.mo | 4 ++-- .../Transfer/Tests/TestUnderfloorHeating.mo | 5 ++++- 11 files changed, 26 insertions(+), 20 deletions(-) diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index 9231ded5..9172c822 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -80,7 +80,7 @@ partial model PartialCase transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters, + parRad, redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData parTra, diff --git a/BESMod/Examples/GasBoilerBuildingOnly.mo b/BESMod/Examples/GasBoilerBuildingOnly.mo index 1e173469..b168a04d 100644 --- a/BESMod/Examples/GasBoilerBuildingOnly.mo +++ b/BESMod/Examples/GasBoilerBuildingOnly.mo @@ -35,11 +35,11 @@ model GasBoilerBuildingOnly transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData - transferDataBaseDefinition, + parTra, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters)), + parRad)), redeclare BESMod.Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, diff --git a/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo b/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo index 6785bfff..13dd25e2 100644 --- a/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo +++ b/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo @@ -43,7 +43,7 @@ package BaseClasses "Contains partial example case" parPIDBoi), redeclare final Systems.Hydraulical.Transfer.IdealValveRadiator transfer(redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters, redeclare + parRad, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, diff --git a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo index 936dba10..449f79de 100644 --- a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo +++ b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo @@ -42,10 +42,10 @@ partial model PartialSolarThermalHPS transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters, + parRad, redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData - transferDataBaseDefinition, + parTra, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, diff --git a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo index 98495165..61de7dce 100644 --- a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo +++ b/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo @@ -78,7 +78,7 @@ model BES_HOM redeclare BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters, redeclare + parRad, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare BESMod.Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index f7ff5ba1..87ffcf23 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -79,7 +79,7 @@ partial model PartialModelicaConferenceUseCase f_design=fill(1.2, hydraulic.transfer.nParallelDem), redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters, + parRad, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), redeclare Systems.Demand.DHW.StandardProfiles DHW( energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index 4693edc2..9f71e3ad 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -2,7 +2,7 @@ within BESMod.Systems.Hydraulical.Transfer; model RadiatorPressureBased "Pressure Based transfer system" // Abui =1 and hBui =1 to avaoid warnings, will be overwritten anyway extends BaseClasses.PartialTransfer( - nHeaTra=radParameters.n, + nHeaTra=parRad.n, ABui=1, hBui=1, final dp_nominal=parTra.dp_nominal, @@ -31,7 +31,7 @@ model RadiatorPressureBased "Pressure Based transfer system" {-72,100}}))); replaceable parameter BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters + parRad annotation (Dialog(group="Component data"), choicesAllMatching=true, Placement(transformation(extent={{-100,-98},{-80,-78}}))); IBPSA.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad[nParallelDem]( @@ -40,14 +40,14 @@ model RadiatorPressureBased "Pressure Based transfer system" each final show_T=show_T, each final energyDynamics=energyDynamics, each final p_start=p_start, - each final nEle=radParameters.nEle, - each final fraRad=radParameters.fraRad, + each final nEle=parRad.nEle, + each final fraRad=parRad.fraRad, final Q_flow_nominal=Q_flow_nominal .* f_design, final T_a_nominal=TTra_nominal, final T_b_nominal=TTra_nominal .- dTTra_nominal, final TAir_nominal=TDem_nominal, final TRad_nominal=TDem_nominal, - each final n=radParameters.n, + each final n=parRad.n, each final deltaM=0.3, final dp_nominal=parTra.dpRad_nominal, redeclare package Medium = Medium, diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo index 1ea9b32b..397e7e7c 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo @@ -5,9 +5,12 @@ model TestIdealValveRadiatorSystem BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator transfer(redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters, redeclare + parRad, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - parPum)); + parPum, + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData + parTra)); extends Modelica.Icons.Example; end TestIdealValveRadiatorSystem; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo index e8040181..68a7f043 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo @@ -6,13 +6,13 @@ model TestPressureBasedSystem transfer( redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData - transferDataBaseDefinition, + parTra, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters)); + parRad)); extends Modelica.Icons.Example; end TestPressureBasedSystem; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo index 841b7e86..a87072f3 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo @@ -7,13 +7,13 @@ model TestPressureBasedSystemWithReliefValve use_preRelVal=true, redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData - transferDataBaseDefinition, + parTra, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - radParameters)); + parRad)); extends Modelica.Icons.Example; end TestPressureBasedSystemWithReliefValve; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestUnderfloorHeating.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestUnderfloorHeating.mo index fa1852f0..dd45c5af 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestUnderfloorHeating.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestUnderfloorHeating.mo @@ -7,7 +7,10 @@ model TestUnderfloorHeating BESMod.Systems.Hydraulical.Transfer.RecordsCollection.DefaultUFHData UFHParameters, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - parPum)); + parPum, + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData + parTra)); extends Modelica.Icons.Example; end TestUnderfloorHeating; From a949d89f5eb024168e69d286380f695da2ea45b8 Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Fri, 8 Dec 2023 09:27:07 +0100 Subject: [PATCH 102/131] Rename use-cases and fix parameter names --- BESMod/Examples/BAUSimStudy/PartialCase.mo | 3 --- .../AachenSystem.mo | 2 +- .../BES.mo | 2 +- .../ParametersToChange.mo | 2 +- BESMod/Examples/DesignOptimization/package.mo | 4 +++ .../package.order | 0 BESMod/Examples/GasBoilerBuildingOnly.mo | 1 - .../Examples/HeatPumpAndBoiler/BaseClasses.mo | 25 ++++++++++--------- .../BES_HOM.mo | 17 ++++++------- .../HOMSystem.mo | 2 +- BESMod/Examples/HighOrderModel/package.mo | 4 +++ .../package.order | 0 .../BESModSystemParas.mo | 2 +- .../BuildingsLibraryRoom.mo | 4 +-- .../PartialModelicaConferenceUseCase.mo | 9 ++++--- .../TEASERBuilding.mo | 6 +++-- .../ModelicaConferencePaper/package.mo | 4 +++ .../package.order | 0 .../PartialSolarThermalHPS.mo | 3 --- .../SolarThermalSystemParameters.mo | 2 +- .../UseCaseDesignOptimization/package.mo | 4 --- .../Examples/UseCaseHighOrderModel/package.mo | 4 --- .../UseCaseModelicaConferencePaper/package.mo | 4 --- BESMod/Examples/package.order | 8 +++--- 24 files changed, 55 insertions(+), 57 deletions(-) rename BESMod/Examples/{UseCaseDesignOptimization => DesignOptimization}/AachenSystem.mo (89%) rename BESMod/Examples/{UseCaseDesignOptimization => DesignOptimization}/BES.mo (99%) rename BESMod/Examples/{UseCaseDesignOptimization => DesignOptimization}/ParametersToChange.mo (95%) create mode 100644 BESMod/Examples/DesignOptimization/package.mo rename BESMod/Examples/{UseCaseDesignOptimization => DesignOptimization}/package.order (100%) rename BESMod/Examples/{UseCaseHighOrderModel => HighOrderModel}/BES_HOM.mo (93%) rename BESMod/Examples/{UseCaseHighOrderModel => HighOrderModel}/HOMSystem.mo (91%) create mode 100644 BESMod/Examples/HighOrderModel/package.mo rename BESMod/Examples/{UseCaseHighOrderModel => HighOrderModel}/package.order (100%) rename BESMod/Examples/{UseCaseModelicaConferencePaper => ModelicaConferencePaper}/BESModSystemParas.mo (89%) rename BESMod/Examples/{UseCaseModelicaConferencePaper => ModelicaConferencePaper}/BuildingsLibraryRoom.mo (80%) rename BESMod/Examples/{UseCaseModelicaConferencePaper => ModelicaConferencePaper}/PartialModelicaConferenceUseCase.mo (95%) rename BESMod/Examples/{UseCaseModelicaConferencePaper => ModelicaConferencePaper}/TEASERBuilding.mo (84%) create mode 100644 BESMod/Examples/ModelicaConferencePaper/package.mo rename BESMod/Examples/{UseCaseModelicaConferencePaper => ModelicaConferencePaper}/package.order (100%) delete mode 100644 BESMod/Examples/UseCaseDesignOptimization/package.mo delete mode 100644 BESMod/Examples/UseCaseHighOrderModel/package.mo delete mode 100644 BESMod/Examples/UseCaseModelicaConferencePaper/package.mo diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index 9172c822..ffb209f1 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -16,7 +16,6 @@ partial model PartialCase BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/5000, dpCon_nominal=0, @@ -45,10 +44,8 @@ partial model PartialCase dTHysDHW=10, redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, diff --git a/BESMod/Examples/UseCaseDesignOptimization/AachenSystem.mo b/BESMod/Examples/DesignOptimization/AachenSystem.mo similarity index 89% rename from BESMod/Examples/UseCaseDesignOptimization/AachenSystem.mo rename to BESMod/Examples/DesignOptimization/AachenSystem.mo index 80adf10d..4a036a26 100644 --- a/BESMod/Examples/UseCaseDesignOptimization/AachenSystem.mo +++ b/BESMod/Examples/DesignOptimization/AachenSystem.mo @@ -1,4 +1,4 @@ -within BESMod.Examples.UseCaseDesignOptimization; +within BESMod.Examples.DesignOptimization; record AachenSystem extends Systems.RecordsCollection.SystemParametersBaseDataDefinition( use_elecHeating=false, diff --git a/BESMod/Examples/UseCaseDesignOptimization/BES.mo b/BESMod/Examples/DesignOptimization/BES.mo similarity index 99% rename from BESMod/Examples/UseCaseDesignOptimization/BES.mo rename to BESMod/Examples/DesignOptimization/BES.mo index 25ec8ef3..e5b4b90d 100644 --- a/BESMod/Examples/UseCaseDesignOptimization/BES.mo +++ b/BESMod/Examples/DesignOptimization/BES.mo @@ -1,4 +1,4 @@ -within BESMod.Examples.UseCaseDesignOptimization; +within BESMod.Examples.DesignOptimization; model BES extends Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, diff --git a/BESMod/Examples/UseCaseDesignOptimization/ParametersToChange.mo b/BESMod/Examples/DesignOptimization/ParametersToChange.mo similarity index 95% rename from BESMod/Examples/UseCaseDesignOptimization/ParametersToChange.mo rename to BESMod/Examples/DesignOptimization/ParametersToChange.mo index cf1bb5ff..2c65d3e7 100644 --- a/BESMod/Examples/UseCaseDesignOptimization/ParametersToChange.mo +++ b/BESMod/Examples/DesignOptimization/ParametersToChange.mo @@ -1,4 +1,4 @@ -within BESMod.Examples.UseCaseDesignOptimization; +within BESMod.Examples.DesignOptimization; record ParametersToChange extends Systems.RecordsCollection.ParameterStudy.ParameterStudyBaseDefinition; // 1. Add parameters like this (WITH Evaluate=false)! diff --git a/BESMod/Examples/DesignOptimization/package.mo b/BESMod/Examples/DesignOptimization/package.mo new file mode 100644 index 00000000..0e04514a --- /dev/null +++ b/BESMod/Examples/DesignOptimization/package.mo @@ -0,0 +1,4 @@ +within BESMod.Examples; +package DesignOptimization "This use case shows the use of BESMod for design optimization" + extends Modelica.Icons.ExamplesPackage; +end DesignOptimization; diff --git a/BESMod/Examples/UseCaseDesignOptimization/package.order b/BESMod/Examples/DesignOptimization/package.order similarity index 100% rename from BESMod/Examples/UseCaseDesignOptimization/package.order rename to BESMod/Examples/DesignOptimization/package.order diff --git a/BESMod/Examples/GasBoilerBuildingOnly.mo b/BESMod/Examples/GasBoilerBuildingOnly.mo index b168a04d..8b861dde 100644 --- a/BESMod/Examples/GasBoilerBuildingOnly.mo +++ b/BESMod/Examples/GasBoilerBuildingOnly.mo @@ -44,7 +44,6 @@ model GasBoilerBuildingOnly redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.PassThrough calcmFlow), - redeclare BESMod.Systems.UserProfiles.TEASERProfiles userProfiles, redeclare BESMod.Systems.RecordsCollection.ParameterStudy.NoStudy parameterStudy, diff --git a/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo b/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo index 13dd25e2..6dd14b65 100644 --- a/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo +++ b/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo @@ -4,7 +4,9 @@ package BaseClasses "Contains partial example case" partial model PartialHybridSystem "Partial bivalent heat pump system" extends Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, - redeclare Systems.Demand.Building.TEASERThermalZone building(redeclare + redeclare Systems.Demand.Building.TEASERThermalZone building( + ABui=sum(building.zoneParam.VAir)^(2/3), + hBui=sum(building.zoneParam.VAir)^(1/3), redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, @@ -19,16 +21,12 @@ package BaseClasses "Contains partial example case" dTHysBui=5, dTHysDHW=5, meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature, - redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare model DHWSetTemperature = BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW, - redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, @@ -41,20 +39,23 @@ package BaseClasses "Contains partial example case" redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicBoilerPI parPIDBoi), redeclare final - Systems.Hydraulical.Transfer.IdealValveRadiator transfer(redeclare + Systems.Hydraulical.Transfer.IdealValveRadiator transfer( + redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - parRad, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), + parRad, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData + parTra)), redeclare Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), redeclare Systems.UserProfiles.TEASERProfiles userProfiles, - redeclare UseCaseDesignOptimization.AachenSystem systemParameters( - use_ventilation=true), - redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy, + redeclare DesignOptimization.AachenSystem systemParameters(use_ventilation= + true), + redeclare DesignOptimization.ParametersToChange parameterStudy, redeclare final package MediumDHW = AixLib.Media.Water, redeclare final package MediumZone = AixLib.Media.Air, redeclare final package MediumHyd = AixLib.Media.Water, diff --git a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo b/BESMod/Examples/HighOrderModel/BES_HOM.mo similarity index 93% rename from BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo rename to BESMod/Examples/HighOrderModel/BES_HOM.mo index 61de7dce..fc530e7f 100644 --- a/BESMod/Examples/UseCaseHighOrderModel/BES_HOM.mo +++ b/BESMod/Examples/HighOrderModel/BES_HOM.mo @@ -1,4 +1,4 @@ -within BESMod.Examples.UseCaseHighOrderModel; +within BESMod.Examples.HighOrderModel; model BES_HOM extends BESMod.Systems.BaseClasses.PartialBuildingEnergySystem( redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, @@ -13,7 +13,6 @@ model BES_HOM Type_Win, redeclare model CorrSolarGainWin = AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.CorGSimple, - redeclare BESMod.Systems.Demand.Building.Components.AixLibHighOrderOFD HOMBuiEnv), redeclare BESMod.Systems.Control.NoControl control, @@ -25,7 +24,6 @@ model BES_HOM BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ parameterStudy.QHP_flow_biv, @@ -51,10 +49,8 @@ model BES_HOM valCtrl, redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, @@ -76,10 +72,13 @@ model BES_HOM redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parThrWayVal), redeclare BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator transfer( - redeclare + redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - parRad, redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), + parRad, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData + parTra)), redeclare BESMod.Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, @@ -90,7 +89,7 @@ model BES_HOM redeclare AixLib.DataBase.Profiles.SetTemperaturesVentilation2perDay TSetProfile), redeclare HOMSystem systemParameters, - redeclare UseCaseDesignOptimization.ParametersToChange parameterStudy, + redeclare DesignOptimization.ParametersToChange parameterStudy, redeclare final package MediumDHW = AixLib.Media.Water, redeclare final package MediumZone = AixLib.Media.Air, redeclare final package MediumHyd = AixLib.Media.Water, diff --git a/BESMod/Examples/UseCaseHighOrderModel/HOMSystem.mo b/BESMod/Examples/HighOrderModel/HOMSystem.mo similarity index 91% rename from BESMod/Examples/UseCaseHighOrderModel/HOMSystem.mo rename to BESMod/Examples/HighOrderModel/HOMSystem.mo index 3731b91f..1e546923 100644 --- a/BESMod/Examples/UseCaseHighOrderModel/HOMSystem.mo +++ b/BESMod/Examples/HighOrderModel/HOMSystem.mo @@ -1,4 +1,4 @@ -within BESMod.Examples.UseCaseHighOrderModel; +within BESMod.Examples.HighOrderModel; record HOMSystem extends Systems.RecordsCollection.SystemParametersBaseDataDefinition( use_elecHeating=false, diff --git a/BESMod/Examples/HighOrderModel/package.mo b/BESMod/Examples/HighOrderModel/package.mo new file mode 100644 index 00000000..91865f3c --- /dev/null +++ b/BESMod/Examples/HighOrderModel/package.mo @@ -0,0 +1,4 @@ +within BESMod.Examples; +package HighOrderModel "Use case of the high order model from AixLib" + extends Modelica.Icons.ExamplesPackage; +end HighOrderModel; diff --git a/BESMod/Examples/UseCaseHighOrderModel/package.order b/BESMod/Examples/HighOrderModel/package.order similarity index 100% rename from BESMod/Examples/UseCaseHighOrderModel/package.order rename to BESMod/Examples/HighOrderModel/package.order diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/BESModSystemParas.mo b/BESMod/Examples/ModelicaConferencePaper/BESModSystemParas.mo similarity index 89% rename from BESMod/Examples/UseCaseModelicaConferencePaper/BESModSystemParas.mo rename to BESMod/Examples/ModelicaConferencePaper/BESModSystemParas.mo index 0710487b..cccec10a 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/BESModSystemParas.mo +++ b/BESMod/Examples/ModelicaConferencePaper/BESModSystemParas.mo @@ -1,4 +1,4 @@ -within BESMod.Examples.UseCaseModelicaConferencePaper; +within BESMod.Examples.ModelicaConferencePaper; record BESModSystemParas "Case studies system parameters" extends Systems.RecordsCollection.SystemParametersBaseDataDefinition( nZones=1, diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mo b/BESMod/Examples/ModelicaConferencePaper/BuildingsLibraryRoom.mo similarity index 80% rename from BESMod/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mo rename to BESMod/Examples/ModelicaConferencePaper/BuildingsLibraryRoom.mo index 9782daec..f5526b93 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mo +++ b/BESMod/Examples/ModelicaConferencePaper/BuildingsLibraryRoom.mo @@ -1,4 +1,4 @@ -within BESMod.Examples.UseCaseModelicaConferencePaper; +within BESMod.Examples.ModelicaConferencePaper; model BuildingsLibraryRoom "System using the buildings libraries room model" extends PartialModelicaConferenceUseCase( redeclare @@ -9,6 +9,6 @@ model BuildingsLibraryRoom "System using the buildings libraries room model" systemParameters(QBui_flow_nominal={2504})); extends Modelica.Icons.Example; -annotation(__Dymola_Commands(file="modelica://BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mos" +annotation(__Dymola_Commands(file="modelica://BESMod/Resources/Scripts/Dymola/Examples/ModelicaConferencePaper/BuildingsLibraryRoom.mos" "Simulate and plot")); end BuildingsLibraryRoom; diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo similarity index 95% rename from BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo rename to BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 87ffcf23..1c9a0855 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -1,4 +1,4 @@ -within BESMod.Examples.UseCaseModelicaConferencePaper; +within BESMod.Examples.ModelicaConferencePaper; partial model PartialModelicaConferenceUseCase "Partial model to be extended to replace single subsystems" extends Systems.BaseClasses.PartialBuildingEnergySystem( @@ -80,7 +80,10 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData parRad, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum)), + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData + parTra)), redeclare Systems.Demand.DHW.StandardProfiles DHW( energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare final BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM @@ -88,7 +91,7 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), - redeclare BESMod.Examples.UseCaseModelicaConferencePaper.BESModSystemParas + redeclare BESMod.Examples.ModelicaConferencePaper.BESModSystemParas systemParameters(use_elecHeating=false), redeclare BESMod.Systems.RecordsCollection.ParameterStudy.NoStudy parameterStudy, diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mo b/BESMod/Examples/ModelicaConferencePaper/TEASERBuilding.mo similarity index 84% rename from BESMod/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mo rename to BESMod/Examples/ModelicaConferencePaper/TEASERBuilding.mo index c5be31a8..2d39717e 100644 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mo +++ b/BESMod/Examples/ModelicaConferencePaper/TEASERBuilding.mo @@ -1,9 +1,11 @@ -within BESMod.Examples.UseCaseModelicaConferencePaper; +within BESMod.Examples.ModelicaConferencePaper; model TEASERBuilding extends PartialModelicaConferenceUseCase( redeclare Systems.Demand.Building.TEASERThermalZone building( AZone={185.9548}, hZone={483.48248/185.9548}, + ABui=sum(building.zoneParam.VAir)^(2/3), + hBui=sum(building.zoneParam.VAir)^(1/3), ARoo=building.oneZoneParam.ARoof, redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0), @@ -20,6 +22,6 @@ initial equation building.thermalZone[1].ROM.roofRC.thermCapExt[1].T = 293.15; -annotation(__Dymola_Commands(file="modelica://BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mos" +annotation(__Dymola_Commands(file="modelica://BESMod/Resources/Scripts/Dymola/Examples/ModelicaConferencePaper/TEASERBuilding.mos" "Simulate and plot")); end TEASERBuilding; diff --git a/BESMod/Examples/ModelicaConferencePaper/package.mo b/BESMod/Examples/ModelicaConferencePaper/package.mo new file mode 100644 index 00000000..d23c7115 --- /dev/null +++ b/BESMod/Examples/ModelicaConferencePaper/package.mo @@ -0,0 +1,4 @@ +within BESMod.Examples; +package ModelicaConferencePaper "The use cases described in the BESMod publication" + extends Modelica.Icons.ExamplesPackage; +end ModelicaConferencePaper; diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/package.order b/BESMod/Examples/ModelicaConferencePaper/package.order similarity index 100% rename from BESMod/Examples/UseCaseModelicaConferencePaper/package.order rename to BESMod/Examples/ModelicaConferencePaper/package.order diff --git a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo index 449f79de..74d700ff 100644 --- a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo +++ b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo @@ -21,10 +21,8 @@ partial model PartialSolarThermalHPS parTheVal, redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, - redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, @@ -51,7 +49,6 @@ partial model PartialSolarThermalHPS redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), - redeclare SolarThermalSystemParameters systemParameters, redeclare SolarThermalDesignOptimization parameterStudy( A=11, diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalSystemParameters.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalSystemParameters.mo index 1f7572bf..7e9a6717 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalSystemParameters.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalSystemParameters.mo @@ -1,5 +1,5 @@ within BESMod.Examples.SolarThermalSystem; record SolarThermalSystemParameters - extends BESMod.Examples.UseCaseDesignOptimization.AachenSystem; + extends BESMod.Examples.DesignOptimization.AachenSystem; end SolarThermalSystemParameters; diff --git a/BESMod/Examples/UseCaseDesignOptimization/package.mo b/BESMod/Examples/UseCaseDesignOptimization/package.mo deleted file mode 100644 index f44eda86..00000000 --- a/BESMod/Examples/UseCaseDesignOptimization/package.mo +++ /dev/null @@ -1,4 +0,0 @@ -within BESMod.Examples; -package UseCaseDesignOptimization "This use case shows the use of BESMod for design optimization" - extends Modelica.Icons.ExamplesPackage; -end UseCaseDesignOptimization; diff --git a/BESMod/Examples/UseCaseHighOrderModel/package.mo b/BESMod/Examples/UseCaseHighOrderModel/package.mo deleted file mode 100644 index f0bc093e..00000000 --- a/BESMod/Examples/UseCaseHighOrderModel/package.mo +++ /dev/null @@ -1,4 +0,0 @@ -within BESMod.Examples; -package UseCaseHighOrderModel "Use case of the high order model from AixLib" - extends Modelica.Icons.ExamplesPackage; -end UseCaseHighOrderModel; diff --git a/BESMod/Examples/UseCaseModelicaConferencePaper/package.mo b/BESMod/Examples/UseCaseModelicaConferencePaper/package.mo deleted file mode 100644 index e66d88f5..00000000 --- a/BESMod/Examples/UseCaseModelicaConferencePaper/package.mo +++ /dev/null @@ -1,4 +0,0 @@ -within BESMod.Examples; -package UseCaseModelicaConferencePaper "The use cases described in the BESMod publication" - extends Modelica.Icons.ExamplesPackage; -end UseCaseModelicaConferencePaper; diff --git a/BESMod/Examples/package.order b/BESMod/Examples/package.order index 79ee0b5d..70f45800 100644 --- a/BESMod/Examples/package.order +++ b/BESMod/Examples/package.order @@ -1,7 +1,7 @@ -UseCaseModelicaConferencePaper -UseCaseDesignOptimization BAUSimStudy -UseCaseHighOrderModel -SolarThermalSystem +DesignOptimization GasBoilerBuildingOnly HeatPumpAndBoiler +HighOrderModel +ModelicaConferencePaper +SolarThermalSystem From b83f08982bdfd44cff6c3d26ffc3405c14691812 Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Fri, 8 Dec 2023 09:27:45 +0100 Subject: [PATCH 103/131] rename others as well --- .../BuildingsLibraryRoom.mos | 2 +- .../UseCaseModelicaConferencePaper/TEASERBuilding.mos | 2 +- .../Demand/Building/HeatDemand/CalcHeaDemHOM.mo | 7 ++++--- .../Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo | 11 ++++------- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mos b/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mos index a6f89c65..bcc3aac2 100644 --- a/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mos +++ b/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mos @@ -1,4 +1,4 @@ -simulateModel("BESMod.Examples.UseCaseModelicaConferencePaper.BuildingsLibraryRoom", stopTime=864000, method="dassl", tolerance=1e-06, resultFile="BuildingsLibraryRoom"); +simulateModel("BESMod.Examples.ModelicaConferencePaper.BuildingsLibraryRoom", stopTime=864000, method="dassl", tolerance=1e-06, resultFile="BuildingsLibraryRoom"); createPlot(id=2, position={75, 70, 1210, 240}, y={"electrical.distribution.batterySimple.PLoad","electrical.distribution.batterySimple.PCharge"}, grid=true, subPlot=1, colors={{28,108,200},{238,46,47}}); createPlot(id=2, position={75, 70, 1210, 240}, y={"hydraulic.distribution.sigBusDistr.TStoDHWTopMea","hydraulic.distribution.sigBusDistr.TStoBufTopMea","hydraulic.generation.sigBusGen.THeaRodMea"}, grid=true, subPlot=2, colors={{28,108,200},{238,46,47},{0,140,72}}); createPlot(id=2, position={75, 70, 1210, 240}, y={"ventilation.generation.TSup.T","ventilation.generation.weaBus.TDryBul","building.buiMeaBus.TZoneMea[1]"}, grid=true, subPlot=3, colors={{28,108,200},{238,46,47},{0,140,72}}); diff --git a/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mos b/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mos index 2d242d3f..409ca8c7 100644 --- a/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mos +++ b/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mos @@ -1,4 +1,4 @@ -simulateModel("BESMod.Examples.UseCaseModelicaConferencePaper.TEASERBuilding", stopTime=864000, method="dassl", tolerance=1e-06, resultFile="TEASERBuilding"); +simulateModel("BESMod.Examples.ModelicaConferencePaper.TEASERBuilding", stopTime=864000, method="dassl", tolerance=1e-06, resultFile="TEASERBuilding"); createPlot(id=2, position={75, 70, 1210, 240}, y={"electrical.distribution.batterySimple.PLoad","electrical.distribution.batterySimple.PCharge"}, grid=true, subPlot=1, colors={{28,108,200},{238,46,47}}); createPlot(id=2, position={75, 70, 1210, 240}, y={"hydraulic.distribution.sigBusDistr.TStoDHWTopMea","hydraulic.distribution.sigBusDistr.TStoBufTopMea","hydraulic.generation.sigBusGen.THeaRodMea"}, grid=true, subPlot=2, colors={{28,108,200},{238,46,47},{0,140,72}}); createPlot(id=2, position={75, 70, 1210, 240}, y={"ventilation.generation.TSup.T","ventilation.generation.weaBus.TDryBul","building.buiMeaBus.TZoneMea[1]"}, grid=true, subPlot=3, colors={{28,108,200},{238,46,47},{0,140,72}}); diff --git a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo index 029e2158..cb799114 100644 --- a/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo +++ b/BESMod/Systems/Demand/Building/HeatDemand/CalcHeaDemHOM.mo @@ -14,14 +14,14 @@ model CalcHeaDemHOM extends PartialCalcHeatingDemand( redeclare BESMod.Systems.UserProfiles.AixLibHighOrderProfiles heaDemSce( - redeclare AixLib.DataBase.Profiles.Ventilation2perDayMean05perH venPro, - redeclare AixLib.DataBase.Profiles.SetTemperaturesVentilation2perDay + redeclare AixLib.DataBase.Profiles.Ventilation2perDayMean05perH venPro, + redeclare AixLib.DataBase.Profiles.SetTemperaturesVentilation2perDay TSetProfile, gain=0), TN_heater=1, KR_heater=10000, h_heater=fill(100000, building.nZones), - redeclare Examples.UseCaseHighOrderModel.HOMSystem systemParameters( + redeclare Examples.HighOrderModel.HOMSystem systemParameters( TOda_nominal=261.15, TSetZone_nominal(each displayUnit="K") = {293.15,293.15,288.15,293.15, 293.15,293.15,293.15,288.15,297.15,293.15}, @@ -40,6 +40,7 @@ model CalcHeaDemHOM Type_Win, redeclare model CorrSolarGainWin = AixLib.ThermalZones.HighOrder.Components.WindowsDoors.BaseClasses.CorrectionSolarGain.CorGSimple, + use_sunblind=false, UValOutDoors=if TIR == 1 then 1.8 else 2.9, use_infiltEN12831=true, diff --git a/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo b/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo index 109a714d..cb0e85e4 100644 --- a/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo +++ b/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo @@ -1,21 +1,18 @@ within BESMod.Utilities.HeatGeneration; model GetHeatPumpCurveVCLib extends PartialGetHeatGenerationCurve( - redeclare Examples.UseCaseDesignOptimization.AachenSystem systemParameters, + redeclare Examples.DesignOptimization.AachenSystem systemParameters, redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( redeclare package Medium_eva = IBPSA.Media.Air, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap (refrigerant= "Propane", flowsheet="VIPhaseSeparatorFlowsheet"), - redeclare - BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR parHeaRod), ramp( height=35, From c73992388341e8ec23c78fd6cf59376a82e97a77 Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Fri, 8 Dec 2023 09:47:03 +0100 Subject: [PATCH 104/131] add min attributes to avoid errors --- .../Demand/Building/BaseClasses/PartialDemand.mo | 15 ++++++++++----- .../Transfer/BaseClasses/PartialTransfer.mo | 14 +++++++++----- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo index c2014c20..f6486182 100644 --- a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo +++ b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo @@ -8,15 +8,20 @@ partial model PartialDemand "Partial demand model for HPS" parameter Modelica.Units.SI.Temperature TSetZone_nominal[nZones]=fill(293.15, nZones) "Nominal room set temerature" annotation (Dialog(group="Temperature demand")); - parameter Modelica.Units.SI.Area AZone[nZones] "Area of zones/rooms" + parameter Modelica.Units.SI.Area AZone[nZones](each min=Modelica.Constants.eps) + "Area of zones/rooms" annotation (Dialog(group="Geometry")); - parameter Modelica.Units.SI.Height hZone[nZones] "Height of zones" + parameter Modelica.Units.SI.Height hZone[nZones](each min=Modelica.Constants.eps) + "Height of zones" annotation (Dialog(group="Geometry")); - parameter Modelica.Units.SI.Area ABui "Ground area of building" + parameter Modelica.Units.SI.Area ABui(min=Modelica.Constants.eps) + "Ground area of building" annotation (Dialog(group="Geometry")); - parameter Modelica.Units.SI.Height hBui "Height of building" + parameter Modelica.Units.SI.Height hBui(min=Modelica.Constants.eps) + "Height of building" annotation (Dialog(group="Geometry")); - parameter Modelica.Units.SI.Area ARoo "Roof area of building" + parameter Modelica.Units.SI.Area ARoo(min=Modelica.Constants.eps) + "Roof area of building" annotation (Dialog(group="Geometry")); parameter Boolean use_hydraulic=true "=false to disable hydraulic supply"; parameter Boolean use_ventilation=true "=false to disable ventilation supply"; diff --git a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo index 49529d11..ee5304c3 100644 --- a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo +++ b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialTransfer.mo @@ -15,7 +15,7 @@ partial model PartialTransfer "Partial transfer model for BES" annotation(Dialog(group="Design - Top Down: Parameters are given by the parent system")); parameter Modelica.Units.SI.MassFlowRate mSup_flow_nominal[nParallelSup]=fill(sum( m_flow_nominal), nParallelSup) - "Nominal mass flow rate of the supply ports to the transfer system" annotation (Dialog( + "Nominal mass flow rate of the supply ports to the transfer system" annotation (Dialog( group="Design - Bottom Up: Parameters are defined by the subsystem")); parameter Modelica.Units.SI.PressureDifference dpSup_nominal[nParallelSup] @@ -23,16 +23,20 @@ partial model PartialTransfer "Partial transfer model for BES" annotation (Dialog(group= "Design - Top Down: Parameters are given by the parent system")); - parameter Modelica.Units.SI.Area AZone[nParallelDem] "Area of zones/rooms" + parameter Modelica.Units.SI.Area AZone[nParallelDem](each min=0.1) + "Area of zones/rooms" annotation (Dialog(group= "Design - Top Down: Parameters are given by the parent system")); - parameter Modelica.Units.SI.Height hZone[nParallelDem] "Height of zones" + parameter Modelica.Units.SI.Height hZone[nParallelDem](each min=0.1) + "Height of zones" annotation (Dialog(group= "Design - Top Down: Parameters are given by the parent system")); - parameter Modelica.Units.SI.Area ABui "Ground area of building" annotation ( + parameter Modelica.Units.SI.Area ABui(min=0.1) + "Ground area of building" annotation ( Dialog(group= "Design - Top Down: Parameters are given by the parent system")); - parameter Modelica.Units.SI.Height hBui "Height of building" annotation ( + parameter Modelica.Units.SI.Height hBui(min=0.1) + "Height of building" annotation ( Dialog(group= "Design - Top Down: Parameters are given by the parent system")); parameter Real nHeaTra "Exponent of heat transfer system" From a7bf84ceff213838991fa0defea1ac7e8f8945d3 Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Fri, 8 Dec 2023 09:54:46 +0100 Subject: [PATCH 105/131] fix min --- .../Demand/Building/BaseClasses/PartialDemand.mo | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo index f6486182..450f584c 100644 --- a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo +++ b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo @@ -8,19 +8,19 @@ partial model PartialDemand "Partial demand model for HPS" parameter Modelica.Units.SI.Temperature TSetZone_nominal[nZones]=fill(293.15, nZones) "Nominal room set temerature" annotation (Dialog(group="Temperature demand")); - parameter Modelica.Units.SI.Area AZone[nZones](each min=Modelica.Constants.eps) + parameter Modelica.Units.SI.Area AZone[nZones](each min=0.1) "Area of zones/rooms" annotation (Dialog(group="Geometry")); - parameter Modelica.Units.SI.Height hZone[nZones](each min=Modelica.Constants.eps) + parameter Modelica.Units.SI.Height hZone[nZones](each min=0.1) "Height of zones" annotation (Dialog(group="Geometry")); - parameter Modelica.Units.SI.Area ABui(min=Modelica.Constants.eps) + parameter Modelica.Units.SI.Area ABui(min=0.1) "Ground area of building" annotation (Dialog(group="Geometry")); - parameter Modelica.Units.SI.Height hBui(min=Modelica.Constants.eps) + parameter Modelica.Units.SI.Height hBui(min=0.1) "Height of building" annotation (Dialog(group="Geometry")); - parameter Modelica.Units.SI.Area ARoo(min=Modelica.Constants.eps) + parameter Modelica.Units.SI.Area ARoo(min=0.1) "Roof area of building" annotation (Dialog(group="Geometry")); parameter Boolean use_hydraulic=true "=false to disable hydraulic supply"; From 9a4b23f285f77aedec362660a06967dadf9f610e Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 8 Dec 2023 16:50:16 +0100 Subject: [PATCH 106/131] Add PV utility functions --- .../Electrical/Generation/PVSystemMultiSub.mo | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo b/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo index 8f8b2117..b7eabba3 100644 --- a/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo +++ b/BESMod/Systems/Electrical/Generation/PVSystemMultiSub.mo @@ -2,7 +2,18 @@ within BESMod.Systems.Electrical.Generation; model PVSystemMultiSub "PV system with subsystems of different orientation and module type" extends BESMod.Systems.Electrical.Generation.BaseClasses.PartialGeneration( - numGenUnits=1); + numGenUnits=if useTwoRoo then 2 else 1); + + parameter Modelica.Units.SI.Area ARooSid = ARoo / 2 + "Roof area of one side of the whole roof"; + + parameter Boolean useTwoRoo = true + "=true to use both roof-sides, e.g. north and south or east and west"; + parameter Modelica.Units.SI.Angle tilAllMod=0.34906585039887 + "Surface's tilt angle of all modules (0:flat)"; + parameter Modelica.Units.SI.Angle aziMaiRoo=0 + "Main roof areas surface's azimut angle (0:South)"; + replaceable model CellTemperature = AixLib.Electrical.PVSystem.BaseClasses.PartialCellTemperature annotation ( __Dymola_choicesAllMatching=true); @@ -15,18 +26,21 @@ model PVSystemMultiSub parameter Real alt "Site altitude in Meters, default= 1"; parameter Modelica.Units.SI.Time timZon "Time zone. Should be equal with timZon in ReaderTMY3, if PVSystem and ReaderTMY3 are used together."; - parameter Real n_mod[numGenUnits]={f_design[i]*ARoo/pVParameters[i].A_mod for i in 1:numGenUnits} - "Number of connected PV modules"; - parameter Modelica.Units.SI.Angle til[numGenUnits]=fill(20*Modelica.Constants.pi/180,numGenUnits) + parameter Real numMod[numGenUnits]={(f_design[i]*ARooSid/pVParameters[i].A_mod) + for i in 1:numGenUnits} "Number of connected PV modules"; + parameter Modelica.Units.SI.Angle til[numGenUnits]=fill(tilAllMod,numGenUnits) "Surface's tilt angle (0:flat)"; - parameter Modelica.Units.SI.Angle azi[numGenUnits]=fill(0*Modelica.Constants.pi/180,numGenUnits) + parameter Modelica.Units.SI.Angle azi[numGenUnits]={aziMaiRoo + (i-1) * Modelica.Constants.pi for i in 1:numGenUnits} "Surface's azimut angle (0:South)"; + parameter Modelica.Units.SI.Power PEleMaxPowPoi[numGenUnits](each displayUnit="kW")={numMod[i]* + pVParameters[i].P_mp0 for i in 1:numGenUnits} + "MPP Power of the PV System [kWp]"; AixLib.Electrical.PVSystem.PVSystem pVSystem[numGenUnits]( final data=pVParameters, redeclare final model IVCharacteristics = AixLib.Electrical.PVSystem.BaseClasses.IVCharacteristics5pAnalytical, redeclare model CellTemperature = CellTemperature, - final n_mod=n_mod, + final n_mod=numMod, final til=til, final azi=azi, each final lat=lat, @@ -50,9 +64,7 @@ model PVSystemMultiSub rotation=90, origin={50,58}))); - - - Utilities.KPIs.EnergyKPICalculator intKPICalPElePV(use_inpCon=true) + BESMod.Utilities.KPIs.EnergyKPICalculator intKPICalPElePV(use_inpCon=true) annotation (Placement(transformation(extent={{60,-60},{80,-40}}))); equation for i in 1:numGenUnits loop From 65db746689ad50a8a3c16fb48abc2d3ebc779972 Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Fri, 8 Dec 2023 18:58:10 +0100 Subject: [PATCH 107/131] add frosting from old package --- .../Frosting/BaseClasses/package.mo | 3 + .../Frosting/BaseClasses/package.order | 1 + .../Frosting/BaseClasses/partialIceFac.mo | 37 +++ .../Frosting/CICOIceFacCalculation.mo | 265 ++++++++++++++++++ .../Components/Frosting/Functions.mo | 86 ++++++ .../Components/Frosting/NoFrosting.mo | 34 +++ .../Frosting/ZhuIceFacCalculation.mo | 255 +++++++++++++++++ .../Components/Frosting/package.mo | 4 + .../Components/Frosting/package.order | 5 + .../Hydraulical/Components/package.order | 1 + 10 files changed, 691 insertions(+) create mode 100644 BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/package.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/package.order create mode 100644 BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/partialIceFac.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Frosting/CICOIceFacCalculation.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Frosting/Functions.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Frosting/NoFrosting.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Frosting/package.mo create mode 100644 BESMod/Systems/Hydraulical/Components/Frosting/package.order diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/package.mo b/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/package.mo new file mode 100644 index 00000000..0756796b --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/package.mo @@ -0,0 +1,3 @@ +within BESMod.Systems.Hydraulical.Components.Frosting; +package BaseClasses "Partial models for HPFrosting package" +end BaseClasses; diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/package.order new file mode 100644 index 00000000..cc2a7c5c --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/package.order @@ -0,0 +1 @@ +partialIceFac diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/partialIceFac.mo b/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/partialIceFac.mo new file mode 100644 index 00000000..0bc236ab --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/partialIceFac.mo @@ -0,0 +1,37 @@ +within BESMod.Systems.Hydraulical.Components.Frosting.BaseClasses; +partial model partialIceFac "PartialIceFacCalculator" + parameter Boolean use_reverse_cycle=true "If false, an eletrical heater will be used instead of reverse cycle method"; + parameter Modelica.SIunits.SpecificEnthalpy h_water_fusion=333.5e3 "Fusion enthalpy of water (Schmelzenthalpie)"; + parameter Real eta_hr=1 "Efficiency of used heating rod" + annotation (Dialog(enable=not use_reverse_cycle)); + parameter Modelica.SIunits.Power P_el_hr=0 "Heating power of heating rod" annotation (Dialog(enable=not use_reverse_cycle)); + + Modelica.Blocks.Interfaces.RealOutput P_el_add + "Additional power required to defrost" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={0,-110}), iconTransformation(extent={{-10,-10},{10,10}}, + rotation=270, + origin={2,-110}))); + Modelica.Blocks.Interfaces.RealInput relHum + "Input relative humidity of outdoor air" annotation (Placement( + transformation(extent={{-140,60},{-100,100}}), iconTransformation( + extent={{-140,56},{-100,96}}))); + AixLib.Controls.Interfaces.VapourCompressionMachineControlBus + genConBus + "Bus with the most relevant information for hp frosting calculation" + annotation (Placement(transformation(extent={{-128,-20},{-88,20}}), + iconTransformation(extent={{-130,-20},{-90,20}}))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid, + lineThickness=0.5), Text( + extent={{-76,102},{66,66}}, + lineColor={28,108,200}, + textString="%name%")}), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end partialIceFac; diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/CICOIceFacCalculation.mo b/BESMod/Systems/Hydraulical/Components/Frosting/CICOIceFacCalculation.mo new file mode 100644 index 00000000..d5f81ae8 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Frosting/CICOIceFacCalculation.mo @@ -0,0 +1,265 @@ +within BESMod.Systems.Hydraulical.Components.Frosting; +model CICOIceFacCalculation "IceFac based on CICO" + extends BaseClasses.partialIceFac; + + /* + + parameter Modelica.SIunits.Area A=parameterAssumptions.A_eva + "Area of heat exchanger (All fins from both sides, as the growth rate is specific for the area of the HE"; + parameter Modelica.SIunits.Density density=918 + "Density of ice"; + parameter Real minIceFac=parameterAssumptions.minIceFac + "Minimal allowed icing Factor to trigger the defrost"; + parameter Modelica.SIunits.Mass m_ice_max=density*A*d/2 + "Maximal possible mass of ice on HE surface. This value is limited by the volume between the fin tube"; + parameter Modelica.SIunits.Distance d=parameterAssumptions.d_fins + "Distance between two fins. Used to calculate the maximal mass of ice on the HE"; + parameter Modelica.SIunits.Volume V_h=parameterAssumptions.V_h + "Compressor Displacement Volume per rev"; + parameter Modelica.SIunits.Frequency N_max=parameterAssumptions.N_max + "Maximal compressor rotational speed"; + parameter Modelica.SIunits.VolumeFlowRate V_flow_air=parameterAssumptions.V_flow_air + "Volume flow rate over outdoor air coil"; + parameter Real natConvCoeff(unit="m/(s*K)")=parameterAssumptions.natConvCoeff + "Parameter to be calibrated for natural defrost"; + + */ + + parameter Modelica.SIunits.Area A=15 + "Area of heat exchanger (All fins from both sides, as the growth rate is specific for the area of the HE"; + parameter Modelica.SIunits.Density density=918 + "Density of ice"; + parameter Real minIceFac=0.5 + "Minimal allowed icing Factor to trigger the defrost"; + parameter Modelica.SIunits.Mass m_ice_max=density*A*d/2 + "Maximal possible mass of ice on HE surface. This value is limited by the volume between the fin tube"; + parameter Modelica.SIunits.Distance d=3e-3 + "Distance between two fins. Used to calculate the maximal mass of ice on the HE"; + parameter Modelica.SIunits.Volume V_h=19e-6 + "Compressor Displacement Volume per rev"; + parameter Modelica.SIunits.Frequency N_max=120 + "Maximal compressor rotational speed"; + parameter Modelica.SIunits.VolumeFlowRate V_flow_air=0.001 + "Volume flow rate over outdoor air coil"; + parameter Real natConvCoeff(unit="m/(s*K)")=1e-7 + "Parameter to be calibrated for natural defrost"; + + Modelica.Blocks.Sources.RealExpression P_el_internal(y=P_el) "Additional power from internal calculations" annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=0, + origin={-30,-80}))); + Modelica.Blocks.Sources.RealExpression iceFac_internal(y=iceFac) + "iceFac from internal calculations" annotation (Placement(transformation( + extent={{-18,15},{18,-15}}, + rotation=180, + origin={-60,33}))); + Modelica.Blocks.Sources.BooleanExpression mode_internal(y=mode_hp) + "Mode from internal calcuations" annotation (Placement( + transformation( + extent={{-18,15},{18,-15}}, + rotation=180, + origin={-60,1}))); + + Boolean mode_hp(start=false) "Heat pump heating mode"; + Real iceFac(start=1) "Icing Factor"; + Modelica.SIunits.MassFlowRate m_flow_ice(start=0) "Current mass of ice on evaporator surface"; + Modelica.SIunits.Mass m_ice(start=0) "Total mass that was on evaporator surface over whole simulation duration"; + Modelica.SIunits.Power P_el(start=0) "Current power required"; + Modelica.SIunits.HeatFlowRate QDef_flow(start=0) "Input energy to melt the ice"; + Modelica.SIunits.Velocity growth_rate_natural_conv(min=0, start=0) "Growth rate of ice for natural convection (melting)"; + Modelica.SIunits.Velocity growth_rate_forced_conv(min=0, start=0) "Growth rate of ice for forced convection"; + + Modelica.SIunits.Time critDefTim + "Time until next defrost cycle (based on time-method)"; + Real CICO(unit="s/m") "CICO value"; + + replaceable function frostMapFunc = + BESMod.Systems.Hydraulical.Components.Frosting.Functions.CICOBasedFunction + constrainedby + BESMod.Systems.Hydraulical.Components.Frosting.Functions.partialFrostingMap annotation(choicesAllMatching=true); + + Modelica.Blocks.Routing.RealPassThrough realPassQEva_flow + annotation (Placement(transformation(extent={{-90,-42},{-70,-22}}))); + Modelica.Blocks.Routing.RealPassThrough realPassT_Amb + annotation (Placement(transformation(extent={{-90,-70},{-70,-50}}))); + + Modelica.Blocks.Logical.Hysteresis hysteresis(uLow=minIceFac, uHigh=1) + "For the iceFac control. Output signal is used internally" + annotation (Placement(transformation(extent={{-20,68},{8,96}}))); + Modelica.Blocks.Logical.Timer timer + annotation (Placement(transformation(extent={{26,-36},{40,-22}}))); + Modelica.Blocks.Logical.Greater greater + annotation (Placement(transformation(extent={{56,-46},{68,-34}}))); + Modelica.Blocks.Sources.RealExpression critDefTim_internal(y=critDefTim) + "Mode from internal calcuations" annotation (Placement(transformation( + extent={{-18,15},{18,-15}}, + rotation=0, + origin={30,-63}))); + Modelica.Blocks.Logical.GreaterThreshold greaterThreshold(threshold=Modelica.Constants.eps) + annotation (Placement(transformation(extent={{-20,-26},{-6,-12}}))); + Modelica.Blocks.Sources.RealExpression growthRateFor_internal(y= + growth_rate_forced_conv) "growthRate from internal calcuations" + annotation (Placement(transformation( + extent={{-13,10},{13,-10}}, + rotation=0, + origin={-47,-18}))); + Modelica.Blocks.Logical.Not not1 + annotation (Placement(transformation(extent={{22,72},{42,92}}))); + Modelica.Blocks.Logical.Or orDefrost "Either hys or crit min time" + annotation (Placement(transformation(extent={{54,2},{64,12}}))); + + Modelica.Blocks.Logical.And and1 + annotation (Placement(transformation(extent={{2,-36},{16,-22}}))); + Modelica.Blocks.Logical.LessEqualThreshold + lessEqualThreshold(threshold=1 - + Modelica.Constants.eps) + annotation (Placement(transformation(extent={{-20,-58},{-6,-44}}))); + Modelica.Blocks.Routing.BooleanPassThrough boolPassHP_on + annotation (Placement(transformation(extent={{-90,-96},{-70,-76}}))); + + Modelica.SIunits.Time totalTimeDefrost "Total time where defrost operation was necessary in the year"; + + Modelica.Blocks.Interfaces.BooleanOutput defrost + "Indicate if we are defrosting (true) or not" annotation (Placement( + transformation(extent={{100,-20},{140,20}}), iconTransformation(extent={ + {-140,56},{-100,96}}))); + Modelica.Blocks.Logical.And andDefrost + "Either hys or crit min time" + annotation (Placement(transformation(extent={{76,-6},{86,4}}))); + Modelica.Blocks.Routing.RealPassThrough realPass_n_hp + annotation (Placement(transformation(extent={{-90,-122},{-70,-102}}))); + Modelica.Blocks.Interfaces.RealOutput growth_rate "Growth rate of ice" + annotation (Placement(transformation(extent={{100,40},{140,80}}), + iconTransformation(extent={{-140,56},{-100,96}}))); + Modelica.Blocks.Sources.RealExpression growthRateNat_internal(y= + growth_rate_natural_conv) "growthRate from internal calcuations" + annotation (Placement(transformation( + extent={{-13,10},{13,-10}}, + rotation=0, + origin={-11,26}))); + Modelica.Blocks.Logical.Switch switchGrowthRate + annotation (Placement(transformation(extent={{26,24},{40,38}}))); +protected + parameter Modelica.SIunits.Power const_P_el_internal = if use_reverse_cycle then 0 else P_el_hr "Additional power used to defrost"; + parameter Boolean const_mode_hp = not use_reverse_cycle; + Modelica.Blocks.Sources.RealExpression m_ice_internal(y=m_ice); + Real Char[2]; + +initial equation + assert(A * V_flow_air / (V_h * N_max)^2 > 7e6, "The paper found the correlations for CICOS greater than 7e6. Extrapolation will yield wrong results", AssertionLevel.warning); +equation + if m_ice > Modelica.Constants.eps then + growth_rate_natural_conv = min(0, -natConvCoeff * (realPassT_Amb.y - 273.15)) "Simply energy balance with constant Area and constant defrost"; + else + growth_rate_natural_conv = 0 "Not possible to melt the ice if no ice is present"; + end if; + + Char = frostMapFunc(realPassT_Amb.y, relHum, CICO); + // Only vaild if the hp is turned on + if boolPassHP_on.y then + critDefTim = Char[1]; + // Build a forced convection velocity to ensure the growth rate matches the timing in the map. + growth_rate_forced_conv = Char[2]; + CICO = A * V_flow_air / (V_h * N_max * realPass_n_hp.y)^2; + else + critDefTim = Modelica.Constants.inf; + growth_rate_forced_conv = 0; + CICO = 8e-6 "Only used to avoid log(0) as CICO is not defined for n_hp = 0"; + end if; + + der(m_ice) = m_flow_ice; + if use_reverse_cycle then + QDef_flow = realPassQEva_flow.y; + else + // No reverse cycle + QDef_flow = P_el_hr/eta_hr; + end if; + + // Calculate defrost: + if defrost then + m_flow_ice =-(QDef_flow/h_water_fusion); + P_el = const_P_el_internal; + mode_hp = const_mode_hp; + der(totalTimeDefrost) = 1; + else + m_flow_ice = A * density * growth_rate; + P_el = 0; + mode_hp = true; + der(totalTimeDefrost) = 0; + end if; + + iceFac = 1 - (m_ice/m_ice_max); + + connect(P_el_internal.y,P_el_add) annotation (Line( + points={{-19,-80},{0,-80},{0,-110}}, + color={0,0,127})); + connect(mode_internal.y, genConBus.hp_mode) annotation (Line( + points={{-79.8,1},{-76,1},{-76,0},{-108,0}}, + color={255,0,255})); + connect(genConBus.QEva_flow, realPassQEva_flow.u) annotation (Line( + points={{-108,0},{-102,0},{-102,2},{-104,2},{-104,-32},{-92,-32}}, + color={255,204,51}, + thickness=0.5)); + connect(genConBus.T_Amb, realPassT_Amb.u) annotation (Line( + points={{-108,0},{-106,0},{-106,-66},{-92,-66},{-92,-60}}, + color={255,204,51}, + thickness=0.5)); + connect(genConBus.iceFac, iceFac_internal.y) annotation (Line( + points={{-108,0},{-94,0},{-94,33},{-79.8,33}}, + color={255,204,51}, + thickness=0.5)); + connect(iceFac_internal.y, hysteresis.u) annotation (Line(points={{-79.8,33},{ + -79.8,82},{-22.8,82}}, color={0,0,127})); + connect(critDefTim_internal.y, greater.u2) annotation (Line(points={{49.8,-63}, + {53.9,-63},{53.9,-44.8},{54.8,-44.8}}, color={0,0,127})); + connect(timer.y, greater.u1) annotation (Line(points={{40.7,-29},{40.7,-30.5}, + {54.8,-30.5},{54.8,-40}}, color={0,0,127})); + connect(greaterThreshold.u, growthRateFor_internal.y) annotation (Line(points= + {{-21.4,-19},{-21.4,-18},{-32.7,-18}}, color={0,0,127})); + connect(hysteresis.y, not1.u) + annotation (Line(points={{9.4,82},{14,82},{14,80},{16,80},{16,82},{20,82}}, + color={255,0,255})); + connect(not1.y, orDefrost.u1) annotation (Line(points={{43,82},{50,82},{50,7}, + {53,7}}, color={255,0,255})); + connect(greater.y, orDefrost.u2) annotation (Line(points={{68.6,-40},{74,-40}, + {74,-24},{54,-24},{54,-10},{53,-10},{53,3}}, + color={255,0,255})); + connect(greaterThreshold.y,and1. u1) annotation (Line(points={{-5.3,-19},{-2.65, + -19},{-2.65,-29},{0.6,-29}}, color={255,0,255})); + connect(iceFac_internal.y, lessEqualThreshold.u) annotation (Line(points={{-79.8, + 33},{-86,33},{-86,48},{-30,48},{-30,-51},{-21.4,-51}}, color={0,0,127})); + connect(lessEqualThreshold.y,and1. u2) annotation (Line(points={{-5.3,-51},{-5.3, + -36.5},{0.6,-36.5},{0.6,-34.6}}, color={255,0,255})); + connect(and1.y, timer.u) annotation (Line(points={{16.7,-29},{16.7,-30.5},{24.6, + -30.5},{24.6,-29}}, color={255,0,255})); + connect(genConBus.hp_on, boolPassHP_on.u) annotation (Line( + points={{-108,0},{-106,0},{-106,-88},{-92,-88},{-92,-86}}, + color={255,204,51}, + thickness=0.5)); + connect(defrost, andDefrost.y) annotation (Line(points={{120,0},{104,0},{104,-1}, + {86.5,-1}}, color={255,0,255})); + connect(orDefrost.y, andDefrost.u1) annotation (Line(points={{64.5,7},{69.25,7}, + {69.25,-1},{75,-1}}, color={255,0,255})); + connect(greaterThreshold.y, andDefrost.u2) annotation (Line(points={{-5.3,-19}, + {-5.3,-4},{-4,-4},{-4,-6},{36,-6},{36,-5},{75,-5}}, color={255,0,255})); + connect(genConBus.n_hp, realPass_n_hp.u) annotation (Line( + points={{-108,0},{-106,0},{-106,-112},{-92,-112}}, + color={255,204,51}, + thickness=0.5), Text( + string="%first", + index=-1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(greaterThreshold.y, switchGrowthRate.u2) annotation (Line(points={{-5.3, + -19},{8,-19},{8,31},{24.6,31}}, color={255,0,255})); + connect(growthRateNat_internal.y, switchGrowthRate.u3) annotation (Line( + points={{3.3,26},{14,26},{14,25.4},{24.6,25.4}}, color={0,0,127})); + connect(growthRateFor_internal.y, switchGrowthRate.u1) annotation (Line( + points={{-32.7,-18},{-26,-18},{-26,36.6},{24.6,36.6}}, color={0,0,127})); + connect(switchGrowthRate.y, growth_rate) annotation (Line(points={{40.7,31},{74, + 31},{74,60},{120,60}}, color={0,0,127})); + annotation (Icon(graphics={Text( + extent={{-64,46},{78,-56}}, + lineColor={0,0,0}, + textString="f(CICO)")}), experiment(StopTime=2592000, Interval=500)); +end CICOIceFacCalculation; diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/Functions.mo b/BESMod/Systems/Hydraulical/Components/Frosting/Functions.mo new file mode 100644 index 00000000..bff335c2 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Frosting/Functions.mo @@ -0,0 +1,86 @@ +within BESMod.Systems.Hydraulical.Components.Frosting; +package Functions + + function CICOBasedFunction + "Function to calculate the frosting map based on the CICO value - Liang 2019." + extends partialFrostingMap; + + protected + Modelica.SIunits.TemperatureDifference dT = 1.7e3 * CICO ^ (-0.36); + Modelica.SIunits.Temperature T_c = T_oda - dT; + algorithm + growth_rate := (-3e-7 * log(CICO) + 5.4e-6); + critDefTim := 0; + // Mapping of CICO into the map by Zhu to determine the time until defrost + if CICO <= 18e6 then + critDefTim := 30 * 60; + elseif CICO <= 39e6 then + critDefTim := 60 * 60; + elseif CICO <= 61e6 then + critDefTim := 165 * 60; + else + critDefTim := Modelica.Constants.inf; + end if; + if T_oda >= 279.15 then + growth_rate := 0; + critDefTim := Modelica.Constants.inf; + end if; + Char :={critDefTim,growth_rate}; + + end CICOBasedFunction; + + function ZhuFrostingMapCico + "Function to calculate the frosting map according to Zhu, 2015. The grwoth rates of the ice are taken from Liu et. al. (the CICO-Paper)" + extends partialFrostingMap; + + protected + parameter Real coeff_severe[4] = {8.24762543e-01, -1.90727602e-02, 1.19709272e-03, 2.15230362e-05}; + parameter Real coeff_moderate[4] = {5.81825389e-01, -8.80317871e-03, 6.18167285e-04, -7.75483854e-07}; + parameter Real coeff_mild[4] = {4.42929753e-01, -7.03658239e-03, 7.32505699e-05, -3.37264259e-06}; + Real relHum_severe = poly_fit(coeff_severe, T_oda-273.15); + Real relHum_moderate = poly_fit(coeff_moderate, T_oda-273.15); + Real relHum_mild = poly_fit(coeff_mild, T_oda-273.15); + function poly_fit + input Real coeff[4]; + input Real x; + output Real y; + algorithm + y := 0; + for n in 1:size(coeff, 1) loop + y := y + coeff[n] * x^(n - 1); + end for; + end poly_fit; + algorithm + if relHum >= relHum_severe then + growth_rate := 3.6e-7; + critDefTim := 30 * 60; + elseif relHum >= relHum_moderate then + growth_rate := 2.5e-7; + critDefTim := 60 * 60; + elseif relHum >= relHum_mild then + growth_rate := 0.7e-7; + critDefTim := 165 * 60; + else + growth_rate := 0; + critDefTim := Modelica.Constants.inf; + end if; + if T_oda >= 279.15 then + growth_rate := 0; + critDefTim := Modelica.Constants.inf; + end if; + Char :={critDefTim,growth_rate}; + + end ZhuFrostingMapCico; + + partial function partialFrostingMap "Function for a partial frost map" + input Modelica.SIunits.Temperature T_oda "Outdoor air temperature"; + input Real relHum "Relative humidity as float (betwenn 0 and 1)"; + input Real CICO(unit="s/m") "CICO value"; + output Real Char[2] "Array with: growth_rate (Time until next defrost cycle) and growth_rate(Growth rate of ice on the surface)"; + protected + Modelica.SIunits.Velocity growth_rate(min=0) "Growth rate of ice"; + Modelica.SIunits.Time critDefTim "Time until next defrost cycle (based on time-method)"; + + end partialFrostingMap; + +end Functions; diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/NoFrosting.mo b/BESMod/Systems/Hydraulical/Components/Frosting/NoFrosting.mo new file mode 100644 index 00000000..02dc6b32 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Frosting/NoFrosting.mo @@ -0,0 +1,34 @@ +within BESMod.Systems.Hydraulical.Components.Frosting; +model NoFrosting "Model for no frosting at all times" + extends BaseClasses.partialIceFac(final use_reverse_cycle=true); + Modelica.Blocks.Sources.Constant constZero(final k=0) "No energy needed" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={0,-70}))); + Modelica.Blocks.Sources.BooleanConstant booCon(final k=true) "Always heating" + annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=180, + origin={-50,0}))); + Modelica.Blocks.Sources.Constant constOne(final k=1) "Always iceFac=1" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-50,50}))); +equation + connect(constZero.y, P_el_add) + annotation (Line(points={{0,-81},{0,-110}}, color={0,0,127})); + connect(booCon.y, genConBus.hp_mode) annotation (Line(points={{-61,8.88178e-16}, + {-88,8.88178e-16},{-88,0},{-108,0}}, color={255,0,255})); + connect(constOne.y, genConBus.iceFac) annotation (Line(points={{-61,50},{-90,50}, + {-90,0},{-108,0}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + annotation (Icon(graphics={Text( + extent={{-68,-50},{80,48}}, + lineColor={0,0,0}, + textString="=1")})); +end NoFrosting; diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo b/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo new file mode 100644 index 00000000..377456d6 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo @@ -0,0 +1,255 @@ +within BESMod.Systems.Hydraulical.Components.Frosting; +model ZhuIceFacCalculation "IceFac based on Zhus Frosting Map" + extends BaseClasses.partialIceFac; + + parameter Modelica.SIunits.Area A=15 + "Area of heat exchanger (All fins from both sides, as the growth rate is specific for the area of the HE"; + parameter Modelica.SIunits.Density density=150 + "Density of ice. Note! This parameter has an impact on the time necessary to melt the ice. + The growth rate is not affected, as it is cancled out with m_flow_ice_max. Papers assume lower values for new ice. "; + parameter Real minIceFac=0.4 + "Minimal allowed icing Factor to trigger the defrost"; + parameter Modelica.SIunits.Mass m_ice_max=density*A*d/2 + "Maximal possible mass of ice on HE surface. This value is limited by the volume between the fin tube"; + parameter Modelica.SIunits.Distance d=3e-3 + "Distance between two fins. Used to calculate the maximal mass of ice on the HE"; + + parameter Real natConvCoeff(unit="m/(s.K)")=1e-7 + "Parameter to be calibrated for natural defrost"; + + Modelica.Blocks.Sources.RealExpression P_el_internal(y=P_el) "Additional power from internal calculations" annotation (Placement(transformation( + extent={{-10,10},{10,-10}}, + rotation=0, + origin={-30,-88}))); + Modelica.Blocks.Sources.RealExpression iceFac_internal(y=iceFac) + "iceFac from internal calculations" annotation (Placement(transformation( + extent={{-18,15},{18,-15}}, + rotation=180, + origin={-60,33}))); + Modelica.Blocks.Sources.BooleanExpression mode_internal(y=mode_hp) + "Mode from internal calcuations" annotation (Placement( + transformation( + extent={{-18,15},{18,-15}}, + rotation=180, + origin={-58,-1}))); + + Boolean mode_hp(start=false) "Heat pump heating mode"; + Real iceFac(start=1) "Icing Factor"; + Modelica.SIunits.MassFlowRate m_flow_ice(start=0) "Current mass of ice on evaporator surface"; + Modelica.SIunits.Mass m_ice(start=0) "Total mass that was on evaporator surface over whole simulation duration"; + Modelica.SIunits.Power P_el(start=0) "Current power required"; + Modelica.SIunits.HeatFlowRate QDef_flow(start=0) "Input energy to melt the ice"; + Modelica.SIunits.Velocity growth_rate_natural_conv(min=0, start=0) "Growth rate of ice for natural convection (melting)"; + Modelica.SIunits.Velocity growth_rate_forced_conv(min=0, start=0) "Growth rate of ice for forced convection"; + + Modelica.SIunits.Time critDefTim + "Time until next defrost cycle (based on time-method)"; + + Real densityCoeff(start=1) "density coefficient"; + + replaceable function frostMapFunc = + BESMod.Systems.Hydraulical.Components.Frosting.Functions.ZhuFrostingMapCico + constrainedby + BESMod.Systems.Hydraulical.Components.Frosting.Functions.partialFrostingMap annotation(choicesAllMatching=true); + + Modelica.Blocks.Routing.RealPassThrough realPassQEva_flow + annotation (Placement(transformation(extent={{-90,-42},{-70,-22}}))); + Modelica.Blocks.Routing.RealPassThrough realPassT_Amb + annotation (Placement(transformation(extent={{-90,-70},{-70,-50}}))); + + Modelica.Blocks.Logical.Hysteresis hysteresis(uLow=minIceFac, uHigh=1) + "For the iceFac control. Output signal is used internally" + annotation (Placement(transformation(extent={{-20,68},{8,96}}))); + Modelica.Blocks.Logical.Timer timer + annotation (Placement(transformation(extent={{26,-36},{40,-22}}))); + Modelica.Blocks.Logical.Greater greater + annotation (Placement(transformation(extent={{56,-46},{68,-34}}))); + Modelica.Blocks.Sources.RealExpression critDefTim_internal(y=critDefTim) + "Mode from internal calcuations" annotation (Placement(transformation( + extent={{-18,15},{18,-15}}, + rotation=0, + origin={30,-63}))); + Modelica.Blocks.Logical.GreaterThreshold greaterThreshold(threshold=Modelica.Constants.eps) + annotation (Placement(transformation(extent={{-20,-26},{-6,-12}}))); + Modelica.Blocks.Sources.RealExpression growthRateFor_internal(y= + growth_rate_forced_conv) "growthRate from internal calcuations" + annotation (Placement(transformation( + extent={{-13,10},{13,-10}}, + rotation=0, + origin={-47,-18}))); + Modelica.Blocks.Logical.Not not1 + annotation (Placement(transformation(extent={{22,72},{42,92}}))); + Modelica.Blocks.Logical.Or orDefrost "Either hys or crit min time" + annotation (Placement(transformation(extent={{54,2},{64,12}}))); + + Modelica.Blocks.Logical.And and1 + annotation (Placement(transformation(extent={{2,-36},{16,-22}}))); + Modelica.Blocks.Logical.LessEqualThreshold + lessEqualThreshold(threshold=1 - + Modelica.Constants.eps) + annotation (Placement(transformation(extent={{-20,-58},{-6,-44}}))); + Modelica.Blocks.Routing.BooleanPassThrough boolPassHP_on + annotation (Placement(transformation(extent={{-90,-96},{-70,-76}}))); + + Modelica.SIunits.Time totalTimeDefrost "Total time where defrost operation was necessary in the year"; + + Modelica.Blocks.Interfaces.BooleanOutput defrost + "Indicate if we are defrosting (true) or not" annotation (Placement( + transformation(extent={{100,-20},{140,20}}), iconTransformation(extent={ + {-140,56},{-100,96}}))); + Modelica.Blocks.Logical.And andDefrost + "Either hys or crit min time" + annotation (Placement(transformation(extent={{76,-6},{86,4}}))); + Modelica.Blocks.Routing.RealPassThrough realPass_n_hp + annotation (Placement(transformation(extent={{-90,-122},{-70,-102}}))); + Modelica.Blocks.Interfaces.RealOutput growth_rate "Growth rate of ice" + annotation (Placement(transformation(extent={{100,40},{140,80}}), + iconTransformation(extent={{-140,56},{-100,96}}))); + Modelica.Blocks.Sources.RealExpression growthRateNat_internal(y= + growth_rate_natural_conv) "growthRate from internal calcuations" + annotation (Placement(transformation( + extent={{-13,10},{13,-10}}, + rotation=0, + origin={-11,26}))); + Modelica.Blocks.Logical.Switch switchGrowthRate + annotation (Placement(transformation(extent={{26,24},{40,38}}))); +protected + parameter Modelica.SIunits.Power const_P_el_internal = if use_reverse_cycle then 0 else P_el_hr "Additional power used to defrost"; + parameter Boolean const_mode_hp = not use_reverse_cycle; + Modelica.Blocks.Sources.RealExpression m_ice_internal(y=m_ice); + Real Char[2]; + +equation + if m_ice > Modelica.Constants.eps then + growth_rate_natural_conv = min(0, -natConvCoeff * (realPassT_Amb.y - 273.15)) "Simply energy balance with constant Area and constant defrost"; + else + growth_rate_natural_conv = 0 "Not possible to melt the ice if no ice is present"; + end if; + + Char = frostMapFunc(realPassT_Amb.y, relHum, 0); + // Only vaild if the hp is turned on + if boolPassHP_on.y then + critDefTim = Char[1]; + // Build a forced convection velocity to ensure the growth rate matches the timing in the map. + growth_rate_forced_conv = Char[2]; + else + critDefTim = Modelica.Constants.inf; + growth_rate_forced_conv = 0; + end if; + + if growth_rate >= 3.6e-7 then + densityCoeff = 1; + elseif growth_rate >= 2.5e-7 then + densityCoeff = 150/190; + elseif growth_rate >= 0.7e-7 then + densityCoeff = 150/310; + else + densityCoeff = 1; + end if; + + der(m_ice) = m_flow_ice; + if use_reverse_cycle then + QDef_flow = realPassQEva_flow.y; + else + // No reverse cycle + QDef_flow = P_el_hr/eta_hr; + end if; + + // Calculate defrost: + if defrost then + m_flow_ice =-(QDef_flow/h_water_fusion)*densityCoeff; + P_el = const_P_el_internal; + mode_hp = const_mode_hp; + der(totalTimeDefrost) = 1; + else + m_flow_ice = A * density * growth_rate; + P_el = 0; + mode_hp = true; + der(totalTimeDefrost) = 0; + end if; + + iceFac = 1 - (m_ice/m_ice_max); + + connect(P_el_internal.y,P_el_add) annotation (Line( + points={{-19,-88},{0,-88},{0,-110}}, + color={0,0,127})); + connect(iceFac_internal.y, hysteresis.u) annotation (Line(points={{-79.8,33},{ + -79.8,82},{-22.8,82}}, color={0,0,127})); + connect(critDefTim_internal.y, greater.u2) annotation (Line(points={{49.8,-63}, + {53.9,-63},{53.9,-44.8},{54.8,-44.8}}, color={0,0,127})); + connect(timer.y, greater.u1) annotation (Line(points={{40.7,-29},{40.7,-30.5}, + {54.8,-30.5},{54.8,-40}}, color={0,0,127})); + connect(greaterThreshold.u, growthRateFor_internal.y) annotation (Line(points= + {{-21.4,-19},{-21.4,-18},{-32.7,-18}}, color={0,0,127})); + connect(hysteresis.y, not1.u) + annotation (Line(points={{9.4,82},{14,82},{14,80},{16,80},{16,82},{20,82}}, + color={255,0,255})); + connect(not1.y, orDefrost.u1) annotation (Line(points={{43,82},{50,82},{50,7}, + {53,7}}, color={255,0,255})); + connect(greater.y, orDefrost.u2) annotation (Line(points={{68.6,-40},{74,-40}, + {74,-24},{54,-24},{54,-10},{53,-10},{53,3}}, + color={255,0,255})); + connect(greaterThreshold.y,and1. u1) annotation (Line(points={{-5.3,-19},{-2.65, + -19},{-2.65,-29},{0.6,-29}}, color={255,0,255})); + connect(iceFac_internal.y, lessEqualThreshold.u) annotation (Line(points={{-79.8, + 33},{-86,33},{-86,48},{-30,48},{-30,-51},{-21.4,-51}}, color={0,0,127})); + connect(lessEqualThreshold.y,and1. u2) annotation (Line(points={{-5.3,-51},{-5.3, + -36.5},{0.6,-36.5},{0.6,-34.6}}, color={255,0,255})); + connect(and1.y, timer.u) annotation (Line(points={{16.7,-29},{16.7,-30.5},{24.6, + -30.5},{24.6,-29}}, color={255,0,255})); + connect(defrost, andDefrost.y) annotation (Line(points={{120,0},{104,0},{104,-1}, + {86.5,-1}}, color={255,0,255})); + connect(orDefrost.y, andDefrost.u1) annotation (Line(points={{64.5,7},{69.25,7}, + {69.25,-1},{75,-1}}, color={255,0,255})); + connect(greaterThreshold.y, andDefrost.u2) annotation (Line(points={{-5.3,-19}, + {-5.3,-4},{-4,-4},{-4,-6},{36,-6},{36,-5},{75,-5}}, color={255,0,255})); + connect(greaterThreshold.y, switchGrowthRate.u2) annotation (Line(points={{-5.3, + -19},{8,-19},{8,31},{24.6,31}}, color={255,0,255})); + connect(growthRateNat_internal.y, switchGrowthRate.u3) annotation (Line( + points={{3.3,26},{14,26},{14,25.4},{24.6,25.4}}, color={0,0,127})); + connect(growthRateFor_internal.y, switchGrowthRate.u1) annotation (Line( + points={{-32.7,-18},{-26,-18},{-26,36.6},{24.6,36.6}}, color={0,0,127})); + connect(switchGrowthRate.y, growth_rate) annotation (Line(points={{40.7,31},{74, + 31},{74,60},{120,60}}, color={0,0,127})); + connect(realPass_n_hp.u, genConBus.nSet) annotation (Line(points={{-92,-112}, + {-102,-112},{-102,0.1},{-107.9,0.1}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(boolPassHP_on.u, genConBus.onOffMea) annotation (Line(points={{-92, + -86},{-107.9,-86},{-107.9,0.1}}, color={255,0,255}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(realPassT_Amb.u, genConBus.TOdaMea) annotation (Line(points={{-92,-60}, + {-102,-60},{-102,-62},{-107.9,-62},{-107.9,0.1}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(realPassQEva_flow.u, genConBus.QEva_flow) annotation (Line(points={{ + -92,-32},{-108,-32},{-108,0}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(mode_internal.y, genConBus.modeSet) annotation (Line(points={{-77.8,-1}, + {-91.9,-1},{-91.9,0.1},{-107.9,0.1}}, color={255,0,255}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(iceFac_internal.y, genConBus.iceFacMea) annotation (Line(points={{ + -79.8,33},{-107.9,33},{-107.9,0.1}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + annotation (Icon(graphics={Text( + extent={{-64,46},{78,-56}}, + lineColor={0,0,0}, + textString="f(CICO)")}), experiment(StopTime=2592000, Interval=500)); +end ZhuIceFacCalculation; diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/package.mo b/BESMod/Systems/Hydraulical/Components/Frosting/package.mo new file mode 100644 index 00000000..1224396c --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Frosting/package.mo @@ -0,0 +1,4 @@ +within BESMod.Systems.Hydraulical.Components; +package Frosting "Package with models to account for possible frosting of a heat pump" + +end Frosting; diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/package.order b/BESMod/Systems/Hydraulical/Components/Frosting/package.order new file mode 100644 index 00000000..5231ad5b --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Frosting/package.order @@ -0,0 +1,5 @@ +NoFrosting +CICOIceFacCalculation +ZhuIceFacCalculation +Functions +BaseClasses diff --git a/BESMod/Systems/Hydraulical/Components/package.order b/BESMod/Systems/Hydraulical/Components/package.order index a5b62a2c..510d06b7 100644 --- a/BESMod/Systems/Hydraulical/Components/package.order +++ b/BESMod/Systems/Hydraulical/Components/package.order @@ -1,2 +1,3 @@ UFH HeatingRodWithSecurityControl +Frosting From 448171c3bc2549a812b71cc98b1ddb1489bfc174 Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Fri, 8 Dec 2023 19:39:32 +0100 Subject: [PATCH 108/131] update to BESMod --- .../Frosting/BaseClasses/partialIceFac.mo | 4 +- .../Frosting/CICOIceFacCalculation.mo | 265 ------------------ .../Components/Frosting/Functions.mo | 10 +- .../Frosting/ZhuIceFacCalculation.mo | 238 ++++++++-------- .../Components/Frosting/package.order | 1 - 5 files changed, 125 insertions(+), 393 deletions(-) delete mode 100644 BESMod/Systems/Hydraulical/Components/Frosting/CICOIceFacCalculation.mo diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/partialIceFac.mo b/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/partialIceFac.mo index 0bc236ab..3c935c24 100644 --- a/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/partialIceFac.mo +++ b/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/partialIceFac.mo @@ -1,10 +1,10 @@ within BESMod.Systems.Hydraulical.Components.Frosting.BaseClasses; partial model partialIceFac "PartialIceFacCalculator" parameter Boolean use_reverse_cycle=true "If false, an eletrical heater will be used instead of reverse cycle method"; - parameter Modelica.SIunits.SpecificEnthalpy h_water_fusion=333.5e3 "Fusion enthalpy of water (Schmelzenthalpie)"; + parameter Modelica.Units.SI.SpecificEnthalpy h_water_fusion=333.5e3 "Fusion enthalpy of water (Schmelzenthalpie)"; parameter Real eta_hr=1 "Efficiency of used heating rod" annotation (Dialog(enable=not use_reverse_cycle)); - parameter Modelica.SIunits.Power P_el_hr=0 "Heating power of heating rod" annotation (Dialog(enable=not use_reverse_cycle)); + parameter Modelica.Units.SI.Power P_el_hr=0 "Heating power of heating rod" annotation (Dialog(enable=not use_reverse_cycle)); Modelica.Blocks.Interfaces.RealOutput P_el_add "Additional power required to defrost" annotation (Placement( diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/CICOIceFacCalculation.mo b/BESMod/Systems/Hydraulical/Components/Frosting/CICOIceFacCalculation.mo deleted file mode 100644 index d5f81ae8..00000000 --- a/BESMod/Systems/Hydraulical/Components/Frosting/CICOIceFacCalculation.mo +++ /dev/null @@ -1,265 +0,0 @@ -within BESMod.Systems.Hydraulical.Components.Frosting; -model CICOIceFacCalculation "IceFac based on CICO" - extends BaseClasses.partialIceFac; - - /* - - parameter Modelica.SIunits.Area A=parameterAssumptions.A_eva - "Area of heat exchanger (All fins from both sides, as the growth rate is specific for the area of the HE"; - parameter Modelica.SIunits.Density density=918 - "Density of ice"; - parameter Real minIceFac=parameterAssumptions.minIceFac - "Minimal allowed icing Factor to trigger the defrost"; - parameter Modelica.SIunits.Mass m_ice_max=density*A*d/2 - "Maximal possible mass of ice on HE surface. This value is limited by the volume between the fin tube"; - parameter Modelica.SIunits.Distance d=parameterAssumptions.d_fins - "Distance between two fins. Used to calculate the maximal mass of ice on the HE"; - parameter Modelica.SIunits.Volume V_h=parameterAssumptions.V_h - "Compressor Displacement Volume per rev"; - parameter Modelica.SIunits.Frequency N_max=parameterAssumptions.N_max - "Maximal compressor rotational speed"; - parameter Modelica.SIunits.VolumeFlowRate V_flow_air=parameterAssumptions.V_flow_air - "Volume flow rate over outdoor air coil"; - parameter Real natConvCoeff(unit="m/(s*K)")=parameterAssumptions.natConvCoeff - "Parameter to be calibrated for natural defrost"; - - */ - - parameter Modelica.SIunits.Area A=15 - "Area of heat exchanger (All fins from both sides, as the growth rate is specific for the area of the HE"; - parameter Modelica.SIunits.Density density=918 - "Density of ice"; - parameter Real minIceFac=0.5 - "Minimal allowed icing Factor to trigger the defrost"; - parameter Modelica.SIunits.Mass m_ice_max=density*A*d/2 - "Maximal possible mass of ice on HE surface. This value is limited by the volume between the fin tube"; - parameter Modelica.SIunits.Distance d=3e-3 - "Distance between two fins. Used to calculate the maximal mass of ice on the HE"; - parameter Modelica.SIunits.Volume V_h=19e-6 - "Compressor Displacement Volume per rev"; - parameter Modelica.SIunits.Frequency N_max=120 - "Maximal compressor rotational speed"; - parameter Modelica.SIunits.VolumeFlowRate V_flow_air=0.001 - "Volume flow rate over outdoor air coil"; - parameter Real natConvCoeff(unit="m/(s*K)")=1e-7 - "Parameter to be calibrated for natural defrost"; - - Modelica.Blocks.Sources.RealExpression P_el_internal(y=P_el) "Additional power from internal calculations" annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=0, - origin={-30,-80}))); - Modelica.Blocks.Sources.RealExpression iceFac_internal(y=iceFac) - "iceFac from internal calculations" annotation (Placement(transformation( - extent={{-18,15},{18,-15}}, - rotation=180, - origin={-60,33}))); - Modelica.Blocks.Sources.BooleanExpression mode_internal(y=mode_hp) - "Mode from internal calcuations" annotation (Placement( - transformation( - extent={{-18,15},{18,-15}}, - rotation=180, - origin={-60,1}))); - - Boolean mode_hp(start=false) "Heat pump heating mode"; - Real iceFac(start=1) "Icing Factor"; - Modelica.SIunits.MassFlowRate m_flow_ice(start=0) "Current mass of ice on evaporator surface"; - Modelica.SIunits.Mass m_ice(start=0) "Total mass that was on evaporator surface over whole simulation duration"; - Modelica.SIunits.Power P_el(start=0) "Current power required"; - Modelica.SIunits.HeatFlowRate QDef_flow(start=0) "Input energy to melt the ice"; - Modelica.SIunits.Velocity growth_rate_natural_conv(min=0, start=0) "Growth rate of ice for natural convection (melting)"; - Modelica.SIunits.Velocity growth_rate_forced_conv(min=0, start=0) "Growth rate of ice for forced convection"; - - Modelica.SIunits.Time critDefTim - "Time until next defrost cycle (based on time-method)"; - Real CICO(unit="s/m") "CICO value"; - - replaceable function frostMapFunc = - BESMod.Systems.Hydraulical.Components.Frosting.Functions.CICOBasedFunction - constrainedby - BESMod.Systems.Hydraulical.Components.Frosting.Functions.partialFrostingMap annotation(choicesAllMatching=true); - - Modelica.Blocks.Routing.RealPassThrough realPassQEva_flow - annotation (Placement(transformation(extent={{-90,-42},{-70,-22}}))); - Modelica.Blocks.Routing.RealPassThrough realPassT_Amb - annotation (Placement(transformation(extent={{-90,-70},{-70,-50}}))); - - Modelica.Blocks.Logical.Hysteresis hysteresis(uLow=minIceFac, uHigh=1) - "For the iceFac control. Output signal is used internally" - annotation (Placement(transformation(extent={{-20,68},{8,96}}))); - Modelica.Blocks.Logical.Timer timer - annotation (Placement(transformation(extent={{26,-36},{40,-22}}))); - Modelica.Blocks.Logical.Greater greater - annotation (Placement(transformation(extent={{56,-46},{68,-34}}))); - Modelica.Blocks.Sources.RealExpression critDefTim_internal(y=critDefTim) - "Mode from internal calcuations" annotation (Placement(transformation( - extent={{-18,15},{18,-15}}, - rotation=0, - origin={30,-63}))); - Modelica.Blocks.Logical.GreaterThreshold greaterThreshold(threshold=Modelica.Constants.eps) - annotation (Placement(transformation(extent={{-20,-26},{-6,-12}}))); - Modelica.Blocks.Sources.RealExpression growthRateFor_internal(y= - growth_rate_forced_conv) "growthRate from internal calcuations" - annotation (Placement(transformation( - extent={{-13,10},{13,-10}}, - rotation=0, - origin={-47,-18}))); - Modelica.Blocks.Logical.Not not1 - annotation (Placement(transformation(extent={{22,72},{42,92}}))); - Modelica.Blocks.Logical.Or orDefrost "Either hys or crit min time" - annotation (Placement(transformation(extent={{54,2},{64,12}}))); - - Modelica.Blocks.Logical.And and1 - annotation (Placement(transformation(extent={{2,-36},{16,-22}}))); - Modelica.Blocks.Logical.LessEqualThreshold - lessEqualThreshold(threshold=1 - - Modelica.Constants.eps) - annotation (Placement(transformation(extent={{-20,-58},{-6,-44}}))); - Modelica.Blocks.Routing.BooleanPassThrough boolPassHP_on - annotation (Placement(transformation(extent={{-90,-96},{-70,-76}}))); - - Modelica.SIunits.Time totalTimeDefrost "Total time where defrost operation was necessary in the year"; - - Modelica.Blocks.Interfaces.BooleanOutput defrost - "Indicate if we are defrosting (true) or not" annotation (Placement( - transformation(extent={{100,-20},{140,20}}), iconTransformation(extent={ - {-140,56},{-100,96}}))); - Modelica.Blocks.Logical.And andDefrost - "Either hys or crit min time" - annotation (Placement(transformation(extent={{76,-6},{86,4}}))); - Modelica.Blocks.Routing.RealPassThrough realPass_n_hp - annotation (Placement(transformation(extent={{-90,-122},{-70,-102}}))); - Modelica.Blocks.Interfaces.RealOutput growth_rate "Growth rate of ice" - annotation (Placement(transformation(extent={{100,40},{140,80}}), - iconTransformation(extent={{-140,56},{-100,96}}))); - Modelica.Blocks.Sources.RealExpression growthRateNat_internal(y= - growth_rate_natural_conv) "growthRate from internal calcuations" - annotation (Placement(transformation( - extent={{-13,10},{13,-10}}, - rotation=0, - origin={-11,26}))); - Modelica.Blocks.Logical.Switch switchGrowthRate - annotation (Placement(transformation(extent={{26,24},{40,38}}))); -protected - parameter Modelica.SIunits.Power const_P_el_internal = if use_reverse_cycle then 0 else P_el_hr "Additional power used to defrost"; - parameter Boolean const_mode_hp = not use_reverse_cycle; - Modelica.Blocks.Sources.RealExpression m_ice_internal(y=m_ice); - Real Char[2]; - -initial equation - assert(A * V_flow_air / (V_h * N_max)^2 > 7e6, "The paper found the correlations for CICOS greater than 7e6. Extrapolation will yield wrong results", AssertionLevel.warning); -equation - if m_ice > Modelica.Constants.eps then - growth_rate_natural_conv = min(0, -natConvCoeff * (realPassT_Amb.y - 273.15)) "Simply energy balance with constant Area and constant defrost"; - else - growth_rate_natural_conv = 0 "Not possible to melt the ice if no ice is present"; - end if; - - Char = frostMapFunc(realPassT_Amb.y, relHum, CICO); - // Only vaild if the hp is turned on - if boolPassHP_on.y then - critDefTim = Char[1]; - // Build a forced convection velocity to ensure the growth rate matches the timing in the map. - growth_rate_forced_conv = Char[2]; - CICO = A * V_flow_air / (V_h * N_max * realPass_n_hp.y)^2; - else - critDefTim = Modelica.Constants.inf; - growth_rate_forced_conv = 0; - CICO = 8e-6 "Only used to avoid log(0) as CICO is not defined for n_hp = 0"; - end if; - - der(m_ice) = m_flow_ice; - if use_reverse_cycle then - QDef_flow = realPassQEva_flow.y; - else - // No reverse cycle - QDef_flow = P_el_hr/eta_hr; - end if; - - // Calculate defrost: - if defrost then - m_flow_ice =-(QDef_flow/h_water_fusion); - P_el = const_P_el_internal; - mode_hp = const_mode_hp; - der(totalTimeDefrost) = 1; - else - m_flow_ice = A * density * growth_rate; - P_el = 0; - mode_hp = true; - der(totalTimeDefrost) = 0; - end if; - - iceFac = 1 - (m_ice/m_ice_max); - - connect(P_el_internal.y,P_el_add) annotation (Line( - points={{-19,-80},{0,-80},{0,-110}}, - color={0,0,127})); - connect(mode_internal.y, genConBus.hp_mode) annotation (Line( - points={{-79.8,1},{-76,1},{-76,0},{-108,0}}, - color={255,0,255})); - connect(genConBus.QEva_flow, realPassQEva_flow.u) annotation (Line( - points={{-108,0},{-102,0},{-102,2},{-104,2},{-104,-32},{-92,-32}}, - color={255,204,51}, - thickness=0.5)); - connect(genConBus.T_Amb, realPassT_Amb.u) annotation (Line( - points={{-108,0},{-106,0},{-106,-66},{-92,-66},{-92,-60}}, - color={255,204,51}, - thickness=0.5)); - connect(genConBus.iceFac, iceFac_internal.y) annotation (Line( - points={{-108,0},{-94,0},{-94,33},{-79.8,33}}, - color={255,204,51}, - thickness=0.5)); - connect(iceFac_internal.y, hysteresis.u) annotation (Line(points={{-79.8,33},{ - -79.8,82},{-22.8,82}}, color={0,0,127})); - connect(critDefTim_internal.y, greater.u2) annotation (Line(points={{49.8,-63}, - {53.9,-63},{53.9,-44.8},{54.8,-44.8}}, color={0,0,127})); - connect(timer.y, greater.u1) annotation (Line(points={{40.7,-29},{40.7,-30.5}, - {54.8,-30.5},{54.8,-40}}, color={0,0,127})); - connect(greaterThreshold.u, growthRateFor_internal.y) annotation (Line(points= - {{-21.4,-19},{-21.4,-18},{-32.7,-18}}, color={0,0,127})); - connect(hysteresis.y, not1.u) - annotation (Line(points={{9.4,82},{14,82},{14,80},{16,80},{16,82},{20,82}}, - color={255,0,255})); - connect(not1.y, orDefrost.u1) annotation (Line(points={{43,82},{50,82},{50,7}, - {53,7}}, color={255,0,255})); - connect(greater.y, orDefrost.u2) annotation (Line(points={{68.6,-40},{74,-40}, - {74,-24},{54,-24},{54,-10},{53,-10},{53,3}}, - color={255,0,255})); - connect(greaterThreshold.y,and1. u1) annotation (Line(points={{-5.3,-19},{-2.65, - -19},{-2.65,-29},{0.6,-29}}, color={255,0,255})); - connect(iceFac_internal.y, lessEqualThreshold.u) annotation (Line(points={{-79.8, - 33},{-86,33},{-86,48},{-30,48},{-30,-51},{-21.4,-51}}, color={0,0,127})); - connect(lessEqualThreshold.y,and1. u2) annotation (Line(points={{-5.3,-51},{-5.3, - -36.5},{0.6,-36.5},{0.6,-34.6}}, color={255,0,255})); - connect(and1.y, timer.u) annotation (Line(points={{16.7,-29},{16.7,-30.5},{24.6, - -30.5},{24.6,-29}}, color={255,0,255})); - connect(genConBus.hp_on, boolPassHP_on.u) annotation (Line( - points={{-108,0},{-106,0},{-106,-88},{-92,-88},{-92,-86}}, - color={255,204,51}, - thickness=0.5)); - connect(defrost, andDefrost.y) annotation (Line(points={{120,0},{104,0},{104,-1}, - {86.5,-1}}, color={255,0,255})); - connect(orDefrost.y, andDefrost.u1) annotation (Line(points={{64.5,7},{69.25,7}, - {69.25,-1},{75,-1}}, color={255,0,255})); - connect(greaterThreshold.y, andDefrost.u2) annotation (Line(points={{-5.3,-19}, - {-5.3,-4},{-4,-4},{-4,-6},{36,-6},{36,-5},{75,-5}}, color={255,0,255})); - connect(genConBus.n_hp, realPass_n_hp.u) annotation (Line( - points={{-108,0},{-106,0},{-106,-112},{-92,-112}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(greaterThreshold.y, switchGrowthRate.u2) annotation (Line(points={{-5.3, - -19},{8,-19},{8,31},{24.6,31}}, color={255,0,255})); - connect(growthRateNat_internal.y, switchGrowthRate.u3) annotation (Line( - points={{3.3,26},{14,26},{14,25.4},{24.6,25.4}}, color={0,0,127})); - connect(growthRateFor_internal.y, switchGrowthRate.u1) annotation (Line( - points={{-32.7,-18},{-26,-18},{-26,36.6},{24.6,36.6}}, color={0,0,127})); - connect(switchGrowthRate.y, growth_rate) annotation (Line(points={{40.7,31},{74, - 31},{74,60},{120,60}}, color={0,0,127})); - annotation (Icon(graphics={Text( - extent={{-64,46},{78,-56}}, - lineColor={0,0,0}, - textString="f(CICO)")}), experiment(StopTime=2592000, Interval=500)); -end CICOIceFacCalculation; diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/Functions.mo b/BESMod/Systems/Hydraulical/Components/Frosting/Functions.mo index bff335c2..2dceb54b 100644 --- a/BESMod/Systems/Hydraulical/Components/Frosting/Functions.mo +++ b/BESMod/Systems/Hydraulical/Components/Frosting/Functions.mo @@ -6,8 +6,8 @@ package Functions extends partialFrostingMap; protected - Modelica.SIunits.TemperatureDifference dT = 1.7e3 * CICO ^ (-0.36); - Modelica.SIunits.Temperature T_c = T_oda - dT; + Modelica.Units.SI.TemperatureDifference dT = 1.7e3 * CICO ^ (-0.36); + Modelica.Units.SI.Temperature T_c = T_oda - dT; algorithm growth_rate := (-3e-7 * log(CICO) + 5.4e-6); critDefTim := 0; @@ -73,13 +73,13 @@ package Functions end ZhuFrostingMapCico; partial function partialFrostingMap "Function for a partial frost map" - input Modelica.SIunits.Temperature T_oda "Outdoor air temperature"; + input Modelica.Units.SI.Temperature T_oda "Outdoor air temperature"; input Real relHum "Relative humidity as float (betwenn 0 and 1)"; input Real CICO(unit="s/m") "CICO value"; output Real Char[2] "Array with: growth_rate (Time until next defrost cycle) and growth_rate(Growth rate of ice on the surface)"; protected - Modelica.SIunits.Velocity growth_rate(min=0) "Growth rate of ice"; - Modelica.SIunits.Time critDefTim "Time until next defrost cycle (based on time-method)"; + Modelica.Units.SI.Velocity growth_rate(min=0) "Growth rate of ice"; + Modelica.Units.SI.Time critDefTim "Time until next defrost cycle (based on time-method)"; end partialFrostingMap; diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo b/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo index 377456d6..241866d9 100644 --- a/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo +++ b/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo @@ -1,124 +1,130 @@ within BESMod.Systems.Hydraulical.Components.Frosting; model ZhuIceFacCalculation "IceFac based on Zhus Frosting Map" - extends BaseClasses.partialIceFac; + extends BaseClasses.partialIceFac; - parameter Modelica.SIunits.Area A=15 + parameter Modelica.Units.SI.Area A=15 "Area of heat exchanger (All fins from both sides, as the growth rate is specific for the area of the HE"; - parameter Modelica.SIunits.Density density=150 - "Density of ice. Note! This parameter has an impact on the time necessary to melt the ice. - The growth rate is not affected, as it is cancled out with m_flow_ice_max. Papers assume lower values for new ice. "; - parameter Real minIceFac=0.4 + parameter Modelica.Units.SI.Density density=918 + "Density of ice"; + parameter Real minIceFac=0.5 "Minimal allowed icing Factor to trigger the defrost"; - parameter Modelica.SIunits.Mass m_ice_max=density*A*d/2 + parameter Modelica.Units.SI.Mass m_ice_max=density*A*d/2 "Maximal possible mass of ice on HE surface. This value is limited by the volume between the fin tube"; - parameter Modelica.SIunits.Distance d=3e-3 + parameter Modelica.Units.SI.Distance d=3e-3 "Distance between two fins. Used to calculate the maximal mass of ice on the HE"; - - parameter Real natConvCoeff(unit="m/(s.K)")=1e-7 + parameter Modelica.Units.SI.Volume V_h=19e-6 + "Compressor Displacement Volume per rev"; + parameter Modelica.Units.SI.Frequency N_max=120 + "Maximal compressor rotational speed"; + parameter Modelica.Units.SI.VolumeFlowRate V_flow_air=0.001 + "Volume flow rate over outdoor air coil"; + parameter Real natConvCoeff(unit="m/(s*K)")=1e-7 "Parameter to be calibrated for natural defrost"; Modelica.Blocks.Sources.RealExpression P_el_internal(y=P_el) "Additional power from internal calculations" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, rotation=0, - origin={-30,-88}))); + origin={-30,-90}))); Modelica.Blocks.Sources.RealExpression iceFac_internal(y=iceFac) "iceFac from internal calculations" annotation (Placement(transformation( - extent={{-18,15},{18,-15}}, - rotation=180, - origin={-60,33}))); + extent={{-10,10},{10,-10}}, + rotation=0, + origin={-62,80}))); Modelica.Blocks.Sources.BooleanExpression mode_internal(y=mode_hp) "Mode from internal calcuations" annotation (Placement( transformation( - extent={{-18,15},{18,-15}}, - rotation=180, - origin={-58,-1}))); + extent={{-10,10},{10,-10}}, + rotation=0, + origin={70,-90}))); Boolean mode_hp(start=false) "Heat pump heating mode"; Real iceFac(start=1) "Icing Factor"; - Modelica.SIunits.MassFlowRate m_flow_ice(start=0) "Current mass of ice on evaporator surface"; - Modelica.SIunits.Mass m_ice(start=0) "Total mass that was on evaporator surface over whole simulation duration"; - Modelica.SIunits.Power P_el(start=0) "Current power required"; - Modelica.SIunits.HeatFlowRate QDef_flow(start=0) "Input energy to melt the ice"; - Modelica.SIunits.Velocity growth_rate_natural_conv(min=0, start=0) "Growth rate of ice for natural convection (melting)"; - Modelica.SIunits.Velocity growth_rate_forced_conv(min=0, start=0) "Growth rate of ice for forced convection"; - - Modelica.SIunits.Time critDefTim + Modelica.Units.SI.MassFlowRate m_flow_ice(start=0) "Current mass of ice on evaporator surface"; + Modelica.Units.SI.Mass m_ice(start=0) "Total mass that was on evaporator surface over whole simulation duration"; + Modelica.Units.SI.Power P_el(start=0) "Current power required"; + Modelica.Units.SI.HeatFlowRate QDef_flow(start=0) "Input energy to melt the ice"; + Modelica.Units.SI.Velocity growth_rate_natural_conv(min=0, start=0) "Growth rate of ice for natural convection (melting)"; + Modelica.Units.SI.Velocity growth_rate_forced_conv(min=0, start=0) "Growth rate of ice for forced convection"; + Real densityCoeff(start=1) "density coefficient"; + Modelica.Units.SI.Time critDefTim "Time until next defrost cycle (based on time-method)"; - - Real densityCoeff(start=1) "density coefficient"; + Real CICO(unit="s/m") "CICO value"; replaceable function frostMapFunc = - BESMod.Systems.Hydraulical.Components.Frosting.Functions.ZhuFrostingMapCico - constrainedby - BESMod.Systems.Hydraulical.Components.Frosting.Functions.partialFrostingMap annotation(choicesAllMatching=true); + BESMod.Systems.Hydraulical.Components.Frosting.Functions.partialFrostingMap + annotation(choicesAllMatching=true); Modelica.Blocks.Routing.RealPassThrough realPassQEva_flow - annotation (Placement(transformation(extent={{-90,-42},{-70,-22}}))); + annotation (Placement(transformation(extent={{-90,-20},{-70,0}}))); Modelica.Blocks.Routing.RealPassThrough realPassT_Amb - annotation (Placement(transformation(extent={{-90,-70},{-70,-50}}))); + annotation (Placement(transformation(extent={{-90,-50},{-70,-30}}))); - Modelica.Blocks.Logical.Hysteresis hysteresis(uLow=minIceFac, uHigh=1) + Modelica.Blocks.Logical.Hysteresis hys(uLow=minIceFac, uHigh=1) "For the iceFac control. Output signal is used internally" - annotation (Placement(transformation(extent={{-20,68},{8,96}}))); + annotation (Placement(transformation(extent={{-30,70},{-10,90}}))); Modelica.Blocks.Logical.Timer timer - annotation (Placement(transformation(extent={{26,-36},{40,-22}}))); + annotation (Placement(transformation(extent={{30,-40},{50,-20}}))); Modelica.Blocks.Logical.Greater greater - annotation (Placement(transformation(extent={{56,-46},{68,-34}}))); + annotation (Placement(transformation(extent={{60,-60},{80,-40}}))); Modelica.Blocks.Sources.RealExpression critDefTim_internal(y=critDefTim) "Mode from internal calcuations" annotation (Placement(transformation( - extent={{-18,15},{18,-15}}, + extent={{-10,10},{10,-10}}, rotation=0, - origin={30,-63}))); + origin={30,-70}))); Modelica.Blocks.Logical.GreaterThreshold greaterThreshold(threshold=Modelica.Constants.eps) - annotation (Placement(transformation(extent={{-20,-26},{-6,-12}}))); + annotation (Placement(transformation(extent={{-30,-20},{-10,0}}))); Modelica.Blocks.Sources.RealExpression growthRateFor_internal(y= growth_rate_forced_conv) "growthRate from internal calcuations" annotation (Placement(transformation( - extent={{-13,10},{13,-10}}, + extent={{-10,10},{10,-10}}, rotation=0, - origin={-47,-18}))); + origin={-50,30}))); Modelica.Blocks.Logical.Not not1 - annotation (Placement(transformation(extent={{22,72},{42,92}}))); + annotation (Placement(transformation(extent={{0,70},{20,90}}))); Modelica.Blocks.Logical.Or orDefrost "Either hys or crit min time" - annotation (Placement(transformation(extent={{54,2},{64,12}}))); + annotation (Placement(transformation(extent={{40,0},{60,20}}))); Modelica.Blocks.Logical.And and1 - annotation (Placement(transformation(extent={{2,-36},{16,-22}}))); - Modelica.Blocks.Logical.LessEqualThreshold - lessEqualThreshold(threshold=1 - - Modelica.Constants.eps) - annotation (Placement(transformation(extent={{-20,-58},{-6,-44}}))); + annotation (Placement(transformation(extent={{0,-40},{20,-20}}))); + Modelica.Blocks.Logical.LessEqualThreshold lesEquThr(threshold=1 - Modelica.Constants.eps) + annotation (Placement(transformation(extent={{-40,-60},{-20,-40}}))); Modelica.Blocks.Routing.BooleanPassThrough boolPassHP_on - annotation (Placement(transformation(extent={{-90,-96},{-70,-76}}))); + annotation (Placement(transformation(extent={{-90,-76},{-70,-56}}))); - Modelica.SIunits.Time totalTimeDefrost "Total time where defrost operation was necessary in the year"; + Modelica.Units.SI.Time totalTimeDefrost "Total time where defrost operation was necessary in the year"; Modelica.Blocks.Interfaces.BooleanOutput defrost "Indicate if we are defrosting (true) or not" annotation (Placement( - transformation(extent={{100,-20},{140,20}}), iconTransformation(extent={ + transformation(extent={{100,-12},{124,12}}), iconTransformation(extent={ {-140,56},{-100,96}}))); Modelica.Blocks.Logical.And andDefrost "Either hys or crit min time" - annotation (Placement(transformation(extent={{76,-6},{86,4}}))); + annotation (Placement(transformation(extent={{72,-10},{92,10}}))); Modelica.Blocks.Routing.RealPassThrough realPass_n_hp - annotation (Placement(transformation(extent={{-90,-122},{-70,-102}}))); + annotation (Placement(transformation(extent={{-90,-100},{-70,-80}}))); Modelica.Blocks.Interfaces.RealOutput growth_rate "Growth rate of ice" - annotation (Placement(transformation(extent={{100,40},{140,80}}), + annotation (Placement(transformation(extent={{100,38},{124,62}}), iconTransformation(extent={{-140,56},{-100,96}}))); Modelica.Blocks.Sources.RealExpression growthRateNat_internal(y= growth_rate_natural_conv) "growthRate from internal calcuations" annotation (Placement(transformation( - extent={{-13,10},{13,-10}}, + extent={{-10,10},{10,-10}}, rotation=0, - origin={-11,26}))); + origin={-10,30}))); Modelica.Blocks.Logical.Switch switchGrowthRate - annotation (Placement(transformation(extent={{26,24},{40,38}}))); + annotation (Placement(transformation(extent={{60,40},{80,60}}))); + Modelica.Blocks.Interfaces.BooleanOutput modeHeaPum "Value of Boolean output" + annotation (Placement(transformation(extent={{100,-58},{120,-38}}))); + Modelica.Blocks.Interfaces.RealOutput iceFacMea "Value of Real output" + annotation (Placement(transformation(extent={{100,70},{120,90}}))); protected - parameter Modelica.SIunits.Power const_P_el_internal = if use_reverse_cycle then 0 else P_el_hr "Additional power used to defrost"; + parameter Modelica.Units.SI.Power const_P_el_internal = if use_reverse_cycle then 0 else P_el_hr "Additional power used to defrost"; parameter Boolean const_mode_hp = not use_reverse_cycle; Modelica.Blocks.Sources.RealExpression m_ice_internal(y=m_ice); Real Char[2]; +initial equation + assert(A * V_flow_air / (V_h * N_max)^2 > 7e6, "The paper found the correlations for CICOS greater than 7e6. Extrapolation will yield wrong results", AssertionLevel.warning); equation if m_ice > Modelica.Constants.eps then growth_rate_natural_conv = min(0, -natConvCoeff * (realPassT_Amb.y - 273.15)) "Simply energy balance with constant Area and constant defrost"; @@ -126,15 +132,17 @@ equation growth_rate_natural_conv = 0 "Not possible to melt the ice if no ice is present"; end if; - Char = frostMapFunc(realPassT_Amb.y, relHum, 0); + Char = frostMapFunc(realPassT_Amb.y, relHum, CICO); // Only vaild if the hp is turned on if boolPassHP_on.y then critDefTim = Char[1]; // Build a forced convection velocity to ensure the growth rate matches the timing in the map. growth_rate_forced_conv = Char[2]; + CICO = A * V_flow_air / (V_h * N_max * realPass_n_hp.y)^2; else critDefTim = Modelica.Constants.inf; growth_rate_forced_conv = 0; + CICO = 8e-6 "Only used to avoid log(0) as CICO is not defined for n_hp = 0"; end if; if growth_rate >= 3.6e-7 then @@ -171,83 +179,73 @@ equation iceFac = 1 - (m_ice/m_ice_max); connect(P_el_internal.y,P_el_add) annotation (Line( - points={{-19,-88},{0,-88},{0,-110}}, + points={{-19,-90},{0,-90},{0,-110}}, color={0,0,127})); - connect(iceFac_internal.y, hysteresis.u) annotation (Line(points={{-79.8,33},{ - -79.8,82},{-22.8,82}}, color={0,0,127})); - connect(critDefTim_internal.y, greater.u2) annotation (Line(points={{49.8,-63}, - {53.9,-63},{53.9,-44.8},{54.8,-44.8}}, color={0,0,127})); - connect(timer.y, greater.u1) annotation (Line(points={{40.7,-29},{40.7,-30.5}, - {54.8,-30.5},{54.8,-40}}, color={0,0,127})); - connect(greaterThreshold.u, growthRateFor_internal.y) annotation (Line(points= - {{-21.4,-19},{-21.4,-18},{-32.7,-18}}, color={0,0,127})); - connect(hysteresis.y, not1.u) - annotation (Line(points={{9.4,82},{14,82},{14,80},{16,80},{16,82},{20,82}}, - color={255,0,255})); - connect(not1.y, orDefrost.u1) annotation (Line(points={{43,82},{50,82},{50,7}, - {53,7}}, color={255,0,255})); - connect(greater.y, orDefrost.u2) annotation (Line(points={{68.6,-40},{74,-40}, - {74,-24},{54,-24},{54,-10},{53,-10},{53,3}}, + connect(genConBus.QEva_flow, realPassQEva_flow.u) annotation (Line( + points={{-108,0},{-104,0},{-104,2},{-106,2},{-106,-10},{-92,-10}}, + color={255,204,51}, + thickness=0.5)); + connect(iceFac_internal.y, hys.u) + annotation (Line(points={{-51,80},{-32,80}}, color={0,0,127})); + connect(critDefTim_internal.y, greater.u2) annotation (Line(points={{41,-70},{ + 53.9,-70},{53.9,-58},{58,-58}}, color={0,0,127})); + connect(timer.y, greater.u1) annotation (Line(points={{51,-30},{51,-30.5},{58, + -30.5},{58,-50}}, color={0,0,127})); + connect(greaterThreshold.u, growthRateFor_internal.y) annotation (Line(points={{-32,-10}, + {-32,30},{-39,30}}, color={0,0,127})); + connect(hys.y, not1.u) + annotation (Line(points={{-9,80},{-2,80}}, color={255,0,255})); + connect(not1.y, orDefrost.u1) annotation (Line(points={{21,80},{34,80},{34,10}, + {38,10}}, color={255,0,255})); + connect(greater.y, orDefrost.u2) annotation (Line(points={{81,-50},{86,-50},{86, + -20},{34,-20},{34,2},{38,2}}, color={255,0,255})); - connect(greaterThreshold.y,and1. u1) annotation (Line(points={{-5.3,-19},{-2.65, - -19},{-2.65,-29},{0.6,-29}}, color={255,0,255})); - connect(iceFac_internal.y, lessEqualThreshold.u) annotation (Line(points={{-79.8, - 33},{-86,33},{-86,48},{-30,48},{-30,-51},{-21.4,-51}}, color={0,0,127})); - connect(lessEqualThreshold.y,and1. u2) annotation (Line(points={{-5.3,-51},{-5.3, - -36.5},{0.6,-36.5},{0.6,-34.6}}, color={255,0,255})); - connect(and1.y, timer.u) annotation (Line(points={{16.7,-29},{16.7,-30.5},{24.6, - -30.5},{24.6,-29}}, color={255,0,255})); - connect(defrost, andDefrost.y) annotation (Line(points={{120,0},{104,0},{104,-1}, - {86.5,-1}}, color={255,0,255})); - connect(orDefrost.y, andDefrost.u1) annotation (Line(points={{64.5,7},{69.25,7}, - {69.25,-1},{75,-1}}, color={255,0,255})); - connect(greaterThreshold.y, andDefrost.u2) annotation (Line(points={{-5.3,-19}, - {-5.3,-4},{-4,-4},{-4,-6},{36,-6},{36,-5},{75,-5}}, color={255,0,255})); - connect(greaterThreshold.y, switchGrowthRate.u2) annotation (Line(points={{-5.3, - -19},{8,-19},{8,31},{24.6,31}}, color={255,0,255})); + connect(greaterThreshold.y,and1. u1) annotation (Line(points={{-9,-10},{-2.65, + -10},{-2.65,-30},{-2,-30}}, color={255,0,255})); + connect(iceFac_internal.y, lesEquThr.u) annotation (Line(points={{-51,80},{-48, + 80},{-48,-50},{-42,-50}}, color={0,0,127})); + connect(lesEquThr.y, and1.u2) annotation (Line(points={{-19,-50},{-19,-50.5},{ + -2,-50.5},{-2,-38}}, color={255,0,255})); + connect(and1.y, timer.u) annotation (Line(points={{21,-30},{21,-30.5},{28,-30.5}, + {28,-30}}, color={255,0,255})); + connect(defrost, andDefrost.y) annotation (Line(points={{112,0},{93,0}}, + color={255,0,255})); + connect(orDefrost.y, andDefrost.u1) annotation (Line(points={{61,10},{69.25,10}, + {69.25,0},{70,0}}, color={255,0,255})); + connect(greaterThreshold.y, andDefrost.u2) annotation (Line(points={{-9,-10},{ + 70,-10},{70,-8}}, color={255,0,255})); + connect(greaterThreshold.y, switchGrowthRate.u2) annotation (Line(points={{-9,-10}, + {8,-10},{8,50},{58,50}}, color={255,0,255})); connect(growthRateNat_internal.y, switchGrowthRate.u3) annotation (Line( - points={{3.3,26},{14,26},{14,25.4},{24.6,25.4}}, color={0,0,127})); + points={{1,30},{14,30},{14,42},{58,42}}, color={0,0,127})); connect(growthRateFor_internal.y, switchGrowthRate.u1) annotation (Line( - points={{-32.7,-18},{-26,-18},{-26,36.6},{24.6,36.6}}, color={0,0,127})); - connect(switchGrowthRate.y, growth_rate) annotation (Line(points={{40.7,31},{74, - 31},{74,60},{120,60}}, color={0,0,127})); - connect(realPass_n_hp.u, genConBus.nSet) annotation (Line(points={{-92,-112}, - {-102,-112},{-102,0.1},{-107.9,0.1}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(boolPassHP_on.u, genConBus.onOffMea) annotation (Line(points={{-92, - -86},{-107.9,-86},{-107.9,0.1}}, color={255,0,255}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(realPassT_Amb.u, genConBus.TOdaMea) annotation (Line(points={{-92,-60}, - {-102,-60},{-102,-62},{-107.9,-62},{-107.9,0.1}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(realPassQEva_flow.u, genConBus.QEva_flow) annotation (Line(points={{ - -92,-32},{-108,-32},{-108,0}}, color={0,0,127}), Text( + points={{-39,30},{-26,30},{-26,58},{58,58}}, color={0,0,127})); + connect(switchGrowthRate.y, growth_rate) annotation (Line(points={{81,50},{112, + 50}}, color={0,0,127})); + connect(realPassT_Amb.u, genConBus.TOdaMea) annotation (Line(points={{-92,-40}, + {-107.9,-40},{-107.9,0.1}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(mode_internal.y, genConBus.modeSet) annotation (Line(points={{-77.8,-1}, - {-91.9,-1},{-91.9,0.1},{-107.9,0.1}}, color={255,0,255}), Text( + connect(boolPassHP_on.u, genConBus.onOffMea) annotation (Line(points={{-92,-66}, + {-102,-66},{-102,0.1},{-107.9,0.1}}, color={255,0,255}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(iceFac_internal.y, genConBus.iceFacMea) annotation (Line(points={{ - -79.8,33},{-107.9,33},{-107.9,0.1}}, color={0,0,127}), Text( + connect(realPass_n_hp.u, genConBus.nSet) annotation (Line(points={{-92,-90},{ + -102,-90},{-102,0.1},{-107.9,0.1}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); + connect(mode_internal.y, modeHeaPum) annotation (Line(points={{81,-90},{99.1, + -90},{99.1,-48},{110,-48}}, color={255,0,255})); + connect(iceFac_internal.y, iceFacMea) annotation (Line(points={{-51,80},{-38,80}, + {-38,66},{70,66},{70,80},{110,80}}, color={0,0,127})); + connect(growth_rate, growth_rate) + annotation (Line(points={{112,50},{112,50}}, color={0,0,127})); annotation (Icon(graphics={Text( extent={{-64,46},{78,-56}}, lineColor={0,0,0}, diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/package.order b/BESMod/Systems/Hydraulical/Components/Frosting/package.order index 5231ad5b..bdd547e3 100644 --- a/BESMod/Systems/Hydraulical/Components/Frosting/package.order +++ b/BESMod/Systems/Hydraulical/Components/Frosting/package.order @@ -1,5 +1,4 @@ NoFrosting -CICOIceFacCalculation ZhuIceFacCalculation Functions BaseClasses From ac54ffcbec46d0c1eed8da2bb197babbad1d1e87 Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Mon, 11 Dec 2023 17:15:39 +0100 Subject: [PATCH 109/131] Add frosting models based on master thesis a --- BESMod/Examples/DesignOptimization/BES.mo | 13 ++- .../Frosting/BaseClasses/PartialFrosting.mo | 35 ++++++++ .../Frosting/BaseClasses/package.order | 2 +- .../Frosting/BaseClasses/partialIceFac.mo | 37 -------- .../Components/Frosting/Functions.mo | 6 +- .../Components/Frosting/NoFrosting.mo | 31 +++---- .../Frosting/ZhuIceFacCalculation.mo | 89 ++++++------------- .../Generation/BaseClasses/PartialHeatPump.mo | 68 +++++++++----- 8 files changed, 132 insertions(+), 149 deletions(-) create mode 100644 BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/PartialFrosting.mo delete mode 100644 BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/partialIceFac.mo diff --git a/BESMod/Examples/DesignOptimization/BES.mo b/BESMod/Examples/DesignOptimization/BES.mo index e5b4b90d..fe03b7ea 100644 --- a/BESMod/Examples/DesignOptimization/BES.mo +++ b/BESMod/Examples/DesignOptimization/BES.mo @@ -5,11 +5,22 @@ model BES redeclare Systems.Demand.Building.TEASERThermalZone building( ABui=sum(building.zoneParam.VAir)^(2/3), hBui=sum(building.zoneParam.VAir)^(1/3), + ARoo=sum(building.zoneParam.ARoof), redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( + redeclare model PerDataRevHP = + AixLib.DataBase.Chiller.PerformanceData.PolynomalApproach (redeclare + function PolyData = + AixLib.DataBase.HeatPump.Functions.Characteristics.ConstantCoP ( + powerCompressor=2000, CoP=2)), + redeclare + BESMod.Systems.Hydraulical.Components.Frosting.ZhuIceFacCalculation + frost(density=200, redeclare function frostMapFunc = + BESMod.Systems.Hydraulical.Components.Frosting.Functions.ZhuFrostingMapCico), + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare @@ -74,11 +85,9 @@ model BES VPerQ_flow=parameterStudy.VPerQFlow, dTLoadingHC1=0, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.B), - redeclare BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.DefaultStorage parStoDHW(dTLoadingHC1=10, energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.A), - redeclare BESMod.Systems.RecordsCollection.Valves.DefaultThreeWayValve parThrWayVal), redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/PartialFrosting.mo b/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/PartialFrosting.mo new file mode 100644 index 00000000..785170eb --- /dev/null +++ b/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/PartialFrosting.mo @@ -0,0 +1,35 @@ +within BESMod.Systems.Hydraulical.Components.Frosting.BaseClasses; +partial model PartialFrosting + "Partial model for frosting and defrost control" + + Modelica.Blocks.Interfaces.RealInput relHum + "Input relative humidity of outdoor air" annotation (Placement( + transformation(extent={{-140,60},{-100,100}}), iconTransformation( + extent={{-140,56},{-100,96}}))); + AixLib.Controls.Interfaces.VapourCompressionMachineControlBus + genConBus + "Bus with the most relevant information for hp frosting calculation" + annotation (Placement(transformation(extent={{-128,-80},{-88,-40}}), + iconTransformation(extent={{-130,-108},{-90,-68}}))); + Modelica.Blocks.Interfaces.RealOutput iceFacMea "Value of Real output" + annotation (Placement(transformation(extent={{100,50},{120,70}}))); + Modelica.Blocks.Interfaces.BooleanOutput modeHeaPum "Value of Boolean output" + annotation (Placement(transformation(extent={{100,-70},{120,-50}}))); + Modelica.Blocks.Interfaces.RealInput TOda "Outdoor air temperature" annotation + (Placement(transformation(extent={{-140,-40},{-100,0}}), iconTransformation( + extent={{-140,-16},{-100,24}}))); + Modelica.Blocks.Interfaces.RealInput QEva_flow "Evaporator heat flow" + annotation (Placement(transformation(extent={{-140,10},{-100,50}}), + iconTransformation(extent={{-140,-74},{-100,-34}}))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid, + lineThickness=0.5), Text( + extent={{-76,102},{66,66}}, + lineColor={28,108,200}, + textString="%name%")}), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end PartialFrosting; diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/package.order index cc2a7c5c..2604f6d1 100644 --- a/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/package.order @@ -1 +1 @@ -partialIceFac +PartialFrosting diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/partialIceFac.mo b/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/partialIceFac.mo deleted file mode 100644 index 3c935c24..00000000 --- a/BESMod/Systems/Hydraulical/Components/Frosting/BaseClasses/partialIceFac.mo +++ /dev/null @@ -1,37 +0,0 @@ -within BESMod.Systems.Hydraulical.Components.Frosting.BaseClasses; -partial model partialIceFac "PartialIceFacCalculator" - parameter Boolean use_reverse_cycle=true "If false, an eletrical heater will be used instead of reverse cycle method"; - parameter Modelica.Units.SI.SpecificEnthalpy h_water_fusion=333.5e3 "Fusion enthalpy of water (Schmelzenthalpie)"; - parameter Real eta_hr=1 "Efficiency of used heating rod" - annotation (Dialog(enable=not use_reverse_cycle)); - parameter Modelica.Units.SI.Power P_el_hr=0 "Heating power of heating rod" annotation (Dialog(enable=not use_reverse_cycle)); - - Modelica.Blocks.Interfaces.RealOutput P_el_add - "Additional power required to defrost" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={0,-110}), iconTransformation(extent={{-10,-10},{10,10}}, - rotation=270, - origin={2,-110}))); - Modelica.Blocks.Interfaces.RealInput relHum - "Input relative humidity of outdoor air" annotation (Placement( - transformation(extent={{-140,60},{-100,100}}), iconTransformation( - extent={{-140,56},{-100,96}}))); - AixLib.Controls.Interfaces.VapourCompressionMachineControlBus - genConBus - "Bus with the most relevant information for hp frosting calculation" - annotation (Placement(transformation(extent={{-128,-20},{-88,20}}), - iconTransformation(extent={{-130,-20},{-90,20}}))); - annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ - Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,0}, - fillColor={215,215,215}, - fillPattern=FillPattern.Solid, - lineThickness=0.5), Text( - extent={{-76,102},{66,66}}, - lineColor={28,108,200}, - textString="%name%")}), Diagram( - coordinateSystem(preserveAspectRatio=false))); -end partialIceFac; diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/Functions.mo b/BESMod/Systems/Hydraulical/Components/Frosting/Functions.mo index 2dceb54b..51782c14 100644 --- a/BESMod/Systems/Hydraulical/Components/Frosting/Functions.mo +++ b/BESMod/Systems/Hydraulical/Components/Frosting/Functions.mo @@ -2,7 +2,7 @@ within BESMod.Systems.Hydraulical.Components.Frosting; package Functions function CICOBasedFunction - "Function to calculate the frosting map based on the CICO value - Liang 2019." + "Function to calculate the growth rate according to CICO (Liang et al. 2019) and defrost time according to Zhu, 2015." extends partialFrostingMap; protected @@ -30,7 +30,7 @@ package Functions end CICOBasedFunction; function ZhuFrostingMapCico - "Function to calculate the frosting map according to Zhu, 2015. The grwoth rates of the ice are taken from Liu et. al. (the CICO-Paper)" + "Function to calculate the growth rate according to Liang et al. 2020 and defrost time according to Zhu, 2015." extends partialFrostingMap; protected @@ -76,7 +76,7 @@ package Functions input Modelica.Units.SI.Temperature T_oda "Outdoor air temperature"; input Real relHum "Relative humidity as float (betwenn 0 and 1)"; input Real CICO(unit="s/m") "CICO value"; - output Real Char[2] "Array with: growth_rate (Time until next defrost cycle) and growth_rate(Growth rate of ice on the surface)"; + output Real Char[2] "Array with: critDefTim (Time until next defrost cycle) and growth_rate(Growth rate of ice on the surface)"; protected Modelica.Units.SI.Velocity growth_rate(min=0) "Growth rate of ice"; Modelica.Units.SI.Time critDefTim "Time until next defrost cycle (based on time-method)"; diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/NoFrosting.mo b/BESMod/Systems/Hydraulical/Components/Frosting/NoFrosting.mo index 02dc6b32..b4a8a8e8 100644 --- a/BESMod/Systems/Hydraulical/Components/Frosting/NoFrosting.mo +++ b/BESMod/Systems/Hydraulical/Components/Frosting/NoFrosting.mo @@ -1,32 +1,21 @@ within BESMod.Systems.Hydraulical.Components.Frosting; model NoFrosting "Model for no frosting at all times" - extends BaseClasses.partialIceFac(final use_reverse_cycle=true); - Modelica.Blocks.Sources.Constant constZero(final k=0) "No energy needed" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={0,-70}))); + extends BaseClasses.PartialFrosting; Modelica.Blocks.Sources.BooleanConstant booCon(final k=true) "Always heating" annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=180, - origin={-50,0}))); + extent={{-10,-10},{10,10}}, + rotation=0, + origin={10,-60}))); Modelica.Blocks.Sources.Constant constOne(final k=1) "Always iceFac=1" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=180, - origin={-50,50}))); + rotation=0, + origin={10,60}))); equation - connect(constZero.y, P_el_add) - annotation (Line(points={{0,-81},{0,-110}}, color={0,0,127})); - connect(booCon.y, genConBus.hp_mode) annotation (Line(points={{-61,8.88178e-16}, - {-88,8.88178e-16},{-88,0},{-108,0}}, color={255,0,255})); - connect(constOne.y, genConBus.iceFac) annotation (Line(points={{-61,50},{-90,50}, - {-90,0},{-108,0}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); + connect(constOne.y, iceFacMea) + annotation (Line(points={{21,60},{110,60}}, color={0,0,127})); + connect(booCon.y, modeHeaPum) + annotation (Line(points={{21,-60},{110,-60}}, color={255,0,255})); annotation (Icon(graphics={Text( extent={{-68,-50},{80,48}}, lineColor={0,0,0}, diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo b/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo index 241866d9..f3ccba74 100644 --- a/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo +++ b/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo @@ -1,6 +1,7 @@ within BESMod.Systems.Hydraulical.Components.Frosting; model ZhuIceFacCalculation "IceFac based on Zhus Frosting Map" - extends BaseClasses.partialIceFac; + extends BaseClasses.PartialFrosting; + parameter Modelica.Units.SI.SpecificEnthalpy h_water_fusion=333.5e3 "Fusion enthalpy of water (Schmelzenthalpie)"; parameter Modelica.Units.SI.Area A=15 "Area of heat exchanger (All fins from both sides, as the growth rate is specific for the area of the HE"; @@ -18,13 +19,9 @@ model ZhuIceFacCalculation "IceFac based on Zhus Frosting Map" "Maximal compressor rotational speed"; parameter Modelica.Units.SI.VolumeFlowRate V_flow_air=0.001 "Volume flow rate over outdoor air coil"; - parameter Real natConvCoeff(unit="m/(s*K)")=1e-7 + parameter Real natConvCoeff(unit="m/(s.K)")=1e-7 "Parameter to be calibrated for natural defrost"; - Modelica.Blocks.Sources.RealExpression P_el_internal(y=P_el) "Additional power from internal calculations" annotation (Placement(transformation( - extent={{-10,10},{10,-10}}, - rotation=0, - origin={-30,-90}))); Modelica.Blocks.Sources.RealExpression iceFac_internal(y=iceFac) "iceFac from internal calculations" annotation (Placement(transformation( extent={{-10,10},{10,-10}}, @@ -41,8 +38,6 @@ model ZhuIceFacCalculation "IceFac based on Zhus Frosting Map" Real iceFac(start=1) "Icing Factor"; Modelica.Units.SI.MassFlowRate m_flow_ice(start=0) "Current mass of ice on evaporator surface"; Modelica.Units.SI.Mass m_ice(start=0) "Total mass that was on evaporator surface over whole simulation duration"; - Modelica.Units.SI.Power P_el(start=0) "Current power required"; - Modelica.Units.SI.HeatFlowRate QDef_flow(start=0) "Input energy to melt the ice"; Modelica.Units.SI.Velocity growth_rate_natural_conv(min=0, start=0) "Growth rate of ice for natural convection (melting)"; Modelica.Units.SI.Velocity growth_rate_forced_conv(min=0, start=0) "Growth rate of ice for forced convection"; Real densityCoeff(start=1) "density coefficient"; @@ -54,11 +49,6 @@ model ZhuIceFacCalculation "IceFac based on Zhus Frosting Map" BESMod.Systems.Hydraulical.Components.Frosting.Functions.partialFrostingMap annotation(choicesAllMatching=true); - Modelica.Blocks.Routing.RealPassThrough realPassQEva_flow - annotation (Placement(transformation(extent={{-90,-20},{-70,0}}))); - Modelica.Blocks.Routing.RealPassThrough realPassT_Amb - annotation (Placement(transformation(extent={{-90,-50},{-70,-30}}))); - Modelica.Blocks.Logical.Hysteresis hys(uLow=minIceFac, uHigh=1) "For the iceFac control. Output signal is used internally" annotation (Placement(transformation(extent={{-30,70},{-10,90}}))); @@ -89,7 +79,7 @@ model ZhuIceFacCalculation "IceFac based on Zhus Frosting Map" Modelica.Blocks.Logical.LessEqualThreshold lesEquThr(threshold=1 - Modelica.Constants.eps) annotation (Placement(transformation(extent={{-40,-60},{-20,-40}}))); Modelica.Blocks.Routing.BooleanPassThrough boolPassHP_on - annotation (Placement(transformation(extent={{-90,-76},{-70,-56}}))); + annotation (Placement(transformation(extent={{-90,-78},{-70,-58}}))); Modelica.Units.SI.Time totalTimeDefrost "Total time where defrost operation was necessary in the year"; @@ -101,9 +91,9 @@ model ZhuIceFacCalculation "IceFac based on Zhus Frosting Map" "Either hys or crit min time" annotation (Placement(transformation(extent={{72,-10},{92,10}}))); Modelica.Blocks.Routing.RealPassThrough realPass_n_hp - annotation (Placement(transformation(extent={{-90,-100},{-70,-80}}))); + annotation (Placement(transformation(extent={{-90,-102},{-70,-82}}))); Modelica.Blocks.Interfaces.RealOutput growth_rate "Growth rate of ice" - annotation (Placement(transformation(extent={{100,38},{124,62}}), + annotation (Placement(transformation(extent={{100,20},{124,44}}), iconTransformation(extent={{-140,56},{-100,96}}))); Modelica.Blocks.Sources.RealExpression growthRateNat_internal(y= growth_rate_natural_conv) "growthRate from internal calcuations" @@ -112,14 +102,8 @@ model ZhuIceFacCalculation "IceFac based on Zhus Frosting Map" rotation=0, origin={-10,30}))); Modelica.Blocks.Logical.Switch switchGrowthRate - annotation (Placement(transformation(extent={{60,40},{80,60}}))); - Modelica.Blocks.Interfaces.BooleanOutput modeHeaPum "Value of Boolean output" - annotation (Placement(transformation(extent={{100,-58},{120,-38}}))); - Modelica.Blocks.Interfaces.RealOutput iceFacMea "Value of Real output" - annotation (Placement(transformation(extent={{100,70},{120,90}}))); + annotation (Placement(transformation(extent={{58,40},{78,60}}))); protected - parameter Modelica.Units.SI.Power const_P_el_internal = if use_reverse_cycle then 0 else P_el_hr "Additional power used to defrost"; - parameter Boolean const_mode_hp = not use_reverse_cycle; Modelica.Blocks.Sources.RealExpression m_ice_internal(y=m_ice); Real Char[2]; @@ -127,12 +111,12 @@ initial equation assert(A * V_flow_air / (V_h * N_max)^2 > 7e6, "The paper found the correlations for CICOS greater than 7e6. Extrapolation will yield wrong results", AssertionLevel.warning); equation if m_ice > Modelica.Constants.eps then - growth_rate_natural_conv = min(0, -natConvCoeff * (realPassT_Amb.y - 273.15)) "Simply energy balance with constant Area and constant defrost"; + growth_rate_natural_conv = min(0, -natConvCoeff * (TOda - 273.15)) "Simply energy balance with constant Area and constant defrost"; else growth_rate_natural_conv = 0 "Not possible to melt the ice if no ice is present"; end if; - Char = frostMapFunc(realPassT_Amb.y, relHum, CICO); + Char = frostMapFunc(TOda, relHum, CICO); // Only vaild if the hp is turned on if boolPassHP_on.y then critDefTim = Char[1]; @@ -145,6 +129,7 @@ equation CICO = 8e-6 "Only used to avoid log(0) as CICO is not defined for n_hp = 0"; end if; + // TODO: Check if necessary if growth_rate >= 3.6e-7 then densityCoeff = 1; elseif growth_rate >= 2.5e-7 then @@ -156,35 +141,20 @@ equation end if; der(m_ice) = m_flow_ice; - if use_reverse_cycle then - QDef_flow = realPassQEva_flow.y; - else - // No reverse cycle - QDef_flow = P_el_hr/eta_hr; - end if; // Calculate defrost: if defrost then - m_flow_ice =-(QDef_flow/h_water_fusion)*densityCoeff; - P_el = const_P_el_internal; - mode_hp = const_mode_hp; + m_flow_ice =-(QEva_flow/h_water_fusion)*densityCoeff; + mode_hp = false; der(totalTimeDefrost) = 1; else m_flow_ice = A * density * growth_rate; - P_el = 0; mode_hp = true; der(totalTimeDefrost) = 0; end if; iceFac = 1 - (m_ice/m_ice_max); - connect(P_el_internal.y,P_el_add) annotation (Line( - points={{-19,-90},{0,-90},{0,-110}}, - color={0,0,127})); - connect(genConBus.QEva_flow, realPassQEva_flow.u) annotation (Line( - points={{-108,0},{-104,0},{-104,2},{-106,2},{-106,-10},{-92,-10}}, - color={255,204,51}, - thickness=0.5)); connect(iceFac_internal.y, hys.u) annotation (Line(points={{-51,80},{-32,80}}, color={0,0,127})); connect(critDefTim_internal.y, greater.u2) annotation (Line(points={{41,-70},{ @@ -215,37 +185,32 @@ equation connect(greaterThreshold.y, andDefrost.u2) annotation (Line(points={{-9,-10},{ 70,-10},{70,-8}}, color={255,0,255})); connect(greaterThreshold.y, switchGrowthRate.u2) annotation (Line(points={{-9,-10}, - {8,-10},{8,50},{58,50}}, color={255,0,255})); + {8,-10},{8,50},{56,50}}, color={255,0,255})); connect(growthRateNat_internal.y, switchGrowthRate.u3) annotation (Line( - points={{1,30},{14,30},{14,42},{58,42}}, color={0,0,127})); + points={{1,30},{14,30},{14,42},{56,42}}, color={0,0,127})); connect(growthRateFor_internal.y, switchGrowthRate.u1) annotation (Line( - points={{-39,30},{-26,30},{-26,58},{58,58}}, color={0,0,127})); - connect(switchGrowthRate.y, growth_rate) annotation (Line(points={{81,50},{112, - 50}}, color={0,0,127})); - connect(realPassT_Amb.u, genConBus.TOdaMea) annotation (Line(points={{-92,-40}, - {-107.9,-40},{-107.9,0.1}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(boolPassHP_on.u, genConBus.onOffMea) annotation (Line(points={{-92,-66}, - {-102,-66},{-102,0.1},{-107.9,0.1}}, color={255,0,255}), Text( + points={{-39,30},{-26,30},{-26,58},{56,58}}, color={0,0,127})); + connect(switchGrowthRate.y, growth_rate) annotation (Line(points={{79,50},{96,50}, + {96,32},{112,32}}, color={0,0,127})); + connect(boolPassHP_on.u, genConBus.onOffMea) annotation (Line(points={{-92,-68}, + {-102,-68},{-102,-59.9},{-107.9,-59.9}}, + color={255,0,255}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(realPass_n_hp.u, genConBus.nSet) annotation (Line(points={{-92,-90},{ - -102,-90},{-102,0.1},{-107.9,0.1}}, color={0,0,127}), Text( + connect(realPass_n_hp.u, genConBus.nSet) annotation (Line(points={{-92,-92},{-102, + -92},{-102,-59.9},{-107.9,-59.9}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(mode_internal.y, modeHeaPum) annotation (Line(points={{81,-90},{99.1, - -90},{99.1,-48},{110,-48}}, color={255,0,255})); - connect(iceFac_internal.y, iceFacMea) annotation (Line(points={{-51,80},{-38,80}, - {-38,66},{70,66},{70,80},{110,80}}, color={0,0,127})); connect(growth_rate, growth_rate) - annotation (Line(points={{112,50},{112,50}}, color={0,0,127})); + annotation (Line(points={{112,32},{112,32}}, color={0,0,127})); + connect(mode_internal.y, modeHeaPum) annotation (Line(points={{81,-90},{90,-90}, + {90,-60},{110,-60}}, color={255,0,255})); + connect(iceFac_internal.y, iceFacMea) annotation (Line(points={{-51,80},{-48,80}, + {-48,60},{110,60}}, color={0,0,127})); annotation (Icon(graphics={Text( extent={{-64,46},{78,-56}}, lineColor={0,0,0}, diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo index 9922d0ad..503d312e 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo @@ -13,6 +13,13 @@ model PartialHeatPump "Generation with only the heat pump" AixLib.DataBase.HeatPump.PerformanceData.BaseClasses.PartialPerformanceData "Heat pump model approach" annotation (Dialog(group="Component data"), choicesAllMatching=true); + replaceable model PerDataRevHP = + AixLib.DataBase.Chiller.PerformanceData.PolynomalApproach (redeclare + function PolyData = + AixLib.DataBase.HeatPump.Functions.Characteristics.ConstantCoP ( powerCompressor=2000, CoP=2)) + constrainedby + AixLib.DataBase.Chiller.PerformanceData.BaseClasses.PartialPerformanceData + annotation (Dialog(group="Frosting"), choicesAllMatching=true); parameter Boolean use_airSource=true "Turn false to use water as temperature source." annotation(Dialog(group="Component choices")); @@ -29,7 +36,10 @@ model PartialHeatPump "Generation with only the heat pump" parameter Modelica.Media.Interfaces.Types.Temperature TSoilConst=273.15 + 10 "Constant soil temperature for ground source heat pumps" annotation(Dialog(group="Component choices", enable=use_airSource)); - + replaceable Components.Frosting.NoFrosting frost constrainedby + Components.Frosting.BaseClasses.PartialFrosting + "Model to account for frosting and defrost control" annotation (Dialog(group="Frosting"), Placement( + transformation(extent={{-178,2},{-162,18}})), choicesAllMatching=true); replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatPumpBaseDataDefinition parHeaPum constrainedby @@ -94,9 +104,7 @@ model PartialHeatPump "Generation with only the heat pump" final energyDynamics=energyDynamics, final show_TPort=show_T, redeclare model PerDataMainHP = PerDataMainHP, - redeclare model PerDataRevHP = - AixLib.DataBase.Chiller.PerformanceData.LookUpTable2D (dataTable= - AixLib.DataBase.Chiller.EN14511.Vitocal200AWO201())) annotation ( + redeclare model PerDataRevHP = PerDataRevHP) annotation ( Placement(transformation( extent={{22,-27},{-22,27}}, rotation=270, @@ -192,24 +200,14 @@ model PartialHeatPump "Generation with only the heat pump" rotation=180, origin={130,-82}))); Modelica.Blocks.Sources.BooleanExpression booExpHeaPumIsOn(y=heatPump.greaterThreshold.y) - annotation (Placement(transformation(extent={{-180,-20},{-160,0}}))); + annotation (Placement(transformation(extent={{-182,-40},{-162,-20}}))); Modelica.Blocks.Sources.RealExpression reaExpPEleHeaPum(y=heatPump.innerCycle.Pel) "Electrical power consumption of heat pump" annotation (Placement(transformation(extent={{-180,-80},{-160,-60}}))); - Modelica.Blocks.Sources.Constant conIceFac(final k=1) annotation (Placement( - transformation( - extent={{-11,-11},{11,11}}, - rotation=0, - origin={-169,11}))); Modelica.Blocks.Sources.RealExpression reaExpTHeaPumOut(y=heatPump.senT_b1.T) annotation (Placement(transformation(extent={{-60,80},{-40,100}}))); Modelica.Blocks.Sources.RealExpression reaExpTHeaPumIn(y=heatPump.senT_a1.T) annotation (Placement(transformation(extent={{-60,60},{-40,80}}))); - Modelica.Blocks.Sources.BooleanConstant conNotRev(final k=true) annotation ( - Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-170,-38}))); Modelica.Blocks.Sources.RealExpression reaExpTEvaIn(y=heatPump.senT_a2.T) annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); Utilities.KPIs.DeviceKPICalculator KPIHeaPum( @@ -218,6 +216,11 @@ model PartialHeatPump "Generation with only the heat pump" calc_totalOnTime=true, calc_numSwi=true) "Heat pump KPIs" annotation (Placement(transformation(extent={{-120,-60},{-100,-40}}))); + + Modelica.Blocks.Sources.RealExpression reaExpQEva_flow(y=heatPump.innerCycle.QEva) + "Electrical power consumption of heat pump" + annotation (Placement(transformation(extent={{-220,-4},{-200,16}}))); + equation connect(bouEva.ports[1], heatPump.port_a2) annotation (Line(points={{-80,50},{-74, 50},{-74,42},{-57.5,42},{-57.5,37}}, color={0,127,255})); @@ -274,16 +277,14 @@ equation connect(reaExpPEleHeaPum.y, KPIWel.u) annotation (Line(points={{-159,-70},{-148,-70},{-148,-30},{-141.8,-30}}, color={0,0,127})); - connect(conIceFac.y, heatPump.iceFac_in) annotation (Line(points={{-156.9,11}, - {-106,11},{-106,-1.72},{-74.6,-1.72}}, color={0,0,127})); connect(heatPump.nSet, sigBusGen.yHeaPumSet) annotation (Line(points={{-39.5,-10.52}, {-39.5,-26},{2,-26},{2,98}}, color={0,0,127}), Text( string="%second", index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); - connect(booExpHeaPumIsOn.y, sigBusGen.heaPumIsOn) annotation (Line(points={{-159, - -10},{-142,-10},{-142,98},{2,98}}, color={255,0,255}), Text( + connect(booExpHeaPumIsOn.y, sigBusGen.heaPumIsOn) annotation (Line(points={{-161, + -30},{-142,-30},{-142,98},{2,98}}, color={255,0,255}), Text( string="%second", index=1, extent={{6,3},{6,3}}, @@ -300,8 +301,6 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(heatPump.modeSet, conNotRev.y) annotation (Line(points={{-48.5,-10.52}, - {-48.5,-38},{-159,-38}}, color={255,0,255})); connect(reaExpTEvaIn.y, sigBusGen.THeaPumEvaIn) annotation (Line(points={{-39, 50},{2,50},{2,98}}, color={0,0,127}), Text( string="%second", @@ -327,8 +326,8 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIHeaPum.u, booExpHeaPumIsOn.y) annotation (Line(points={{-122.2,-50}, - {-134,-50},{-134,-48},{-154,-48},{-154,-10},{-159,-10}}, color={255,0, + connect(KPIHeaPum.u, booExpHeaPumIsOn.y) annotation (Line(points={{-122.2,-50},{ + -134,-50},{-134,-48},{-154,-48},{-154,-30},{-161,-30}}, color={255,0, 255})); connect(KPIHeaPum.KPI, outBusGen.heaPum) annotation (Line(points={{-97.8,-50},{ 0,-50},{0,-100}}, color={135,135,135}), Text( @@ -336,6 +335,29 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); + connect(frost.modeHeaPum, heatPump.modeSet) annotation (Line(points={{-161.2,5.2}, + {-112,5.2},{-112,-36},{-48.5,-36},{-48.5,-10.52}}, color={255,0,255})); + connect(frost.iceFacMea, heatPump.iceFac_in) annotation (Line(points={{-161.2,14.8}, + {-120,14.8},{-120,-1.72},{-74.6,-1.72}}, color={0,0,127})); + connect(frost.relHum, weaBus.relHum) annotation (Line(points={{-179.6,16.08},{-190, + 16.08},{-190,80.11},{-100.895,80.11}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(frost.genConBus, heatPump.sigBus) annotation (Line( + points={{-178.8,2.96},{-190,2.96},{-190,-38},{-52.775,-38},{-52.775,-6.78}}, + color={255,204,51}, + thickness=0.5)); + + connect(frost.TOda, weaBus.TDryBul) annotation (Line(points={{-179.6,10.32},{-200, + 10.32},{-200,80.11},{-100.895,80.11}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(reaExpQEva_flow.y, frost.QEva_flow) annotation (Line(points={{-199,6},{-190, + 6},{-190,5.68},{-179.6,5.68}}, color={0,0,127})); annotation (Line( points={{-52.775,-6.78},{-52.775,33.61},{-56,33.61},{-56,74}}, color={255,204,51}, From 9862a19de7e2ba06a583093fc42c66a66119d4a9 Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Wed, 3 Jan 2024 14:17:42 +0100 Subject: [PATCH 110/131] Make heating curve replaceable and enable a simple one zone PI control --- .../Examples/HeatPumpAndBoiler/BaseClasses.mo | 13 +++-- .../PartialHeatPumpSystemController.mo | 15 +++--- .../{ => BaseClasses}/ConstantAdd.mo | 2 +- .../HeatPumpBusPassThrough.mo | 2 +- .../{ => BaseClasses}/MeasuredValue.mo | 4 +- .../ParallelValveController.mo | 2 +- .../SetAndMeasuredValueSelector.mo | 26 +++++----- .../Control/Components/BaseClasses/package.mo | 4 ++ .../Components/BaseClasses/package.order | 5 ++ .../Components/BuildingAndDHWControl.mo | 50 ++++++++++--------- .../HeatingCurve.mo | 23 +++++++++ .../PartialSetpoint.mo | 33 ++++++++++++ .../SingleZonePID.mo | 36 +++++++++++++ .../package.mo | 3 ++ .../package.order | 3 ++ .../Control/Components/HeatingCurve.mo | 48 ------------------ .../Control/Components/package.order | 12 ++--- .../Systems/Hydraulical/Control/GasBoiler.mo | 9 ++-- .../Control/HybridHeatPumpSystem.mo | 8 +-- .../Control/MonoenergeticHeatPumpSystem.mo | 3 +- .../PartialGetHeatGenerationCurve.mo | 5 +- 21 files changed, 186 insertions(+), 120 deletions(-) rename BESMod/Systems/Hydraulical/Control/Components/{ => BaseClasses}/ConstantAdd.mo (96%) rename BESMod/Systems/Hydraulical/Control/Components/{ => BaseClasses}/HeatPumpBusPassThrough.mo (98%) rename BESMod/Systems/Hydraulical/Control/Components/{ => BaseClasses}/MeasuredValue.mo (66%) rename BESMod/Systems/Hydraulical/Control/Components/{ => BaseClasses}/ParallelValveController.mo (94%) rename BESMod/Systems/Hydraulical/Control/Components/{ => BaseClasses}/SetAndMeasuredValueSelector.mo (83%) create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BaseClasses/package.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BaseClasses/package.order create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/HeatingCurve.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/PartialSetpoint.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.order delete mode 100644 BESMod/Systems/Hydraulical/Control/Components/HeatingCurve.mo diff --git a/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo b/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo index 6dd14b65..24369657 100644 --- a/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo +++ b/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo @@ -6,9 +6,9 @@ package BaseClasses "Contains partial example case" redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, redeclare Systems.Demand.Building.TEASERThermalZone building( ABui=sum(building.zoneParam.VAir)^(2/3), - hBui=sum(building.zoneParam.VAir)^(1/3), redeclare - BESMod.Systems.Demand.Building.RecordsCollection.RefAachen oneZoneParam( - heaLoadFacGrd=0, heaLoadFacOut=0)), + hBui=sum(building.zoneParam.VAir)^(1/3), + redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic(redeclare Systems.Hydraulical.Control.HybridHeatPumpSystem control( @@ -20,13 +20,17 @@ package BaseClasses "Contains partial example case" parTheVal, dTHysBui=5, dTHysDHW=5, - meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature, + meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.GenerationSupplyTemperature, + redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + redeclare model DHWSetTemperature = BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW, + redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, @@ -49,6 +53,7 @@ package BaseClasses "Contains partial example case" parTra)), redeclare Systems.Demand.DHW.StandardProfiles DHW( redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo index 8713bae6..9c4ed379 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo @@ -16,12 +16,12 @@ partial model PartialHeatPumpSystemController supCtrDHWTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local "Supervisory control approach for DHW supply temperature " annotation(Dialog(group="DHW control")); - parameter Components.MeasuredValue meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature + parameter Components.BaseClasses.MeasuredValue meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.GenerationSupplyTemperature "Control measurement value for primary device" annotation (Dialog(group="Component choices")); - parameter Components.MeasuredValue meaValSecGen + parameter Components.BaseClasses.MeasuredValue meaValSecGen "Control measurement value for secondary device" - annotation (Dialog(group="Component choices")); + annotation (Dialog(group="Component choices")); replaceable model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController constrainedby @@ -118,7 +118,7 @@ partial model PartialHeatPumpSystemController extent={{-10,-10},{10,10}}, rotation=270, origin={-150,-10}))); - Components.HeatPumpBusPassThrough heaPumSigBusPasThr + Components.BaseClasses.HeatPumpBusPassThrough heaPumSigBusPasThr "Bus connector pass through for OpenModelica" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, @@ -140,7 +140,7 @@ partial model PartialHeatPumpSystemController "Control for building and DHW system" annotation (Placement(transformation(extent={{-200,20},{-120,80}}))); - Components.SetAndMeasuredValueSelector setAndMeaSelPri( + Components.BaseClasses.SetAndMeasuredValueSelector setAndMeaSelPri( final meaVal=meaValPriGen, final dTTraToDis_nominal=parTra.dTLoss_nominal[1], final dTDisToGen_nominal=parDis.dTTra_nominal[1] + parGen.dTLoss_nominal[1], @@ -148,7 +148,7 @@ partial model PartialHeatPumpSystemController final dTHysDHW=dTHysDHW) "Selection of set and measured value for primary generation device" annotation (Placement(transformation(extent={{40,60},{60,80}}))); - Components.SetAndMeasuredValueSelector setAndMeaSelSec( + Components.BaseClasses.SetAndMeasuredValueSelector setAndMeaSelSec( final meaVal=meaValSecGen, final dTTraToDis_nominal=parTra.dTLoss_nominal[1], final dTDisToGen_nominal=parDis.dTTra_nominal[1] + parGen.dTLoss_nominal[1], @@ -230,7 +230,8 @@ equation extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); connect(buiAndDHWCtr.TOda, weaBus.TDryBul) annotation (Line(points={{-204,55},{ - -244,55},{-244,2},{-237,2}}, color={0,0,127}), Text( + -244,55},{-244,2.11},{-236.895,2.11}}, + color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, diff --git a/BESMod/Systems/Hydraulical/Control/Components/ConstantAdd.mo b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/ConstantAdd.mo similarity index 96% rename from BESMod/Systems/Hydraulical/Control/Components/ConstantAdd.mo rename to BESMod/Systems/Hydraulical/Control/Components/BaseClasses/ConstantAdd.mo index 27bbca98..06bac581 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/ConstantAdd.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/ConstantAdd.mo @@ -1,4 +1,4 @@ -within BESMod.Systems.Hydraulical.Control.Components; +within BESMod.Systems.Hydraulical.Control.Components.BaseClasses; block ConstantAdd "Output the addition of a constant offset with the input signal" diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpBusPassThrough.mo b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/HeatPumpBusPassThrough.mo similarity index 98% rename from BESMod/Systems/Hydraulical/Control/Components/HeatPumpBusPassThrough.mo rename to BESMod/Systems/Hydraulical/Control/Components/BaseClasses/HeatPumpBusPassThrough.mo index d6923001..a4df5391 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatPumpBusPassThrough.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/HeatPumpBusPassThrough.mo @@ -1,4 +1,4 @@ -within BESMod.Systems.Hydraulical.Control.Components; +within BESMod.Systems.Hydraulical.Control.Components.BaseClasses; model HeatPumpBusPassThrough Interfaces.GenerationControlBus sigBusGen annotation (Placement(transformation(extent={{-110,-10},{-90,10}}))); diff --git a/BESMod/Systems/Hydraulical/Control/Components/MeasuredValue.mo b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/MeasuredValue.mo similarity index 66% rename from BESMod/Systems/Hydraulical/Control/Components/MeasuredValue.mo rename to BESMod/Systems/Hydraulical/Control/Components/BaseClasses/MeasuredValue.mo index 21d417df..6f5f6fa0 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/MeasuredValue.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/MeasuredValue.mo @@ -1,7 +1,7 @@ -within BESMod.Systems.Hydraulical.Control.Components; +within BESMod.Systems.Hydraulical.Control.Components.BaseClasses; type MeasuredValue = enumeration( GenerationSupplyTemperature "Supply temperature of generation system", DistributionTemperature "Temperature in distribution") - "Select possible measurements for control"; + "Select possible measurements for control"; diff --git a/BESMod/Systems/Hydraulical/Control/Components/ParallelValveController.mo b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/ParallelValveController.mo similarity index 94% rename from BESMod/Systems/Hydraulical/Control/Components/ParallelValveController.mo rename to BESMod/Systems/Hydraulical/Control/Components/BaseClasses/ParallelValveController.mo index dfeef1f5..cb8fd886 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/ParallelValveController.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/ParallelValveController.mo @@ -1,4 +1,4 @@ -within BESMod.Systems.Hydraulical.Control.Components; +within BESMod.Systems.Hydraulical.Control.Components.BaseClasses; model ParallelValveController "Model to switch a three way valve based on device usage" Modelica.Blocks.Interfaces.BooleanInput priGen diff --git a/BESMod/Systems/Hydraulical/Control/Components/SetAndMeasuredValueSelector.mo b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/SetAndMeasuredValueSelector.mo similarity index 83% rename from BESMod/Systems/Hydraulical/Control/Components/SetAndMeasuredValueSelector.mo rename to BESMod/Systems/Hydraulical/Control/Components/BaseClasses/SetAndMeasuredValueSelector.mo index a401be31..a566a165 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/SetAndMeasuredValueSelector.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/SetAndMeasuredValueSelector.mo @@ -1,8 +1,9 @@ -within BESMod.Systems.Hydraulical.Control.Components; +within BESMod.Systems.Hydraulical.Control.Components.BaseClasses; model SetAndMeasuredValueSelector "Model to select the measured value and add to the set value accordingly" - parameter BESMod.Systems.Hydraulical.Control.Components.MeasuredValue meaVal - "Type of measurement to use in control"; + parameter + BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue + meaVal "Type of measurement to use in control"; parameter Modelica.Units.SI.TemperatureDifference dTTraToDis_nominal "Nominal temperature difference between transfer and distribution system"; @@ -29,17 +30,16 @@ model SetAndMeasuredValueSelector Modelica.Blocks.Interfaces.RealInput TDHWSet(unit="K", displayUnit="degC") "DHW supply set temperature" annotation (Placement(transformation(extent={{-120,78},{-100,98}}))); - BESMod.Systems.Hydraulical.Control.Components.ConstantAdd constAddBuf( - final k=dTBui_nominal) - "Add temperature difference in DHW system" + BESMod.Systems.Hydraulical.Control.Components.BaseClasses.ConstantAdd + constAddBuf(final k=dTBui_nominal) "Add temperature difference in DHW system" annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); Modelica.Blocks.Logical.Switch swiDHWBuiSet "Switch between building and DHW" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-10,60}))); - BESMod.Systems.Hydraulical.Control.Components.ConstantAdd constAddDHW( - final k=dTTraDHW_nominal + dTHysDHW/2) + BESMod.Systems.Hydraulical.Control.Components.BaseClasses.ConstantAdd + constAddDHW(final k=dTTraDHW_nominal + dTHysDHW/2) "Add temperature difference in DHW system" annotation (Placement(transformation(extent={{-60,70},{-40,90}}))); Modelica.Blocks.Interfaces.RealOutput TMea(unit="K", displayUnit="degC") @@ -48,22 +48,22 @@ model SetAndMeasuredValueSelector Modelica.Blocks.Interfaces.RealOutput TSet(unit="K", displayUnit="degC") "Set temperature" annotation (Placement(transformation(extent={{100,50},{120,70}}))); - Modelica.Blocks.Logical.Switch swiDHWBuiMea - if meaVal == BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.DistributionTemperature + Modelica.Blocks.Logical.Switch swiDHWBuiMea if meaVal == BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.DistributionTemperature "Switch between building and DHW" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-10,-40}))); - Modelica.Blocks.Routing.RealPassThrough reaPasTrhGenSup if meaVal == BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature + Modelica.Blocks.Routing.RealPassThrough reaPasTrhGenSup if meaVal == BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue. + GenerationSupplyTemperature "Real pass through for conditional option" annotation (Placement(transformation(extent={{-20,-92},{0,-72}}))); protected parameter Modelica.Units.SI.TemperatureDifference dTTraDHW_nominal= - if meaVal == BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature + if meaVal ==BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.GenerationSupplyTemperature then dTDHWToGen_nominal else 0 "Helper for conditional sum in DHW dTs"; parameter Modelica.Units.SI.TemperatureDifference dTBui_nominal= - if meaVal == BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature + if meaVal ==BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.GenerationSupplyTemperature then dTTraToDis_nominal + dTDisToGen_nominal else dTTraToDis_nominal "Helper for conditional sum in building dTs"; equation diff --git a/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/package.mo b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/package.mo new file mode 100644 index 00000000..1de4008d --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/package.mo @@ -0,0 +1,4 @@ +within BESMod.Systems.Hydraulical.Control.Components; +package BaseClasses "Package with partial and util models" + extends Modelica.Icons.BasesPackage; +end BaseClasses; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/package.order new file mode 100644 index 00000000..907a0670 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/package.order @@ -0,0 +1,5 @@ +MeasuredValue +ConstantAdd +HeatPumpBusPassThrough +SetAndMeasuredValueSelector +ParallelValveController diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo index c8db0ee0..40e2f3aa 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo @@ -41,7 +41,7 @@ model BuildingAndDHWControl replaceable model SummerMode = BESMod.Systems.Hydraulical.Control.Components.SummerMode.No constrainedby - BESMod.Systems.Hydraulical.Control.Components.SummerMode.BaseClasses.PartialSummerMode + BESMod.Systems.Hydraulical.Control.Components.SummerMode.BaseClasses.PartialSummerMode "Summer mode model" annotation(choicesAllMatching=true); SummerMode sumMod "Summer mode instance" @@ -57,12 +57,17 @@ model BuildingAndDHWControl DHWSetTemperature TSetDHW "DHW set temperature module" annotation ( Placement(transformation(extent={{-78,82},{-62,98}}))); - BESMod.Systems.Hydraulical.Control.Components.HeatingCurve heaCur( + replaceable + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.HeatingCurve + heaCur constrainedby + BuildingSupplyTemperatureSetpoints.PartialSetpoint( final TSup_nominal=TSup_nominal, final TRet_nominal=TRet_nominal, final TOda_nominal=TOda_nominal, - final nHeaTra=nHeaTra) "Heating curve" - annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}))); + final nZones=nZones, + final nHeaTra=nHeaTra) + "Heating curve" annotation (Placement(transformation(extent={{-60,-100},{-40,-80}})), + choicesAllMatching=true); Modelica.Blocks.Logical.Or priGenOn "Turn on primary generation device" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -76,8 +81,6 @@ model BuildingAndDHWControl BESMod.Utilities.SupervisoryControl.SupervisoryControl supCtrDHW(ctrlType=supCtrDHWTyp) "Supervisory control of DHW" annotation (Placement(transformation(extent={{0,60},{20,80}}))); - Modelica.Blocks.Math.MinMax minMax(nu=nZones) - annotation (Placement(transformation(extent={{-80,-76},{-60,-56}}))); Modelica.Blocks.Interfaces.RealInput TOda(unit="K", displayUnit="degC") "Outdoor air temperature" annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); @@ -175,17 +178,15 @@ equation connect(hysDHW.priGenOn, priGenOn.u1) annotation (Line(points={{79.12,75.6},{79.12, 74},{108,74},{108,46},{230,46},{230,-90},{238,-90}}, color={255,0,255})); connect(TSetDHW.y, orDHW.u[1]) annotation (Line(points={{-61.2,85.36},{-54, - 85.36},{-54,50},{-48,50},{-48,34},{90,34},{90,74},{108,74},{108, - 67.6667},{120,67.6667}}, color={255,0,255})); + 85.36},{-54,50},{-48,50},{-48,34},{90,34},{90,74},{108,74},{108,67.6667}, + {120,67.6667}}, color={255,0,255})); connect(hysDHW.secGenOn, orDHW.u[2]) annotation (Line(points={{79.12,66},{90,66}, {90,50},{120,50},{120,70}}, color={255,0,255})); connect(TSetDHW.TSetDHW, supCtrDHW.uLoc) annotation (Line(points={{-61.2,90},{-10, 90},{-10,62},{-2,62}}, color={0,0,127})); connect(supCtrDHW.y, hysDHW.TSupSet) annotation (Line(points={{22,70},{22,56},{70, 56},{70,61.2}}, color={0,0,127})); - connect(minMax.yMax,heaCur.TZoneSet) - annotation (Line(points={{-59,-60},{-30,-60},{-30,-78}}, color={0,0,127})); - connect(heaCur.TOda, TOda) annotation (Line(points={{-42,-90},{-94,-90},{-94,0}, + connect(heaCur.TOda, TOda) annotation (Line(points={{-62,-90},{-90,-90},{-90,0}, {-120,0}}, color={0,0,127})); connect(TSetDHW.sigBusDistr, sigBusDistr) annotation (Line( points={{-78,89.92},{-78,90},{-86,90},{-86,70},{-100,70}}, @@ -215,8 +216,8 @@ equation color={255,0,255})); connect(secGenOn.y, secGen) annotation (Line(points={{221.5,-110},{286,-110},{ 286,-70},{310,-70}}, color={255,0,255})); - connect(hysDHW.secGenOn, secGenOn.u[1]) annotation (Line(points={{79.12,66},{ - 90,66},{90,34},{178,34},{178,-112.333},{200,-112.333}}, + connect(hysDHW.secGenOn, secGenOn.u[1]) annotation (Line(points={{79.12,66},{90, + 66},{90,34},{178,34},{178,-112.333},{200,-112.333}}, color={255,0,255})); connect(TSetDHW.y, secGenOn.u[2]) annotation (Line(points={{-61.2,85.36},{-54, 85.36},{-54,50},{-48,50},{-48,34},{178,34},{178,-110},{200,-110}}, @@ -266,10 +267,8 @@ equation horizontalAlignment=TextAlignment.Right)); connect(supCtrHeaCur.y, hysBui.TSupSet) annotation (Line(points={{22,-90},{50,-90},{50,-78.8}}, color={0,0,127})); - connect(supCtrHeaCur.uLoc, heaCur.TSet) annotation (Line(points={{-2,-98},{-14, - -98},{-14,-90},{-19,-90}}, color={0,0,127})); - connect(minMax.u, TZoneSet) annotation (Line(points={{-80,-66},{-92,-66},{-92, - -80},{-120,-80}}, color={0,0,127})); + connect(supCtrHeaCur.uLoc, heaCur.TSet) annotation (Line(points={{-2,-98},{-14,-98}, + {-14,-90},{-39,-90}}, color={0,0,127})); connect(constAntLegOff.y, swiAntLeg.u3) annotation (Line(points={{-59,30},{-50, 30},{-50,42},{-42,42}}, color={0,0,127})); connect(constAntLeg.y, swiAntLeg.u1) @@ -302,9 +301,8 @@ equation {274,80},{310,80}}, color={0,0,127})); connect(logSwiSumModPriGen.y, priGenOn.u2) annotation (Line(points={{141,-70}, {164,-70},{164,-98},{238,-98}}, color={255,0,255})); - connect(logSwiSumModSecGen.y, secGenOn.u[3]) annotation (Line(points={{141, - -110},{140,-110},{140,-126},{200,-126},{200,-107.667}}, - color={255,0,255})); + connect(logSwiSumModSecGen.y, secGenOn.u[3]) annotation (Line(points={{141,-110}, + {140,-110},{140,-126},{200,-126},{200,-107.667}}, color={255,0,255})); connect(logSwiDHW.y, DHW) annotation (Line(points={{261,20},{282,20},{282,52}, {310,52}}, color={255,0,255})); connect(logSwiSumModSecGen.u3, conSumModGen.y) annotation (Line(points={{118, @@ -331,8 +329,8 @@ equation 20},{238,20}}, color={255,0,255})); connect(logSwiDHW.y, bufOn.u) annotation (Line(points={{261,20},{266,20},{266, 66},{148,66},{148,80}}, color={255,0,255})); - connect(heaCur.TSet, sigBusHyd.TBuiLoc) annotation (Line(points={{-19,-90},{ - -20,-90},{-20,-24},{-112,-24},{-112,103},{100,103}}, color={0,0,127}), + connect(heaCur.TSet, sigBusHyd.TBuiLoc) annotation (Line(points={{-39,-90},{-20, + -90},{-20,-24},{-112,-24},{-112,103},{100,103}}, color={0,0,127}), Text( string="%second", index=1, @@ -345,12 +343,16 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(realPassThrough.u, sigBusDistr.TStoDHWTopMea) annotation (Line(points - ={{-2,130},{-100,130},{-100,70}}, color={0,0,127}), Text( + connect(realPassThrough.u, sigBusDistr.TStoDHWTopMea) annotation (Line(points= + {{-2,130},{-100,130},{-100,70}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); + connect(heaCur.TZoneMea, TZoneMea) annotation (Line(points={{-62,-82},{-86,-82}, + {-86,-40},{-120,-40}}, color={0,0,127})); + connect(heaCur.TZoneSet, TZoneSet) annotation (Line(points={{-62,-98},{-92,-98}, + {-92,-80},{-120,-80}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140}, {300,100}})), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140},{300,100}}), graphics={ diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/HeatingCurve.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/HeatingCurve.mo new file mode 100644 index 00000000..534f1339 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/HeatingCurve.mo @@ -0,0 +1,23 @@ +within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints; +model HeatingCurve + "Defines supply temperature to building in dependency of ambient temperature" + extends PartialSetpoint; + Modelica.Blocks.Math.MinMax maxTZoneSet(final nu=nZones) + annotation (Placement(transformation(extent={{-60,-80},{-40,-60}}))); +protected + parameter Modelica.Units.SI.Temperature TSupMea_nominal= + (TSup_nominal + TRet_nominal) / 2 "Nominal mean temperature"; + Real derQRel = - 1 / (maxTZoneSet.yMax - TOda_nominal); + +equation + if TOda < maxTZoneSet.yMax then + TSet = TSup_nominal + (derQRel * (TSupMea_nominal - maxTZoneSet.yMax) * 1 / nHeaTra + + (TSup_nominal - TRet_nominal) / 2 * derQRel) + * (TOda - TOda_nominal); + else + // No heating required. + TSet = maxTZoneSet.yMax; + end if; + connect(maxTZoneSet.u, TZoneSet) annotation (Line(points={{-60,-70},{-84,-70},{-84, + -80},{-120,-80}}, color={0,0,127})); +end HeatingCurve; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/PartialSetpoint.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/PartialSetpoint.mo new file mode 100644 index 00000000..6338fc7f --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/PartialSetpoint.mo @@ -0,0 +1,33 @@ +within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints; +model PartialSetpoint + parameter Integer nZones "Number of heated zones"; + parameter Modelica.Units.SI.Temperature TSup_nominal + "Nominal supply temperature"; + parameter Modelica.Units.SI.Temperature TRet_nominal + "Nominal supply temperature"; + parameter Modelica.Units.SI.Temperature TOda_nominal + "Nominal outdoor air temperature"; + parameter Real nHeaTra "Exponent of heat transfer system"; + Modelica.Blocks.Interfaces.RealOutput TSet(final unit="K", final displayUnit="degC") + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); + Modelica.Blocks.Interfaces.RealInput TOda(final unit="K", final displayUnit="degC") + annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); + Modelica.Blocks.Interfaces.RealInput TZoneMea[nZones](each final unit="K", + each final displayUnit="degC") "Zones temperatures measurements" + annotation (Placement(transformation(extent={{-140,60},{-100,100}}))); + Modelica.Blocks.Interfaces.RealInput TZoneSet[nZones](each final unit="K", + each final displayUnit="degC") "Zones set temperatures" + annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false), graphics={ + Rectangle( + extent={{-100,100},{100,-100}}, + lineColor={0,0,0}, + lineThickness=0.5, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Text( + extent={{-100,230},{100,30}}, + lineColor={0,0,0}, + textString="%name")}), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end PartialSetpoint; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo new file mode 100644 index 00000000..f0279519 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo @@ -0,0 +1,36 @@ +within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints; +model SingleZonePID + "Model which controls the setpoint based on a single zone PID" + extends PartialSetpoint; + + replaceable parameter RecordsCollection.PIDBaseDataDefinition parPID + constrainedby RecordsCollection.PIDBaseDataDefinition( + final yMax=TSup_nominal, + final yOff=293.15, + final y_start=TSup_nominal, + final yMin=293.15, + final timeDer=0, + final Nd=10) + "PID parameters for boiler" + annotation (choicesAllMatching=true, Placement(transformation(extent={{42,22}, + {58,38}}))); + Modelica.Blocks.Continuous.LimPID PI( + final controllerType=Modelica.Blocks.Types.SimpleController.PI, + final k=parPID.P, + final Ti=parPID.timeInt, + final Td=parPID.timeDer, + final yMax=parPID.yMax, + final yMin=parPID.yMin, + final wp=1, + final Ni=parPID.Ni, + final Nd=parPID.Nd) "PI control" + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); +initial equation + assert(nZones==1, "Model only supports single zones", AssertionLevel.error); +equation + connect(PI.y, TSet) annotation (Line(points={{11,0},{110,0}}, color={0,0,127})); + connect(PI.u_s, TZoneSet[1]) annotation (Line(points={{-12,0},{-30,0},{-30,-80}, + {-120,-80}}, color={0,0,127})); + connect(PI.u_m, TZoneMea[1]) annotation (Line(points={{0,-12},{0,-32},{-70,-32}, + {-70,80},{-120,80}}, color={0,0,127})); +end SingleZonePID; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.mo new file mode 100644 index 00000000..ae25de4e --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.mo @@ -0,0 +1,3 @@ +within BESMod.Systems.Hydraulical.Control.Components; +package BuildingSupplyTemperatureSetpoints "Package with models for supply temperatur setpoints for building heating" +end BuildingSupplyTemperatureSetpoints; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.order b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.order new file mode 100644 index 00000000..0bfb6382 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.order @@ -0,0 +1,3 @@ +HeatingCurve +SingleZonePID +PartialSetpoint diff --git a/BESMod/Systems/Hydraulical/Control/Components/HeatingCurve.mo b/BESMod/Systems/Hydraulical/Control/Components/HeatingCurve.mo deleted file mode 100644 index a63f4e08..00000000 --- a/BESMod/Systems/Hydraulical/Control/Components/HeatingCurve.mo +++ /dev/null @@ -1,48 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.Components; -model HeatingCurve - "Defines supply temperature to building in dependency of ambient temperature" - - parameter Modelica.Units.SI.Temperature TSup_nominal - "Nominal supply temperature"; - parameter Modelica.Units.SI.Temperature TRet_nominal - "Nominal supply temperature"; - parameter Modelica.Units.SI.Temperature TOda_nominal - "Nominal outdoor air temperature"; - parameter Real nHeaTra "Exponent of heat transfer system"; - - Modelica.Blocks.Interfaces.RealInput TOda - annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); - Modelica.Blocks.Interfaces.RealOutput TSet - annotation (Placement(transformation(extent={{100,-10},{120,10}}))); - - Modelica.Blocks.Interfaces.RealInput TZoneSet "Zone / room set temperature" - annotation (Placement( - transformation( - extent={{-20,-20},{20,20}}, - rotation=270, - origin={0,120}))); -protected - parameter Modelica.Units.SI.Temperature TSupMea_nominal= - (TSup_nominal + TRet_nominal) / 2 "Nominal mean temperature"; - Real derQRel = - 1 / (TZoneSet - TOda_nominal); - -equation - if TOda < TZoneSet then - TSet = TSup_nominal + (derQRel * (TSupMea_nominal - TZoneSet) * 1 / nHeaTra + - (TSup_nominal - TRet_nominal) / 2 * derQRel) - * (TOda - TOda_nominal); - else - // No heating required. - TSet = TZoneSet; - end if; - annotation (Icon(graphics={Rectangle( - extent={{-100,100},{100,-100}}, - lineColor={0,0,0}, - lineThickness=0.5, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Text( - extent={{-100,230},{100,30}}, - lineColor={0,0,0}, - textString="%name")})); -end HeatingCurve; diff --git a/BESMod/Systems/Hydraulical/Control/Components/package.order b/BESMod/Systems/Hydraulical/Control/Components/package.order index 4ae76739..92a6664e 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/package.order @@ -1,13 +1,9 @@ -HeatingCurve +BivalentOnOffControllers +BuildingSupplyTemperatureSetpoints DHWSetControl +SummerMode ThermostaticValveController -BivalentOnOffControllers RelativeSpeedController -HeatPumpBusPassThrough BuildingAndDHWControl -ConstantAdd BoilerInHybridSystem -SetAndMeasuredValueSelector -MeasuredValue -ParallelValveController -SummerMode +BaseClasses diff --git a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo index d409a6c7..473a25c6 100644 --- a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo @@ -9,7 +9,7 @@ model GasBoiler "PI Control of gas boiler" replaceable parameter RecordsCollection.PIDBaseDataDefinition parPID "PID parameters for boiler" annotation (choicesAllMatching=true, Placement(transformation(extent={{142,84},{162,104}}))); - BESMod.Systems.Hydraulical.Control.Components.HeatingCurve + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.HeatingCurve heatingCurve( TSup_nominal=max(parTra.TTra_nominal), TRet_nominal=max(parTra.TTra_nominal - parTra.dTTra_nominal), @@ -139,8 +139,9 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(heatingCurve.TOda, weaBus.TDryBul) annotation (Line(points={{-222,30}, - {-237,30},{-237,2}}, color={0,0,127}), Text( + connect(heatingCurve.TOda, weaBus.TDryBul) annotation (Line(points={{-222,30},{ + -236.895,30},{-236.895,2.11}}, + color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, @@ -179,7 +180,7 @@ equation extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(minMax.yMax,heatingCurve.TZoneSet) - annotation (Line(points={{-219,66},{-210,66},{-210,42}}, color={0,0,127})); + annotation (Line(points={{-219,66},{-222,66},{-222,22}}, color={0,0,127})); connect(minMax.u, useProBus.TZoneSet) annotation (Line(points={{-240,60},{-244, 60},{-244,103},{-119,103}}, color={0,0,127}), Text( string="%second", diff --git a/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo b/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo index a40249c6..cbe6e015 100644 --- a/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo +++ b/BESMod/Systems/Hydraulical/Control/HybridHeatPumpSystem.mo @@ -3,9 +3,8 @@ model HybridHeatPumpSystem "Hybrid HPS with PID controlled boiler" extends BESMod.Systems.Hydraulical.Control.BaseClasses.PartialHeatPumpSystemController( - final meaValSecGen= - if boiInGeneration then BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature - else BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.DistributionTemperature); + final meaValSecGen=if boiInGeneration then BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.GenerationSupplyTemperature + else BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.DistributionTemperature); parameter Modelica.Units.SI.Temperature TBiv "Bivalence temperature"; parameter Modelica.Units.SI.Temperature TCutOff "Cutoff temperature"; parameter Boolean boiInGeneration @@ -37,7 +36,8 @@ model HybridHeatPumpSystem TCutOff) "Check whether the boiler can turn on" annotation (Placement(transformation(extent={{-30,-20},{-12,0}}))); - BESMod.Systems.Hydraulical.Control.Components.ParallelValveController priOrSecDevValCtrl + BESMod.Systems.Hydraulical.Control.Components.BaseClasses.ParallelValveController + priOrSecDevValCtrl "Control the valve to switch between primary and secondary device" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, diff --git a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo index 04f6769c..14aebe4a 100644 --- a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo +++ b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo @@ -1,7 +1,8 @@ within BESMod.Systems.Hydraulical.Control; model MonoenergeticHeatPumpSystem "Monoenergetic HPS with on/off heating rod" - extends BaseClasses.PartialHeatPumpSystemController(final meaValSecGen=BESMod.Systems.Hydraulical.Control.Components.MeasuredValue.GenerationSupplyTemperature); + extends BaseClasses.PartialHeatPumpSystemController(final meaValSecGen=BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue + .GenerationSupplyTemperature); Modelica.Blocks.Sources.Constant constZero(final k=0) annotation (Placement( transformation( diff --git a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo index 8045bc89..cb6fe9d7 100644 --- a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo +++ b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo @@ -28,11 +28,12 @@ partial model PartialGetHeatGenerationCurve extent={{-10,-10},{10,10}}, rotation=180, origin={82,10}))); - Systems.Hydraulical.Control.Components.HeatingCurve heatingCurve( + Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.HeatingCurve + heatingCurve( TSup_nominal=systemParameters.THydSup_nominal[1], TRet_nominal=systemParameters.THydSup_nominal[1] - 7, TOda_nominal=systemParameters.TOda_nominal, - nHeaTra=1.3) annotation (Placement(transformation( + nHeaTra=1.3) annotation (Placement(transformation( extent={{-11,11},{11,-11}}, rotation=0, origin={-9,-71}))); From bca643a1703eb0ed46d8abf17baf50a26c539a47 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 5 Jan 2024 16:29:57 +0100 Subject: [PATCH 111/131] fix nu --- .../Generation/BaseClasses/PartialHeatPump.mo | 9 +++------ .../Hydraulical/Generation/HeatPumpAndHeatingRod.mo | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo index 503d312e..f4cf991a 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo @@ -194,7 +194,7 @@ model PartialHeatPump "Generation with only the heat pump" extent={{-10,-10},{10,10}}, rotation=180, origin={100,-78}))); - Modelica.Blocks.Math.MultiSum multiSum(nu=2) annotation (Placement( + Modelica.Blocks.Math.MultiSum multiSum(nu=1) annotation (Placement( transformation( extent={{-6,-6},{6,6}}, rotation=180, @@ -249,11 +249,8 @@ equation thickness=1)); connect(multiSum.y, realToElecCon.PEleLoa) annotation (Line(points={{122.98,-82},{112,-82}}, color={0,0,127})); - connect(multiSum.u[2], pump.P) annotation (Line(points={{136,-83.05},{144, - -83.05},{144,-114},{-14,-114},{-14,-58},{0,-58},{0,-61},{-1,-61}}, - color={0,0,127})); - connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136, - -80.95},{144,-80.95},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, + connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136,-82}, + {144,-82},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, color={0,0,127}), Text( string="%second", diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index 8ffce976..6977b10e 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -2,7 +2,7 @@ within BESMod.Systems.Hydraulical.Generation; model HeatPumpAndHeatingRod "Heat pump with heating rod in series" extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialHeatPump( dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal}, - multiSum(nu=if use_heaRod then 3 else 2)); + multiSum(nu=if use_heaRod then 2 else 1)); parameter Boolean use_heaRod=true "=false to disable the heating rod" annotation(Dialog(group="Component choices")); @@ -69,7 +69,7 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(multiSum.u[3], hea.Pel) annotation (Line(points={{136,-82},{140,-82},{ + connect(multiSum.u[2], hea.Pel) annotation (Line(points={{136,-82},{140,-82},{ 140,56},{41,56}}, color={0,0,127})); connect(KPIQHeaRod_flow.KPI, outBusGen.QHeaRod_flow) annotation (Line(points={{ -117.8,-130},{0,-130},{0,-100}}, color={135,135,135}), Text( From 719b9a8bedcb020291d464c930b258c59ebab661 Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Mon, 8 Jan 2024 08:42:07 +0100 Subject: [PATCH 112/131] Add automatic pipe diameter estimation for storages --- .../BaseClasses/PartialTwoStorageParallel.mo | 8 ++------ .../DistributionTwoStorageParallel.mo | 6 ++---- .../BufferStorageBaseDataDefinition.mo | 16 ++++++++-------- .../BufferStorage/DefaultDetailedStorage.mo | 4 +--- .../BufferStorage/bufferData.mo | 1 - .../PartialStorageBaseDataDefinition.mo | 19 +++++++++---------- .../Generation/BaseClasses/PartialHeatPump.mo | 8 +++++--- .../Generation/HeatPumpAndHeatingRod.mo | 4 ++-- .../CopperPipeVariableSize.mo | 16 ++++++++++++++++ .../RecordsCollection/package.order | 1 + 10 files changed, 46 insertions(+), 37 deletions(-) create mode 100644 BESMod/Systems/Hydraulical/RecordsCollection/CopperPipeVariableSize.mo diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo index 86047125..3c99b6dd 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo @@ -48,15 +48,13 @@ partial model PartialTwoStorageParallel "Partial model to later extent" T_m=TSup_nominal[1], final QHC1_flow_nominal=Q_flow_nominal[1]*f_design[1], final mHC1_flow_nominal=mSup_flow_nominal[1], - redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, final use_HC2=stoBuf.useHeatingCoil2, final use_HC1=stoBuf.useHeatingCoil1, final dTLoadingHC2=9999999, final fHeiHC2=1, final fDiaHC2=1, final QHC2_flow_nominal=9999999, - final mHC2_flow_nominal=9999999, - redeclare final AixLib.DataBase.Pipes.Copper.Copper_10x0_6 pipeHC2) + final mHC2_flow_nominal=9999999) "Parameters for buffer storage" annotation ( Dialog(group="Component data"), choicesAllMatching=true, @@ -76,15 +74,13 @@ partial model PartialTwoStorageParallel "Partial model to later extent" T_m=TDHW_nominal, final QHC1_flow_nominal=QDHW_flow_nominal, final mHC1_flow_nominal=mSup_flow_nominal[1], - redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1, final use_HC2=stoDHW.useHeatingCoil2, final use_HC1=stoDHW.useHeatingCoil1, final dTLoadingHC2=dTLoadingHC2, fHeiHC2=1, fDiaHC2=1, final QHC2_flow_nominal=QHC2_flow_nominal, - final mHC2_flow_nominal=mHC2_flow_nominal, - redeclare final AixLib.DataBase.Pipes.Copper.Copper_10x0_6 pipeHC2) + final mHC2_flow_nominal=mHC2_flow_nominal) "Parameters for DHW storage" annotation ( Dialog(group="Component data"), choicesAllMatching=true, diff --git a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo index 2e58cc08..0000cab8 100644 --- a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo @@ -112,8 +112,7 @@ model DistributionTwoStorageParallel final TAmb=TAmb, final T_m=TDem_nominal[1], final QHC1_flow_nominal=Q_flow_nominal[1], - final mHC1_flow_nominal=mSup_flow_nominal[1], - redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1) annotation ( + final mHC1_flow_nominal=mSup_flow_nominal[1]) annotation ( choicesAllMatching=true, Placement(transformation(extent={{84,56},{98,70}}))); replaceable parameter BESMod.Systems.Hydraulical.Distribution.RecordsCollection.SimpleStorage.SimpleStorageBaseDataDefinition @@ -127,8 +126,7 @@ model DistributionTwoStorageParallel final Q_flow_nominal=0, final VPerQ_flow=0, final T_m=TDHW_nominal, - final mHC1_flow_nominal=mSup_flow_nominal[1], - redeclare final AixLib.DataBase.Pipes.Copper.Copper_12x1 pipeHC1) annotation ( + final mHC1_flow_nominal=mSup_flow_nominal[1]) annotation ( choicesAllMatching=true, Placement(transformation(extent={{82,-58},{98,-42}}))); Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTemDHW(final T= parStoDHW.TAmb) "Constant ambient temperature of storage" diff --git a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/BufferStorageBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/BufferStorageBaseDataDefinition.mo index 00e92484..913babba 100644 --- a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/BufferStorageBaseDataDefinition.mo +++ b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/BufferStorageBaseDataDefinition.mo @@ -28,8 +28,13 @@ record BufferStorageBaseDataDefinition parameter Modelica.Units.SI.MassFlowRate mHC2_flow_nominal "Nominal mass flow rate of HC fluid" annotation (Dialog(group="Loading", enable=use_HC2)); - replaceable parameter AixLib.DataBase.Pipes.Copper.Copper_12x0_6 pipeHC2 constrainedby - AixLib.DataBase.Pipes.PipeBaseDataDefinition "Type of Pipe for HC2" annotation (choicesAllMatching=true, Dialog(group="Loading", enable=use_HC2)); + final parameter Modelica.Units.SI.Velocity vHC2_nominal=mHC2_flow_nominal/( + rho*Modelica.Constants.pi*(pipeHC2.d_i/2)^2) + "Fluid velocity in pipe of HC 1 at nominal conditions"; + replaceable parameter BESMod.Systems.Hydraulical.RecordsCollection.CopperPipeVariableSize + pipeHC2(d_i=2 * sqrt(mHC2_flow_nominal/(v_nominal * rho * Modelica.Constants.pi))) + constrainedby AixLib.DataBase.Pipes.PipeBaseDataDefinition "Type of Pipe for HC2" + annotation (choicesAllMatching=true, Dialog(group="Loading", tab="Calculated", enable=use_HC2)); parameter Modelica.Units.SI.CoefficientOfHeatTransfer hConHC2=(2/pipeHC2.d_i + 2/pipeHC2.d_o)/(((max(dTLoadingHC2, dTLoaMin)*2*Modelica.Constants.pi* lengthHC2)/QHC2_flow_nominal) - (1/pipeHC2.lambda*log(pipeHC2.d_o/pipeHC2.d_i))) @@ -38,11 +43,6 @@ record BufferStorageBaseDataDefinition tab="Calculated", group="Loading", enable=use_HC2)); - parameter Modelica.Units.SI.Velocity vHC2_nominal=mHC2_flow_nominal/(rho*( - pipeHC2.d_i*Modelica.Constants.pi/2)^2) - "Fluid velocity in pipe of HC 1 at nominal conditions" annotation (Dialog( - tab="Calculated", - group="Loading", - enable=use_HC2)); + end BufferStorageBaseDataDefinition; diff --git a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/DefaultDetailedStorage.mo b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/DefaultDetailedStorage.mo index bed2c4a0..6eca36c1 100644 --- a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/DefaultDetailedStorage.mo +++ b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/DefaultDetailedStorage.mo @@ -2,7 +2,5 @@ within BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage; record DefaultDetailedStorage extends BufferStorageBaseDataDefinition( energyLabel=BESMod.Systems.Hydraulical.Distribution.Types.EnergyLabel.B, - dTLoadingHC1=5, - redeclare AixLib.DataBase.Pipes.Copper.Copper_28x0_9 pipeHC2, - redeclare AixLib.DataBase.Pipes.Copper.Copper_28x0_9 pipeHC1); + dTLoadingHC1=5); end DefaultDetailedStorage; diff --git a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/bufferData.mo b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/bufferData.mo index 5d6d879f..34e1f901 100644 --- a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/bufferData.mo +++ b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/bufferData.mo @@ -1,7 +1,6 @@ within BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage; record bufferData "Simpler design for this repo" extends AixLib.DataBase.Storage.BufferStorageBaseDataDefinition( - pipeHC1=AixLib.DataBase.Pipes.Copper.Copper_22x1(), roughness=2.5e-5, lengthHC1=floor((hHC1Up - hHC1Low)/(dTank*0.8*tan(0.17453292519943)))*cos(0.17453292519943)*dTank*0.8, cWall=cIns, diff --git a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/PartialStorageBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/PartialStorageBaseDataDefinition.mo index 33a1bace..c7eca5f0 100644 --- a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/PartialStorageBaseDataDefinition.mo +++ b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/PartialStorageBaseDataDefinition.mo @@ -8,8 +8,8 @@ partial record PartialStorageBaseDataDefinition "Heat capacity of water"; parameter Modelica.Units.SI.HeatFlowRate Q_flow_nominal "Nominal heat flow rate"; - - + parameter Modelica.Units.SI.Velocity v_nominal=0.5 + "Nominal fluid velocity to calculate pipe diameters for given m_flow_nominal"; // Design parameter Real VPerQ_flow=23.5 "Litre per kW of nominal heat flow rate" annotation (Dialog(group="Geometry")); parameter Real storage_H_dia_ratio = 2 "Storage tank height-diameter ration. SOURCE: Working Assumption of all paper before" annotation (Dialog(group="Geometry")); @@ -44,8 +44,12 @@ partial record PartialStorageBaseDataDefinition parameter Modelica.Units.SI.MassFlowRate mHC1_flow_nominal "Nominal mass flow rate of HC fluid" annotation (Dialog(group="Loading", enable=use_HC1)); - replaceable parameter AixLib.DataBase.Pipes.Copper.Copper_12x0_6 pipeHC1 constrainedby - AixLib.DataBase.Pipes.PipeBaseDataDefinition "Type of Pipe for HC1" annotation (choicesAllMatching=true, Dialog(group="Loading", enable=use_HC1)); + final parameter Modelica.Units.SI.Velocity vHC1_nominal=mHC1_flow_nominal/(rho*Modelica.Constants.pi*(pipeHC1.d_i/2)^2) + "Fluid velocity in pipe of HC 1 at nominal conditions"; + replaceable parameter BESMod.Systems.Hydraulical.RecordsCollection.CopperPipeVariableSize + pipeHC1(final d_i=2 * sqrt(mHC1_flow_nominal/(v_nominal * rho * Modelica.Constants.pi))) constrainedby + AixLib.DataBase.Pipes.PipeBaseDataDefinition "Type of Pipe for HC1" + annotation (choicesAllMatching=true, Dialog(group="Loading", tab="Calculated", enable=use_HC1)); parameter Modelica.Units.SI.CoefficientOfHeatTransfer hConHC1=(2/pipeHC1.d_o) /(((max(dTLoadingHC1, dTLoaMin)*2*Modelica.Constants.pi*lengthHC1)/ QHC1_flow_nominal) - (1/pipeHC1.lambda*log(pipeHC1.d_o/pipeHC1.d_i))) @@ -54,12 +58,7 @@ partial record PartialStorageBaseDataDefinition tab="Calculated", group="Loading", enable=use_HC1)); - parameter Modelica.Units.SI.Velocity vHC1_nominal=mHC1_flow_nominal/(rho*( - pipeHC1.d_i*Modelica.Constants.pi/2)^2) - "Fluid velocity in pipe of HC 1 at nominal conditions" annotation (Dialog( - tab="Calculated", - group="Loading", - enable=use_HC1)); + // Heat losses diff --git a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo index f4cf991a..83456436 100644 --- a/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/BaseClasses/PartialHeatPump.mo @@ -194,7 +194,7 @@ model PartialHeatPump "Generation with only the heat pump" extent={{-10,-10},{10,10}}, rotation=180, origin={100,-78}))); - Modelica.Blocks.Math.MultiSum multiSum(nu=1) annotation (Placement( + Modelica.Blocks.Math.MultiSum multiSum(nu=2) annotation (Placement( transformation( extent={{-6,-6},{6,6}}, rotation=180, @@ -249,8 +249,8 @@ equation thickness=1)); connect(multiSum.y, realToElecCon.PEleLoa) annotation (Line(points={{122.98,-82},{112,-82}}, color={0,0,127})); - connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136,-82}, - {144,-82},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, + connect(multiSum.u[1], reaExpPEleHeaPum.y) annotation (Line(points={{136,-80.95}, + {144,-80.95},{144,-150},{-154,-150},{-154,-70},{-159,-70}}, color={0,0,127}), Text( string="%second", @@ -355,6 +355,8 @@ equation horizontalAlignment=TextAlignment.Right)); connect(reaExpQEva_flow.y, frost.QEva_flow) annotation (Line(points={{-199,6},{-190, 6},{-190,5.68},{-179.6,5.68}}, color={0,0,127})); + connect(pump.P, multiSum.u[2]) annotation (Line(points={{-1,-61},{-10,-61},{-10, + -116},{148,-116},{148,-83.05},{136,-83.05}}, color={0,0,127})); annotation (Line( points={{-52.775,-6.78},{-52.775,33.61},{-56,33.61},{-56,74}}, color={255,204,51}, diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo index 6977b10e..f619ec28 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo @@ -2,7 +2,7 @@ within BESMod.Systems.Hydraulical.Generation; model HeatPumpAndHeatingRod "Heat pump with heating rod in series" extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialHeatPump( dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal}, - multiSum(nu=if use_heaRod then 2 else 1)); + multiSum(nu=if use_heaRod then 3 else 2)); parameter Boolean use_heaRod=true "=false to disable the heating rod" annotation(Dialog(group="Component choices")); @@ -69,7 +69,7 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(multiSum.u[2], hea.Pel) annotation (Line(points={{136,-82},{140,-82},{ + connect(multiSum.u[3], hea.Pel) annotation (Line(points={{136,-82},{140,-82},{ 140,56},{41,56}}, color={0,0,127})); connect(KPIQHeaRod_flow.KPI, outBusGen.QHeaRod_flow) annotation (Line(points={{ -117.8,-130},{0,-130},{0,-100}}, color={135,135,135}), Text( diff --git a/BESMod/Systems/Hydraulical/RecordsCollection/CopperPipeVariableSize.mo b/BESMod/Systems/Hydraulical/RecordsCollection/CopperPipeVariableSize.mo new file mode 100644 index 00000000..c5cf2775 --- /dev/null +++ b/BESMod/Systems/Hydraulical/RecordsCollection/CopperPipeVariableSize.mo @@ -0,0 +1,16 @@ +within BESMod.Systems.Hydraulical.RecordsCollection; +record CopperPipeVariableSize + "Record for a copper pipe with a variable size" + extends AixLib.DataBase.Pipes.PipeBaseDataDefinition( + d_o=d_i + 2*1e-3, + d=8900, + lambda=393, + c=390); + annotation (Documentation(info=" +

+ The parameter d_i is calculated automatically based on mass + flow rate and a given flow velocity. The pipe assume a + default pipe thickness of 1 mm. +

+")); +end CopperPipeVariableSize; diff --git a/BESMod/Systems/Hydraulical/RecordsCollection/package.order b/BESMod/Systems/Hydraulical/RecordsCollection/package.order index 6086ca14..060ce782 100644 --- a/BESMod/Systems/Hydraulical/RecordsCollection/package.order +++ b/BESMod/Systems/Hydraulical/RecordsCollection/package.order @@ -1,2 +1,3 @@ HydraulicSystemBaseDataDefinition DHWDesignParameters +CopperPipeVariableSize From 34d45a80833151400102d93dbeb55f9a1995b9cb Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Mon, 8 Jan 2024 15:45:02 +0100 Subject: [PATCH 113/131] Make HeatingCurve.mo replacable and rename it --- .../PartialHeatPumpSystemController.mo | 45 +++++++----- .../Components/BuildingAndDHWControl.mo | 71 ++++++++++--------- .../HeatingCurve.mo | 2 +- .../SingleZonePID.mo | 2 +- .../Control/MonoenergeticHeatPumpSystem.mo | 4 +- install_dependencies.py | 2 +- 6 files changed, 70 insertions(+), 56 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo index 9c4ed379..91260a05 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo @@ -22,32 +22,43 @@ partial model PartialHeatPumpSystemController parameter Components.BaseClasses.MeasuredValue meaValSecGen "Control measurement value for secondary device" annotation (Dialog(group="Component choices")); - replaceable model DHWHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController - constrainedby - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController( - final dTHys=dTHysDHW) - "Hysteresis for DHW system" annotation (Dialog(group="Component choices"), - choicesAllMatching=true); + replaceable model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController constrainedby BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController( final dTHys=dTHysBui) - "Hysteresis for building" annotation (Dialog(group="Component choices"), + "Hysteresis for building" annotation (Dialog(group="Building control"), choicesAllMatching=true); + replaceable model BuildingSupplySetTemperature = + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.HeatingCurve + constrainedby BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.PartialSetpoint( + final TSup_nominal=buiAndDHWCtr.TSup_nominal, + final TRet_nominal=buiAndDHWCtr.TRet_nominal, + final TOda_nominal=buiAndDHWCtr.TOda_nominal, + final nZones=buiAndDHWCtr.nZones, + final nHeaTra=buiAndDHWCtr.nHeaTra) + "Supply temperature setpoint model, e.g. heating curve" + annotation (choicesAllMatching=true, Dialog(group="Building control")); replaceable model DHWSetTemperature = BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW constrainedby BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control( final TSetDHW_nominal=parDis.TDHW_nominal) - "DHW set temperture module" annotation (Dialog(group="Component choices"), + "DHW set temperture module" annotation (Dialog(group="DHW control"), choicesAllMatching=true); + replaceable model DHWHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController + constrainedby + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController( + final dTHys=dTHysDHW) + "Hysteresis for DHW system" annotation (Dialog(group="DHW control"), + choicesAllMatching=true); replaceable model SummerMode = BESMod.Systems.Hydraulical.Control.Components.SummerMode.No constrainedby BESMod.Systems.Hydraulical.Control.Components.SummerMode.BaseClasses.PartialSummerMode - "Summer mode model" annotation(Dialog(group="Component choices"), choicesAllMatching=true); + "Summer mode model" annotation(Dialog(group="Building control"), choicesAllMatching=true); replaceable parameter BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition parPIDHeaPum constrainedby BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition @@ -159,16 +170,18 @@ partial model PartialHeatPumpSystemController equation - connect(safCtr.modeSet, heaPumHea.y) annotation (Line(points={{198.667,68},{186, - 68},{186,90},{181,90}}, color={255,0,255})); - connect(safCtr.nOut, sigBusGen.yHeaPumSet) annotation (Line(points={{220.833,72}, - {254,72},{254,-118},{-152,-118},{-152,-99}}, color={0,0,127}), Text( + connect(safCtr.modeSet, heaPumHea.y) annotation (Line(points={{198.667,68},{ + 186,68},{186,90},{181,90}}, + color={255,0,255})); + connect(safCtr.nOut, sigBusGen.yHeaPumSet) annotation (Line(points={{220.833, + 72},{254,72},{254,-118},{-152,-118},{-152,-99}}, + color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(priGenPIDCtrl.ySet, safCtr.nSet) annotation (Line(points={{118.8,90},{ - 154,90},{154,76},{190,76},{190,72},{198.667,72}}, + connect(priGenPIDCtrl.ySet, safCtr.nSet) annotation (Line(points={{118.8,90}, + {154,90},{154,76},{190,76},{190,72},{198.667,72}}, color={0,0,127})); connect(priGenPIDCtrl.isOn, sigBusGen.heaPumIsOn) annotation (Line(points={{105.2, diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo index 40e2f3aa..e36e290f 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo @@ -19,25 +19,33 @@ model BuildingAndDHWControl supCtrDHWTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local "Supervisory control approach for DHW supply temperature "; - - replaceable model DHWHysteresis = + replaceable model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod (dTHys=10) constrainedby BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController - "Hysteresis for DHW system" annotation (choicesAllMatching=true); - replaceable model BuildingHysteresis = + "Hysteresis for building" annotation (choicesAllMatching=true); + replaceable model BuildingSupplySetTemperature = + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.HeatingCurve + constrainedby BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.PartialSetpoint( + final TSup_nominal=TSup_nominal, + final TRet_nominal=TRet_nominal, + final TOda_nominal=TOda_nominal, + final nZones=nZones, + final nHeaTra=nHeaTra) + "Supply temperature setpoint model, e.g. heating curve" annotation ( + choicesAllMatching=true); + replaceable model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod (dTHys=10) constrainedby BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController - "Hysteresis for building" annotation (choicesAllMatching=true); + "Hysteresis for DHW system" annotation (choicesAllMatching=true); replaceable model DHWSetTemperature = BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW constrainedby BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.BaseClasses.PartialTSet_DHW_Control "DHW set temperture module" annotation (choicesAllMatching=true); - replaceable model SummerMode = BESMod.Systems.Hydraulical.Control.Components.SummerMode.No constrainedby @@ -47,27 +55,19 @@ model BuildingAndDHWControl SummerMode sumMod "Summer mode instance" annotation (Placement(transformation(extent={{42,-18},{62,2}}))); - - DHWHysteresis hysDHW - "Hysteresis for DHW system" annotation (Placement( - transformation(extent={{62,62},{78,78}}))); BuildingHysteresis hysBui "Hysteresis for building" annotation (Placement( transformation(extent={{42,-78},{58,-62}}))); + BuildingSupplySetTemperature TSetBuiSup + "Building supply set temperature module" annotation ( + Placement(transformation(extent={{-60,-100},{-40,-80}}))); + DHWHysteresis hysDHW + "Hysteresis for DHW system" annotation (Placement( + transformation(extent={{62,62},{78,78}}))); DHWSetTemperature TSetDHW "DHW set temperature module" annotation ( Placement(transformation(extent={{-78,82},{-62,98}}))); - replaceable - BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.HeatingCurve - heaCur constrainedby - BuildingSupplyTemperatureSetpoints.PartialSetpoint( - final TSup_nominal=TSup_nominal, - final TRet_nominal=TRet_nominal, - final TOda_nominal=TOda_nominal, - final nZones=nZones, - final nHeaTra=nHeaTra) - "Heating curve" annotation (Placement(transformation(extent={{-60,-100},{-40,-80}})), - choicesAllMatching=true); + Modelica.Blocks.Logical.Or priGenOn "Turn on primary generation device" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, @@ -178,16 +178,16 @@ equation connect(hysDHW.priGenOn, priGenOn.u1) annotation (Line(points={{79.12,75.6},{79.12, 74},{108,74},{108,46},{230,46},{230,-90},{238,-90}}, color={255,0,255})); connect(TSetDHW.y, orDHW.u[1]) annotation (Line(points={{-61.2,85.36},{-54, - 85.36},{-54,50},{-48,50},{-48,34},{90,34},{90,74},{108,74},{108,67.6667}, - {120,67.6667}}, color={255,0,255})); + 85.36},{-54,50},{-48,50},{-48,34},{90,34},{90,74},{108,74},{108, + 67.6667},{120,67.6667}}, color={255,0,255})); connect(hysDHW.secGenOn, orDHW.u[2]) annotation (Line(points={{79.12,66},{90,66}, {90,50},{120,50},{120,70}}, color={255,0,255})); connect(TSetDHW.TSetDHW, supCtrDHW.uLoc) annotation (Line(points={{-61.2,90},{-10, 90},{-10,62},{-2,62}}, color={0,0,127})); connect(supCtrDHW.y, hysDHW.TSupSet) annotation (Line(points={{22,70},{22,56},{70, 56},{70,61.2}}, color={0,0,127})); - connect(heaCur.TOda, TOda) annotation (Line(points={{-62,-90},{-90,-90},{-90,0}, - {-120,0}}, color={0,0,127})); + connect(TSetBuiSup.TOda, TOda) annotation (Line(points={{-62,-90},{-90,-90},{-90, + 0},{-120,0}}, color={0,0,127})); connect(TSetDHW.sigBusDistr, sigBusDistr) annotation (Line( points={{-78,89.92},{-78,90},{-86,90},{-86,70},{-100,70}}, color={255,204,51}, @@ -216,8 +216,8 @@ equation color={255,0,255})); connect(secGenOn.y, secGen) annotation (Line(points={{221.5,-110},{286,-110},{ 286,-70},{310,-70}}, color={255,0,255})); - connect(hysDHW.secGenOn, secGenOn.u[1]) annotation (Line(points={{79.12,66},{90, - 66},{90,34},{178,34},{178,-112.333},{200,-112.333}}, + connect(hysDHW.secGenOn, secGenOn.u[1]) annotation (Line(points={{79.12,66},{ + 90,66},{90,34},{178,34},{178,-112.333},{200,-112.333}}, color={255,0,255})); connect(TSetDHW.y, secGenOn.u[2]) annotation (Line(points={{-61.2,85.36},{-54, 85.36},{-54,50},{-48,50},{-48,34},{178,34},{178,-110},{200,-110}}, @@ -267,8 +267,8 @@ equation horizontalAlignment=TextAlignment.Right)); connect(supCtrHeaCur.y, hysBui.TSupSet) annotation (Line(points={{22,-90},{50,-90},{50,-78.8}}, color={0,0,127})); - connect(supCtrHeaCur.uLoc, heaCur.TSet) annotation (Line(points={{-2,-98},{-14,-98}, - {-14,-90},{-39,-90}}, color={0,0,127})); + connect(supCtrHeaCur.uLoc, TSetBuiSup.TSet) annotation (Line(points={{-2,-98},{-14, + -98},{-14,-90},{-39,-90}}, color={0,0,127})); connect(constAntLegOff.y, swiAntLeg.u3) annotation (Line(points={{-59,30},{-50, 30},{-50,42},{-42,42}}, color={0,0,127})); connect(constAntLeg.y, swiAntLeg.u1) @@ -301,8 +301,9 @@ equation {274,80},{310,80}}, color={0,0,127})); connect(logSwiSumModPriGen.y, priGenOn.u2) annotation (Line(points={{141,-70}, {164,-70},{164,-98},{238,-98}}, color={255,0,255})); - connect(logSwiSumModSecGen.y, secGenOn.u[3]) annotation (Line(points={{141,-110}, - {140,-110},{140,-126},{200,-126},{200,-107.667}}, color={255,0,255})); + connect(logSwiSumModSecGen.y, secGenOn.u[3]) annotation (Line(points={{141, + -110},{140,-110},{140,-126},{200,-126},{200,-107.667}}, + color={255,0,255})); connect(logSwiDHW.y, DHW) annotation (Line(points={{261,20},{282,20},{282,52}, {310,52}}, color={255,0,255})); connect(logSwiSumModSecGen.u3, conSumModGen.y) annotation (Line(points={{118, @@ -329,8 +330,8 @@ equation 20},{238,20}}, color={255,0,255})); connect(logSwiDHW.y, bufOn.u) annotation (Line(points={{261,20},{266,20},{266, 66},{148,66},{148,80}}, color={255,0,255})); - connect(heaCur.TSet, sigBusHyd.TBuiLoc) annotation (Line(points={{-39,-90},{-20, - -90},{-20,-24},{-112,-24},{-112,103},{100,103}}, color={0,0,127}), + connect(TSetBuiSup.TSet, sigBusHyd.TBuiLoc) annotation (Line(points={{-39,-90},{-20, + -90},{-20,-24},{-112,-24},{-112,103},{100,103}}, color={0,0,127}), Text( string="%second", index=1, @@ -349,9 +350,9 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(heaCur.TZoneMea, TZoneMea) annotation (Line(points={{-62,-82},{-86,-82}, + connect(TSetBuiSup.TZoneMea, TZoneMea) annotation (Line(points={{-62,-82},{-86,-82}, {-86,-40},{-120,-40}}, color={0,0,127})); - connect(heaCur.TZoneSet, TZoneSet) annotation (Line(points={{-62,-98},{-92,-98}, + connect(TSetBuiSup.TZoneSet, TZoneSet) annotation (Line(points={{-62,-98},{-92,-98}, {-92,-80},{-120,-80}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140}, {300,100}})), Diagram(coordinateSystem(preserveAspectRatio=false, diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/HeatingCurve.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/HeatingCurve.mo index 534f1339..fbe9edf3 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/HeatingCurve.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/HeatingCurve.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints; model HeatingCurve - "Defines supply temperature to building in dependency of ambient temperature" + "Ideal heating curve" extends PartialSetpoint; Modelica.Blocks.Math.MinMax maxTZoneSet(final nu=nZones) annotation (Placement(transformation(extent={{-60,-80},{-40,-60}}))); diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo index f0279519..2856edb3 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints; model SingleZonePID - "Model which controls the setpoint based on a single zone PID" + "Single zone PID controller" extends PartialSetpoint; replaceable parameter RecordsCollection.PIDBaseDataDefinition parPID diff --git a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo index 14aebe4a..a32f72d8 100644 --- a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo +++ b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo @@ -1,8 +1,8 @@ within BESMod.Systems.Hydraulical.Control; model MonoenergeticHeatPumpSystem "Monoenergetic HPS with on/off heating rod" - extends BaseClasses.PartialHeatPumpSystemController(final meaValSecGen=BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue - .GenerationSupplyTemperature); + extends BaseClasses.PartialHeatPumpSystemController( + final meaValSecGen=BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.GenerationSupplyTemperature); Modelica.Blocks.Sources.Constant constZero(final k=0) annotation (Placement( transformation( diff --git a/install_dependencies.py b/install_dependencies.py index 27276691..93e58b42 100644 --- a/install_dependencies.py +++ b/install_dependencies.py @@ -87,7 +87,7 @@ def install_dependencies( with open(besmod_directory.joinpath("startup.mos"), "w+") as file: file.write(open_libs_mos) file.write("\n// Change working directory\n") - file.write(f'cd("{str(working_directory)}")') + file.write(f'cd("{str(working_directory)}");') if __name__ == '__main__': From 3c837556c2e4c30cdde313ad108fee7e37beab4c Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Tue, 9 Jan 2024 07:48:06 +0100 Subject: [PATCH 114/131] rename heating rod to electric heater and adjust package orders based on move_class script --- .../BAUSimStudy/Buildings/package.order | 4 +- BESMod/Examples/BAUSimStudy/PartialCase.mo | 14 ++-- BESMod/Examples/DesignOptimization/BES.mo | 8 +- .../Examples/DesignOptimization/package.order | 2 +- .../Examples/HeatPumpAndBoiler/BaseClasses.mo | 4 +- .../Examples/HeatPumpAndBoiler/package.order | 8 +- BESMod/Examples/HighOrderModel/BES_HOM.mo | 10 +-- .../PartialModelicaConferenceUseCase.mo | 10 +-- .../ModelicaConferencePaper/package.order | 4 +- .../PartialSolarThermalHPS.mo | 4 +- .../SolarThermalSystem/SolarThermalAixLib.mo | 6 +- .../SolarThermalBuildings.mo | 6 +- .../Examples/SolarThermalSystem/package.order | 4 +- BESMod/Examples/package.order | 2 +- .../ConvertBESMod_from_0.2.2_to_0.3.0.mos | 21 ----- .../ConvertBESMod_from_0.3.1_to_0.3.2.mos | 42 ---------- .../BuildingsLibraryRoom.mos | 2 +- .../TEASERBuilding.mos | 2 +- BESMod/Systems/BaseClasses/package.order | 2 +- .../Demand/Building/BaseClasses/package.order | 2 +- .../Components/BaseClasses/package.order | 2 +- .../Demand/Building/Components/package.order | 2 +- .../Demand/Building/HeatDemand/package.order | 2 +- .../DHW/RecordsCollection/package.order | 4 +- .../Demand/DHW/TappingProfiles/package.order | 2 +- .../Electrical/Generation/Tests/package.order | 2 +- .../Interfaces/BaseClasses/package.order | 2 +- .../Electrical/Interfaces/package.order | 14 ++-- ...o => ElectricHeaterWithSecurityControl.mo} | 4 +- .../Components/Frosting/package.order | 2 +- .../Hydraulical/Components/package.order | 4 +- .../Control/BaseClasses/package.order | 2 +- .../Components/BaseClasses/package.order | 4 +- .../Examples/OnOffControllerTest.mo | 4 +- .../Examples/package.order | 2 +- .../FloatingHysteresis.mo | 4 +- ...atingRod.mo => TimeBasedElectricHeater.mo} | 10 +-- .../Utilities/package.order | 2 +- .../BivalentOnOffControllers/package.order | 4 +- .../Components/BuildingAndDHWControl.mo | 4 +- .../package.order | 2 +- .../BaseClasses/package.order | 2 +- .../RelativeSpeedController/package.order | 2 +- .../SummerMode/BaseClasses/package.order | 2 +- .../Control/Components/package.order | 6 +- .../Systems/Hydraulical/Control/GasBoiler.mo | 25 +++--- .../Control/MonoenergeticHeatPumpSystem.mo | 2 +- .../Control/RecordsCollection/package.order | 8 +- .../PartialTwoStorageParallelWithHeaters.mo | 20 ++--- .../Distribution/BaseClasses/package.order | 2 +- .../Components/Valves/Tests/package.order | 2 +- .../Components/Valves/package.order | 2 +- .../BufferStorage/package.order | 2 +- .../SimpleStorage/package.order | 2 +- .../RecordsCollection/package.order | 4 +- .../Distribution/Tests/TestDirectLoading.mo | 4 +- .../Distribution/Tests/TestIndirectLoading.mo | 4 +- .../Distribution/Tests/package.order | 4 +- .../Distribution/Types/HeaterType.mo | 4 +- .../DetailedSolarThermalWithHeatPump.mo | 4 +- .../Generation/ElectricalHeater.mo | 29 +++---- .../Hydraulical/Generation/GasBoiler.mo | 17 ++-- ...ingRod.mo => HeatPumpAndElectricHeater.mo} | 81 +++++++++---------- ...{DefaultHR.mo => DefaultElectricHeater.mo} | 6 +- ....mo => EletricHeaterBaseDataDefinition.mo} | 4 +- .../RecordsCollection/package.order | 12 +-- .../SimpleSolarThermalWithHeatPump.mo | 4 +- .../Generation/Tests/ElectricalHeater.mo | 12 +-- ...ingRod.mo => HeatPumpAndElectricHeater.mo} | 14 ++-- ....mo => SolarThermalAndHeatPumpDetailed.mo} | 12 +-- ...le.mo => SolarThermalAndHeatPumpSimple.mo} | 10 +-- .../Generation/Tests/package.order | 6 +- .../Hydraulical/Interfaces/package.order | 10 +-- .../RecordsCollection/package.order | 4 +- .../Transfer/RecordsCollection/package.order | 6 +- .../Hydraulical/Transfer/Tests/package.order | 4 +- .../Hydraulical/Transfer/Types/package.order | 2 +- BESMod/Systems/Interfaces/package.order | 2 +- .../RecordsCollection/Movers/package.order | 2 +- .../TemperatureSensors/package.order | 2 +- .../RecordsCollection/Valves/package.order | 2 +- .../Systems/RecordsCollection/package.order | 4 +- .../Systems/UserProfiles/Tests/package.order | 2 +- .../RecordsCollection/package.order | 2 +- .../Ventilation/Interfaces/package.order | 6 +- BESMod/Utilities/Electrical/package.order | 6 +- .../HeatGeneration/GetHeatPumpCurveVCLib.mo | 6 +- .../PartialGetHeatGenerationCurve.mo | 2 +- BESMod/Utilities/HeatGeneration/package.order | 2 +- BESMod/Utilities/Icons/package.order | 16 ++-- .../Utilities/KPIs/BaseClasses/package.order | 2 +- BESMod/Utilities/KPIs/package.order | 2 +- .../ArrayInExpandable/package.order | 2 +- .../ReplaceableArray/package.order | 2 +- .../VirtualVariable/package.order | 4 +- .../OpenModelicaErrors/package.order | 4 +- BESMod/Utilities/package.order | 8 +- 97 files changed, 294 insertions(+), 353 deletions(-) delete mode 100644 BESMod/Resources/Scripts/ConvertBESMod_from_0.2.2_to_0.3.0.mos delete mode 100644 BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos rename BESMod/Systems/Hydraulical/Components/{HeatingRodWithSecurityControl.mo => ElectricHeaterWithSecurityControl.mo} (99%) rename BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/{ConstantHysteresisTimeBasedHeatingRod.mo => TimeBasedElectricHeater.mo} (96%) rename BESMod/Systems/Hydraulical/Generation/{HeatPumpAndHeatingRod.mo => HeatPumpAndElectricHeater.mo} (51%) rename BESMod/Systems/Hydraulical/Generation/RecordsCollection/{DefaultHR.mo => DefaultElectricHeater.mo} (54%) rename BESMod/Systems/Hydraulical/Generation/RecordsCollection/{HeatingRodBaseDataDefinition.mo => EletricHeaterBaseDataDefinition.mo} (89%) rename BESMod/Systems/Hydraulical/Generation/Tests/{HeatPumpAndHeatingRod.mo => HeatPumpAndElectricHeater.mo} (84%) rename BESMod/Systems/Hydraulical/Generation/Tests/{SolarThermalAndHeatPumpAndHeatingRodDetailed.mo => SolarThermalAndHeatPumpDetailed.mo} (88%) rename BESMod/Systems/Hydraulical/Generation/Tests/{SolarThermalAndHeatPumpAndHeatingRodSimple.mo => SolarThermalAndHeatPumpSimple.mo} (89%) diff --git a/BESMod/Examples/BAUSimStudy/Buildings/package.order b/BESMod/Examples/BAUSimStudy/Buildings/package.order index b185c60d..5e010bde 100644 --- a/BESMod/Examples/BAUSimStudy/Buildings/package.order +++ b/BESMod/Examples/BAUSimStudy/Buildings/package.order @@ -1,4 +1,4 @@ -Case_1_standard Case_1_retrofit -Case_2_standard +Case_1_standard Case_2_retrofit +Case_2_standard diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index ffb209f1..f9bdb678 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -9,7 +9,7 @@ partial model PartialCase ABui=sum(building.zoneParam.VAir)^(2/3)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( + redeclare Systems.Hydraulical.Generation.HeatPumpAndElectricHeater generation( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare @@ -23,8 +23,8 @@ partial model PartialCase use_refIne=false, refIneFre_constant=0), redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRod, + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHea, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, @@ -43,9 +43,9 @@ partial model PartialCase dTHysBui=10, dTHysDHW=10, redeclare model DHWHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater, redeclare model BuildingHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, @@ -71,8 +71,8 @@ partial model PartialCase use_QLos=true, T_m=65 + 273.15), redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRodAftBuf), + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHeaAftBuf), redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased transfer( redeclare diff --git a/BESMod/Examples/DesignOptimization/BES.mo b/BESMod/Examples/DesignOptimization/BES.mo index fe03b7ea..2a8106b3 100644 --- a/BESMod/Examples/DesignOptimization/BES.mo +++ b/BESMod/Examples/DesignOptimization/BES.mo @@ -10,7 +10,7 @@ model BES oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( + redeclare Systems.Hydraulical.Generation.HeatPumpAndElectricHeater generation( redeclare model PerDataRevHP = AixLib.DataBase.Chiller.PerformanceData.PolynomalApproach (redeclare function PolyData = @@ -20,14 +20,12 @@ model BES BESMod.Systems.Hydraulical.Components.Frosting.ZhuIceFacCalculation frost(density=200, redeclare function frostMapFunc = BESMod.Systems.Hydraulical.Components.Frosting.Functions.ZhuFrostingMapCico), - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum( genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, - TBiv=parameterStudy.TBiv, scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ parameterStudy.QHP_flow_biv, @@ -36,8 +34,8 @@ model BES use_refIne=false, refIneFre_constant=0), redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRod, + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHea, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, diff --git a/BESMod/Examples/DesignOptimization/package.order b/BESMod/Examples/DesignOptimization/package.order index d1d1cc2e..207c8038 100644 --- a/BESMod/Examples/DesignOptimization/package.order +++ b/BESMod/Examples/DesignOptimization/package.order @@ -1,3 +1,3 @@ BES -ParametersToChange AachenSystem +ParametersToChange diff --git a/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo b/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo index 24369657..2089afdb 100644 --- a/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo +++ b/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo @@ -23,10 +23,10 @@ package BaseClasses "Contains partial example case" meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.GenerationSupplyTemperature, redeclare model DHWHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater, redeclare model BuildingHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater, redeclare model DHWSetTemperature = BESMod.Systems.Hydraulical.Control.Components.DHWSetControl.ConstTSet_DHW, diff --git a/BESMod/Examples/HeatPumpAndBoiler/package.order b/BESMod/Examples/HeatPumpAndBoiler/package.order index a6bcf1f6..b903e2d7 100644 --- a/BESMod/Examples/HeatPumpAndBoiler/package.order +++ b/BESMod/Examples/HeatPumpAndBoiler/package.order @@ -1,7 +1,7 @@ -ParametersToChange -AachenSystem -Parallel -Serial AfterBufferWithDHW AfterBufferWithoutDHW BaseClasses +Parallel +Serial +AachenSystem +ParametersToChange diff --git a/BESMod/Examples/HighOrderModel/BES_HOM.mo b/BESMod/Examples/HighOrderModel/BES_HOM.mo index fc530e7f..4ee8a9fc 100644 --- a/BESMod/Examples/HighOrderModel/BES_HOM.mo +++ b/BESMod/Examples/HighOrderModel/BES_HOM.mo @@ -17,7 +17,7 @@ model BES_HOM HOMBuiEnv), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( - redeclare BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod + redeclare BESMod.Systems.Hydraulical.Generation.HeatPumpAndElectricHeater generation( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare @@ -32,8 +32,8 @@ model BES_HOM use_refIne=false, refIneFre_constant=0), redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRod, + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHea, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, @@ -48,9 +48,9 @@ model BES_HOM BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled valCtrl, redeclare model DHWHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater, redeclare model BuildingHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, diff --git a/BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 1c9a0855..e3b13907 100644 --- a/BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -22,7 +22,7 @@ partial model PartialModelicaConferenceUseCase systemParameters.TSetDHW), redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( + redeclare Systems.Hydraulical.Generation.HeatPumpAndElectricHeater generation( dTTra_nominal={10}, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, @@ -37,8 +37,8 @@ partial model PartialModelicaConferenceUseCase use_refIne=false, refIneFre_constant=0), redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRod, + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHea, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D (dataTable= AixLib.DataBase.HeatPump.EN255.Vitocal350AWI114()), @@ -55,9 +55,9 @@ partial model PartialModelicaConferenceUseCase parTheVal, supCtrDHWTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal, redeclare model DHWHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater, redeclare model BuildingHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, diff --git a/BESMod/Examples/ModelicaConferencePaper/package.order b/BESMod/Examples/ModelicaConferencePaper/package.order index c9e47c5c..ef68f13b 100644 --- a/BESMod/Examples/ModelicaConferencePaper/package.order +++ b/BESMod/Examples/ModelicaConferencePaper/package.order @@ -1,4 +1,4 @@ -PartialModelicaConferenceUseCase -BESModSystemParas BuildingsLibraryRoom +PartialModelicaConferenceUseCase TEASERBuilding +BESModSystemParas diff --git a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo index 74d700ff..79706ab8 100644 --- a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo +++ b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo @@ -20,9 +20,9 @@ partial model PartialSolarThermalHPS BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition parTheVal, redeclare model DHWHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater, redeclare model BuildingHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod, + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo index b985f7cc..7e6d13fc 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalAixLib.mo @@ -3,7 +3,7 @@ model SolarThermalAixLib "Solar thermal collector from AixLib" extends BESMod.Examples.SolarThermalSystem.PartialSolarThermalHPS(redeclare model hydGeneration = BESMod.Systems.Hydraulical.Generation.SimpleSolarThermalWithHeatPump ( - use_heaRod=false, + use_eleHea=false, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap (refrigerant= "Propane", flowsheet="VIPhaseSeparatorFlowsheet"), @@ -11,8 +11,8 @@ model SolarThermalAixLib "Solar thermal collector from AixLib" BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum(genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.Monovalent), redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRod, + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHea, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare diff --git a/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo b/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo index 6965b31e..2c385db4 100644 --- a/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo +++ b/BESMod/Examples/SolarThermalSystem/SolarThermalBuildings.mo @@ -4,7 +4,7 @@ model SolarThermalBuildings extends BESMod.Examples.SolarThermalSystem.PartialSolarThermalHPS(redeclare model hydGeneration = BESMod.Systems.Hydraulical.Generation.DetailedSolarThermalWithHeatPump ( - use_heaRod=false, + use_eleHea=false, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.VCLibMap (refrigerant= "Propane", flowsheet="VIPhaseSeparatorFlowsheet"), @@ -12,8 +12,8 @@ model SolarThermalBuildings BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum(genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.Monovalent), redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRod, + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHea, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare package Medium_eva = AixLib.Media.Air, redeclare diff --git a/BESMod/Examples/SolarThermalSystem/package.order b/BESMod/Examples/SolarThermalSystem/package.order index f85932a5..2bde989a 100644 --- a/BESMod/Examples/SolarThermalSystem/package.order +++ b/BESMod/Examples/SolarThermalSystem/package.order @@ -1,7 +1,7 @@ PartialSolarThermalHPS SolarThermalAixLib SolarThermalBuildings -SolarThermalSystemParameters -SolarThermalDesignOptimization CombiStorage SolarCollector +SolarThermalDesignOptimization +SolarThermalSystemParameters diff --git a/BESMod/Examples/package.order b/BESMod/Examples/package.order index 70f45800..648f38d2 100644 --- a/BESMod/Examples/package.order +++ b/BESMod/Examples/package.order @@ -1,6 +1,6 @@ +GasBoilerBuildingOnly BAUSimStudy DesignOptimization -GasBoilerBuildingOnly HeatPumpAndBoiler HighOrderModel ModelicaConferencePaper diff --git a/BESMod/Resources/Scripts/ConvertBESMod_from_0.2.2_to_0.3.0.mos b/BESMod/Resources/Scripts/ConvertBESMod_from_0.2.2_to_0.3.0.mos deleted file mode 100644 index 40c47a65..00000000 --- a/BESMod/Resources/Scripts/ConvertBESMod_from_0.2.2_to_0.3.0.mos +++ /dev/null @@ -1,21 +0,0 @@ -clear - -convertClear(); - - -// Rename -// Examples -convertClass("BESMod.Examples.UseCaseAachen", "BESMod.Examples.UseCaseDesignOptimization"); -convertClass("BESMod.Examples.SolarThermalSystem.SolarThermalHPS", "BESMod.Examples.SolarThermalSystem.SolarThermalAixLib"); -// Systems -convertClass("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHP", "BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib"); -convertClass("BESMod.Systems.Hydraulical.Transfer.RadiatorTransferSystem", "BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator"); - -// Bus connectors -convertElement("BESMod.Systems.Hydraulical.Interfaces.GenerationControlBus", "hp_bus.TConInMea", "THeaPumIn"); -convertElement("BESMod.Systems.Hydraulical.Interfaces.GenerationControlBus", "hp_bus.TConOutMea", "THeaPumOut"); -convertElement("BESMod.Systems.Hydraulical.Interfaces.GenerationControlBus", "hp_bus.nSet", "yHeaPumSet"); -convertElement("BESMod.Systems.Hydraulical.Interfaces.GenerationControlBus", "hp_bus.onOffMea", "heaPumIsOn"); -convertElement("BESMod.Systems.Hydraulical.Interfaces.GenerationControlBus", "hp_bus.TEvaInMea", "THeaPumEvaIn"); -convertElement("BESMod.Systems.Hydraulical.Interfaces.GenerationControlBus", "hr_on", "uHeaRod"); -convertElement("BESMod.Systems.Hydraulical.Interfaces.GenerationControlBus", "uHR", "uHeaRod"); diff --git a/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos b/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos deleted file mode 100644 index 40e7547e..00000000 --- a/BESMod/Resources/Scripts/ConvertBESMod_from_0.3.1_to_0.3.2.mos +++ /dev/null @@ -1,42 +0,0 @@ -clear - -convertClear(); - -convertClass("BESMod.Systems.Demand.DHW.DHW", "BESMod.Systems.Demand.DHW.StandardProfiles"); - -convertClass("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib", "BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib"); -convertClass("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib", "BESMod.Systems.Hydraulical.Generation.SimpleSolarThermalWithHeatPump"); - -// Parameters -convertElement("BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod", "heatPumpParameters", "parHeaPum"); -convertElement("BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod", "heatingRodParameters", "parHeaRod"); -convertElement("BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod", "temperatureSensorData", "parTemSen"); -convertElement("BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod", "pumpData", "parPum"); - -convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib", "heatPumpParameters", "parHeaPum"); -convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib", "heatingRodParameters", "parHeaRod"); -convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib", "temperatureSensorData", "parTemSen"); -convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPBuiLib", "pumpData", "parPum"); - -convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib", "heatPumpParameters", "parHeaPum"); -convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib", "heatingRodParameters", "parHeaRod"); -convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib", "temperatureSensorData", "parTemSen"); -convertElement("BESMod.Systems.Hydraulical.Generation.SolarThermalBivHPAixLib", "pumpData", "parPum"); - -convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "temperatureSensorData", "parTemSen"); -convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "temperatureSensorData", "parTemSen"); - -convertElement("BESMod.Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl", "thermostaticValveParameters", "parTheVal"); -convertElement("BESMod.Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl", "thermostaticValveParameters", "parTheVal"); - - - -convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "bufParameters", "parStoBuf"); -convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "dhwParameters", "parStoDHW"); -convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "threeWayValveParameters", "parThrWayVal"); -convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedIndirectLoading", "heatingRodAftBufParameters", "parHeaRodAftBuf"); -convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "bufParameters", "parStoBuf"); -convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "dhwParameters", "parStoDHW"); -convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "threeWayValveParameters", "parThrWayVal"); -convertElement("BESMod.Systems.Hydraulical.Distribution.TwoStoDetailedDirectLoading", "heatingRodAftBufParameters", "parHeaRodAftBuf"); - diff --git a/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mos b/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mos index bcc3aac2..e4875d80 100644 --- a/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mos +++ b/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/BuildingsLibraryRoom.mos @@ -1,4 +1,4 @@ simulateModel("BESMod.Examples.ModelicaConferencePaper.BuildingsLibraryRoom", stopTime=864000, method="dassl", tolerance=1e-06, resultFile="BuildingsLibraryRoom"); createPlot(id=2, position={75, 70, 1210, 240}, y={"electrical.distribution.batterySimple.PLoad","electrical.distribution.batterySimple.PCharge"}, grid=true, subPlot=1, colors={{28,108,200},{238,46,47}}); -createPlot(id=2, position={75, 70, 1210, 240}, y={"hydraulic.distribution.sigBusDistr.TStoDHWTopMea","hydraulic.distribution.sigBusDistr.TStoBufTopMea","hydraulic.generation.sigBusGen.THeaRodMea"}, grid=true, subPlot=2, colors={{28,108,200},{238,46,47},{0,140,72}}); +createPlot(id=2, position={75, 70, 1210, 240}, y={"hydraulic.distribution.sigBusDistr.TStoDHWTopMea","hydraulic.distribution.sigBusDistr.TStoBufTopMea","hydraulic.generation.sigBusGen.TGenOutMea"}, grid=true, subPlot=2, colors={{28,108,200},{238,46,47},{0,140,72}}); createPlot(id=2, position={75, 70, 1210, 240}, y={"ventilation.generation.TSup.T","ventilation.generation.weaBus.TDryBul","building.buiMeaBus.TZoneMea[1]"}, grid=true, subPlot=3, colors={{28,108,200},{238,46,47},{0,140,72}}); diff --git a/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mos b/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mos index 409ca8c7..eeb5aadc 100644 --- a/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mos +++ b/BESMod/Resources/Scripts/Dymola/Examples/UseCaseModelicaConferencePaper/TEASERBuilding.mos @@ -1,4 +1,4 @@ simulateModel("BESMod.Examples.ModelicaConferencePaper.TEASERBuilding", stopTime=864000, method="dassl", tolerance=1e-06, resultFile="TEASERBuilding"); createPlot(id=2, position={75, 70, 1210, 240}, y={"electrical.distribution.batterySimple.PLoad","electrical.distribution.batterySimple.PCharge"}, grid=true, subPlot=1, colors={{28,108,200},{238,46,47}}); -createPlot(id=2, position={75, 70, 1210, 240}, y={"hydraulic.distribution.sigBusDistr.TStoDHWTopMea","hydraulic.distribution.sigBusDistr.TStoBufTopMea","hydraulic.generation.sigBusGen.THeaRodMea"}, grid=true, subPlot=2, colors={{28,108,200},{238,46,47},{0,140,72}}); +createPlot(id=2, position={75, 70, 1210, 240}, y={"hydraulic.distribution.sigBusDistr.TStoDHWTopMea","hydraulic.distribution.sigBusDistr.TStoBufTopMea","hydraulic.generation.sigBusGen.TGenOutMea"}, grid=true, subPlot=2, colors={{28,108,200},{238,46,47},{0,140,72}}); createPlot(id=2, position={75, 70, 1210, 240}, y={"ventilation.generation.TSup.T","ventilation.generation.weaBus.TDryBul","building.buiMeaBus.TZoneMea[1]"}, grid=true, subPlot=3, colors={{28,108,200},{238,46,47},{0,140,72}}); diff --git a/BESMod/Systems/BaseClasses/package.order b/BESMod/Systems/BaseClasses/package.order index f1173a75..aabebfa8 100644 --- a/BESMod/Systems/BaseClasses/package.order +++ b/BESMod/Systems/BaseClasses/package.order @@ -1,5 +1,5 @@ PartialBESExample PartialBuildingEnergySystem PartialFluidSubsystem -PartialSubsystemParameters PartialFluidSubsystemWithParameters +PartialSubsystemParameters diff --git a/BESMod/Systems/Demand/Building/BaseClasses/package.order b/BESMod/Systems/Demand/Building/BaseClasses/package.order index 46196a31..42e460b9 100644 --- a/BESMod/Systems/Demand/Building/BaseClasses/package.order +++ b/BESMod/Systems/Demand/Building/BaseClasses/package.order @@ -1,2 +1,2 @@ -PartialDemand PartialAixLibHighOrder +PartialDemand diff --git a/BESMod/Systems/Demand/Building/Components/BaseClasses/package.order b/BESMod/Systems/Demand/Building/Components/BaseClasses/package.order index cc12d8c7..21c223e6 100644 --- a/BESMod/Systems/Demand/Building/Components/BaseClasses/package.order +++ b/BESMod/Systems/Demand/Building/Components/BaseClasses/package.order @@ -1,2 +1,2 @@ -PartialAixLibHighOrder HighOrderModelParameters +PartialAixLibHighOrder diff --git a/BESMod/Systems/Demand/Building/Components/package.order b/BESMod/Systems/Demand/Building/Components/package.order index 5c48b96c..4bd71357 100644 --- a/BESMod/Systems/Demand/Building/Components/package.order +++ b/BESMod/Systems/Demand/Building/Components/package.order @@ -1,4 +1,4 @@ AixLibHighOrderOFD -SunWithWeaBus RadOnTiltedSurf_LiuWeaBus +SunWithWeaBus BaseClasses diff --git a/BESMod/Systems/Demand/Building/HeatDemand/package.order b/BESMod/Systems/Demand/Building/HeatDemand/package.order index cd961cee..ffbc147b 100644 --- a/BESMod/Systems/Demand/Building/HeatDemand/package.order +++ b/BESMod/Systems/Demand/Building/HeatDemand/package.order @@ -1,4 +1,4 @@ -CalcHeaDemROM CalcHeaBuiRoomCase600FF CalcHeaDemHOM +CalcHeaDemROM PartialCalcHeatingDemand diff --git a/BESMod/Systems/Demand/DHW/RecordsCollection/package.order b/BESMod/Systems/Demand/DHW/RecordsCollection/package.order index b864f09e..f781eaad 100644 --- a/BESMod/Systems/Demand/DHW/RecordsCollection/package.order +++ b/BESMod/Systems/Demand/DHW/RecordsCollection/package.order @@ -1,5 +1,5 @@ +NoDHW PartialDHWTap ProfileL -ProfileS ProfileM -NoDHW +ProfileS diff --git a/BESMod/Systems/Demand/DHW/TappingProfiles/package.order b/BESMod/Systems/Demand/DHW/TappingProfiles/package.order index 30b3a7b9..b8c43cf6 100644 --- a/BESMod/Systems/Demand/DHW/TappingProfiles/package.order +++ b/BESMod/Systems/Demand/DHW/TappingProfiles/package.order @@ -1,4 +1,4 @@ +PassThrough calcmFlowEquDynamic calcmFlowEquStatic -PassThrough BaseClasses diff --git a/BESMod/Systems/Electrical/Generation/Tests/package.order b/BESMod/Systems/Electrical/Generation/Tests/package.order index 0c111ec0..4dc8e0d0 100644 --- a/BESMod/Systems/Electrical/Generation/Tests/package.order +++ b/BESMod/Systems/Electrical/Generation/Tests/package.order @@ -1,3 +1,3 @@ PVSystemMultiSub -TestNoGeneration PartialTest +TestNoGeneration diff --git a/BESMod/Systems/Electrical/Interfaces/BaseClasses/package.order b/BESMod/Systems/Electrical/Interfaces/BaseClasses/package.order index 43b6cd07..82a89e7a 100644 --- a/BESMod/Systems/Electrical/Interfaces/BaseClasses/package.order +++ b/BESMod/Systems/Electrical/Interfaces/BaseClasses/package.order @@ -1,2 +1,2 @@ -ElectricalPinOut ElectricalPinIn +ElectricalPinOut diff --git a/BESMod/Systems/Electrical/Interfaces/package.order b/BESMod/Systems/Electrical/Interfaces/package.order index 626de3b0..ed458eb2 100644 --- a/BESMod/Systems/Electrical/Interfaces/package.order +++ b/BESMod/Systems/Electrical/Interfaces/package.order @@ -1,12 +1,12 @@ -GenerationControlBus +ControlOutputs DistributionControlBus -TransferControlBus -GenerationOutputs DistributionOutputs -TransferOutputs -ControlOutputs -SystemControlBus +ExternalElectricalPin +GenerationControlBus +GenerationOutputs InternalElectricalPinIn InternalElectricalPinOut -ExternalElectricalPin +SystemControlBus +TransferControlBus +TransferOutputs BaseClasses diff --git a/BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo b/BESMod/Systems/Hydraulical/Components/ElectricHeaterWithSecurityControl.mo similarity index 99% rename from BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo rename to BESMod/Systems/Hydraulical/Components/ElectricHeaterWithSecurityControl.mo index 981ed532..71f5c1b1 100644 --- a/BESMod/Systems/Hydraulical/Components/HeatingRodWithSecurityControl.mo +++ b/BESMod/Systems/Hydraulical/Components/ElectricHeaterWithSecurityControl.mo @@ -1,5 +1,5 @@ within BESMod.Systems.Hydraulical.Components; -model HeatingRodWithSecurityControl +model ElectricHeaterWithSecurityControl "Heating rod which converts electrical energy into heat with a given efficiency" extends IBPSA.Fluid.Interfaces.TwoPortHeatMassExchanger( redeclare final IBPSA.Fluid.MixingVolumes.MixingVolume vol( @@ -273,4 +273,4 @@ revisions="
")); -end HeatingRodWithSecurityControl; +end ElectricHeaterWithSecurityControl; diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/package.order b/BESMod/Systems/Hydraulical/Components/Frosting/package.order index bdd547e3..0c918017 100644 --- a/BESMod/Systems/Hydraulical/Components/Frosting/package.order +++ b/BESMod/Systems/Hydraulical/Components/Frosting/package.order @@ -1,4 +1,4 @@ +Functions NoFrosting ZhuIceFacCalculation -Functions BaseClasses diff --git a/BESMod/Systems/Hydraulical/Components/package.order b/BESMod/Systems/Hydraulical/Components/package.order index 510d06b7..03f93f27 100644 --- a/BESMod/Systems/Hydraulical/Components/package.order +++ b/BESMod/Systems/Hydraulical/Components/package.order @@ -1,3 +1,3 @@ -UFH -HeatingRodWithSecurityControl +ElectricHeaterWithSecurityControl Frosting +UFH diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order index fa58782d..5e6a0c4e 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/package.order @@ -1,3 +1,3 @@ PartialControl -PartialThermostaticValveControl PartialHeatPumpSystemController +PartialThermostaticValveControl diff --git a/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/package.order index 907a0670..b5e73325 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/package.order @@ -1,5 +1,5 @@ -MeasuredValue ConstantAdd HeatPumpBusPassThrough -SetAndMeasuredValueSelector +MeasuredValue ParallelValveController +SetAndMeasuredValueSelector diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/OnOffControllerTest.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/OnOffControllerTest.mo index 3f472cea..8cb2a9a0 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/OnOffControllerTest.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/OnOffControllerTest.mo @@ -2,8 +2,8 @@ within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.Ex model OnOffControllerTest extends Modelica.Icons.Example; - ConstantHysteresisTimeBasedHeatingRod constantHysteresisTimeBasedHR(dTHys=10, - dtHeaRod=1800) + TimeBasedElectricHeater constantHysteresisTimeBasedHR(dTHys=10, + dtEleHea=1800) annotation (Placement(transformation(extent={{-28,42},{16,82}}))); BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.DegreeMinuteController degreeMinuteController(dTHys=10, diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/package.order b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/package.order index 25659c4f..43d1bfda 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Examples/package.order @@ -1,3 +1,3 @@ +OnOffControllerTest ParallelBivalentControl PartialOnOffController -OnOffControllerTest diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/FloatingHysteresis.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/FloatingHysteresis.mo index 8b04fe59..4fd501d7 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/FloatingHysteresis.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/FloatingHysteresis.mo @@ -9,7 +9,7 @@ model FloatingHysteresis "Minimum hysteresis"; parameter Modelica.Units.SI.Time time_factor=20 "The time which should be spent to have the floating hysteresis equal to the average of maximum and minimum hysteresis."; - parameter Modelica.Units.SI.Time dtHeaRod=20*60 + parameter Modelica.Units.SI.Time dtEleHea=20*60 "Seconds for regulation when hr should be activated: If lower set temperature is hurt for more than this time period"; /******************************* Variables *******************************/ @@ -39,7 +39,7 @@ algorithm end when; // Activate hr in case temperature is below lower hysteresis and critical time period is passed - when (TStoTop < TSupSet - Hysteresis_floating/2) and time > (t1 + dtHeaRod) + when (TStoTop < TSupSet - Hysteresis_floating/2) and time > (t1 + dtEleHea) and priGenOn then secGenOn := true; ySecGenSet := 1; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/ConstantHysteresisTimeBasedHeatingRod.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/TimeBasedElectricHeater.mo similarity index 96% rename from BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/ConstantHysteresisTimeBasedHeatingRod.mo rename to BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/TimeBasedElectricHeater.mo index 30e9f2bb..220fce1e 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/ConstantHysteresisTimeBasedHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/TimeBasedElectricHeater.mo @@ -1,12 +1,12 @@ within BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers; -model ConstantHysteresisTimeBasedHeatingRod +model TimeBasedElectricHeater "Const. hysteresis and time-based auxilliar heater control" extends BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController; - parameter Modelica.Units.SI.Time dtHeaRod(displayUnit="min")=1800 + parameter Modelica.Units.SI.Time dtEleHea(displayUnit="min")=1800 "Seconds for regulation when hr should be activated: If lower set temperature is hurt for more than this time period"; - parameter Real addSetDelTimHeaRod=1 + parameter Real addSetDelTimEleHea=1 "Each time dt_hr passes, the output of the heating rod is increased by this amount in percentage. Maximum and default is 100 (on-off hr)%"; BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.Utilities.StorageHysteresis @@ -16,7 +16,7 @@ model ConstantHysteresisTimeBasedHeatingRod trigTime "Trigger once the hysteresis is violated" annotation (Placement(transformation(extent={{-32,-88},{-12,-68}}))); Modelica.Blocks.Sources.RealExpression reaExp(y=min(floor((time - trigTime.y)/ - dtHeaRod)*addSetDelTimHeaRod, 1)) + dtEleHea)*addSetDelTimEleHea, 1)) "Calculate if heating rod time has elapsed" annotation (Placement(transformation(extent={{6,-70},{26,-50}}))); Modelica.Blocks.Logical.GreaterThreshold greThr(threshold=Modelica.Constants.eps) @@ -113,4 +113,4 @@ equation lineColor={0,0,0}, textString="uLow"),Line(points={{-69,10},{-60,10}}, color={160, 160,164})})); -end ConstantHysteresisTimeBasedHeatingRod; +end TimeBasedElectricHeater; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/package.order b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/package.order index 9445d5a9..f84a653a 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/Utilities/package.order @@ -1,3 +1,3 @@ -TriggerTime CountTimeBelowThreshold StorageHysteresis +TriggerTime diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/package.order b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/package.order index a1cce53a..4e4eacf1 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/package.order @@ -1,8 +1,8 @@ AlternativeBivalent -ConstantHysteresisTimeBasedHeatingRod DegreeMinuteController FloatingHysteresis PartParallelBivalent -Examples +TimeBasedElectricHeater Utilities +Examples BaseClasses diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo index e36e290f..ea8f6846 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo @@ -20,7 +20,7 @@ model BuildingAndDHWControl "Supervisory control approach for DHW supply temperature "; replaceable model BuildingHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater (dTHys=10) constrainedby BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController @@ -36,7 +36,7 @@ model BuildingAndDHWControl "Supply temperature setpoint model, e.g. heating curve" annotation ( choicesAllMatching=true); replaceable model DHWHysteresis = - BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.ConstantHysteresisTimeBasedHeatingRod + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater (dTHys=10) constrainedby BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.order b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.order index 0bfb6382..75f053fa 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.order @@ -1,3 +1,3 @@ HeatingCurve -SingleZonePID PartialSetpoint +SingleZonePID diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order index 033605dc..9be49d29 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/BaseClasses/package.order @@ -1,2 +1,2 @@ -PartialControler LimPID +PartialControler diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/package.order b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/package.order index db36f7c8..249e56ea 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/package.order @@ -1,3 +1,3 @@ -BaseClasses OnOff PID +BaseClasses diff --git a/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/package.order index 210ed483..9dbfff2d 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/SummerMode/BaseClasses/package.order @@ -1,2 +1,2 @@ -SummerTimeConstraint PartialSummerMode +SummerTimeConstraint diff --git a/BESMod/Systems/Hydraulical/Control/Components/package.order b/BESMod/Systems/Hydraulical/Control/Components/package.order index 92a6664e..785608dd 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/package.order @@ -1,9 +1,9 @@ +BoilerInHybridSystem +BuildingAndDHWControl BivalentOnOffControllers BuildingSupplyTemperatureSetpoints DHWSetControl +RelativeSpeedController SummerMode ThermostaticValveController -RelativeSpeedController -BuildingAndDHWControl -BoilerInHybridSystem BaseClasses diff --git a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo index 473a25c6..236217a9 100644 --- a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo @@ -11,6 +11,7 @@ model GasBoiler "PI Control of gas boiler" annotation (choicesAllMatching=true, Placement(transformation(extent={{142,84},{162,104}}))); BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.HeatingCurve heatingCurve( + final nZones=parTra.nParallelDem, TSup_nominal=max(parTra.TTra_nominal), TRet_nominal=max(parTra.TTra_nominal - parTra.dTTra_nominal), TOda_nominal=parGen.TOda_nominal, @@ -71,8 +72,6 @@ model GasBoiler "PI Control of gas boiler" annotation (Placement(transformation(extent={{46,48},{66,68}}))); Modelica.Blocks.Math.BooleanToReal booleanToReal annotation (Placement(transformation(extent={{40,0},{60,20}}))); - Modelica.Blocks.Math.MinMax minMax(nu=parTra.nParallelDem) - annotation (Placement(transformation(extent={{-240,50},{-220,70}}))); Modelica.Blocks.Logical.Not bufOn if use_dhw "buffer is charged" annotation (Placement( transformation( @@ -179,14 +178,6 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(minMax.yMax,heatingCurve.TZoneSet) - annotation (Line(points={{-219,66},{-222,66},{-222,22}}, color={0,0,127})); - connect(minMax.u, useProBus.TZoneSet) annotation (Line(points={{-240,60},{-244, - 60},{-244,103},{-119,103}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); connect(bufOn.y, booToRea.u) annotation (Line(points={{-59,-50},{-42,-50}}, color={255,0,255})); connect(booToRea.y, sigBusDistr.uThrWayVal) annotation (Line(points={{-19,-50}, @@ -197,4 +188,18 @@ equation horizontalAlignment=TextAlignment.Left)); connect(bufOn.u, boilerOnOffDHW.y) annotation (Line(points={{-82,-50},{-122, -50},{-122,50},{-139,50}}, color={255,0,255})); + connect(heatingCurve.TZoneMea, buiMeaBus.TZoneMea) annotation (Line(points={{ + -222,38},{-234,38},{-234,40},{-242,40},{-242,103},{65,103}}, color={0,0, + 127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(heatingCurve.TZoneSet, useProBus.TZoneSet) annotation (Line(points={{ + -222,22},{-236,22},{-236,24},{-238,24},{-238,103},{-119,103}}, color={0, + 0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); end GasBoiler; diff --git a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo index a32f72d8..6c0539e1 100644 --- a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo +++ b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo @@ -17,7 +17,7 @@ model MonoenergeticHeatPumpSystem equation connect(constZero.y,swiSecGen. u3) annotation (Line(points={{81,-10},{92,-10},{92,2},{98,2}}, color={0,0,127})); - connect(swiSecGen.y, sigBusGen.uHeaRod) annotation (Line(points={{121,10},{126, + connect(swiSecGen.y, sigBusGen.uEleHea) annotation (Line(points={{121,10},{126, 10},{126,-60},{-152,-60},{-152,-99}}, color={0,0,127}), Text( string="%second", diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order b/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order index 334d1515..db9fa183 100644 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order @@ -1,6 +1,6 @@ -HeatPumpSafetyControl +BasicBoilerPI +BasicHeatPumpPI DefaultSafetyControl -ThermostaticValveDataDefinition +HeatPumpSafetyControl PIDBaseDataDefinition -BasicHeatPumpPI -BasicBoilerPI +ThermostaticValveDataDefinition diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo index d7ea3cf2..f5f433d5 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo @@ -10,10 +10,10 @@ partial model PartialTwoStorageParallelWithHeaters "Type of heater after the buffer storage" annotation(Dialog(group="Component choices")); - replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRodAftBuf if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod + replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHeaAftBuf if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.ElectricHeater "Parameters for heating rod after buffer storage" annotation ( - Dialog(group="Component data", enable=heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod), + Dialog(group="Component data", enable=heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.ElectricHeater), choicesAllMatching=true, Placement(transformation( extent={{-6,-6},{6,6}}, @@ -32,20 +32,20 @@ partial model PartialTwoStorageParallelWithHeaters annotation(Placement(transformation(extent={{64,124},{80,140}})), choicesAllMatching=true, Dialog(group="Component data")); - BESMod.Systems.Hydraulical.Components.HeatingRodWithSecurityControl hea( + BESMod.Systems.Hydraulical.Components.ElectricHeaterWithSecurityControl hea( redeclare package Medium = Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=m_flow_nominal[1], final m_flow_small=1E-4*abs(m_flow_nominal[1]), final show_T=show_T, - final dp_nominal=parHeaRodAftBuf.dp_nominal, + final dp_nominal=parEleHeaAftBuf.dp_nominal, final tau=30, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final Q_flow_nominal=QHeaAftBuf_flow_nominal, - final V=parHeaRodAftBuf.V_hr, - final eta=parHeaRodAftBuf.eta_hr) if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod + final V=parEleHeaAftBuf.V_hr, + final eta=parEleHeaAftBuf.eta_hr) if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.ElectricHeater annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -56,8 +56,8 @@ partial model PartialTwoStorageParallelWithHeaters BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.No annotation (Placement(transformation(extent={{40,54},{60,74}}))); - Utilities.KPIs.EnergyKPICalculator eneKPICalAftBufHeaRod(use_inpCon=false, y= - hea.Pel) if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.HeatingRod + Utilities.KPIs.EnergyKPICalculator eneKPICalAftBufEleHea(use_inpCon=false, y= + hea.Pel) if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.ElectricHeater "Heating rod after buffer KPIs" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, @@ -95,7 +95,7 @@ partial model PartialTwoStorageParallelWithHeaters rotation=180, origin={30,-150}))); equation - connect(eneKPICalAftBufHeaRod.KPI, outBusDist.PEleHRAftBuf) annotation (Line( + connect(eneKPICalAftBufEleHea.KPI, outBusDist.PEleHeaAftBuf) annotation (Line( points={{17.8,-130},{0,-130},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/package.order index 8dcef6b5..2c84ec7e 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/package.order @@ -1,4 +1,4 @@ +PartialDHWParameters PartialDistribution PartialTwoStorageParallel -PartialDHWParameters PartialTwoStorageParallelWithHeaters diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order index 7d834d79..56f32ba3 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/Tests/package.order @@ -1,2 +1,2 @@ -TestThreeWayValve PressureReliefExample +TestThreeWayValve diff --git a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order index e9eb0dad..976f64f1 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/Components/Valves/package.order @@ -1,3 +1,3 @@ -ThreeWayValveWithFlowReturn PressureReliefValve +ThreeWayValveWithFlowReturn Tests diff --git a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/package.order b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/package.order index f8f0077a..597c5e54 100644 --- a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/package.order @@ -1,3 +1,3 @@ BufferStorageBaseDataDefinition -bufferData DefaultDetailedStorage +bufferData diff --git a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/SimpleStorage/package.order b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/SimpleStorage/package.order index 4e262eab..42e2ef9a 100644 --- a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/SimpleStorage/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/SimpleStorage/package.order @@ -1,2 +1,2 @@ -SimpleStorageBaseDataDefinition DefaultStorage +SimpleStorageBaseDataDefinition diff --git a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/package.order b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/package.order index 7d92fedb..2375e2a2 100644 --- a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/package.order @@ -1,5 +1,5 @@ +GetStorageInsulation DistributionControlBaseDataDefinition PartialStorageBaseDataDefinition -SimpleStorage BufferStorage -GetStorageInsulation +SimpleStorage diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo index f0049d7a..708290ba 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestDirectLoading.mo @@ -16,8 +16,8 @@ model TestDirectLoading BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage parStoDHW(dTLoadingHC1=5), redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRodAftBuf, + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHeaAftBuf, QHeaAftBuf_flow_nominal= 0)); extends Modelica.Icons.Example; diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo index c16b829b..cbc1357e 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/TestIndirectLoading.mo @@ -16,8 +16,8 @@ model TestIndirectLoading BESMod.Systems.Hydraulical.Distribution.RecordsCollection.BufferStorage.DefaultDetailedStorage parStoDHW, redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRodAftBuf, + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHeaAftBuf, dTLoaHCBuf=10, QHeaAftBuf_flow_nominal= 0)); diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/package.order b/BESMod/Systems/Hydraulical/Distribution/Tests/package.order index dc3d4979..2626fe32 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/package.order @@ -1,8 +1,8 @@ +PartialTest +TestBoilerWithDHW TestCombiStorage TestDirectLoading TestIndirectLoading TestOnlyBuilding TestOnlyDHW TestSimpleStorages -TestBoilerWithDHW -PartialTest diff --git a/BESMod/Systems/Hydraulical/Distribution/Types/HeaterType.mo b/BESMod/Systems/Hydraulical/Distribution/Types/HeaterType.mo index e74752a5..568e4cae 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Types/HeaterType.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Types/HeaterType.mo @@ -2,8 +2,8 @@ within BESMod.Systems.Hydraulical.Distribution.Types; type HeaterType = enumeration( No "No heater", - HeatingRod - "Use a heating rod", + ElectricHeater + "Use an electric heater", Boiler "Use a boiler") "Select between boiler, heating rod or no additional heater"; diff --git a/BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo index 7df9fcbc..5a464c2c 100644 --- a/BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/DetailedSolarThermalWithHeatPump.mo @@ -1,14 +1,14 @@ within BESMod.Systems.Hydraulical.Generation; model DetailedSolarThermalWithHeatPump "Detailed solar thermal model with monoenergetic heat pump" - extends HeatPumpAndHeatingRod( + extends HeatPumpAndElectricHeater( m_flow_nominal={Q_flow_nominal[1]*f_design[1]/dTTra_nominal[1]/4184, solarThermalParas.m_flow_nominal}, redeclare package Medium = IBPSA.Media.Water, dTTra_nominal={if TDem_nominal[1] > 273.15 + 55 then 10 elseif TDem_nominal[1] > 44.9 then 8 else 5,solarThermalParas.dTMax}, final nParallelDem=2, - final dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal, dpST_nominal}); + final dp_nominal={heatPump.dpCon_nominal +dpEleHea_nominal, dpST_nominal}); replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.SolarThermalBaseDataDefinition solarThermalParas constrainedby BESMod.Systems.Hydraulical.Generation.RecordsCollection.SolarThermalBaseDataDefinition( final c_p=cp) diff --git a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo index cace4089..7eaeba96 100644 --- a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo @@ -24,19 +24,19 @@ model ElectricalHeater "Only heat using a heating rod" final m_flow_nominal=m_flow_nominal[1], final m_flow_small=1E-4*abs(m_flow_nominal[1]), final show_T=show_T, - final dp_nominal=parHeaRod.dp_nominal, + final dp_nominal=parEleHea.dp_nominal, final tau=30, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final Q_flow_nominal=Q_flow_nominal[1], - final V=parHeaRod.V_hr, - final eta=parHeaRod.eta_hr) + final V=parEleHea.V_hr, + final eta=parEleHea.eta_hr) annotation (Placement(transformation(extent={{-16,-16},{16,16}}, rotation=90, origin={-32,10}))); - replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.HeatingRodBaseDataDefinition - parHeaRod + replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.EletricHeaterBaseDataDefinition + parEleHea "Electric heater parameters" annotation (choicesAllMatching=true, Placement(transformation(extent={{-62,-42}, {-50,-30}}))); @@ -73,7 +73,8 @@ model ElectricalHeater "Only heat using a heating rod" rotation=90, origin={62,-74}))); - Utilities.KPIs.EnergyKPICalculator KPIQHR(use_inpCon=false, y=hea.vol.heatPort.Q_flow) + Utilities.KPIs.EnergyKPICalculator KPIQEleHea(use_inpCon=false, y=hea.vol.heatPort.Q_flow) + "Electric heater heat flow rate" annotation (Placement(transformation(extent={{-40,-80},{-20,-60}}))); replaceable parameter BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition @@ -81,11 +82,11 @@ model ElectricalHeater "Only heat using a heating rod" {28,-52}}))); BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) annotation (Placement(transformation(extent={{32,-108},{52,-88}}))); - Utilities.KPIs.DeviceKPICalculator KPIHeaRod1( + Utilities.KPIs.DeviceKPICalculator KPIEleHea( use_reaInp=true, calc_singleOnTime=true, calc_totalOnTime=true, - calc_numSwi=true) + calc_numSwi=true) "Electric heater KPIs" annotation (Placement(transformation(extent={{-60,-100},{-40,-80}}))); equation connect(dummyZero.y,switch1. u3) @@ -126,25 +127,25 @@ equation connect(realToElecCon.PEleLoa, hea.Pel) annotation (Line(points={{30,-94},{ -80,-94},{-80,28},{-60,28},{-60,27.6},{-41.6,27.6}}, color={0,0,127})); - connect(KPIQHR.KPI, outBusGen.QHR_flow) annotation (Line(points={{-17.8,-70}, + connect(KPIQEleHea.KPI, outBusGen.QEleHea_flow) annotation (Line(points={{-17.8,-70}, {0,-70},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIHeaRod1.KPI, outBusGen.heaRod) annotation (Line(points={{-37.8,-90}, - {-14,-90},{-14,-86},{0,-86},{0,-100}}, color={135,135,135}), Text( + connect(KPIEleHea.KPI, outBusGen.eleHea) annotation (Line(points={{-37.8,-90},{-14, + -90},{-14,-86},{0,-86},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIHeaRod1.uRea, sigBusGen.uHR) annotation (Line(points={{-62.2,-90}, - {-76,-90},{-76,98},{2,98}}, color={0,0,127}), Text( + connect(KPIEleHea.uRea, sigBusGen.uHR) annotation (Line(points={{-62.2,-90},{-76, + -90},{-76,98},{2,98}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(hea.u, sigBusGen.uHeaRod) annotation (Line(points={{-41.6,-9.2},{ + connect(hea.u, sigBusGen.uEleHea) annotation (Line(points={{-41.6,-9.2},{ -41.6,-14},{-54,-14},{-54,98},{2,98}}, color={0,0,127}), Text( string="%second", index=1, diff --git a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo index 3d79b75e..e598ab38 100644 --- a/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Generation/GasBoiler.mo @@ -46,7 +46,8 @@ model GasBoiler "Just a gas boiler" annotation (Placement(transformation(extent={{-66,-6},{-34,26}}))); - Utilities.KPIs.EnergyKPICalculator KPIQHR(use_inpCon=false, y=boi.QflowCalculation.y) + Utilities.KPIs.EnergyKPICalculator KPIQBoi(use_inpCon=false, y=boi.QflowCalculation.y) + "Boiler heat flow rate" annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}))); IBPSA.Fluid.Movers.Preconfigured.SpeedControlled_y pump( @@ -79,11 +80,11 @@ model GasBoiler "Just a gas boiler" origin={66,-26}))); BESMod.Utilities.Electrical.ZeroLoad zeroLoad annotation (Placement(transformation(extent={{26,-108},{46,-88}}))); - Utilities.KPIs.DeviceKPICalculator KPIHeaRod1( + Utilities.KPIs.DeviceKPICalculator KPIBoi( use_reaInp=true, calc_singleOnTime=true, calc_totalOnTime=true, - calc_numSwi=true) + calc_numSwi=true) "Boiler KPIs" annotation (Placement(transformation(extent={{-60,-80},{-40,-60}}))); initial algorithm @@ -129,20 +130,20 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIQHR.KPI, outBusGen.QBoi_flow) annotation (Line(points={{-17.8,-90}, + connect(KPIQBoi.KPI, outBusGen.QBoi_flow) annotation (Line(points={{-17.8,-90}, {-10,-90},{-10,-88},{0,-88},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIHeaRod1.KPI, outBusGen.boi) annotation (Line(points={{-37.8,-70},{ - 0,-70},{0,-100}}, color={135,135,135}), Text( + connect(KPIBoi.KPI, outBusGen.boi) annotation (Line(points={{-37.8,-70},{0,-70}, + {0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIHeaRod1.uRea, sigBusGen.uBoiSet) annotation (Line(points={{-62.2, - -70},{-74,-70},{-74,98},{2,98}}, color={0,0,127}), Text( + connect(KPIBoi.uRea, sigBusGen.uBoiSet) annotation (Line(points={{-62.2,-70},{-74, + -70},{-74,98},{2,98}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndElectricHeater.mo similarity index 51% rename from BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo rename to BESMod/Systems/Hydraulical/Generation/HeatPumpAndElectricHeater.mo index f619ec28..9533cd6d 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndElectricHeater.mo @@ -1,96 +1,95 @@ within BESMod.Systems.Hydraulical.Generation; -model HeatPumpAndHeatingRod "Heat pump with heating rod in series" +model HeatPumpAndElectricHeater "Heat pump with an electric heater in series" extends BESMod.Systems.Hydraulical.Generation.BaseClasses.PartialHeatPump( - dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal}, - multiSum(nu=if use_heaRod then 3 else 2)); + dp_nominal={heatPump.dpCon_nominal +dpEleHea_nominal}, + multiSum(nu=if use_eleHea then 3 else 2)); - parameter Boolean use_heaRod=true "=false to disable the heating rod" + parameter Boolean use_eleHea=true "=false to disable the electric heater" annotation(Dialog(group="Component choices")); - AixLib.Fluid.HeatExchangers.HeatingRod hea( + AixLib.Fluid.HeatExchangers.HeatingRod eleHea( redeclare package Medium = Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=m_flow_nominal[1], final m_flow_small=1E-4*abs(m_flow_nominal[1]), final show_T=show_T, - final dp_nominal=parHeaRod.dp_nominal, + final dp_nominal=parEleHea.dp_nominal, final tau=30, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final Q_flow_nominal=parHeaPum.QSec_flow_nominal, - final V=parHeaRod.V_hr, - final eta=parHeaRod.eta_hr, - use_countNumSwi=false) if use_heaRod + final V=parEleHea.V_hr, + final eta=parEleHea.eta_hr, + use_countNumSwi=false) if use_eleHea "Electric heater" annotation (Placement(transformation(extent={{20,40},{40,60}}))); - AixLib.Fluid.Interfaces.PassThroughMedium pasThrMedHeaRod(redeclare package - Medium = Medium, allowFlowReversal=allowFlowReversal) if not use_heaRod + AixLib.Fluid.Interfaces.PassThroughMedium pasThrMedEleHea(redeclare package + Medium = Medium, allowFlowReversal=allowFlowReversal) if not use_eleHea "Pass through if heating rod is not used" annotation (Placement(transformation(extent={{20,20},{40,40}}))); - replaceable parameter RecordsCollection.HeatingRodBaseDataDefinition parHeaRod - "Heating rod parameters" annotation ( + replaceable parameter RecordsCollection.EletricHeaterBaseDataDefinition parEleHea + "Electric heater parameters" + annotation ( Dialog(group="Component data"), choicesAllMatching=true, Placement(transformation(extent={{24,64},{36,76}}))); - Utilities.KPIs.DeviceKPICalculator KPIHeaRod( + Utilities.KPIs.DeviceKPICalculator KPIEleHea( use_reaInp=true, calc_singleOnTime=true, calc_totalOnTime=true, - calc_numSwi=true) if use_heaRod - "Heating rod KPIs" + calc_numSwi=true) if use_eleHea "Electric heater KPIs" annotation (Placement(transformation(extent={{-120,-120},{-100,-100}}))); - Utilities.KPIs.EnergyKPICalculator KPIQHeaRod_flow(use_inpCon=false, y=hea.vol.heatPort.Q_flow) - if use_heaRod "Heating rod heat flow rate" + Utilities.KPIs.EnergyKPICalculator KPIQEleHea_flow(use_inpCon=false, y=eleHea.vol.heatPort.Q_flow) + if use_eleHea "Electric heater heat flow rate" annotation (Placement(transformation(extent={{-140,-140},{-120,-120}}))); - Utilities.KPIs.EnergyKPICalculator KPIPEleHeaRod(use_inpCon=false, y=hea.Pel) - if use_heaRod "Heating rod heat flow rate" + Utilities.KPIs.EnergyKPICalculator KPIPEleEleHea(use_inpCon=false, y=eleHea.Pel) + if use_eleHea "Electric heater heat flow rate" annotation (Placement(transformation(extent={{-140,-100},{-120,-80}}))); protected - parameter Modelica.Units.SI.PressureDifference dpHeaRod_nominal=if use_heaRod - then parHeaRod.dp_nominal else 0; + parameter Modelica.Units.SI.PressureDifference dpEleHea_nominal=if use_eleHea + then parEleHea.dp_nominal else 0 + "Possible electric heater nominal pressure drop"; equation connect(heatPump.port_a1, pump.port_b) annotation (Line(points={{-30.5,-7},{ -30.5,-70},{1.77636e-15,-70}}, color={0,127,255})); - connect(pasThrMedHeaRod.port_b, senTGenOut.port_a) annotation (Line(points={{40,30}, + connect(pasThrMedEleHea.port_b, senTGenOut.port_a) annotation (Line(points={{40,30}, {54,30},{54,80},{60,80}}, color={0,127,255})); - connect(hea.port_b,senTGenOut. port_a) - annotation (Line(points={{40,50},{54,50},{54,80},{60,80}}, - color={0,127,255})); - connect(pasThrMedHeaRod.port_a, heatPump.port_b1) annotation (Line(points={{20,30}, + connect(eleHea.port_b, senTGenOut.port_a) annotation (Line(points={{40,50},{54,50}, + {54,80},{60,80}}, color={0,127,255})); + connect(pasThrMedEleHea.port_a, heatPump.port_b1) annotation (Line(points={{20,30}, {10,30},{10,50},{-30,50},{-30,38},{-30.5,38},{-30.5,37}}, color={0, 127,255})); - connect(heatPump.port_b1,hea. port_a) annotation (Line(points={{-30.5,37},{-30.5, - 36},{-30,36},{-30,50},{20,50}}, - color={0,127,255})); - connect(hea.u, sigBusGen.uHeaRod) annotation (Line(points={{18,56},{2,56},{2,98}}, - color={0,0,127}), Text( + connect(heatPump.port_b1, eleHea.port_a) annotation (Line(points={{-30.5,37},{-30.5, + 36},{-30,36},{-30,50},{20,50}}, color={0,127,255})); + connect(eleHea.u, sigBusGen.uEleHea) annotation (Line(points={{18,56},{2,56},{2, + 98}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(multiSum.u[3], hea.Pel) annotation (Line(points={{136,-82},{140,-82},{ - 140,56},{41,56}}, color={0,0,127})); - connect(KPIQHeaRod_flow.KPI, outBusGen.QHeaRod_flow) annotation (Line(points={{ + connect(multiSum.u[3], eleHea.Pel) annotation (Line(points={{136,-82},{140,-82}, + {140,56},{41,56}}, color={0,0,127})); + connect(KPIQEleHea_flow.KPI, outBusGen.QEleHea_flow) annotation (Line(points={{ -117.8,-130},{0,-130},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(hea.Pel, KPIHeaRod.uRea) annotation (Line(points={{41,56},{42,56},{42, - -38},{-10,-38},{-10,-66},{92,-66},{92,-154},{-130,-154},{-130,-110},{ - -122.2,-110}}, color={0,0,127})); - connect(KPIPEleHeaRod.KPI, outBusGen.PEleHeaRod) annotation (Line(points={{ + connect(eleHea.Pel, KPIEleHea.uRea) annotation (Line(points={{41,56},{42,56},{42, + -38},{-10,-38},{-10,-66},{92,-66},{92,-154},{-130,-154},{-130,-110},{-122.2, + -110}}, color={0,0,127})); + connect(KPIPEleEleHea.KPI, outBusGen.PEleEleHea) annotation (Line(points={{ -117.8,-90},{-68,-90},{-68,-92},{0,-92},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIHeaRod.KPI, outBusGen.heaRod) annotation (Line(points={{-97.8,-110},{ + connect(KPIEleHea.KPI, outBusGen.eleHea) annotation (Line(points={{-97.8,-110},{ -56,-110},{-56,-100},{0,-100}}, color={135,135,135}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); -end HeatPumpAndHeatingRod; +end HeatPumpAndElectricHeater; diff --git a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/DefaultHR.mo b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/DefaultElectricHeater.mo similarity index 54% rename from BESMod/Systems/Hydraulical/Generation/RecordsCollection/DefaultHR.mo rename to BESMod/Systems/Hydraulical/Generation/RecordsCollection/DefaultElectricHeater.mo index ae1bee6d..3206d00f 100644 --- a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/DefaultHR.mo +++ b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/DefaultElectricHeater.mo @@ -1,9 +1,9 @@ within BESMod.Systems.Hydraulical.Generation.RecordsCollection; -record DefaultHR +record DefaultElectricHeater extends - Systems.Hydraulical.Generation.RecordsCollection.HeatingRodBaseDataDefinition( + BESMod.Systems.Hydraulical.Generation.RecordsCollection.EletricHeaterBaseDataDefinition( discretizationSteps=0, V_hr=0.001, eta_hr=0.97, dp_nominal(displayUnit="Pa") = 1000); -end DefaultHR; +end DefaultElectricHeater; diff --git a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/HeatingRodBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/EletricHeaterBaseDataDefinition.mo similarity index 89% rename from BESMod/Systems/Hydraulical/Generation/RecordsCollection/HeatingRodBaseDataDefinition.mo rename to BESMod/Systems/Hydraulical/Generation/RecordsCollection/EletricHeaterBaseDataDefinition.mo index fa1e20ec..eb2235e2 100644 --- a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/HeatingRodBaseDataDefinition.mo +++ b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/EletricHeaterBaseDataDefinition.mo @@ -1,5 +1,5 @@ within BESMod.Systems.Hydraulical.Generation.RecordsCollection; -partial record HeatingRodBaseDataDefinition +partial record EletricHeaterBaseDataDefinition extends Modelica.Icons.Record; // Generation: Heating Rod parameter Real eta_hr "Heating rod efficiency"; @@ -13,4 +13,4 @@ partial record HeatingRodBaseDataDefinition annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, coordinateSystem(preserveAspectRatio=false))); -end HeatingRodBaseDataDefinition; +end EletricHeaterBaseDataDefinition; diff --git a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/package.order b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/package.order index 90a45fc0..f806de53 100644 --- a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/package.order +++ b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/package.order @@ -1,8 +1,8 @@ -HeatingRodBaseDataDefinition -DefaultHR -SolarThermalBaseDataDefinition +AutoparameterBoiler +BivalentHeatPumpBaseDataDefinition +DefaultElectricHeater +DefaultHP DefaultSolarThermal +EletricHeaterBaseDataDefinition HeatPumpBaseDataDefinition -DefaultHP -BivalentHeatPumpBaseDataDefinition -AutoparameterBoiler +SolarThermalBaseDataDefinition diff --git a/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo b/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo index 7727d01d..fb717bc9 100644 --- a/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo +++ b/BESMod/Systems/Hydraulical/Generation/SimpleSolarThermalWithHeatPump.mo @@ -1,12 +1,12 @@ within BESMod.Systems.Hydraulical.Generation; model SimpleSolarThermalWithHeatPump "Simple solar thermal model with monoenergetic heat pump" - extends HeatPumpAndHeatingRod( + extends HeatPumpAndElectricHeater( m_flow_nominal={Q_flow_nominal[1]*f_design[1]/dTTra_nominal[1]/4184,parSolThe.m_flow_nominal}, dTTra_nominal={if TDem_nominal[1] > 273.15 + 55 then 10 elseif TDem_nominal[1] > 44.9 then 8 else 5,parSolThe.dTMax}, final nParallelDem=2, - final dp_nominal={heatPump.dpCon_nominal + dpHeaRod_nominal,dpST_nominal}); + final dp_nominal={heatPump.dpCon_nominal +dpEleHea_nominal, dpST_nominal}); replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.SolarThermalBaseDataDefinition diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo b/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo index 5409bec4..301e13e3 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo @@ -2,18 +2,18 @@ within BESMod.Systems.Hydraulical.Generation.Tests; model ElectricalHeater extends PartialTest(redeclare BESMod.Systems.Hydraulical.Generation.ElectricalHeater - generation( - redeclare - BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRod, redeclare + generation( redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover - parPum)); + parPum, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHea)); extends Modelica.Icons.Example; Modelica.Blocks.Sources.Constant const1(k=1) annotation (Placement(transformation(extent={{-52,64},{-32,84}}))); equation - connect(const1.y, genControlBus.uHeaRod) annotation (Line(points={{-31,74},{ + connect(const1.y, genControlBus.uEleHea) annotation (Line(points={{-31,74},{ 10,74}}, color={0,0,127}), Text( string="%second", index=1, diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndElectricHeater.mo similarity index 84% rename from BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo rename to BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndElectricHeater.mo index 31c8a2a4..2a3e982d 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndHeatingRod.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/HeatPumpAndElectricHeater.mo @@ -1,9 +1,9 @@ within BESMod.Systems.Hydraulical.Generation.Tests; -model HeatPumpAndHeatingRod +model HeatPumpAndElectricHeater "Test for HeatPumpAndElectricHeater" extends PartialTest( redeclare - BESMod.Systems.Hydraulical.Generation.HeatPumpAndHeatingRod + BESMod.Systems.Hydraulical.Generation.HeatPumpAndElectricHeater generation( - use_heaRod=true, + use_eleHea=true, redeclare model PerDataMainHP = AixLib.DataBase.HeatPump.PerformanceData.LookUpTable2D (dataTable= AixLib.DataBase.HeatPump.EN255.Vitocal350AWI114()), @@ -14,8 +14,8 @@ model HeatPumpAndHeatingRod parPum, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, - redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRod)); + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHea)); extends Modelica.Icons.Example; Modelica.Blocks.Sources.Constant const1(k=0) @@ -35,10 +35,10 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(const1.y, genControlBus.uHeaRod) annotation (Line(points={{-59,50},{ + connect(const1.y, genControlBus.uEleHea) annotation (Line(points={{-59,50},{ -24,50},{-24,48},{10,48},{10,74}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); -end HeatPumpAndHeatingRod; +end HeatPumpAndElectricHeater; diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodDetailed.mo b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpDetailed.mo similarity index 88% rename from BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodDetailed.mo rename to BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpDetailed.mo index ee059c8a..a5c5e0a0 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodDetailed.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpDetailed.mo @@ -1,5 +1,5 @@ within BESMod.Systems.Hydraulical.Generation.Tests; -model SolarThermalAndHeatPumpAndHeatingRodDetailed +model SolarThermalAndHeatPumpDetailed "Test for SolarThermalAndHeatPumpDetailed" extends PartialTest(redeclare BESMod.Systems.Hydraulical.Generation.DetailedSolarThermalWithHeatPump generation( @@ -11,12 +11,12 @@ model SolarThermalAndHeatPumpAndHeatingRodDetailed redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, - redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRod, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultSolarThermal solarThermalParas, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPumSolThe)); + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPumSolThe, + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHea)); extends Modelica.Icons.Example; Modelica.Blocks.Sources.Constant const1(k=0) @@ -36,10 +36,10 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(const1.y, genControlBus.uHeaRod) annotation (Line(points={{-79,50},{ + connect(const1.y, genControlBus.uEleHea) annotation (Line(points={{-79,50},{ -32,50},{-32,48},{10,48},{10,74}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); -end SolarThermalAndHeatPumpAndHeatingRodDetailed; +end SolarThermalAndHeatPumpDetailed; diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodSimple.mo b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpSimple.mo similarity index 89% rename from BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodSimple.mo rename to BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpSimple.mo index f7d3a499..cad1863d 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpAndHeatingRodSimple.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/SolarThermalAndHeatPumpSimple.mo @@ -1,5 +1,5 @@ within BESMod.Systems.Hydraulical.Generation.Tests; -model SolarThermalAndHeatPumpAndHeatingRodSimple +model SolarThermalAndHeatPumpSimple "Test for SolarThermalAndHeatPumpSimple" extends PartialTest(redeclare BESMod.Systems.Hydraulical.Generation.SimpleSolarThermalWithHeatPump generation( @@ -15,8 +15,8 @@ model SolarThermalAndHeatPumpAndHeatingRodSimple redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultSolarThermal parSolThe, - redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRod)); + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHea)); extends Modelica.Icons.Example; @@ -37,10 +37,10 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(const1.y, genControlBus.uHeaRod) annotation (Line(points={{-79,50},{ + connect(const1.y, genControlBus.uEleHea) annotation (Line(points={{-79,50},{ -32,50},{-32,48},{10,48},{10,74}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); -end SolarThermalAndHeatPumpAndHeatingRodSimple; +end SolarThermalAndHeatPumpSimple; diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/package.order b/BESMod/Systems/Hydraulical/Generation/Tests/package.order index ebf273a8..9dd1dbe6 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Generation/Tests/package.order @@ -3,7 +3,7 @@ GasBoiler HeatPump HeatPumpAndGasBoilerParallel HeatPumpAndGasBoilerSeries -HeatPumpAndHeatingRod -SolarThermalAndHeatPumpAndHeatingRodDetailed -SolarThermalAndHeatPumpAndHeatingRodSimple +HeatPumpAndElectricHeater PartialTest +SolarThermalAndHeatPumpDetailed +SolarThermalAndHeatPumpSimple diff --git a/BESMod/Systems/Hydraulical/Interfaces/package.order b/BESMod/Systems/Hydraulical/Interfaces/package.order index e35a775f..38141147 100644 --- a/BESMod/Systems/Hydraulical/Interfaces/package.order +++ b/BESMod/Systems/Hydraulical/Interfaces/package.order @@ -1,8 +1,8 @@ -GenerationControlBus +ControlOutputs DistributionControlBus -TransferControlBus -GenerationOutputs -TransferOutputs DistributionOutputs -ControlOutputs +GenerationControlBus +GenerationOutputs SystemControlBus +TransferControlBus +TransferOutputs diff --git a/BESMod/Systems/Hydraulical/RecordsCollection/package.order b/BESMod/Systems/Hydraulical/RecordsCollection/package.order index 060ce782..00106210 100644 --- a/BESMod/Systems/Hydraulical/RecordsCollection/package.order +++ b/BESMod/Systems/Hydraulical/RecordsCollection/package.order @@ -1,3 +1,3 @@ -HydraulicSystemBaseDataDefinition -DHWDesignParameters CopperPipeVariableSize +DHWDesignParameters +HydraulicSystemBaseDataDefinition diff --git a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/package.order b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/package.order index 1c937acf..351271a5 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/package.order @@ -1,6 +1,6 @@ -TransferDataBaseDefinition +DefaultUFHData RadiatorTransferData SteelRadiatorStandardPressureLossData -UFHData -DefaultUFHData TransferControlBaseDataDefinition +TransferDataBaseDefinition +UFHData diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/package.order b/BESMod/Systems/Hydraulical/Transfer/Tests/package.order index 1d5c8f6a..820d4c30 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/package.order @@ -1,5 +1,5 @@ +PartialTest TestIdealValveRadiatorSystem TestPressureBasedSystem -TestUnderfloorHeating TestPressureBasedSystemWithReliefValve -PartialTest +TestUnderfloorHeating diff --git a/BESMod/Systems/Hydraulical/Transfer/Types/package.order b/BESMod/Systems/Hydraulical/Transfer/Types/package.order index 4489a8f3..29d1c330 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Types/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/Types/package.order @@ -1,3 +1,3 @@ -HydraulicResistanceType HeatTransferSystemType +HydraulicResistanceType PressureDropPerLength diff --git a/BESMod/Systems/Interfaces/package.order b/BESMod/Systems/Interfaces/package.order index af6a2cb3..0ce2d60a 100644 --- a/BESMod/Systems/Interfaces/package.order +++ b/BESMod/Systems/Interfaces/package.order @@ -1,7 +1,7 @@ BuiMeaBus ControlOutputs -DemandOutputs DHWOutputs +DemandOutputs ElectricalOutputs HEMSBus HydraulicOutputs diff --git a/BESMod/Systems/RecordsCollection/Movers/package.order b/BESMod/Systems/RecordsCollection/Movers/package.order index 254c4935..277ccaa3 100644 --- a/BESMod/Systems/RecordsCollection/Movers/package.order +++ b/BESMod/Systems/RecordsCollection/Movers/package.order @@ -1,3 +1,3 @@ AutomaticConfigurationData -MoverBaseDataDefinition DefaultMover +MoverBaseDataDefinition diff --git a/BESMod/Systems/RecordsCollection/TemperatureSensors/package.order b/BESMod/Systems/RecordsCollection/TemperatureSensors/package.order index 6502ae2e..de48513b 100644 --- a/BESMod/Systems/RecordsCollection/TemperatureSensors/package.order +++ b/BESMod/Systems/RecordsCollection/TemperatureSensors/package.order @@ -1,2 +1,2 @@ -TemperatureSensorBaseDefinition DefaultSensor +TemperatureSensorBaseDefinition diff --git a/BESMod/Systems/RecordsCollection/Valves/package.order b/BESMod/Systems/RecordsCollection/Valves/package.order index a9cfcef6..2b6b9c2c 100644 --- a/BESMod/Systems/RecordsCollection/Valves/package.order +++ b/BESMod/Systems/RecordsCollection/Valves/package.order @@ -1,2 +1,2 @@ -ThreeWayValve DefaultThreeWayValve +ThreeWayValve diff --git a/BESMod/Systems/RecordsCollection/package.order b/BESMod/Systems/RecordsCollection/package.order index 1369160e..32eecb12 100644 --- a/BESMod/Systems/RecordsCollection/package.order +++ b/BESMod/Systems/RecordsCollection/package.order @@ -1,8 +1,8 @@ -SystemParametersBaseDataDefinition ExampleSystemParameters SubsystemControlBaseDataDefinition SupplySystemBaseDataDefinition -ParameterStudy +SystemParametersBaseDataDefinition Movers +ParameterStudy TemperatureSensors Valves diff --git a/BESMod/Systems/UserProfiles/Tests/package.order b/BESMod/Systems/UserProfiles/Tests/package.order index 205cc253..59d531b3 100644 --- a/BESMod/Systems/UserProfiles/Tests/package.order +++ b/BESMod/Systems/UserProfiles/Tests/package.order @@ -1,4 +1,4 @@ -TEASERProfileTest Case600Profiles HOMUserTest PartialTest +TEASERProfileTest diff --git a/BESMod/Systems/Ventilation/Generation/RecordsCollection/package.order b/BESMod/Systems/Ventilation/Generation/RecordsCollection/package.order index afc698d2..ddd8d73d 100644 --- a/BESMod/Systems/Ventilation/Generation/RecordsCollection/package.order +++ b/BESMod/Systems/Ventilation/Generation/RecordsCollection/package.order @@ -1,2 +1,2 @@ -PartialHeatExchangerRecovery DummyHeatExchangerRecovery +PartialHeatExchangerRecovery diff --git a/BESMod/Systems/Ventilation/Interfaces/package.order b/BESMod/Systems/Ventilation/Interfaces/package.order index 7b3c5a70..8b705474 100644 --- a/BESMod/Systems/Ventilation/Interfaces/package.order +++ b/BESMod/Systems/Ventilation/Interfaces/package.order @@ -1,6 +1,6 @@ -GenerationControlBus +ControlOutputs DistributionControlBus -GenerationOutputs DistributionOutputs -ControlOutputs +GenerationControlBus +GenerationOutputs SystemControlBus diff --git a/BESMod/Utilities/Electrical/package.order b/BESMod/Utilities/Electrical/package.order index 8f90790d..5ec85bda 100644 --- a/BESMod/Utilities/Electrical/package.order +++ b/BESMod/Utilities/Electrical/package.order @@ -1,6 +1,6 @@ -RealToElecCon -RealToElecConSplit +ConverterExample ElecConToReal MultiSumElec +RealToElecCon +RealToElecConSplit ZeroLoad -ConverterExample diff --git a/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo b/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo index cb0e85e4..fdc4b582 100644 --- a/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo +++ b/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo @@ -2,7 +2,7 @@ within BESMod.Utilities.HeatGeneration; model GetHeatPumpCurveVCLib extends PartialGetHeatGenerationCurve( redeclare Examples.DesignOptimization.AachenSystem systemParameters, - redeclare Systems.Hydraulical.Generation.HeatPumpAndHeatingRod generation( + redeclare Systems.Hydraulical.Generation.HeatPumpAndElectricHeater generation( redeclare package Medium_eva = IBPSA.Media.Air, redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP parHeaPum, @@ -12,8 +12,8 @@ model GetHeatPumpCurveVCLib redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor parTemSen, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHR - parHeaRod), + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHea), ramp( height=35, duration=84400, diff --git a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo index cb6fe9d7..42dd4150 100644 --- a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo +++ b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo @@ -97,7 +97,7 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(const1.y, sigBusGen.uHeaRod) annotation (Line(points={{-79,30},{-62, + connect(const1.y, sigBusGen.uEleHea) annotation (Line(points={{-79,30},{-62, 30},{-62,64}}, color={0,0,127}), Text( string="%second", index=1, diff --git a/BESMod/Utilities/HeatGeneration/package.order b/BESMod/Utilities/HeatGeneration/package.order index b11087b3..00df9b9a 100644 --- a/BESMod/Utilities/HeatGeneration/package.order +++ b/BESMod/Utilities/HeatGeneration/package.order @@ -1,2 +1,2 @@ -PartialGetHeatGenerationCurve GetHeatPumpCurveVCLib +PartialGetHeatGenerationCurve diff --git a/BESMod/Utilities/Icons/package.order b/BESMod/Utilities/Icons/package.order index bf4afdec..28a43f33 100644 --- a/BESMod/Utilities/Icons/package.order +++ b/BESMod/Utilities/Icons/package.order @@ -1,14 +1,14 @@ -SystemIcon +BuiMeaBus BuildingIcon -VentilationIcon +ControlBus ControlIcon +DHWIcon +DistributionIcon GenerationIcon -TransferIcon +OutputsBus StorageIcon -DistributionIcon -DHWIcon -ControlBus -BuiMeaBus +TransferIcon UseProBus +VentilationIcon ControlPackage -OutputsBus +SystemIcon diff --git a/BESMod/Utilities/KPIs/BaseClasses/package.order b/BESMod/Utilities/KPIs/BaseClasses/package.order index 68ad5171..2cc69cdb 100644 --- a/BESMod/Utilities/KPIs/BaseClasses/package.order +++ b/BESMod/Utilities/KPIs/BaseClasses/package.order @@ -1,4 +1,4 @@ +KPIDevice KPIIcon KPIIntegral -KPIDevice PartialKPIConnector diff --git a/BESMod/Utilities/KPIs/package.order b/BESMod/Utilities/KPIs/package.order index 2a187e57..785aacf8 100644 --- a/BESMod/Utilities/KPIs/package.order +++ b/BESMod/Utilities/KPIs/package.order @@ -1,5 +1,5 @@ -CountTimeDiscomfort ComfortCalculator +CountTimeDiscomfort DeviceKPICalculator EnergyKPICalculator BaseClasses diff --git a/BESMod/Utilities/OpenModelicaErrors/ArrayInExpandable/package.order b/BESMod/Utilities/OpenModelicaErrors/ArrayInExpandable/package.order index 491386cb..9f678428 100644 --- a/BESMod/Utilities/OpenModelicaErrors/ArrayInExpandable/package.order +++ b/BESMod/Utilities/OpenModelicaErrors/ArrayInExpandable/package.order @@ -1,4 +1,4 @@ -BusWithArr Bus +BusWithArr ModelShouldWork ModelWorks diff --git a/BESMod/Utilities/OpenModelicaErrors/ReplaceableArray/package.order b/BESMod/Utilities/OpenModelicaErrors/ReplaceableArray/package.order index add7969f..1935bfb8 100644 --- a/BESMod/Utilities/OpenModelicaErrors/ReplaceableArray/package.order +++ b/BESMod/Utilities/OpenModelicaErrors/ReplaceableArray/package.order @@ -1,4 +1,4 @@ -ReplaceableModel Example ModelUsesReplaceableModel +ReplaceableModel UseReplaceableModel diff --git a/BESMod/Utilities/OpenModelicaErrors/VirtualVariable/package.order b/BESMod/Utilities/OpenModelicaErrors/VirtualVariable/package.order index 0792b43b..983b1aed 100644 --- a/BESMod/Utilities/OpenModelicaErrors/VirtualVariable/package.order +++ b/BESMod/Utilities/OpenModelicaErrors/VirtualVariable/package.order @@ -1,6 +1,6 @@ -SomeConnector Bus +BusWithVar +SomeConnector Subsystem SystemShouldWork SystemWorks -BusWithVar diff --git a/BESMod/Utilities/OpenModelicaErrors/package.order b/BESMod/Utilities/OpenModelicaErrors/package.order index 6f4d2767..a4c66b13 100644 --- a/BESMod/Utilities/OpenModelicaErrors/package.order +++ b/BESMod/Utilities/OpenModelicaErrors/package.order @@ -1,4 +1,4 @@ -ReplaceableArray +ArrayInExpandable ExpandableInExpandableBus +ReplaceableArray VirtualVariable -ArrayInExpandable diff --git a/BESMod/Utilities/package.order b/BESMod/Utilities/package.order index 884acab0..dec94b7f 100644 --- a/BESMod/Utilities/package.order +++ b/BESMod/Utilities/package.order @@ -1,6 +1,6 @@ -KPIs -Icons -HeatGeneration -SupervisoryControl Electrical +HeatGeneration +Icons +KPIs OpenModelicaErrors +SupervisoryControl From abd7271c9ea8c92fc22a1c66748865c43557a157 Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Wed, 10 Jan 2024 12:45:45 +0100 Subject: [PATCH 115/131] Further rename, add TimeConstantEstimation --- .../ElectricHeaterWithSecurityControl.mo | 10 +-- .../Systems/Hydraulical/Components/package.mo | 2 +- .../PartialHeatPumpSystemController.mo | 4 +- .../PartialThermostaticValveControl.mo | 8 +- .../TimeBasedElectricHeater.mo | 4 +- .../Components/BuildingAndDHWControl.mo | 4 +- .../{ => BaseClasses}/PartialSetpoint.mo | 2 +- .../BaseClasses/package.mo | 3 + .../BaseClasses/package.order | 1 + .../Constant.mo | 12 +++ .../{HeatingCurve.mo => IdealHeatingCurve.mo} | 16 ++-- .../SingleZonePID.mo | 5 +- .../package.order | 5 +- .../Systems/Hydraulical/Control/GasBoiler.mo | 2 +- .../Control/MonoenergeticHeatPumpSystem.mo | 2 +- .../ThermostaticValveDataDefinition.mo | 23 ----- .../Control/RecordsCollection/package.order | 1 - .../PartialTwoStorageParallelWithHeaters.mo | 12 +-- .../BufferStorageBaseDataDefinition.mo | 10 +-- .../Distribution/Types/HeaterType.mo | 2 +- .../Generation/ElectricalHeater.mo | 24 ++++-- .../Generation/HeatPumpAndElectricHeater.mo | 4 +- .../DefaultElectricHeater.mo | 2 +- .../EletricHeaterBaseDataDefinition.mo | 4 +- .../Generation/Tests/ElectricalHeater.mo | 8 +- .../Hydraulical/Generation/package.order | 2 +- .../Hydraulical/Transfer/UFHTransferSystem.mo | 2 +- BESMod/Systems/UserProfiles/TEASERProfiles.mo | 4 +- .../PartialGetHeatGenerationCurve.mo | 2 +- .../BaseClasses/PartialEstimation.mo | 83 +++++++++++++++++++ .../BaseClasses/ProfilesWithStep.mo | 34 ++++++++ .../TimeConstantEstimationControl.mo | 83 +++++++++++++++++++ .../BaseClasses/package.mo | 4 + .../BaseClasses/package.order | 3 + .../UnderfloorHeating/ConstantSupply.mo | 8 ++ .../UnderfloorHeating/HeatingCurve.mo | 8 ++ .../UnderfloorHeating/Partial.mo | 33 ++++++++ .../UnderfloorHeating/SmartThermostat.mo | 20 +++++ .../UnderfloorHeating/package.mo | 3 + .../UnderfloorHeating/package.order | 4 + .../TimeConstantEstimation/package.mo | 3 + .../TimeConstantEstimation/package.order | 2 + BESMod/Utilities/package.order | 1 + 43 files changed, 378 insertions(+), 91 deletions(-) rename BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/{ => BaseClasses}/PartialSetpoint.mo (97%) create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/package.mo create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/package.order create mode 100644 BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/Constant.mo rename BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/{HeatingCurve.mo => IdealHeatingCurve.mo} (59%) delete mode 100644 BESMod/Systems/Hydraulical/Control/RecordsCollection/ThermostaticValveDataDefinition.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/BaseClasses/TimeConstantEstimationControl.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.order create mode 100644 BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/ConstantSupply.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/HeatingCurve.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/Partial.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/SmartThermostat.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/package.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/package.order create mode 100644 BESMod/Utilities/TimeConstantEstimation/package.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/package.order diff --git a/BESMod/Systems/Hydraulical/Components/ElectricHeaterWithSecurityControl.mo b/BESMod/Systems/Hydraulical/Components/ElectricHeaterWithSecurityControl.mo index 71f5c1b1..7721503b 100644 --- a/BESMod/Systems/Hydraulical/Components/ElectricHeaterWithSecurityControl.mo +++ b/BESMod/Systems/Hydraulical/Components/ElectricHeaterWithSecurityControl.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Components; model ElectricHeaterWithSecurityControl - "Heating rod which converts electrical energy into heat with a given efficiency" + "Electric heater which converts electrical energy into heat with a given efficiency" extends IBPSA.Fluid.Interfaces.TwoPortHeatMassExchanger( redeclare final IBPSA.Fluid.MixingVolumes.MixingVolume vol( final m_flow_small=m_flow_small, @@ -11,11 +11,11 @@ model ElectricHeaterWithSecurityControl "Heat flow rate at u=1, positive for heating"; parameter Modelica.Units.SI.Volume V=m_flow_nominal*tau/rho_default "Volume of heat exchanger"; - parameter Real eta "Efficiency of the heating rod"; + parameter Real eta "Efficiency of the electric heater rod"; // Count switches parameter Boolean use_countNumSwi=true - "Turn the counting of the number of heating rod uses on or off." + "Turn the counting of the number of electric heater uses on or off." annotation (Dialog(tab="Advanced", group="Diagnostics"), choices(checkBox=true)); Modelica.Blocks.Interfaces.RealInput u(unit="1", min=0, @@ -211,7 +211,7 @@ equation thickness=0.5)}), defaultComponentName="hea", Documentation(info="

- Model for a heating rod. + Model for a electric heater.

This model adds heat in the amount of

Components used in building energy systems which are not given in an existing model library to the modeling depth required by the simulation.

Most of these components shall not stay in this library but rather

    -
  • be integrated into the corresponding component library. For instance, we modified the heating rod model in the IBPSA. This will be added to the IBPSA in the near future
  • +
  • be integrated into the corresponding component library. For instance, we modified the electric heater model in the AixLib. This will be added to the IBPSA in the near future
  • be replaced by better fitting models. For instance, the ArtificalPumps were used starting this library but are replaced one after another be the movers from IBPSA
  • be moved to a matching project library. For instance, we simulated an UFH system in one project. Moving the UFH-subsystem and these models into an own project library is more straightforward.
diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo index 91260a05..5e697043 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo @@ -31,8 +31,8 @@ partial model PartialHeatPumpSystemController "Hysteresis for building" annotation (Dialog(group="Building control"), choicesAllMatching=true); replaceable model BuildingSupplySetTemperature = - BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.HeatingCurve - constrainedby BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.PartialSetpoint( + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.IdealHeatingCurve + constrainedby BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.PartialSetpoint( final TSup_nominal=buiAndDHWCtr.TSup_nominal, final TRet_nominal=buiAndDHWCtr.TRet_nominal, final TOda_nominal=buiAndDHWCtr.TOda_nominal, diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo index 184d4c0a..555a226a 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo @@ -6,16 +6,10 @@ partial model PartialThermostaticValveControl BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.BaseClasses.PartialThermostaticValveController valCtrl constrainedby BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.BaseClasses.PartialThermostaticValveController( - final nZones=parTra.nParallelDem, final leakageOpening=parTheVal.leakageOpening) + final nZones=parTra.nParallelDem) "Thermostatic valve controller" annotation ( Dialog(group="Building control"), choicesAllMatching=true, Placement(transformation(extent={{122,-78},{138,-62}}))); - replaceable parameter - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - parTheVal "Thermostatic valve parameters" - annotation (Dialog(group="Building control"), - choicesAllMatching=true, Placement( - transformation(extent={{182,-78},{198,-62}}))); equation connect(valCtrl.opening, sigBusTra.opening) annotation (Line(points={{139.6,-70}, {174,-70},{174,-100}}, color={0,0,127}), Text( diff --git a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/TimeBasedElectricHeater.mo b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/TimeBasedElectricHeater.mo index 220fce1e..7900ac21 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/TimeBasedElectricHeater.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BivalentOnOffControllers/TimeBasedElectricHeater.mo @@ -7,7 +7,7 @@ model TimeBasedElectricHeater parameter Modelica.Units.SI.Time dtEleHea(displayUnit="min")=1800 "Seconds for regulation when hr should be activated: If lower set temperature is hurt for more than this time period"; parameter Real addSetDelTimEleHea=1 - "Each time dt_hr passes, the output of the heating rod is increased by this amount in percentage. Maximum and default is 100 (on-off hr)%"; + "Each time electric heater time passes, the output of the electric heater is increased by this amount in percentage. Maximum and default is 100 (on-off hr)%"; BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.Utilities.StorageHysteresis hysSto(final bandwidth=dTHys, final pre_y_start=true) "Storage hysteresis" @@ -17,7 +17,7 @@ model TimeBasedElectricHeater annotation (Placement(transformation(extent={{-32,-88},{-12,-68}}))); Modelica.Blocks.Sources.RealExpression reaExp(y=min(floor((time - trigTime.y)/ dtEleHea)*addSetDelTimEleHea, 1)) - "Calculate if heating rod time has elapsed" + "Calculate if electric heater time has elapsed" annotation (Placement(transformation(extent={{6,-70},{26,-50}}))); Modelica.Blocks.Logical.GreaterThreshold greThr(threshold=Modelica.Constants.eps) annotation (Placement(transformation(extent={{70,-68},{86,-52}}))); diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo index ea8f6846..5434f5b8 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo @@ -26,8 +26,8 @@ model BuildingAndDHWControl BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController "Hysteresis for building" annotation (choicesAllMatching=true); replaceable model BuildingSupplySetTemperature = - BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.HeatingCurve - constrainedby BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.PartialSetpoint( + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.IdealHeatingCurve + constrainedby BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.PartialSetpoint( final TSup_nominal=TSup_nominal, final TRet_nominal=TRet_nominal, final TOda_nominal=TOda_nominal, diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/PartialSetpoint.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/PartialSetpoint.mo similarity index 97% rename from BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/PartialSetpoint.mo rename to BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/PartialSetpoint.mo index 6338fc7f..93184f89 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/PartialSetpoint.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/PartialSetpoint.mo @@ -1,4 +1,4 @@ -within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints; +within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses; model PartialSetpoint parameter Integer nZones "Number of heated zones"; parameter Modelica.Units.SI.Temperature TSup_nominal diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/package.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/package.mo new file mode 100644 index 00000000..b4ac07a4 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/package.mo @@ -0,0 +1,3 @@ +within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints; +package BaseClasses +end BaseClasses; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/package.order new file mode 100644 index 00000000..0ff82622 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/package.order @@ -0,0 +1 @@ +PartialSetpoint diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/Constant.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/Constant.mo new file mode 100644 index 00000000..ba31207b --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/Constant.mo @@ -0,0 +1,12 @@ +within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints; +model Constant "Constant supply temperature" + extends BaseClasses.PartialSetpoint; + parameter Modelica.Units.SI.Temperature TConSup=TSup_nominal + "Constant supply temperature"; + Modelica.Blocks.Sources.Constant const(final k=TConSup) + annotation (Placement(transformation(extent={{60,-10},{80,10}}))); + +equation + connect(const.y, TSet) + annotation (Line(points={{81,0},{94,0},{94,0},{110,0}}, color={0,0,127})); +end Constant; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/HeatingCurve.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/IdealHeatingCurve.mo similarity index 59% rename from BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/HeatingCurve.mo rename to BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/IdealHeatingCurve.mo index fbe9edf3..89bf8ac9 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/HeatingCurve.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/IdealHeatingCurve.mo @@ -1,9 +1,10 @@ within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints; -model HeatingCurve - "Ideal heating curve" - extends PartialSetpoint; +model IdealHeatingCurve "Ideal linear heating curve" + extends BaseClasses.PartialSetpoint; Modelica.Blocks.Math.MinMax maxTZoneSet(final nu=nZones) annotation (Placement(transformation(extent={{-60,-80},{-40,-60}}))); + parameter Modelica.Units.SI.TemperatureDifference dTAddCon=0 + "Constant offset of ideal heating curve"; protected parameter Modelica.Units.SI.Temperature TSupMea_nominal= (TSup_nominal + TRet_nominal) / 2 "Nominal mean temperature"; @@ -11,13 +12,12 @@ protected equation if TOda < maxTZoneSet.yMax then - TSet = TSup_nominal + (derQRel * (TSupMea_nominal - maxTZoneSet.yMax) * 1 / nHeaTra + - (TSup_nominal - TRet_nominal) / 2 * derQRel) - * (TOda - TOda_nominal); + TSet = TSup_nominal + dTAddCon + (derQRel * (TSupMea_nominal - maxTZoneSet.yMax) * + 1 / nHeaTra + (TSup_nominal - TRet_nominal) / 2 * derQRel) * (TOda - TOda_nominal); else // No heating required. - TSet = maxTZoneSet.yMax; + TSet = maxTZoneSet.yMax + dTAddCon; end if; connect(maxTZoneSet.u, TZoneSet) annotation (Line(points={{-60,-70},{-84,-70},{-84, -80},{-120,-80}}, color={0,0,127})); -end HeatingCurve; +end IdealHeatingCurve; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo index 2856edb3..5f1b46cc 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints; model SingleZonePID "Single zone PID controller" - extends PartialSetpoint; + extends BaseClasses.PartialSetpoint; replaceable parameter RecordsCollection.PIDBaseDataDefinition parPID constrainedby RecordsCollection.PIDBaseDataDefinition( @@ -10,8 +10,7 @@ model SingleZonePID final y_start=TSup_nominal, final yMin=293.15, final timeDer=0, - final Nd=10) - "PID parameters for boiler" + final Nd=10) "PID parameters" annotation (choicesAllMatching=true, Placement(transformation(extent={{42,22}, {58,38}}))); Modelica.Blocks.Continuous.LimPID PI( diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.order b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.order index 75f053fa..29eff788 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/package.order @@ -1,3 +1,4 @@ -HeatingCurve -PartialSetpoint +IdealHeatingCurve SingleZonePID +Constant +BaseClasses diff --git a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo index 236217a9..2ad0b11d 100644 --- a/BESMod/Systems/Hydraulical/Control/GasBoiler.mo +++ b/BESMod/Systems/Hydraulical/Control/GasBoiler.mo @@ -9,7 +9,7 @@ model GasBoiler "PI Control of gas boiler" replaceable parameter RecordsCollection.PIDBaseDataDefinition parPID "PID parameters for boiler" annotation (choicesAllMatching=true, Placement(transformation(extent={{142,84},{162,104}}))); - BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.HeatingCurve + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.IdealHeatingCurve heatingCurve( final nZones=parTra.nParallelDem, TSup_nominal=max(parTra.TTra_nominal), diff --git a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo index 6c0539e1..485ab2ce 100644 --- a/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo +++ b/BESMod/Systems/Hydraulical/Control/MonoenergeticHeatPumpSystem.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Hydraulical.Control; model MonoenergeticHeatPumpSystem - "Monoenergetic HPS with on/off heating rod" + "Monoenergetic HPS with on/off electric heater" extends BaseClasses.PartialHeatPumpSystemController( final meaValSecGen=BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.GenerationSupplyTemperature); diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/ThermostaticValveDataDefinition.mo b/BESMod/Systems/Hydraulical/Control/RecordsCollection/ThermostaticValveDataDefinition.mo deleted file mode 100644 index c79c0f7c..00000000 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/ThermostaticValveDataDefinition.mo +++ /dev/null @@ -1,23 +0,0 @@ -within BESMod.Systems.Hydraulical.Control.RecordsCollection; -record ThermostaticValveDataDefinition - extends Modelica.Icons.Record; - //Demand - Building - parameter Real Kvs=1.2 "Kv value at full opening (=1)"; - parameter Real Kv_setT=1.4 - "Kv value when set temperature = measured temperature"; - parameter Real P = 2 "Deviation of P-controller when valve is closed"; - - parameter Real leakageOpening = 0.0001 - "may be useful for simulation stability. Always check the influence it has on your results"; - parameter Real k=0.2 - "Gain of controller"; - parameter Modelica.Units.SI.Time Ti=1800 "Time constant of Integrator block"; - - parameter Modelica.Units.SI.PressureDifference dpFixed_nominal=1000 - "Pressure drop of pipe and other resistances that are in series"; - parameter Modelica.Units.SI.PressureDifference dpValve_nominal=1000 - "Nominal pressure drop of fully open valve, used if CvData=IBPSA.Fluid.Types.CvTypes.OpPoint"; - annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, - coordinateSystem(preserveAspectRatio=false))); -end ThermostaticValveDataDefinition; diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order b/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order index db9fa183..a80fd535 100644 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order @@ -3,4 +3,3 @@ BasicHeatPumpPI DefaultSafetyControl HeatPumpSafetyControl PIDBaseDataDefinition -ThermostaticValveDataDefinition diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo index f5f433d5..6ce14532 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallelWithHeaters.mo @@ -12,7 +12,7 @@ partial model PartialTwoStorageParallelWithHeaters replaceable parameter BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater parEleHeaAftBuf if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.ElectricHeater - "Parameters for heating rod after buffer storage" annotation ( + "Parameters for electric heater after buffer storage" annotation ( Dialog(group="Component data", enable=heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.ElectricHeater), choicesAllMatching=true, Placement(transformation( @@ -45,20 +45,20 @@ partial model PartialTwoStorageParallelWithHeaters final T_start=T_start, final Q_flow_nominal=QHeaAftBuf_flow_nominal, final V=parEleHeaAftBuf.V_hr, - final eta=parEleHeaAftBuf.eta_hr) if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.ElectricHeater + final eta=parEleHeaAftBuf.eta) if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.ElectricHeater annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={50,90}))); - AixLib.Fluid.Interfaces.PassThroughMedium pasThrHeaRodBuf(redeclare package + AixLib.Fluid.Interfaces.PassThroughMedium pasThrEleHeaBuf(redeclare package Medium = Medium, allowFlowReversal=allowFlowReversal) if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.No annotation (Placement(transformation(extent={{40,54},{60,74}}))); Utilities.KPIs.EnergyKPICalculator eneKPICalAftBufEleHea(use_inpCon=false, y= hea.Pel) if heaAftBufTyp == BESMod.Systems.Hydraulical.Distribution.Types.HeaterType.ElectricHeater - "Heating rod after buffer KPIs" annotation (Placement(transformation( + "Electric heater after buffer KPIs" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, origin={30,-130}))); @@ -119,7 +119,7 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(stoBuf.fluidportTop2, pasThrHeaRodBuf.port_a) annotation (Line(points={{ + connect(stoBuf.fluidportTop2, pasThrEleHeaBuf.port_a) annotation (Line(points={{ -29,40.2},{-29,60},{32,60},{32,64},{40,64}}, color={0,127,255})); connect(stoBuf.fluidportTop2, hea.port_a) annotation (Line(points={{-29,40.2},{-29, 60},{32,60},{32,90},{40,90}}, color={0,127,255})); @@ -129,7 +129,7 @@ equation {66,102},{64,102},{64,82},{62,82},{62,80},{66,80}}, color={0,127,255})); connect(hea.port_b, senTBuiSup.port_a) annotation (Line(points={{60,90},{60,86}, {66,86},{66,80}}, color={0,127,255})); - connect(pasThrHeaRodBuf.port_b, senTBuiSup.port_a) + connect(pasThrEleHeaBuf.port_b, senTBuiSup.port_a) annotation (Line(points={{60,64},{66,64},{66,80}}, color={0,127,255})); connect(eneKPICalAftBufBoi.KPI, outBusDist.PBoiAftBuf) annotation (Line(points={ {17.8,-150},{0,-150},{0,-100}}, color={135,135,135}), Text( diff --git a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/BufferStorageBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/BufferStorageBaseDataDefinition.mo index 913babba..48dcd594 100644 --- a/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/BufferStorageBaseDataDefinition.mo +++ b/BESMod/Systems/Hydraulical/Distribution/RecordsCollection/BufferStorage/BufferStorageBaseDataDefinition.mo @@ -3,12 +3,12 @@ record BufferStorageBaseDataDefinition extends Systems.Hydraulical.Distribution.RecordsCollection.PartialStorageBaseDataDefinition; - // Heating rod: - parameter Boolean use_hr=false annotation (Dialog(group="Heating Rod")); + // electric heater: + parameter Boolean use_hr=false annotation (Dialog(group="Electric Heater")); parameter Modelica.Units.SI.Power QHR_flow_nominal=0 - annotation (Dialog(group="Heating Rod")); - parameter Integer nLayerHR = integer(floor(nLayer/2)) "Layer of heating rod" annotation (Dialog(group="Heating Rod")); - parameter Integer discretizationStepsHR=0 "Number of steps to dicretize the heating rod. =0 modulating, =1 resembels an on-off controller. =2 would sample 0, 0.5 and 1" annotation (Dialog(group="Heating Rod")); + annotation (Dialog(group="Electric Heater")); + parameter Integer nLayerHR = integer(floor(nLayer/2)) "Layer of electric heater" annotation (Dialog(group="Electric Heater")); + parameter Integer discretizationStepsHR=0 "Number of steps to dicretize the electric heater. =0 modulating, =1 resembels an on-off controller. =2 would sample 0, 0.5 and 1" annotation (Dialog(group="Electric Heater")); // Heating coil 2: parameter Boolean use_HC2 "=false to disable heating coil 2" annotation (Dialog(group="Loading")); parameter Modelica.Units.SI.TemperatureDifference dTLoadingHC2 diff --git a/BESMod/Systems/Hydraulical/Distribution/Types/HeaterType.mo b/BESMod/Systems/Hydraulical/Distribution/Types/HeaterType.mo index 568e4cae..e4a76ccc 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Types/HeaterType.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Types/HeaterType.mo @@ -6,4 +6,4 @@ type HeaterType = enumeration( "Use an electric heater", Boiler "Use a boiler") - "Select between boiler, heating rod or no additional heater"; + "Select between boiler, electric heater or no additional heater"; diff --git a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo index 7eaeba96..04df8ca2 100644 --- a/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/ElectricalHeater.mo @@ -1,5 +1,5 @@ within BESMod.Systems.Hydraulical.Generation; -model ElectricalHeater "Only heat using a heating rod" +model ElectricalHeater "Only heat using an electric heater" extends BaseClasses.PartialGeneration( final dTLoss_nominal=fill(0, nParallelDem), dp_nominal={hea.dp_nominal}, final nParallelDem=1); @@ -31,7 +31,7 @@ model ElectricalHeater "Only heat using a heating rod" final T_start=T_start, final Q_flow_nominal=Q_flow_nominal[1], final V=parEleHea.V_hr, - final eta=parEleHea.eta_hr) + final eta=parEleHea.eta) annotation (Placement(transformation(extent={{-16,-16},{16,16}}, rotation=90, origin={-32,10}))); @@ -88,14 +88,18 @@ model ElectricalHeater "Only heat using a heating rod" calc_totalOnTime=true, calc_numSwi=true) "Electric heater KPIs" annotation (Placement(transformation(extent={{-60,-100},{-40,-80}}))); + Modelica.Blocks.Sources.RealExpression reaExpTOut(y=hea.vol.T) + annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-30,70}))); equation connect(dummyZero.y,switch1. u3) annotation (Line(points={{29,4},{38,4},{38,-4}}, color={0,0,127})); connect(dummyMassFlow.y,switch1. u1) annotation (Line(points={{63,4},{54,4},{54,-4}}, color={0,0,127})); - connect(hea.port_b, portGen_out[1]) annotation (Line(points={{-32,26},{-32,80}, - {100,80}}, color={0,127,255})); connect(hea.Pel, outBusGen.PelHR) annotation (Line(points={{-41.6,27.6},{-41.6, 49.6},{-72,49.6},{-72,-100},{0,-100}}, color={0,0,127}), Text( @@ -113,7 +117,7 @@ equation annotation (Line(points={{46,7.4},{46,-4}}, color={255,0,255})); connect(hea.port_a, pump.port_b) annotation (Line(points={{-32,-6},{-34,-6},{ -34,-48},{38,-48}}, color={0,127,255})); - connect(isOnHR.u, sigBusGen.uHR) annotation (Line(points={{46,21.2},{48,21.2}, + connect(isOnHR.u, sigBusGen.uEleHea) annotation (Line(points={{46,21.2},{48,21.2}, {48,46},{2,46},{2,98}}, color={0,0,127}), Text( string="%second", index=1, @@ -139,7 +143,7 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(KPIEleHea.uRea, sigBusGen.uHR) annotation (Line(points={{-62.2,-90},{-76, + connect(KPIEleHea.uRea, sigBusGen.uEleHea) annotation (Line(points={{-62.2,-90},{-76, -90},{-76,98},{2,98}}, color={0,0,127}), Text( string="%second", index=1, @@ -151,4 +155,12 @@ equation index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); + connect(reaExpTOut.y, sigBusGen.TGenOutMea) annotation (Line(points={{-19,70},{ + 2,70},{2,98}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(hea.port_b, portGen_out[1]) annotation (Line(points={{-32,26},{-32,40}, + {20,40},{20,80},{100,80}}, color={0,127,255})); end ElectricalHeater; diff --git a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndElectricHeater.mo b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndElectricHeater.mo index 9533cd6d..90cd5f6b 100644 --- a/BESMod/Systems/Hydraulical/Generation/HeatPumpAndElectricHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/HeatPumpAndElectricHeater.mo @@ -20,12 +20,12 @@ model HeatPumpAndElectricHeater "Heat pump with an electric heater in series" final T_start=T_start, final Q_flow_nominal=parHeaPum.QSec_flow_nominal, final V=parEleHea.V_hr, - final eta=parEleHea.eta_hr, + final eta=parEleHea.eta, use_countNumSwi=false) if use_eleHea "Electric heater" annotation (Placement(transformation(extent={{20,40},{40,60}}))); AixLib.Fluid.Interfaces.PassThroughMedium pasThrMedEleHea(redeclare package Medium = Medium, allowFlowReversal=allowFlowReversal) if not use_eleHea - "Pass through if heating rod is not used" + "Pass through if electric heater is not used" annotation (Placement(transformation(extent={{20,20},{40,40}}))); replaceable parameter RecordsCollection.EletricHeaterBaseDataDefinition parEleHea "Electric heater parameters" diff --git a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/DefaultElectricHeater.mo b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/DefaultElectricHeater.mo index 3206d00f..08c21fb3 100644 --- a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/DefaultElectricHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/DefaultElectricHeater.mo @@ -4,6 +4,6 @@ record DefaultElectricHeater BESMod.Systems.Hydraulical.Generation.RecordsCollection.EletricHeaterBaseDataDefinition( discretizationSteps=0, V_hr=0.001, - eta_hr=0.97, + eta=0.97, dp_nominal(displayUnit="Pa") = 1000); end DefaultElectricHeater; diff --git a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/EletricHeaterBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/EletricHeaterBaseDataDefinition.mo index eb2235e2..1717fba9 100644 --- a/BESMod/Systems/Hydraulical/Generation/RecordsCollection/EletricHeaterBaseDataDefinition.mo +++ b/BESMod/Systems/Hydraulical/Generation/RecordsCollection/EletricHeaterBaseDataDefinition.mo @@ -1,8 +1,8 @@ within BESMod.Systems.Hydraulical.Generation.RecordsCollection; partial record EletricHeaterBaseDataDefinition extends Modelica.Icons.Record; - // Generation: Heating Rod - parameter Real eta_hr "Heating rod efficiency"; + // Generation: electric heater + parameter Real eta "Electric heater efficiency"; parameter Modelica.Units.SI.Volume V_hr "Volume to model thermal inertia of water"; parameter Modelica.Units.SI.PressureDifference dp_nominal diff --git a/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo b/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo index 301e13e3..e886cbcf 100644 --- a/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo +++ b/BESMod/Systems/Hydraulical/Generation/Tests/ElectricalHeater.mo @@ -1,11 +1,9 @@ within BESMod.Systems.Hydraulical.Generation.Tests; model ElectricalHeater extends PartialTest(redeclare - BESMod.Systems.Hydraulical.Generation.ElectricalHeater - generation( redeclare - BESMod.Systems.RecordsCollection.Movers.DefaultMover - parPum, - redeclare + BESMod.Systems.Hydraulical.Generation.ElectricalHeater generation( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater parEleHea)); extends Modelica.Icons.Example; diff --git a/BESMod/Systems/Hydraulical/Generation/package.order b/BESMod/Systems/Hydraulical/Generation/package.order index 6bfac3ae..ef33cd6d 100644 --- a/BESMod/Systems/Hydraulical/Generation/package.order +++ b/BESMod/Systems/Hydraulical/Generation/package.order @@ -3,7 +3,7 @@ GasBoiler HeatPump HeatPumpAndGasBoilerParallel HeatPumpAndGasBoilerSerial -HeatPumpAndHeatingRod +HeatPumpAndElectricHeater NoGeneration SimpleSolarThermalWithHeatPump DetailedSolarThermalWithHeatPump diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index d6a5cf18..55d2616d 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -24,7 +24,7 @@ model UFHTransferSystem final floorHeatingType=floorHeatingType, each final dis=5, final A=UFHParameters.area, - final T0=TDem_nominal, + each final T0=T_start, each calcMethod=1) "Underfloor heating" annotation (Placement( transformation( extent={{-29.5,-10.5},{29.5,10.5}}, diff --git a/BESMod/Systems/UserProfiles/TEASERProfiles.mo b/BESMod/Systems/UserProfiles/TEASERProfiles.mo index 7aa3a1e4..6468c792 100644 --- a/BESMod/Systems/UserProfiles/TEASERProfiles.mo +++ b/BESMod/Systems/UserProfiles/TEASERProfiles.mo @@ -23,7 +23,9 @@ model TEASERProfiles "Standard TEASER Profiles" rotation=180, origin={30,30}))); - Modelica.Blocks.Sources.Constant conTSetZone[nZones](k=TSetZone_nominal) + Modelica.Blocks.Sources.Constant conTSetZone[nZones]( + k(each unit="K", each displayUnit="K")=TSetZone_nominal, + y(each unit="K", each displayUnit="K")) "Constant room set temperature" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=180, diff --git a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo index 42dd4150..a304d080 100644 --- a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo +++ b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo @@ -28,7 +28,7 @@ partial model PartialGetHeatGenerationCurve extent={{-10,-10},{10,10}}, rotation=180, origin={82,10}))); - Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.HeatingCurve + Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.IdealHeatingCurve heatingCurve( TSup_nominal=systemParameters.THydSup_nominal[1], TRet_nominal=systemParameters.THydSup_nominal[1] - 7, diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo new file mode 100644 index 00000000..66b5866d --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo @@ -0,0 +1,83 @@ +within BESMod.Utilities.TimeConstantEstimation.BaseClasses; +partial model PartialEstimation "Partial model for estimation of time constants" + extends BESMod.Systems.BaseClasses.PartialBuildingEnergySystem( + redeclare BESMod.Examples.DesignOptimization.AachenSystem systemParameters( + QBui_flow_nominal=building.QRec_flow_nominal, TSetDHW=293.15), + redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, + redeclare Systems.Demand.Building.TEASERThermalZone building( + ARoo=sum(building.zoneParam.ARoof), + redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen + oneZoneParam, + hBui=sum(building.zoneParam.VAir)^(1/3), + ABui=sum(building.zoneParam.VAir)^(2/3), + T_start=293.15 - dTStepSet), + redeclare BESMod.Systems.Control.NoControl control, + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic(redeclare + BESMod.Systems.Hydraulical.Generation.ElectricalHeater generation( + dTTra_nominal={max(hydraulic.transfer.dTTra_nominal)}, + f_design={2}, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHea, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum), + redeclare + BESMod.Utilities.TimeConstantEstimation.BaseClasses.TimeConstantEstimationControl + control), + redeclare Systems.Demand.DHW.StandardProfiles DHW( + redeclare BESMod.Systems.Demand.DHW.RecordsCollection.NoDHW DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic + calcmFlow), + redeclare + BESMod.Utilities.TimeConstantEstimation.BaseClasses.ProfilesWithStep + userProfiles(dTStep=dTStepSet, startTime=startTimeTSet), + redeclare BESMod.Systems.RecordsCollection.ParameterStudy.NoStudy + parameterStudy, + redeclare final package MediumDHW = AixLib.Media.Water, + redeclare final package MediumZone = AixLib.Media.Air, + redeclare final package MediumHyd = AixLib.Media.Water, + redeclare BESMod.Systems.Ventilation.NoVentilation ventilation, + weaDat( + TDryBulSou=IBPSA.BoundaryConditions.Types.DataSource.Input, + TDewPoiSou=IBPSA.BoundaryConditions.Types.DataSource.Input, + TBlaSkySou=IBPSA.BoundaryConditions.Types.DataSource.Input, + relHumSou=IBPSA.BoundaryConditions.Types.DataSource.Parameter, + relHum=0, + winSpeSou=IBPSA.BoundaryConditions.Types.DataSource.Parameter, + winSpe=0, + HInfHorSou=if use_solGai then IBPSA.BoundaryConditions.Types.DataSource.File else IBPSA.BoundaryConditions.Types.DataSource.Parameter, + HInfHor=0, + HSou=if use_solGai then IBPSA.BoundaryConditions.Types.RadiationDataSource.File else IBPSA.BoundaryConditions.Types.RadiationDataSource.Input_HGloHor_HDifHor)); + + extends Modelica.Icons.Example; + + parameter Modelica.Units.SI.TemperatureDifference dTStepSet=2 + "Temperature difference of step"; + parameter Modelica.Units.SI.TemperatureDifference dTStepOda=2 + "Temperature difference of step"; + parameter Modelica.Units.SI.Temperature TOda_start=systemParameters.TSetZone_nominal[1] annotation (Evaluate=false); + parameter Modelica.Units.SI.Time startTimeTOda=Modelica.Constants.inf + "Start time outdoor temperature step"; + parameter Modelica.Units.SI.Time startTimeTSet=86400*2 + "Start time of step in TSetZone"; + parameter Boolean use_solGai = false "=true to activate solar gains from weather file"; + + Modelica.Blocks.Sources.Constant consNultIrr(each final k=0) "No irradiation" + annotation (Placement(transformation(extent={{-320,18},{-298,40}}))); + Modelica.Blocks.Sources.Step consNultIrr1( + height=-dTStepOda, offset=TOda_start, + startTime=startTimeTOda) "No irradiation" + annotation (Placement(transformation(extent={{-322,82},{-300,104}}))); +equation + connect(consNultIrr.y, weaDat.HGloHor_in) annotation (Line(points={{-296.9,29},{ + -292.45,29},{-292.45,31},{-283,31}}, color={0,0,127})); + connect(consNultIrr.y, weaDat.HDifHor_in) annotation (Line(points={{-296.9,29},{ + -288.45,29},{-288.45,41.5},{-283,41.5}}, color={0,0,127})); + connect(consNultIrr1.y, weaDat.TDewPoi_in) annotation (Line(points={{-298.9,93}, + {-298.9,90},{-283,90},{-283,103.6}}, color={0,0,127})); + connect(consNultIrr1.y, weaDat.TDryBul_in) annotation (Line(points={{-298.9,93}, + {-291.45,93},{-291.45,97},{-283,97}}, color={0,0,127})); + connect(consNultIrr1.y, weaDat.TBlaSky_in) annotation (Line(points={{-298.9,93}, + {-291.45,93},{-291.45,91},{-283,91}}, color={0,0,127})); + +end PartialEstimation; diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo new file mode 100644 index 00000000..6e96e163 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo @@ -0,0 +1,34 @@ +within BESMod.Utilities.TimeConstantEstimation.BaseClasses; +model ProfilesWithStep "User profile with a step and no internal gains" + extends Systems.UserProfiles.BaseClasses.PartialUserProfiles; + parameter Modelica.Units.SI.TemperatureDifference dTStep "Temperature difference of step"; + parameter Modelica.Units.SI.Time startTime=0 "Start time of step"; + Modelica.Blocks.Sources.Step conTSetZone[nZones]( + each height=dTStep, + offset=TSetZone_nominal .- dTStep, + y(each unit="K", each displayUnit="K"), + each startTime=startTime) "Constant room set temperature" + annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-10,-50}))); + + Modelica.Blocks.Sources.Constant conIntGai[3](each final k=0) + "Constant no internal gains" annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-10,-10}))); +equation + connect(conTSetZone.y, useProBus.TZoneSet) annotation (Line(points={{1,-50},{ + 115,-50},{115,-1}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(conIntGai.y, useProBus.intGains) annotation (Line(points={{1,-10},{62,-10}, + {62,-1},{115,-1}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); +end ProfilesWithStep; diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/TimeConstantEstimationControl.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/TimeConstantEstimationControl.mo new file mode 100644 index 00000000..2cef0fd8 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/TimeConstantEstimationControl.mo @@ -0,0 +1,83 @@ +within BESMod.Utilities.TimeConstantEstimation.BaseClasses; +model TimeConstantEstimationControl + "Control model to help time constant estimation" + extends Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl(redeclare + BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled + valCtrl); + replaceable parameter + Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition parPID + "PID parameters for boiler" annotation (choicesAllMatching=true, Placement( + transformation(extent={{142,84},{162,104}}))); + replaceable + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.IdealHeatingCurve + supTSet constrainedby + Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.PartialSetpoint( + final nZones=parTra.nParallelDem, + final TSup_nominal=max(parTra.TTra_nominal), + final TRet_nominal=max(parTra.TTra_nominal - parTra.dTTra_nominal), + final TOda_nominal=parGen.TOda_nominal, + final nHeaTra=parTra.nHeaTra) "Supply set temperature" annotation (Placement( + transformation(extent={{-160,20},{-140,40}})), choicesAllMatching=true); + BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.PID PIDCtrl( + yMax=parPID.yMax, + yOff=parPID.yOff, + y_start=parPID.y_start, + P=parPID.P, + yMin=parPID.yMin, + timeInt=parPID.timeInt, + Ni=parPID.Ni, + timeDer=parPID.timeDer, + Nd=parPID.Nd) "PID control" annotation (choicesAllMatching=true, Placement( + transformation(extent={{42,22},{78,58}}))); + + Modelica.Blocks.Sources.Constant const(k=1) + annotation (Placement(transformation(extent={{-220,-60},{-200,-40}}))); + Modelica.Blocks.Sources.BooleanConstant booleanConstant(k=true) + annotation (Placement(transformation(extent={{-20,20},{0,40}}))); +equation + connect(supTSet.TOda, weaBus.TDryBul) annotation (Line(points={{-162,30},{-236.895, + 30},{-236.895,2.11}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + + connect(supTSet.TZoneMea, buiMeaBus.TZoneMea) annotation (Line(points={{-162,38}, + {-234,38},{-234,40},{-242,40},{-242,103},{65,103}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(supTSet.TZoneSet, useProBus.TZoneSet) annotation (Line(points={{-162,22}, + {-236,22},{-236,24},{-238,24},{-238,103},{-119,103}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(const.y, sigBusGen.uPump) annotation (Line(points={{-199,-50},{-152,-50}, + {-152,-99}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(PIDCtrl.TMea, sigBusGen.TGenOutMea) annotation (Line(points={{60,18.4},{ + 60,-26},{-152,-26},{-152,-99}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-3,-6},{-3,-6}}, + horizontalAlignment=TextAlignment.Right)); + connect(PIDCtrl.ySet, sigBusGen.uEleHea) annotation (Line(points={{79.8,40},{88, + 40},{88,-22},{-152,-22},{-152,-99}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(booleanConstant.y, PIDCtrl.setOn) annotation (Line(points={{1,30},{18.5, + 30},{18.5,40},{38.4,40}}, color={255,0,255})); + connect(booleanConstant.y, PIDCtrl.isOn) annotation (Line(points={{1,30},{18,30}, + {18,2},{49.2,2},{49.2,18.4}}, color={255,0,255})); + connect(PIDCtrl.TSet, supTSet.TSet) annotation (Line(points={{38.4,50.8},{-112,50.8}, + {-112,30},{-139,30}}, color={0,0,127})); +end TimeConstantEstimationControl; diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.mo new file mode 100644 index 00000000..ee60d00a --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.mo @@ -0,0 +1,4 @@ +within BESMod.Utilities.TimeConstantEstimation; +package BaseClasses "Partial models for time constant estimation" + extends Modelica.Icons.BasesPackage; +end BaseClasses; diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.order b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.order new file mode 100644 index 00000000..b5d3e7fd --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.order @@ -0,0 +1,3 @@ +ProfilesWithStep +PartialEstimation +TimeConstantEstimationControl diff --git a/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/ConstantSupply.mo b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/ConstantSupply.mo new file mode 100644 index 00000000..a62086ea --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/ConstantSupply.mo @@ -0,0 +1,8 @@ +within BESMod.Utilities.TimeConstantEstimation.UnderfloorHeating; +model ConstantSupply + extends Partial(hydraulic(control(redeclare + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.Constant + supTSet(TConSup=TConSup)))); + parameter Modelica.Units.SI.Temperature TConSup=45 + "Constant supply temperature" annotation (Evaluate=false); +end ConstantSupply; diff --git a/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/HeatingCurve.mo b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/HeatingCurve.mo new file mode 100644 index 00000000..ebf71af4 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/HeatingCurve.mo @@ -0,0 +1,8 @@ +within BESMod.Utilities.TimeConstantEstimation.UnderfloorHeating; +model HeatingCurve + extends Partial(hydraulic(control(redeclare + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.IdealHeatingCurve + supTSet(dTAddCon=dTAddCon)))); + parameter Modelica.Units.SI.TemperatureDifference dTAddCon=5 + "Constant supply temperature" annotation (Evaluate=false); +end HeatingCurve; diff --git a/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/Partial.mo b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/Partial.mo new file mode 100644 index 00000000..5185b0b2 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/Partial.mo @@ -0,0 +1,33 @@ +within BESMod.Utilities.TimeConstantEstimation.UnderfloorHeating; +partial model Partial "Estimate UFH time constants" + extends BaseClasses.PartialEstimation( + startTimeTSet=86400*3 + 3600*5, + use_solGai=false, + TOda_start=268.15, + hydraulic( + T_start=308.15, + redeclare BESMod.Systems.Hydraulical.Distribution.BuildingOnly distribution( + nParallelDem=1), + redeclare BESMod.Systems.Hydraulical.Transfer.UFHTransferSystem transfer( + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.DefaultUFHData + UFHParameters, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData + parTra), + control( + valCtrl(k={0.5}), + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicBoilerPI + parPID( + yMin=0, + P=0.05, + timeInt=100))), + systemParameters(THydSup_nominal={308.15}, + use_dhw=false)); + annotation (experiment( + StopTime=864000, + Interval=600, + __Dymola_Algorithm="Dassl")); +end Partial; diff --git a/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/SmartThermostat.mo b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/SmartThermostat.mo new file mode 100644 index 00000000..20fe83be --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/SmartThermostat.mo @@ -0,0 +1,20 @@ +within BESMod.Utilities.TimeConstantEstimation.UnderfloorHeating; +model SmartThermostat "Smart thermotat PI control estimation" + extends Partial(hydraulic(control(redeclare + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.SingleZonePID + supTSet(parPID=parPID)))); + replaceable parameter BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI + parPID( + yMax=273.15 + 45, + yOff=293.15, + y_start=293.15, + yMin=293.15, + P=P, + timeInt=timeInt) + "PID parameters for smart thermostat" + annotation (choicesAllMatching=true); + parameter Modelica.Units.SI.Time timeInt=1200 + "Time constant of Integrator block" annotation (Dialog(tab="Advanced")); + parameter Real P=0.3 "Gain of PID-controller" + annotation (Dialog(tab="Advanced")); +end SmartThermostat; diff --git a/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/package.mo b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/package.mo new file mode 100644 index 00000000..4b9affd6 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/package.mo @@ -0,0 +1,3 @@ +within BESMod.Utilities.TimeConstantEstimation; +package UnderfloorHeating "Package with estimation for underfloor heating models" +end UnderfloorHeating; diff --git a/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/package.order b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/package.order new file mode 100644 index 00000000..32ad3da6 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/package.order @@ -0,0 +1,4 @@ +SmartThermostat +HeatingCurve +ConstantSupply +Partial diff --git a/BESMod/Utilities/TimeConstantEstimation/package.mo b/BESMod/Utilities/TimeConstantEstimation/package.mo new file mode 100644 index 00000000..4b7d3bd7 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/package.mo @@ -0,0 +1,3 @@ +within BESMod.Utilities; +package TimeConstantEstimation "Package to estimate time constants in the system" +end TimeConstantEstimation; diff --git a/BESMod/Utilities/TimeConstantEstimation/package.order b/BESMod/Utilities/TimeConstantEstimation/package.order new file mode 100644 index 00000000..e0a3ae45 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/package.order @@ -0,0 +1,2 @@ +UnderfloorHeating +BaseClasses diff --git a/BESMod/Utilities/package.order b/BESMod/Utilities/package.order index dec94b7f..3d39eacc 100644 --- a/BESMod/Utilities/package.order +++ b/BESMod/Utilities/package.order @@ -4,3 +4,4 @@ Icons KPIs OpenModelicaErrors SupervisoryControl +TimeConstantEstimation From 164122319f460475d42a5d6d76aaec81288a076c Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Wed, 17 Jan 2024 11:00:35 +0100 Subject: [PATCH 116/131] add radiator time estimation and split k and P --- .../BaseClasses/PartialSetpoint.mo | 2 +- .../SingleZonePID.mo | 19 +++++------ .../Components/RelativeSpeedController/PID.mo | 4 +-- .../RecordsCollection/BasicBoilerPI.mo | 2 +- .../RecordsCollection/BasicHeatPumpPI.mo | 2 +- .../RecordsCollection/SmartThermostatPI.mo | 13 +++++++ .../Control/RecordsCollection/package.order | 1 + BESMod/Utilities/HeatGeneration/package.mo | 8 ----- .../BaseClasses/ProfilesWithStep.mo | 27 ++++++++------- .../Radiator/HeatingCurve.mo | 8 +++++ .../Radiator/Partial.mo | 34 +++++++++++++++++++ .../Radiator/SmartThermostat.mo | 14 ++++++++ .../Radiator/package.mo | 3 ++ .../Radiator/package.order | 3 ++ .../UnderfloorHeating/SmartThermostat.mo | 22 +++++------- .../TimeConstantEstimation/package.order | 1 + BESMod/Utilities/package.order | 1 - 17 files changed, 112 insertions(+), 52 deletions(-) create mode 100644 BESMod/Systems/Hydraulical/Control/RecordsCollection/SmartThermostatPI.mo delete mode 100644 BESMod/Utilities/HeatGeneration/package.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/Radiator/Partial.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/Radiator/package.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/Radiator/package.order diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/PartialSetpoint.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/PartialSetpoint.mo index 93184f89..87dada43 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/PartialSetpoint.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/BaseClasses/PartialSetpoint.mo @@ -1,5 +1,5 @@ within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses; -model PartialSetpoint +partial model PartialSetpoint parameter Integer nZones "Number of heated zones"; parameter Modelica.Units.SI.Temperature TSup_nominal "Nominal supply temperature"; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo index 5f1b46cc..3c1623ba 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingSupplyTemperatureSetpoints/SingleZonePID.mo @@ -1,28 +1,25 @@ within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints; model SingleZonePID "Single zone PID controller" - extends BaseClasses.PartialSetpoint; + extends BaseClasses.PartialSetpoint(nZones=1); replaceable parameter RecordsCollection.PIDBaseDataDefinition parPID - constrainedby RecordsCollection.PIDBaseDataDefinition( - final yMax=TSup_nominal, - final yOff=293.15, - final y_start=TSup_nominal, - final yMin=293.15, - final timeDer=0, - final Nd=10) "PID parameters" + constrainedby RecordsCollection.PIDBaseDataDefinition "PID parameters" annotation (choicesAllMatching=true, Placement(transformation(extent={{42,22}, {58,38}}))); Modelica.Blocks.Continuous.LimPID PI( final controllerType=Modelica.Blocks.Types.SimpleController.PI, final k=parPID.P, - final Ti=parPID.timeInt, - final Td=parPID.timeDer, + final Ti=parPID.timeInt*parPID.P, + final Td=parPID.timeDer/parPID.P, final yMax=parPID.yMax, final yMin=parPID.yMin, final wp=1, final Ni=parPID.Ni, - final Nd=parPID.Nd) "PI control" + final Nd=parPID.Nd, + y_start=parPID.y_start, + homotopyType=Modelica.Blocks.Types.LimiterHomotopy.NoHomotopy) + "PI control" annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); initial equation assert(nZones==1, "Model only supports single zones", AssertionLevel.error); diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo index 00e64b62..3b6b6c70 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo @@ -13,8 +13,8 @@ model PID "PID controller for inverter controlled devices" PID( controllerType=Modelica.Blocks.Types.SimpleController.PID, final k=P, - final Ti=timeInt, - final Td=timeDer, + final Ti=timeInt*P, + final Td=timeDer/P, final yMax=yMax, final yMin=yMin, final wp=1, diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicBoilerPI.mo b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicBoilerPI.mo index 76912d1d..f7b156bf 100644 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicBoilerPI.mo +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicBoilerPI.mo @@ -4,7 +4,7 @@ record BasicBoilerPI "Currently used PI values for a boiler" Nd=10, timeDer=0, Ni=0.9, - timeInt=1200, + timeInt=600, P=2, y_start=0, yOff=0, diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicHeatPumpPI.mo b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicHeatPumpPI.mo index 731e2d38..e13c0215 100644 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicHeatPumpPI.mo +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/BasicHeatPumpPI.mo @@ -2,7 +2,7 @@ within BESMod.Systems.Hydraulical.Control.RecordsCollection; record BasicHeatPumpPI "Typically good PI values for a heat pump" extends PIDBaseDataDefinition( timeDer=0, - timeInt=1200, + timeInt=4000, P=0.3, y_start=0, yOff=0, diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/SmartThermostatPI.mo b/BESMod/Systems/Hydraulical/Control/RecordsCollection/SmartThermostatPI.mo new file mode 100644 index 00000000..99ab7409 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/SmartThermostatPI.mo @@ -0,0 +1,13 @@ +within BESMod.Systems.Hydraulical.Control.RecordsCollection; +record SmartThermostatPI + "Typically good PI values for a smart thermostat" + extends PIDBaseDataDefinition( + timeInt=500, + P=1, + yMax=273.15 + 55, + final yOff=293.15, + final y_start=yMax, + final yMin=293.15, + final timeDer=0, + final Nd=10); +end SmartThermostatPI; diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order b/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order index a80fd535..ac08c7ff 100644 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/package.order @@ -3,3 +3,4 @@ BasicHeatPumpPI DefaultSafetyControl HeatPumpSafetyControl PIDBaseDataDefinition +SmartThermostatPI diff --git a/BESMod/Utilities/HeatGeneration/package.mo b/BESMod/Utilities/HeatGeneration/package.mo deleted file mode 100644 index abdf1e27..00000000 --- a/BESMod/Utilities/HeatGeneration/package.mo +++ /dev/null @@ -1,8 +0,0 @@ -within BESMod.Utilities; -package HeatGeneration - extends Modelica.Icons.InternalPackage; - -annotation (Documentation(info=" -

Note: The models in this package are used to scale the heat pump model from the IBPSA according to the heating curve in use. However, the model will be obsolete with the integration of the heat pump model into the IBPSA library. Hence, these functions will be deleted in future versions as well.

-")); -end HeatGeneration; diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo index 6e96e163..c4d85b98 100644 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo @@ -3,30 +3,31 @@ model ProfilesWithStep "User profile with a step and no internal gains" extends Systems.UserProfiles.BaseClasses.PartialUserProfiles; parameter Modelica.Units.SI.TemperatureDifference dTStep "Temperature difference of step"; parameter Modelica.Units.SI.Time startTime=0 "Start time of step"; - Modelica.Blocks.Sources.Step conTSetZone[nZones]( - each height=dTStep, - offset=TSetZone_nominal .- dTStep, - y(each unit="K", each displayUnit="K"), - each startTime=startTime) "Constant room set temperature" - annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={-10,-50}))); Modelica.Blocks.Sources.Constant conIntGai[3](each final k=0) "Constant no internal gains" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=180, origin={-10,-10}))); + Modelica.Blocks.Sources.Pulse nigSetBakTSetZone[nZones]( + each amplitude=-dTStep, + width=100*8/24, + period=86400, + offset=TSetZone_nominal, + startTime=startTime) "Constant room set temperature" + annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=180, + origin={-10,-50}))); equation - connect(conTSetZone.y, useProBus.TZoneSet) annotation (Line(points={{1,-50},{ - 115,-50},{115,-1}}, color={0,0,127}), Text( + connect(conIntGai.y, useProBus.intGains) annotation (Line(points={{1,-10},{62,-10}, + {62,-1},{115,-1}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(conIntGai.y, useProBus.intGains) annotation (Line(points={{1,-10},{62,-10}, - {62,-1},{115,-1}}, color={0,0,127}), Text( + connect(nigSetBakTSetZone.y, useProBus.TZoneSet) annotation (Line(points={{1, + -50},{116,-50},{116,-54},{115,-54},{115,-1}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo b/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo new file mode 100644 index 00000000..838d85e7 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo @@ -0,0 +1,8 @@ +within BESMod.Utilities.TimeConstantEstimation.Radiator; +model HeatingCurve + extends Partial(hydraulic(control(redeclare + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.IdealHeatingCurve + supTSet(dTAddCon=dTAddCon)))); + parameter Modelica.Units.SI.TemperatureDifference dTAddCon=5 + "Constant supply temperature" annotation (Evaluate=false); +end HeatingCurve; diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/Partial.mo b/BESMod/Utilities/TimeConstantEstimation/Radiator/Partial.mo new file mode 100644 index 00000000..96b104a9 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/Partial.mo @@ -0,0 +1,34 @@ +within BESMod.Utilities.TimeConstantEstimation.Radiator; +partial model Partial "Estimate UFH time constants" + extends BaseClasses.PartialEstimation( + startTimeTSet=86400*3 + 3600*5, + use_solGai=false, + TOda_start=268.15, + hydraulic( + T_start=273.15 + 55, + redeclare BESMod.Systems.Hydraulical.Distribution.BuildingOnly distribution( + nParallelDem=1), + redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased + transfer( + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData + parTra, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + parRad), + control( + valCtrl(k={0.5}), + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicBoilerPI + parPID( + yMin=0, + P=0.05, + timeInt=100))), + systemParameters(THydSup_nominal={328.15}, + use_dhw=false)); + annotation (experiment( + StopTime=864000, + Interval=600, + __Dymola_Algorithm="Dassl")); +end Partial; diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo b/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo new file mode 100644 index 00000000..f3024eef --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo @@ -0,0 +1,14 @@ +within BESMod.Utilities.TimeConstantEstimation.Radiator; +model SmartThermostat "Smart thermotat PI control estimation" + extends Partial(hydraulic(control(redeclare + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.SingleZonePID + supTSet(redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.SmartThermostatPI + parPID( + yMax=273.15 + 70, + P=P, + timeInt=timeInt)))), systemParameters(QBui_flow_nominal={11000})); + parameter Modelica.Units.SI.Time timeInt=1200 + "Time constant of Integrator block"; + parameter Real P=0.3 "Gain of PID-controller"; +end SmartThermostat; diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/package.mo b/BESMod/Utilities/TimeConstantEstimation/Radiator/package.mo new file mode 100644 index 00000000..6816e162 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/package.mo @@ -0,0 +1,3 @@ +within BESMod.Utilities.TimeConstantEstimation; +package Radiator "Package with estimation for raditor models" +end Radiator; diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/package.order b/BESMod/Utilities/TimeConstantEstimation/Radiator/package.order new file mode 100644 index 00000000..44adfe18 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/package.order @@ -0,0 +1,3 @@ +SmartThermostat +HeatingCurve +Partial diff --git a/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/SmartThermostat.mo b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/SmartThermostat.mo index 20fe83be..6a5040b7 100644 --- a/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/SmartThermostat.mo +++ b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/SmartThermostat.mo @@ -2,19 +2,13 @@ within BESMod.Utilities.TimeConstantEstimation.UnderfloorHeating; model SmartThermostat "Smart thermotat PI control estimation" extends Partial(hydraulic(control(redeclare BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.SingleZonePID - supTSet(parPID=parPID)))); - replaceable parameter BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI - parPID( - yMax=273.15 + 45, - yOff=293.15, - y_start=293.15, - yMin=293.15, - P=P, - timeInt=timeInt) - "PID parameters for smart thermostat" - annotation (choicesAllMatching=true); + supTSet(redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.SmartThermostatPI + parPID( + yMax=273.15 + 45, + P=P, + timeInt=timeInt)))), systemParameters(QBui_flow_nominal={11000})); parameter Modelica.Units.SI.Time timeInt=1200 - "Time constant of Integrator block" annotation (Dialog(tab="Advanced")); - parameter Real P=0.3 "Gain of PID-controller" - annotation (Dialog(tab="Advanced")); + "Time constant of Integrator block"; + parameter Real P=0.3 "Gain of PID-controller"; end SmartThermostat; diff --git a/BESMod/Utilities/TimeConstantEstimation/package.order b/BESMod/Utilities/TimeConstantEstimation/package.order index e0a3ae45..96b66ed8 100644 --- a/BESMod/Utilities/TimeConstantEstimation/package.order +++ b/BESMod/Utilities/TimeConstantEstimation/package.order @@ -1,2 +1,3 @@ UnderfloorHeating BaseClasses +Radiator diff --git a/BESMod/Utilities/package.order b/BESMod/Utilities/package.order index 3d39eacc..19aa2e3f 100644 --- a/BESMod/Utilities/package.order +++ b/BESMod/Utilities/package.order @@ -1,5 +1,4 @@ Electrical -HeatGeneration Icons KPIs OpenModelicaErrors From 7f852480974f4863c507170899f3322efbb1a40d Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Wed, 17 Jan 2024 11:01:44 +0100 Subject: [PATCH 117/131] remove final storage volume to allow custom sizes --- .../Distribution/BaseClasses/PartialTwoStorageParallel.mo | 2 +- .../Hydraulical/Distribution/DistributionTwoStorageParallel.mo | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo index 3c99b6dd..68afe4f5 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo @@ -68,7 +68,7 @@ partial model PartialTwoStorageParallel "Partial model to later extent" final VPerQ_flow=0, final rho=rho, final c_p=cp, - final V=if designType == Types.DHWDesignType.FullStorage then VDHWDay* + V=if designType == Types.DHWDesignType.FullStorage then VDHWDay* fFullSto else VDHWDay, final TAmb=TAmb, T_m=TDHW_nominal, diff --git a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo index 0000cab8..b238757f 100644 --- a/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/DistributionTwoStorageParallel.mo @@ -122,7 +122,7 @@ model DistributionTwoStorageParallel final c_p=cp, final TAmb=TAmb, final QHC1_flow_nominal=QDHW_flow_nominal, - final V=if designType == Types.DHWDesignType.FullStorage then VDHWDay * fFullSto else VDHWDay, + V=if designType == Types.DHWDesignType.FullStorage then VDHWDay * fFullSto else VDHWDay, final Q_flow_nominal=0, final VPerQ_flow=0, final T_m=TDHW_nominal, From 7a43ed4bac7ba852f9e6013ce76a0a4b13dc8861 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Fri, 19 Jan 2024 15:48:40 +0100 Subject: [PATCH 118/131] fix time zone --- .../PartialModelicaConferenceUseCase.mo | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index 1c9a0855..eb83ed00 100644 --- a/BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -7,14 +7,17 @@ partial model PartialModelicaConferenceUseCase redeclare BuildingSystems.Technologies.ElectricalStorages.Data.LithiumIon.LithiumIonTeslaPowerwall1 batteryParameters), - redeclare BESMod.Systems.Electrical.Generation.PVSystemMultiSub generation( + redeclare BESMod.Systems.Electrical.Generation.PVSystemMultiSub + generation( redeclare model CellTemperature = AixLib.Electrical.PVSystem.BaseClasses.CellTemperatureMountingContactToGround, + redeclare AixLib.DataBase.SolarElectric.SchuecoSPV170SME1 pVParameters, + lat=weaDat.lat, lon=weaDat.lon, alt=weaDat.alt, - timZon=3600, + timZon=weaDat.timZon, ARoo=building.ARoo/2), redeclare BESMod.Systems.Electrical.Transfer.NoElectricalTransfer transfer, redeclare BESMod.Systems.Electrical.Control.NoControl control), From 9ecadabb0b7f2ea0c4746569eb71e3449712f63f Mon Sep 17 00:00:00 2001 From: FWuellhorst Date: Tue, 30 Jan 2024 09:29:04 +0100 Subject: [PATCH 119/131] Fix wrong enable annotation --- .../RecordsCollection/SystemParametersBaseDataDefinition.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BESMod/Systems/RecordsCollection/SystemParametersBaseDataDefinition.mo b/BESMod/Systems/RecordsCollection/SystemParametersBaseDataDefinition.mo index ba32fd45..7594bc61 100644 --- a/BESMod/Systems/RecordsCollection/SystemParametersBaseDataDefinition.mo +++ b/BESMod/Systems/RecordsCollection/SystemParametersBaseDataDefinition.mo @@ -64,7 +64,7 @@ record SystemParametersBaseDataDefinition parameter Boolean use_hydraulic=true "=false to disable hydraulic subsystem" annotation(Dialog(group="System layout")); parameter Boolean use_ventilation=true "=false to disable ventilation subsystem" annotation(Dialog(group="System layout")); parameter Boolean use_dhw=use_hydraulic "=false to disable DHW subsystem" annotation(Dialog(group="System layout", enable=use_hydraulic)); - parameter Boolean use_elecHeating=true "= false to disable heating using the electric system" annotation(Dialog(group="System layout", enable=use_hydraulic)); + parameter Boolean use_elecHeating=true "= false to disable heating using the electric system" annotation(Dialog(group="System layout")); annotation (defaultComponentName = "baseParameterAssumptions", Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram(graphics, coordinateSystem(preserveAspectRatio=false))); From 4658e01e79118ae309a74291503656f9d88ff490 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sun, 25 Feb 2024 17:08:58 +0100 Subject: [PATCH 120/131] better default no dhw values --- BESMod/Systems/Demand/DHW/RecordsCollection/NoDHW.mo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BESMod/Systems/Demand/DHW/RecordsCollection/NoDHW.mo b/BESMod/Systems/Demand/DHW/RecordsCollection/NoDHW.mo index 34436bdf..37ecf70b 100644 --- a/BESMod/Systems/Demand/DHW/RecordsCollection/NoDHW.mo +++ b/BESMod/Systems/Demand/DHW/RecordsCollection/NoDHW.mo @@ -1,11 +1,11 @@ within BESMod.Systems.Demand.DHW.RecordsCollection; record NoDHW extends BESMod.Systems.Demand.DHW.RecordsCollection.PartialDHWTap( - QCrit=1, + QCrit=0, tCrit=1, - final m_flow_nominal=1, + final m_flow_nominal=0.1, final table=[0,0,0,10,10; 86400,0,0,10,10], - final VDHWDay=1); + final VDHWDay=100e-3); annotation (Documentation(info="

Do not tap any DHW water. The defalt values for other parameters prevent division by zero errors in the automatic parameterization on system level. As no DHW will be used, it should not affect the system in any way.

")); From 8d1bef07ac6fed2d0609cfdb0029156771decff0 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Sun, 24 Mar 2024 16:04:16 +0100 Subject: [PATCH 121/131] add operative room temperature as control option is some cases --- .../Demand/Building/TEASERThermalZone.mo | 53 ++++++++++++++++++- .../PartialThermostaticValveControl.mo | 28 +++++++--- .../TimeConstantEstimationControl.mo | 25 ++++++--- .../Radiator/SmartThermostat.mo | 4 +- 4 files changed, 94 insertions(+), 16 deletions(-) diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index 57150255..3ce0afc4 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -168,11 +168,27 @@ model TEASERThermalZone extent={{-10,-10},{10,10}}, rotation=180, origin={114,62}))); + Modelica.Blocks.Math.Add calTOpe[nZones]( + final k1=0.5, + final k2=0.5, + y(unit="K", displayUnit="degC")) "Calculate operative room temperature" + 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}}))); equation for i in 1:nZones loop connect(weaBus.TDryBul, realPassThroughTDry[i].u) annotation (Line( - points={{-47,98},{-47,96},{134,96},{134,62},{126,62}}, + points={{-46.895,98.11},{-46.895,96},{134,96},{134,62},{126,62}}, color={255,204,51}, thickness=0.5), Text( string="%first", @@ -372,6 +388,41 @@ equation 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( + 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,-16},{-81,-16},{-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( + 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,44},{-52,44},{-52,28},{-46,28},{-46,6},{0,6},{0,99}}, + 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( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); 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/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo index 555a226a..e06841a8 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialThermostaticValveControl.mo @@ -2,6 +2,10 @@ within BESMod.Systems.Hydraulical.Control.BaseClasses; partial model PartialThermostaticValveControl "Only provide thermostatic valve control" extends PartialControl; + parameter Boolean useOpeTemCtrl=false + "=true to control the operative room temperature" + annotation (Dialog(group="Building control")); + replaceable BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.BaseClasses.PartialThermostaticValveController valCtrl constrainedby @@ -17,13 +21,23 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(valCtrl.TZoneMea, buiMeaBus.TZoneMea) annotation (Line(points={{120.4,-65.2}, - {120.4,-66},{76,-66},{76,-116},{-250,-116},{-250,118},{65,118},{65,103}}, - color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); + if useOpeTemCtrl then + connect(valCtrl.TZoneMea, buiMeaBus.TZoneOpeMea) annotation (Line(points={{120.4,-65.2}, + {120.4,-66},{76,-66},{76,-116},{-250,-116},{-250,118},{65,118},{65,103}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + else + connect(valCtrl.TZoneMea, buiMeaBus.TZoneMea) annotation (Line(points={{120.4,-65.2}, + {120.4,-66},{76,-66},{76,-116},{-250,-116},{-250,118},{65,118},{65,103}}, + color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + end if; connect(valCtrl.TZoneSet, useProBus.TZoneSet) annotation (Line(points={{120.4,-74.8}, {76,-74.8},{76,-116},{-250,-116},{-250,102},{-119,102},{-119,103}}, color={0,0,127}), Text( diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/TimeConstantEstimationControl.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/TimeConstantEstimationControl.mo index 2cef0fd8..06d93e6b 100644 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/TimeConstantEstimationControl.mo +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/TimeConstantEstimationControl.mo @@ -4,6 +4,7 @@ model TimeConstantEstimationControl extends Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl(redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled valCtrl); + parameter Boolean useOpeTemCtrl = false "=true to control the operative room temperature"; replaceable parameter Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition parPID "PID parameters for boiler" annotation (choicesAllMatching=true, Placement( @@ -41,14 +42,24 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); + if useOpeTemCtrl then + connect(supTSet.TZoneMea, buiMeaBus.TZoneOpeMea) annotation (Line(points={{-162,38}, + {-234,38},{-234,40},{-242,40},{-242,103},{65,103}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + else + connect(supTSet.TZoneMea, buiMeaBus.TZoneMea) annotation (Line(points={{-162,38}, + {-234,38},{-234,40},{-242,40},{-242,103},{65,103}}, color={0,0,127}), + Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); - connect(supTSet.TZoneMea, buiMeaBus.TZoneMea) annotation (Line(points={{-162,38}, - {-234,38},{-234,40},{-242,40},{-242,103},{65,103}}, color={0,0,127}), - Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); + end if; connect(supTSet.TZoneSet, useProBus.TZoneSet) annotation (Line(points={{-162,22}, {-236,22},{-236,24},{-238,24},{-238,103},{-119,103}}, color={0,0,127}), Text( diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo b/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo index f3024eef..47cc6a2a 100644 --- a/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo @@ -1,6 +1,8 @@ within BESMod.Utilities.TimeConstantEstimation.Radiator; model SmartThermostat "Smart thermotat PI control estimation" - extends Partial(hydraulic(control(redeclare + extends Partial( + dTStepSet=0, hydraulic(control(useOpeTemCtrl=true, + redeclare BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.SingleZonePID supTSet(redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.SmartThermostatPI From c1c04b074f14efa146bfd54fd57d1293f8371b07 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Thu, 28 Mar 2024 09:40:51 +0100 Subject: [PATCH 122/131] update default floor temperature, which is too cold as a default --- .../Hydraulical/Transfer/RecordsCollection/DefaultUFHData.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/DefaultUFHData.mo b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/DefaultUFHData.mo index 8734570e..aca2af1e 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/DefaultUFHData.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RecordsCollection/DefaultUFHData.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Transfer.RecordsCollection; record DefaultUFHData "For a well insulated retrofit building" extends UFHData( - T_floor=281.65, + T_floor=291.15, final diameter=18e-3, c_top_ratio=fill(0.19, nZones), C_ActivatedElement=fill(380000, nZones), From 986a343615ebcbfffe01771d90e6f44ae8eed903 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 10 Apr 2024 08:03:34 +0200 Subject: [PATCH 123/131] add custom radiator models to analyze impact of different radiation parts --- .../Demand/Building/TEASERThermalZone.mo | 9 +- .../ConstantOpening.mo | 12 + .../ThermostaticValveController/package.order | 1 + .../BaseClasses/CustomRadiator.mo | 178 +++++++ .../BaseClasses/PartialEstimation.mo | 9 +- .../BaseClasses/ProfilesWithStep.mo | 6 +- .../BaseClasses/RadiatorEN442_2.mo | 494 ++++++++++++++++++ .../TimeConstantEstimationControl.mo | 3 +- .../BaseClasses/package.order | 2 + .../Radiator/ConstantSupply.mo | 24 + .../Radiator/HeatingCurve.mo | 16 +- .../Radiator/Partial.mo | 9 +- .../Radiator/SmartThermostat.mo | 26 +- .../Radiator/package.order | 1 + 14 files changed, 770 insertions(+), 20 deletions(-) create mode 100644 BESMod/Systems/Hydraulical/Control/Components/ThermostaticValveController/ConstantOpening.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/BaseClasses/RadiatorEN442_2.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/Radiator/ConstantSupply.mo diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index 3ce0afc4..4109dc19 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -169,9 +169,10 @@ model TEASERThermalZone rotation=180, origin={114,62}))); Modelica.Blocks.Math.Add calTOpe[nZones]( - final k1=0.5, - final k2=0.5, - y(unit="K", displayUnit="degC")) "Calculate operative room temperature" + each final k1=0.5, + each final k2=0.5, + each y(unit="K", displayUnit="degC")) + "Calculate operative room temperature" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=180, @@ -410,7 +411,7 @@ equation extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(calTOpe.y, buiMeaBus.TZoneOpeMea) annotation (Line(points={{-81,30},{ - -88,30},{-88,44},{-52,44},{-52,28},{-46,28},{-46,6},{0,6},{0,99}}, + -88,30},{-88,92},{0,92},{0,99}}, color={0,0,127}), Text( string="%second", index=1, diff --git a/BESMod/Systems/Hydraulical/Control/Components/ThermostaticValveController/ConstantOpening.mo b/BESMod/Systems/Hydraulical/Control/Components/ThermostaticValveController/ConstantOpening.mo new file mode 100644 index 00000000..58d18765 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/ThermostaticValveController/ConstantOpening.mo @@ -0,0 +1,12 @@ +within BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController; +model ConstantOpening "Model with a constant opening of the valves" + extends BaseClasses.PartialThermostaticValveController; +protected + Modelica.Blocks.Sources.Constant const[nZones](each final k=conOpe) + annotation (Placement(transformation(extent={{-8,-10},{12,10}}))); +public + parameter Real conOpe=1 "Constant opening"; +equation + connect(const.y, opening) + annotation (Line(points={{13,0},{120,0}}, color={0,0,127})); +end ConstantOpening; diff --git a/BESMod/Systems/Hydraulical/Control/Components/ThermostaticValveController/package.order b/BESMod/Systems/Hydraulical/Control/Components/ThermostaticValveController/package.order index 7244be22..954b9399 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/ThermostaticValveController/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/ThermostaticValveController/package.order @@ -1,3 +1,4 @@ +ConstantOpening ThermostaticValvePControlled ThermostaticValvePIControlled BaseClasses diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo new file mode 100644 index 00000000..bd550592 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo @@ -0,0 +1,178 @@ +within BESMod.Utilities.TimeConstantEstimation.BaseClasses; +model CustomRadiator "Custom radiator with radiative fractions" + // Abui =1 and hBui =1 to avaoid warnings, will be overwritten anyway + extends Systems.Hydraulical.Transfer.BaseClasses.PartialTransfer( + nHeaTra=parRad.n, + ABui=1, + hBui=1, + final dp_nominal=parTra.dp_nominal, + final nParallelSup=1); + parameter Boolean use_preRelVal=false "=false to disable pressure relief valve" + annotation(Dialog(group="Component choices")); + parameter Real perPreRelValOpens=0.99 + "Percentage of nominal pressure difference at which the pressure relief valve starts to open" + annotation(Dialog(group="Component choices", enable=use_preRelVal)); + replaceable parameter + Systems.Hydraulical.Transfer.RecordsCollection.TransferDataBaseDefinition parTra + constrainedby + Systems.Hydraulical.Transfer.RecordsCollection.TransferDataBaseDefinition( + final Q_flow_nominal=Q_flow_nominal .* f_design, + final nZones=nParallelDem, + final AFloor=ABui, + final heiBui=hBui, + mRad_flow_nominal=m_flow_nominal, + mHeaCir_flow_nominal=mSup_flow_nominal[1]) "Transfer parameters" + annotation ( + Dialog(group="Component data"), + choicesAllMatching=true, + Placement(transformation(extent={{-62,-98},{-42,-78}}))); + + replaceable parameter + BESMod.Systems.RecordsCollection.Movers.MoverBaseDataDefinition + parPum annotation (Dialog(group="Component data"), + choicesAllMatching=true, Placement(transformation(extent={{-98,78}, + {-72,100}}))); + + replaceable parameter BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + parRad + annotation (Dialog(group="Component data"), choicesAllMatching=true, + Placement(transformation(extent={{-100,-98},{-80,-78}}))); + RadiatorEN442_2 rad[nParallelDem]( + each final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=m_flow_nominal, + each final show_T=show_T, + each final energyDynamics=energyDynamics, + each final p_start=p_start, + each final nEle=parRad.nEle, + fraRad_nominal=parRad.fraRad, + final Q_flow_nominal=Q_flow_nominal .* f_design, + final T_a_nominal=TTra_nominal, + final T_b_nominal=TTra_nominal .- dTTra_nominal, + final TAir_nominal=TDem_nominal, + final TRad_nominal=TDem_nominal, + each final n=parRad.n, + each final deltaM=0.3, + final dp_nominal=parTra.dpRad_nominal, + redeclare package Medium = Medium, + each final T_start=T_start) "Radiator" annotation (Placement(transformation( + extent={{11,11},{-11,-11}}, + rotation=90, + origin={-13,-25}))); + + IBPSA.Fluid.FixedResistances.PressureDrop res[nParallelDem]( + redeclare package Medium = Medium, + each final dp_nominal=parTra.dpHeaDistr_nominal, + final m_flow_nominal=m_flow_nominal) "Hydraulic resistance of supply" + annotation (Placement(transformation( + extent={{-12.5,-13.5},{12.5,13.5}}, + rotation=0, + origin={-34.5,37.5}))); + IBPSA.Fluid.Actuators.Valves.TwoWayLinear val[nParallelDem]( + redeclare package Medium = Medium, + each final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=m_flow_nominal, + each final show_T=show_T, + each final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, + final dpValve_nominal=parTra.dpHeaSysValve_nominal, + each final use_inputFilter=false, + final dpFixed_nominal=parTra.dpHeaSysPreValve_nominal, + each final l=parTra.leakageOpening) annotation (Placement(transformation( + extent={{-10,-11},{10,11}}, + rotation=270, + origin={-12,1}))); + + IBPSA.Fluid.MixingVolumes.MixingVolume vol( + redeclare package Medium = Medium, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final mSenFac=1, + final m_flow_nominal=sum(rad.m_flow_nominal), + final m_flow_small=1E-4*abs(sum(rad.m_flow_nominal)), + final allowFlowReversal=allowFlowReversal, + final V(displayUnit="l") = parTra.vol, + final use_C_flow=false, + nPorts=1 + nParallelDem) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-58,18}))); + IBPSA.Fluid.Movers.Preconfigured.SpeedControlled_y pump( + redeclare final package Medium = Medium, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final allowFlowReversal=allowFlowReversal, + final show_T=show_T, + final m_flow_nominal=sum(m_flow_nominal), + final dp_nominal=parTra.dpPumpHeaCir_nominal + dpSup_nominal[1], + final addPowerToMedium=parPum.addPowerToMedium, + final tau=parPum.tau, + final use_inputFilter=parPum.use_inputFilter, + final riseTime=parPum.riseTimeInpFilter, + final y_start=1) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-74,38}))); + + Modelica.Blocks.Sources.Constant m_flow1(k=1) annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-48,68}))); + + BESMod.Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) + annotation (Placement(transformation(extent={{34,-94},{54,-74}}))); + Systems.Hydraulical.Distribution.Components.Valves.PressureReliefValve pressureReliefValve( + redeclare final package Medium = Medium, + m_flow_nominal=mSup_flow_nominal[1], + final dpFullOpen_nominal=dp_nominal[1], + final dpThreshold_nominal=perPreRelValOpens*dp_nominal[1], + final facDpValve_nominal=parTra.valveAutho[1], + final l=parTra.leakageOpening) if use_preRelVal annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={-90,-10}))); +equation + connect(rad.heatPortRad, heatPortRad) annotation (Line(points={{-5.08,-27.2}, + {40,-27.2},{40,-40},{100,-40}}, color={191,0,0})); + connect(rad.heatPortCon, heatPortCon) annotation (Line(points={{-5.08,-22.8}, + {-5.08,-26},{40,-26},{40,40},{100,40}}, color={191,0,0})); + + for i in 1:nParallelDem loop + connect(rad[i].port_b, portTra_out[1]) annotation (Line(points={{-13,-36},{-13, + -42},{-100,-42}}, + color={0,127,255})); + connect(res[i].port_a, vol.ports[i + 1]) annotation (Line(points={{-47,37.5}, + {-56,37.5},{-56,28},{-58,28}}, color={0,127,255})); + end for; + + connect(val.port_b, rad.port_a) annotation (Line(points={{-12,-9},{-12,-13.5}, + {-13,-13.5},{-13,-14}}, color={0,127,255})); + connect(res.port_b, val.port_a) annotation (Line(points={{-22,37.5},{-12,37.5}, + {-12,11}}, color={0,127,255})); + connect(portTra_in[1],pump.port_a) + annotation (Line(points={{-100,38},{-84,38}}, color={0,127,255})); + connect(pump.port_b, vol.ports[1]) annotation (Line(points={{-64,38},{-62,38}, + {-62,28},{-58,28}}, color={0,127,255})); + + connect(m_flow1.y,pump. y) + annotation (Line(points={{-59,68},{-74,68},{-74,50}}, color={0,0,127})); + connect(val.y, traControlBus.opening) annotation (Line(points={{1.2,1},{8,1},{ + 8,74},{0,74},{0,100}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(realToElecCon.internalElectricalPin, internalElectricalPin) + annotation (Line( + points={{54.2,-83.8},{54.2,-84},{72,-84},{72,-98}}, + color={0,0,0}, + thickness=1)); + connect(realToElecCon.PEleLoa, pump.P) annotation (Line(points={{32,-80},{ + 22,-80},{22,47},{-63,47}}, color={0,0,127})); + connect(pressureReliefValve.port_b, portTra_out[1]) annotation (Line(points={{-90,-20}, + {-90,-42},{-100,-42}}, color={0,127,255})); + connect(pump.port_b, pressureReliefValve.port_a) annotation (Line(points={{-64,38}, + {-60,38},{-60,30},{-90,30},{-90,0}}, color={0,127,255})); +end CustomRadiator; diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo index 66b5866d..7dfd660d 100644 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo @@ -7,9 +7,10 @@ partial model PartialEstimation "Partial model for estimation of time constants" redeclare Systems.Demand.Building.TEASERThermalZone building( ARoo=sum(building.zoneParam.ARoof), redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen - oneZoneParam, + oneZoneParam(useConstantACHrate=true), hBui=sum(building.zoneParam.VAir)^(1/3), ABui=sum(building.zoneParam.VAir)^(2/3), + ventRate={0.3}, T_start=293.15 - dTStepSet), redeclare BESMod.Systems.Control.NoControl control, redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic(redeclare @@ -68,6 +69,12 @@ partial model PartialEstimation "Partial model for estimation of time constants" height=-dTStepOda, offset=TOda_start, startTime=startTimeTOda) "No irradiation" annotation (Placement(transformation(extent={{-322,82},{-300,104}}))); + +initial equation + building.thermalZone[1].ROM.extWallRC.thermCapExt[1].T = building.T_start; + building.thermalZone[1].ROM.floorRC.thermCapExt[1].T = building.T_start; + building.thermalZone[1].ROM.intWallRC.thermCapInt[1].T = building.T_start; + building.thermalZone[1].ROM.roofRC.thermCapExt[1].T = building.T_start; equation connect(consNultIrr.y, weaDat.HGloHor_in) annotation (Line(points={{-296.9,29},{ -292.45,29},{-292.45,31},{-283,31}}, color={0,0,127})); diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo index c4d85b98..08a73cb4 100644 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo @@ -11,10 +11,10 @@ model ProfilesWithStep "User profile with a step and no internal gains" origin={-10,-10}))); Modelica.Blocks.Sources.Pulse nigSetBakTSetZone[nZones]( each amplitude=-dTStep, - width=100*8/24, - period=86400, + each width=100*8/24, + each period=86400, offset=TSetZone_nominal, - startTime=startTime) "Constant room set temperature" + each startTime=startTime) "Constant room set temperature" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=180, diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/RadiatorEN442_2.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/RadiatorEN442_2.mo new file mode 100644 index 00000000..ed96086a --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/RadiatorEN442_2.mo @@ -0,0 +1,494 @@ +within BESMod.Utilities.TimeConstantEstimation.BaseClasses; +model RadiatorEN442_2 "Dynamic radiator for space heating" + extends IBPSA.Fluid.Interfaces.PartialTwoPortInterface( + show_T=true, + m_flow_nominal=abs(Q_flow_nominal/cp_nominal/(T_a_nominal-T_b_nominal))); + extends IBPSA.Fluid.Interfaces.LumpedVolumeDeclarations( + final X_start = Medium.X_default, + final C_start = fill(0, Medium.nC), + final C_nominal = fill(1E-2, Medium.nC), + final mSenFac = 1 + 500*mDry/(VWat*cp_nominal*Medium.density( + Medium.setState_pTX(Medium.p_default, Medium.T_default, Medium.X_default))), + final massDynamics=energyDynamics); + + constant Boolean homotopyInitialization = true "= true, use homotopy method" + annotation(HideResult=true); + + parameter Integer nEle(min=1) = 5 + "Number of elements used in the discretization"; + parameter Real fraRad_nominal(min=0, max=1) = 0.35 + "Fraction radiant heat transfer at nominal conditions"; + parameter Modelica.Units.SI.Temperature TMean_nominal = (T_a_nominal + T_b_nominal)/2; + parameter Boolean use_dynamicFraRad = true; + Real fraRad[nEle](each min=0, each max=1) = if use_dynamicFraRad then + {max(0, min(1, fraRad_nominal * + (vol[i].T^4 - heatPortRad.T^4) /( + (dTRad_nominal[i] + TRad_nominal)^4 - TRad_nominal^4) * + (dTCon_nominal[i]/(vol[i].T - heatPortCon.T))^n)) + for i in 1:nEle} else fill(fraRad_nominal, nEle) "Fraction radiant heat transfer"; + // Assumptions + + parameter Modelica.Units.SI.Power Q_flow_nominal + "Nominal heating power (positive for heating)" + annotation (Dialog(group="Nominal condition")); + parameter Modelica.Units.SI.Temperature T_a_nominal + "Water inlet temperature at nominal condition" + annotation (Dialog(group="Nominal condition")); + parameter Modelica.Units.SI.Temperature T_b_nominal + "Water outlet temperature at nominal condition" + annotation (Dialog(group="Nominal condition")); + parameter Modelica.Units.SI.Temperature TAir_nominal=293.15 + "Air temperature at nominal condition" + annotation (Dialog(group="Nominal condition")); + parameter Modelica.Units.SI.Temperature TRad_nominal=TAir_nominal + "Radiative temperature at nominal condition" + annotation (Dialog(group="Nominal condition")); + + parameter Real n = 1.24 "Exponent for heat transfer"; + parameter Modelica.Units.SI.Volume VWat=5.8E-6*abs(Q_flow_nominal) + "Water volume of radiator" annotation (Dialog(tab="Dynamics", enable=not ( + energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState))); + parameter Modelica.Units.SI.Mass mDry=0.0263*abs(Q_flow_nominal) + "Dry mass of radiator that will be lumped to water heat capacity" + annotation (Dialog(tab="Dynamics", enable=not (energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState))); + parameter Real deltaM(min=0.01) = 0.3 + "Fraction of nominal mass flow rate where transition to turbulent occurs" + annotation(Evaluate=true, + Dialog(group = "Transition to laminar", + enable = not linearized)); + + parameter Boolean from_dp = false + "= true, use m_flow = f(dp) else dp = f(m_flow)" + annotation (Evaluate=true, Dialog(tab="Advanced")); + + parameter Modelica.Units.SI.PressureDifference dp_nominal(displayUnit="Pa")= + 0 "Pressure drop at nominal mass flow rate" + annotation (Dialog(group="Nominal condition")); + parameter Boolean linearized = false + "= true, use linear relation between m_flow and dp for any flow rate" + annotation(Evaluate=true, Dialog(tab="Advanced")); + + // Heat flow rates + Modelica.Units.SI.HeatFlowRate QCon_flow=heatPortCon.Q_flow + "Heat input into the water due to convective heat transfer with room air"; + Modelica.Units.SI.HeatFlowRate QRad_flow=heatPortRad.Q_flow + "Heat input into the water due to radiative heat transfer with room"; + Modelica.Units.SI.HeatFlowRate Q_flow=QCon_flow + QRad_flow + "Heat input into the water"; + + // Heat ports + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPortCon + "Heat port for convective heat transfer with room air temperature" + annotation (Placement(transformation(extent={{-30,62},{-10,82}}))); + Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a heatPortRad + "Heat port for radiative heat transfer with room radiation temperature" + annotation (Placement(transformation(extent={{10,62},{30,82}}))); + + IBPSA.Fluid.MixingVolumes.MixingVolume[nEle] vol( + redeclare each package Medium = Medium, + each nPorts=2, + each V=VWat/nEle, + each final m_flow_nominal = m_flow_nominal, + each final energyDynamics=energyDynamics, + each final massDynamics=energyDynamics, + each final p_start=p_start, + each final T_start=T_start, + each final X_start=X_start, + each final C_start=C_start, + each final mSenFac=mSenFac) "Volume for fluid stream" + annotation (Placement(transformation(extent={{-9,0},{11,-20}}))); +protected + parameter Modelica.Units.SI.SpecificHeatCapacity cp_nominal= + Medium.specificHeatCapacityCp(Medium.setState_pTX( + Medium.p_default, + T_a_nominal, + Medium.X_default)) "Specific heat capacity at nominal conditions"; + parameter Modelica.Units.SI.HeatFlowRate QEle_flow_nominal[nEle](each fixed= + false, each start=Q_flow_nominal/nEle) + "Nominal heating power of each element"; + parameter Modelica.Units.SI.Temperature TWat_nominal[nEle](each fixed=false, + start={T_a_nominal - i/nEle*(T_a_nominal - T_b_nominal) for i in 1:nEle}) + "Water temperature in each element at nominal conditions"; + parameter Modelica.Units.SI.TemperatureDifference[nEle] dTRad_nominal(each + fixed=false, start={T_a_nominal - i/nEle*(T_a_nominal - T_b_nominal) - + TRad_nominal for i in 1:nEle}) + "Temperature difference for radiative heat transfer at nominal conditions"; + parameter Modelica.Units.SI.TemperatureDifference[nEle] dTCon_nominal(each + fixed=false, start={T_a_nominal - i/nEle*(T_a_nominal - T_b_nominal) - + TAir_nominal for i in 1:nEle}) + "Temperature difference for convective heat transfer at nominal conditions"; + + parameter Modelica.Units.SI.ThermalConductance UAEle( + fixed=false, + min=0, + start=Q_flow_nominal/((T_a_nominal + T_b_nominal)/2 - ((1 - fraRad_nominal)* + TAir_nominal + fraRad_nominal*TRad_nominal))/nEle) + "UA value at nominal condition for each element"; + + final parameter Real k = if T_b_nominal > TAir_nominal then 1 else -1 + "Parameter that is used to compute QEle_flow_nominal for heating or cooling mode"; + + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow[nEle] preCon( + each final alpha=0) + "Heat input into radiator from convective heat transfer" + annotation (Placement(transformation(extent={{-48,-48},{-28,-28}}))); + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow[nEle] preRad( + each final alpha=0) + "Heat input into radiator from radiative heat transfer" + annotation (Placement(transformation(extent={{-48,-80},{-28,-60}}))); + + Modelica.Units.SI.TemperatureDifference dTCon[nEle]={heatPortCon.T - vol[i].T + for i in 1:nEle} "Temperature difference for convective heat transfer"; + Modelica.Units.SI.TemperatureDifference dTRad[nEle]={heatPortRad.T - vol[i].T + for i in 1:nEle} "Temperature difference for radiative heat transfer"; + + Modelica.Blocks.Sources.RealExpression QCon[nEle](y={if homotopyInitialization + then homotopy(actual=(1 - fraRad[i]) * UAEle * (heatPortCon.T - vol[i].T) * + IBPSA.Utilities.Math.Functions.regNonZeroPower( + x=(heatPortCon.T - vol[i].T), + n=n - 1, + delta=0.05), simplified=(1 - fraRad[i]) * UAEle .* abs(dTCon_nominal[i]) ^ ( + n - 1) * (heatPortCon.T - vol[i].T)) else (1 - fraRad[i]) * UAEle * (heatPortCon.T - vol[i].T) * + IBPSA.Utilities.Math.Functions.regNonZeroPower( + x=(heatPortCon.T - vol[i].T), + n=n - 1, + delta=0.05) for i in 1:nEle}) "Convective heat flow rate" + annotation (Placement(transformation(extent={{-100,-48},{-80,-28}}))); + + Modelica.Blocks.Sources.RealExpression QRad[nEle](y={if homotopyInitialization + then homotopy(actual=fraRad[i] * UAEle * (heatPortRad.T - vol[i].T) * + IBPSA.Utilities.Math.Functions.regNonZeroPower( + x=(heatPortRad.T - vol[i].T), + n=n - 1, + delta=0.05), simplified=fraRad[i] * UAEle * abs(dTRad_nominal[i]) ^ (n - 1) + * (heatPortRad.T - vol[i].T)) else fraRad[i] * UAEle * (heatPortRad.T - vol[i].T) * + IBPSA.Utilities.Math.Functions.regNonZeroPower( + x=(heatPortRad.T - vol[i].T), + n=n - 1, + delta=0.05) for i in 1:nEle}) "Radiative heat flow rate" + annotation (Placement(transformation(extent={{-100,-80},{-80,-60}}))); + + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preSumCon( + final alpha=0) + "Heat input into radiator from convective heat transfer" + annotation (Placement(transformation(extent={{52,-60},{72,-40}}))); + Modelica.Blocks.Math.Sum sumCon(nin=nEle, k=-ones(nEle)) + "Sum of convective heat flow rate" + annotation (Placement(transformation(extent={{20,-60},{40,-40}}))); + Modelica.Blocks.Math.Sum sumRad(nin=nEle, k=-ones(nEle)) + "Sum of radiative heat flow rate" + annotation (Placement(transformation(extent={{20,-90},{40,-70}}))); + Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow preSumRad( + final alpha=0) + "Heat input into radiator from radiative heat transfer" + annotation (Placement(transformation(extent={{52,-90},{72,-70}}))); + + IBPSA.Fluid.FixedResistances.PressureDrop res( + redeclare final package Medium = Medium, + final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=m_flow_nominal, + final from_dp=from_dp, + final dp_nominal=dp_nominal, + final homotopyInitialization=homotopyInitialization, + final linearized=linearized, + final deltaM=deltaM, + final show_T=false) "Pressure drop component" + annotation (Placement(transformation(extent={{-60,-10},{-40,10}}))); + +initial equation + if T_b_nominal > TAir_nominal then + assert(T_a_nominal > T_b_nominal, + "In RadiatorEN442_2, T_a_nominal must be higher than T_b_nominal."); + assert(Q_flow_nominal > 0, + "In RadiatorEN442_2, nominal power must be bigger than zero if T_b_nominal > TAir_nominal."); + else + assert(T_a_nominal < T_b_nominal, + "In RadiatorEN442_2, T_a_nominal must be lower than T_b_nominal."); + assert(Q_flow_nominal < 0, + "In RadiatorEN442_2, nominal power must be smaller than zero if T_b_nominal < TAir_nominal."); + end if; + TWat_nominal[1] = T_a_nominal - QEle_flow_nominal[1]/m_flow_nominal/ + Medium.specificHeatCapacityCp( + Medium.setState_pTX(Medium.p_default, T_a_nominal, Medium.X_default)); + for i in 2:nEle loop + TWat_nominal[i] = TWat_nominal[i-1] - QEle_flow_nominal[i]/m_flow_nominal/ + Medium.specificHeatCapacityCp( + Medium.setState_pTX(Medium.p_default, TWat_nominal[i-1], Medium.X_default)); + end for; + dTRad_nominal = TWat_nominal .- TRad_nominal; + dTCon_nominal = TWat_nominal .- TAir_nominal; + Q_flow_nominal = sum(QEle_flow_nominal); + + for i in 1:nEle loop + // Use difference, TWat_nominal[i] - TRad/Air_nominal, to avoid larger system of equations + QEle_flow_nominal[i] = k * UAEle * (fraRad_nominal * + IBPSA.Utilities.Math.Functions.powerLinearized( + x=k*TWat_nominal[i] - TRad_nominal, + n=n, + x0=0.1*k*(T_b_nominal-TRad_nominal)) + (1-fraRad_nominal) * + IBPSA.Utilities.Math.Functions.powerLinearized( + x=k*TWat_nominal[i] - TAir_nominal, + n=n, + x0=0.1*k*(T_b_nominal-TAir_nominal))); + end for; + + assert(homotopyInitialization, "In " + getInstanceName() + + ": The constant homotopyInitialization has been modified from its default value. This constant will be removed in future releases.", + level = AssertionLevel.warning); + +equation + connect(preCon.port, vol.heatPort) annotation (Line( + points={{-28,-38},{-20,-38},{-20,-10},{-9,-10}}, + color={191,0,0})); + connect(preRad.port, vol.heatPort) annotation (Line( + points={{-28,-70},{-20,-70},{-20,-10},{-9,-10}}, + color={191,0,0})); + connect(vol[nEle].ports[2], port_b) annotation (Line( + points={{2,5.55112e-16},{27.25,5.55112e-16},{27.25,1.11022e-15},{51.5, + 1.11022e-15},{51.5,5.55112e-16},{100,5.55112e-16}}, + color={0,127,255})); + for i in 1:nEle-1 loop + connect(vol[i].ports[2], vol[i+1].ports[1]) annotation (Line( + points={{2,5.55112e-16},{2,5.55112e-16},{2,1.11022e-15},{1,1.11022e-15}, + {1,5.55112e-16},{0,5.55112e-16}}, + color={0,127,255})); + end for; + connect(QCon.y, preCon.Q_flow) annotation (Line( + points={{-79,-38},{-48,-38}}, + color={0,0,127})); + connect(sumCon.u, QCon.y) annotation (Line( + points={{18,-50},{-60,-50},{-60,-38},{-79,-38}}, + color={0,0,127})); + connect(sumCon.y, preSumCon.Q_flow) annotation (Line( + points={{41,-50},{52,-50}}, + color={0,0,127})); + connect(preSumCon.port, heatPortCon) annotation (Line( + points={{72,-50},{80,-50},{80,40},{-20,40},{-20,72}}, + color={191,0,0})); + connect(QRad.y, preRad.Q_flow) annotation (Line( + points={{-79,-70},{-48,-70}}, + color={0,0,127})); + connect(QRad.y, sumRad.u) annotation (Line( + points={{-79,-70},{-60,-70},{-60,-80},{18,-80}}, + color={0,0,127})); + connect(sumRad.y, preSumRad.Q_flow) annotation (Line( + points={{41,-80},{52,-80}}, + color={0,0,127})); + connect(preSumRad.port, heatPortRad) annotation (Line( + points={{72,-80},{86,-80},{86,50},{20,50},{20,72}}, + color={191,0,0})); + connect(res.port_a, port_a) annotation (Line(points={{-60,0},{-80,0},{-100,0}}, + color={0,127,255})); + connect(res.port_b, vol[1].ports[1]) + annotation (Line(points={{-40,0},{0,0}}, color={0,127,255})); + annotation ( Icon(graphics={ + Ellipse( + extent={{-20,22},{20,-20}}, + fillColor={127,0,0}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Rectangle( + extent={{-95,6},{106,-4}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-102,-4},{-2,6}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-20,22},{20,-20}}, + fillColor={127,0,0}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Rectangle( + extent={{-80,60},{80,-60}}, + lineColor={0,0,0}, + fillColor=DynamicSelect({95,95,95}, + max(0, min(1, -Q_flow/Q_flow_nominal))*{255,0,0}+(1-max(0, min(1, -Q_flow/Q_flow_nominal)))*{95,95,95}), + fillPattern=FillPattern.Solid), + Line( + points={{-66,30},{66,30}}), + Line( + points={{-66,2},{66,2}}), + Line( + points={{-66,-30},{66,-30}}), + Line( + points={{-66,60},{-66,-60}}), + Line( + points={{66,60},{66,-60}})}), + defaultComponentName="rad", + Documentation(info=" +

+This is a model of a radiator that can be used as a dynamic or steady-state model. +The required parameters are data that are typically available from +manufacturers that follow the European Norm EN 442-2. +

+

+However, to allow for varying mass flow rates, the transferred heat is computed +using a discretization along the water flow path, and heat is exchanged between +each compartment and a uniform room air and radiation temperature. +This discretization is different from the computation in EN 442-2, which +may yield water outlet temperatures that are below +the room temperature at low mass flow rates. +Furthermore, rather than using only one room temperature, this model uses +a room air and room radiation temperature. +

+

+The transferred heat is modeled as follows: +Let N denote the number of elements used to discretize the radiator model. +For each element i ∈ {1, … , N}, +the convective and radiative heat transfer +Qic and +Qir +from the radiator to the room is +

+

+ Qic = sign(Ti-Ta) + (1-fr) UA ⁄ N |Ti-Ta|n +

+ Qir = sign(Ti-Tr) + fr UA ⁄ N |Ti-Tr|n +

+

+where +Ti is the water temperature of the element, +Ta is the temperature of the room air, +Tr is the radiative temperature, +0 < fr < 1 is the fraction of radiant to total heat transfer, +UA is the UA-value of the radiator, +and +n is an exponent for the heat transfer. +The model computes the UA-value by numerically solving the above equations +for given +nominal heating power, nominal temperatures, fraction radiant to total heat transfer +and exponent for heat transfer. +

+

+The parameter energyDynamics (in the Assumptions tab), +determines whether the model computes the dynamic or the steady-state response. +For the transient response, heat storage is computed using a +finite volume approach for the +water and the metal mass, which are both assumed to be at the same +temperature. +

+

+The default parameters for the heat capacities are valid for a flat plate radiator without fins, +with one plate of water carying fluid, and a height of 0.42 meters. +

+", revisions=" +
    +
  • +March 7, 2022, by Michael Wetter:
    +Set final massDynamics=energyDynamics.
    +This is for +#1542. +
  • +
  • +April 14, 2020, by Michael Wetter:
    +Changed homotopyInitialization to a constant.
    +This is for +IBPSA, #1341. +
  • +
  • +February 21, 2020, by Michael Wetter:
    +Changed icon to display its operating state.
    +This is for +#1294. +
  • +
  • +November 17, 2016, by Filip Jorissen:
    +Added pressure drop equations and parameters.
    +This is for +#586. +
  • +
  • +November 3, 2016, by Michael Wetter:
    +Set preHea(final alpha=0) as this allows to simplify the +system of equations.
    +This is for +#570. +
  • +
  • +March 17, 2016, by Michael Wetter:
    +Reformulated model to reduce the dimension of the nonlinear system of equations. +This is for +#435. +
  • +
  • +November 19, 2015, by Michael Wetter:
    +Removed assignment of parameter +showDesignFlowDirection in extends statement. +This is for +#349. +
  • +
  • +April 11, 2015, by Filip Jorissen:
    +Propagated vol.massDynamics to +top level parameter massDynamics instead of energyDynamics. +
  • +
  • +November 25, 2014, by Carles Ribas Tugores:
    +Interchange position of fraRad parameter and the complementary (1-fraRad) +in the equation used to calculate the nominal heating power of each element, QEle_flow_nominal[i]. +
  • +
  • +October 29, 2014, by Michael Wetter:
    +Made assignment of mFactor final, and changed computation of +density to use default medium states as are also used to compute the +specific heat capacity. +
  • +
  • +October 21, 2014, by Filip Jorissen:
    +Added parameter mFactor and removed thermal capacity +which can lead to an index reduction. +
  • +
  • +May 29, 2014, by Michael Wetter:
    +Removed undesirable annotation Evaluate=true. +
  • +
  • +October 8, 2013 by Michael Wetter:
    +Removed conditional statement in the declaration of the parameter +mDry, as this is incorrect syntax. +
  • +
  • +September 26, 2013 by Michael Wetter:
    +Reformulated implementation to avoid mixing textual and graphical +declarations in the equation section. +
  • +
  • +April 4, 2011 by Michael Wetter:
    +Changed the implementation to use + +IBPSA.Utilities.Math.Functions.regNonZeroPower. +This allows formulating the model without any non-differentiable function +inside the equation section. +
  • +
  • +April 2, 2011 by Michael Wetter:
    +Added homotopy operator. +
  • +
  • +February 11, 2011 by Michael Wetter:
    +Revised the initialization to ensure that at the nominal conditions, the +amount of transferred heat is excatly the same as the specified nominal power. +In the previous implementation, the UA-value was computed using a simplified +expression for the temperature difference, leading to a slightly different amount +of heat transfer. +
  • +
  • +February 4, 2011 by Michael Wetter:
    +Simplified implementation. +
  • +
  • +January 30, 2009 by Michael Wetter:
    +First implementation. +
  • +
+"), + Diagram(graphics={Rectangle(extent={{-62,78},{-46,50}}, lineColor={28,108,200})})); +end RadiatorEN442_2; diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/TimeConstantEstimationControl.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/TimeConstantEstimationControl.mo index 06d93e6b..d114db4f 100644 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/TimeConstantEstimationControl.mo +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/TimeConstantEstimationControl.mo @@ -1,10 +1,9 @@ within BESMod.Utilities.TimeConstantEstimation.BaseClasses; model TimeConstantEstimationControl "Control model to help time constant estimation" - extends Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl(redeclare + extends Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl(redeclare replaceable BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled valCtrl); - parameter Boolean useOpeTemCtrl = false "=true to control the operative room temperature"; replaceable parameter Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition parPID "PID parameters for boiler" annotation (choicesAllMatching=true, Placement( diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.order b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.order index b5d3e7fd..22d4a3ea 100644 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.order +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.order @@ -1,3 +1,5 @@ ProfilesWithStep PartialEstimation TimeConstantEstimationControl +RadiatorEN442_2 +CustomRadiator diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/ConstantSupply.mo b/BESMod/Utilities/TimeConstantEstimation/Radiator/ConstantSupply.mo new file mode 100644 index 00000000..042dcd63 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/ConstantSupply.mo @@ -0,0 +1,24 @@ +within BESMod.Utilities.TimeConstantEstimation.Radiator; +model ConstantSupply "Smart thermotat PI control estimation" + extends Partial( + QBuiNoRetrofit_flow_nominal=systemParameters.QBui_flow_nominal*3, + dTStepSet=0, hydraulic(control( + useOpeTemCtrl=false, + redeclare + BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ConstantOpening + valCtrl, + redeclare + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.Constant + supTSet(TConSup=TConSup)), transfer(rad(use_dynamicFraRad=true))), + systemParameters(QBui_flow_nominal={11000}, + THydSup_nominal={343.15})); + parameter Modelica.Units.SI.Time timeInt=1200 + "Time constant of Integrator block"; + parameter Real P=0.3 "Gain of PID-controller"; + parameter Modelica.Units.SI.Temperature TConSup=273.15 + 40 + "Constant supply temperature" annotation (Dialog(tab="Advanced")); + annotation (experiment( + StopTime=864000, + Interval=60, + __Dymola_Algorithm="Dassl")); +end ConstantSupply; diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo b/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo index 838d85e7..463fece1 100644 --- a/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo @@ -1,8 +1,20 @@ within BESMod.Utilities.TimeConstantEstimation.Radiator; model HeatingCurve - extends Partial(hydraulic(control(redeclare + extends Partial( + dTStepSet=0, + TOda_start=273.15, + dTStepOda=5, + QBuiNoRetrofit_flow_nominal=systemParameters.QBui_flow_nominal, + hydraulic(T_start=293.15, + control( + useOpeTemCtrl=true, + redeclare + BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled + valCtrl(Ti={200}), + redeclare BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.IdealHeatingCurve - supTSet(dTAddCon=dTAddCon)))); + supTSet(dTAddCon=dTAddCon))), + systemParameters(QBui_flow_nominal={11000}, THydSup_nominal={312.15})); parameter Modelica.Units.SI.TemperatureDifference dTAddCon=5 "Constant supply temperature" annotation (Evaluate=false); end HeatingCurve; diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/Partial.mo b/BESMod/Utilities/TimeConstantEstimation/Radiator/Partial.mo index 96b104a9..b3fa44d1 100644 --- a/BESMod/Utilities/TimeConstantEstimation/Radiator/Partial.mo +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/Partial.mo @@ -8,8 +8,11 @@ partial model Partial "Estimate UFH time constants" T_start=273.15 + 55, redeclare BESMod.Systems.Hydraulical.Distribution.BuildingOnly distribution( nParallelDem=1), - redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased + redeclare + BESMod.Utilities.TimeConstantEstimation.BaseClasses.CustomRadiator transfer( + f_design=QBuiNoRetrofit_flow_nominal ./ systemParameters.QBui_flow_nominal, + redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData parTra, @@ -18,7 +21,6 @@ partial model Partial "Estimate UFH time constants" BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData parRad), control( - valCtrl(k={0.5}), redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicBoilerPI parPID( @@ -27,6 +29,9 @@ partial model Partial "Estimate UFH time constants" timeInt=100))), systemParameters(THydSup_nominal={328.15}, use_dhw=false)); + + parameter Modelica.Units.SI.HeatFlowRate QBuiNoRetrofit_flow_nominal[systemParameters.nZones] + "Nominal heat flow rate before possible retrofits"; annotation (experiment( StopTime=864000, Interval=600, diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo b/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo index 47cc6a2a..95b4a638 100644 --- a/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo @@ -1,16 +1,30 @@ within BESMod.Utilities.TimeConstantEstimation.Radiator; model SmartThermostat "Smart thermotat PI control estimation" extends Partial( - dTStepSet=0, hydraulic(control(useOpeTemCtrl=true, - redeclare + QBuiNoRetrofit_flow_nominal=systemParameters.QBui_flow_nominal*3, + dTStepSet=2, hydraulic( + T_start=333.15, + control( + useOpeTemCtrl=true, + redeclare + BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ConstantOpening + valCtrl, + redeclare BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.SingleZonePID supTSet(redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.SmartThermostatPI parPID( - yMax=273.15 + 70, + yMax=273.15 + 75, P=P, - timeInt=timeInt)))), systemParameters(QBui_flow_nominal={11000})); - parameter Modelica.Units.SI.Time timeInt=1200 + timeInt=timeInt))), transfer(rad(use_dynamicFraRad=false), parRad( + nEle=4))), systemParameters(QBui_flow_nominal={11000}, + THydSup_nominal={343.15})); + parameter Modelica.Units.SI.Time timeInt=400 "Time constant of Integrator block"; - parameter Real P=0.3 "Gain of PID-controller"; + parameter Real P=0.03 + "Gain of PID-controller"; + annotation (experiment( + StopTime=864000, + Interval=60, + __Dymola_Algorithm="Dassl")); end SmartThermostat; diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/package.order b/BESMod/Utilities/TimeConstantEstimation/Radiator/package.order index 44adfe18..3864ba55 100644 --- a/BESMod/Utilities/TimeConstantEstimation/Radiator/package.order +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/package.order @@ -1,3 +1,4 @@ SmartThermostat HeatingCurve Partial +ConstantSupply From ded9a03c1a683916c43deb0279a69156de440e6a Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 10 Apr 2024 18:41:21 +0200 Subject: [PATCH 124/131] add more user profile options and TEASER heating load calculation --- .../TEASERHeatLoadCalculation/Example.mo | 7 +++ .../PartialCalculation.mo | 40 +++++++++++++++++ .../TEASERHeatLoadCalculation/package.mo | 5 +++ .../TEASERHeatLoadCalculation/package.order | 2 + BESMod/Examples/package.order | 1 + .../Electrical/Transfer/IdealHeater.mo | 44 ++++++++++++------- BESMod/Systems/UserProfiles/TEASERProfiles.mo | 22 +++++++--- .../BaseClasses/ProfilesWithStep.mo | 3 +- 8 files changed, 101 insertions(+), 23 deletions(-) create mode 100644 BESMod/Examples/TEASERHeatLoadCalculation/Example.mo create mode 100644 BESMod/Examples/TEASERHeatLoadCalculation/PartialCalculation.mo create mode 100644 BESMod/Examples/TEASERHeatLoadCalculation/package.mo create mode 100644 BESMod/Examples/TEASERHeatLoadCalculation/package.order diff --git a/BESMod/Examples/TEASERHeatLoadCalculation/Example.mo b/BESMod/Examples/TEASERHeatLoadCalculation/Example.mo new file mode 100644 index 00000000..2b6d8289 --- /dev/null +++ b/BESMod/Examples/TEASERHeatLoadCalculation/Example.mo @@ -0,0 +1,7 @@ +within BESMod.Examples.TEASERHeatLoadCalculation; +model Example "Simple example" + extends PartialCalculation(building(redeclare + BESMod.Examples.BAUSimStudy.Buildings.Case_2_retrofit oneZoneParam( + heaLoadFacOut=200, heaLoadFacGrd=100)), userProfiles(dTSetBack=3)); + extends Modelica.Icons.Example; +end Example; diff --git a/BESMod/Examples/TEASERHeatLoadCalculation/PartialCalculation.mo b/BESMod/Examples/TEASERHeatLoadCalculation/PartialCalculation.mo new file mode 100644 index 00000000..7258e2ed --- /dev/null +++ b/BESMod/Examples/TEASERHeatLoadCalculation/PartialCalculation.mo @@ -0,0 +1,40 @@ +within BESMod.Examples.TEASERHeatLoadCalculation; +model PartialCalculation "Partial model with common interfaces" + extends BESMod.Systems.BaseClasses.PartialBuildingEnergySystem( + redeclare BESMod.Systems.UserProfiles.TEASERProfiles userProfiles, + redeclare BESMod.Systems.RecordsCollection.ExampleSystemParameters + systemParameters( + QBui_flow_nominal=building.QRec_flow_nominal, + use_hydraulic=false, + use_ventilation=false), + redeclare BESMod.Systems.Control.NoControl control, + redeclare BESMod.Systems.Ventilation.NoVentilation ventilation, + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare BESMod.Systems.Hydraulical.Generation.NoGeneration generation, + redeclare BESMod.Systems.Hydraulical.Control.NoControl control, + redeclare BESMod.Systems.Hydraulical.Distribution.BuildingOnly + distribution(nParallelDem=1), + redeclare BESMod.Systems.Hydraulical.Transfer.NoHeatTransfer transfer( + nParallelSup=1)), + redeclare BESMod.Systems.Electrical.ElectricalSystem electrical( + redeclare BESMod.Systems.Electrical.Generation.NoGeneration generation, + redeclare BESMod.Systems.Electrical.Distribution.DirectlyToGrid + distribution, + redeclare BESMod.Systems.Electrical.Transfer.IdealHeater transfer( + TN_heater=120), + redeclare BESMod.Systems.Electrical.Control.IdealHeater control), + redeclare BESMod.Systems.Demand.DHW.StandardProfiles DHW( + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare BESMod.Systems.Demand.DHW.TappingProfiles.PassThrough calcmFlow, + + redeclare BESMod.Systems.Demand.DHW.RecordsCollection.NoDHW DHWProfile), + redeclare BESMod.Systems.Demand.Building.TEASERThermalZone building, + redeclare BESMod.Systems.RecordsCollection.ParameterStudy.NoStudy + parameterStudy); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + experiment( + StopTime=31536000, + Interval=3600, + __Dymola_Algorithm="Dassl")); +end PartialCalculation; diff --git a/BESMod/Examples/TEASERHeatLoadCalculation/package.mo b/BESMod/Examples/TEASERHeatLoadCalculation/package.mo new file mode 100644 index 00000000..30b5cf16 --- /dev/null +++ b/BESMod/Examples/TEASERHeatLoadCalculation/package.mo @@ -0,0 +1,5 @@ +within BESMod.Examples; +package TEASERHeatLoadCalculation "Package with models for TEASER heat load calculations with BESMod" + extends Modelica.Icons.ExamplesPackage; + +end TEASERHeatLoadCalculation; diff --git a/BESMod/Examples/TEASERHeatLoadCalculation/package.order b/BESMod/Examples/TEASERHeatLoadCalculation/package.order new file mode 100644 index 00000000..0e558352 --- /dev/null +++ b/BESMod/Examples/TEASERHeatLoadCalculation/package.order @@ -0,0 +1,2 @@ +PartialCalculation +Example diff --git a/BESMod/Examples/package.order b/BESMod/Examples/package.order index 648f38d2..3422d2af 100644 --- a/BESMod/Examples/package.order +++ b/BESMod/Examples/package.order @@ -5,3 +5,4 @@ HeatPumpAndBoiler HighOrderModel ModelicaConferencePaper SolarThermalSystem +TEASERHeatLoadCalculation diff --git a/BESMod/Systems/Electrical/Transfer/IdealHeater.mo b/BESMod/Systems/Electrical/Transfer/IdealHeater.mo index 020548e2..40d25a12 100644 --- a/BESMod/Systems/Electrical/Transfer/IdealHeater.mo +++ b/BESMod/Systems/Electrical/Transfer/IdealHeater.mo @@ -4,8 +4,8 @@ model IdealHeater "Ideal heater as in reduced order model" parameter Real KR_heater=1000 "Gain of the heating controller"; parameter Modelica.Units.SI.Time TN_heater=1 "Time constant of the heating controller"; - BESMod.Utilities.Electrical.ZeroLoad zeroLoad - annotation (Placement(transformation(extent={{16,64},{36,84}}))); + Utilities.Electrical.RealToElecCon realToElecCon(use_souGen=false) + annotation (Placement(transformation(extent={{20,60},{40,80}}))); AixLib.Utilities.Sources.HeaterCooler.HeaterCoolerPI heaterCooler[nParallelDem]( h_heater=Q_flow_nominal .* 1.5, each final l_heater=0, @@ -16,37 +16,43 @@ model IdealHeater "Ideal heater as in reduced order model" each Heater_on=true, each Cooler_on=false, each final staOrDyn=false) "Heater Cooler with PI control" - annotation (Placement(transformation(extent={{-62,18},{-22,58}}))); + annotation (Placement(transformation(extent={{-62,0},{-20,40}}))); Modelica.Blocks.Sources.BooleanConstant booCooAct[nParallelDem](each final k= false) "Cooling active" - annotation (Placement(transformation(extent={{-98,0},{-78,20}}))); + annotation (Placement(transformation(extent={{-82,-40},{-62,-20}}))); Modelica.Blocks.Sources.BooleanConstant booHeaAct[nParallelDem](each final k= true) "Heating active" - annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); + annotation (Placement(transformation(extent={{-82,-80},{-62,-60}}))); Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow fixHeaFlo[nParallelDem]( each final Q_flow=0) - annotation (Placement(transformation(extent={{40,-48},{60,-28}}))); + annotation (Placement(transformation(extent={{40,-40},{60,-20}}))); Utilities.KPIs.EnergyKPICalculator heaKPI[nParallelDem](each final use_inpCon= true) "Heating power KPI" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, origin={0,-40}))); + Modelica.Blocks.Math.Sum sum1 + annotation (Placement(transformation(extent={{-40,60},{-20,80}}))); equation - connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( - Line( - points={{36,74},{48,74},{48,100}}, + connect(realToElecCon.internalElectricalPin, internalElectricalPin) + annotation (Line( + points={{40.2,70.2},{48,70.2},{48,100}}, color={0,0,0}, thickness=1)); connect(booCooAct.y, heaterCooler.coolerActive) - annotation (Line(points={{-77,10},{-56,10},{-56,23.6}}, color={255,0,255})); - connect(heaterCooler.heaterActive, booHeaAct.y) annotation (Line(points={{-28.4, - 23.6},{-28.4,-30},{-79,-30}}, color={255,0,255})); - connect(heaterCooler.heatCoolRoom, heatPortCon) annotation (Line(points={{-24,30}, - {84,30},{84,38},{100,38}}, color={191,0,0})); + annotation (Line(points={{-61,-30},{-54,-30},{-54,-32},{-55.7,-32},{-55.7, + 5.6}}, color={255,0,255})); + connect(heaterCooler.heaterActive, booHeaAct.y) annotation (Line(points={{-26.72, + 5.6},{-26.72,-70},{-61,-70}}, color={255,0,255})); + connect(heaterCooler.heatCoolRoom, heatPortCon) annotation (Line(points={{-22.1, + 12},{86,12},{86,38},{100,38}}, + color={191,0,0})); connect(fixHeaFlo.port, heatPortRad) - annotation (Line(points={{60,-38},{100,-38}}, color={191,0,0})); + annotation (Line(points={{60,-30},{80,-30},{80,-38},{100,-38}}, + color={191,0,0})); connect(heaterCooler.setPointHeat, transferControlBus.TZoneSet) annotation ( - Line(points={{-37.6,23.6},{-37.6,-6},{1.77636e-15,-6},{1.77636e-15,98}}, + Line(points={{-36.38,5.6},{-36.38,-10},{-90,-10},{-90,90},{1.77636e-15,90}, + {1.77636e-15,98}}, color={0,0,127}), Text( string="%second", index=1, @@ -59,7 +65,11 @@ equation extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); connect(heaKPI.u, heaterCooler.heatingPower) annotation (Line(points={{ - 2.22045e-15,-28.2},{2.22045e-15,46},{-22,46}}, color={0,0,127})); + 2.10942e-15,-28.2},{2.10942e-15,28},{-20,28}}, color={0,0,127})); + connect(heaterCooler.heatingPower, sum1.u) annotation (Line(points={{-20,28}, + {0,28},{0,54},{-52,54},{-52,70},{-42,70}}, color={0,0,127})); + connect(sum1.y, realToElecCon.PEleLoa) annotation (Line(points={{-19,70},{6, + 70},{6,74},{18,74}}, color={0,0,127})); annotation (Icon(graphics, coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Systems/UserProfiles/TEASERProfiles.mo b/BESMod/Systems/UserProfiles/TEASERProfiles.mo index 6468c792..4756efa7 100644 --- a/BESMod/Systems/UserProfiles/TEASERProfiles.mo +++ b/BESMod/Systems/UserProfiles/TEASERProfiles.mo @@ -5,6 +5,13 @@ model TEASERProfiles "Standard TEASER Profiles" "File where matrix is stored"; parameter Real gain[3]=fill(1, 3) "Gain value multiplied with internal gains. Used to e.g. disable single gains."; + parameter Modelica.Units.SI.TemperatureDifference dTSetBack=0 + "Temperature difference of set-back"; + parameter Modelica.Units.SI.Time startTimeSetBack(displayUnit="h")=79200 + "Start time of day of set back"; + parameter Real hoursSetBack(max=24, min=0)=8 + "Number of hours the set-back lasts, maximum 24"; + Modelica.Blocks.Sources.CombiTimeTable tabIntGai( final tableOnFile=true, @@ -23,10 +30,15 @@ model TEASERProfiles "Standard TEASER Profiles" rotation=180, origin={30,30}))); - Modelica.Blocks.Sources.Constant conTSetZone[nZones]( - k(each unit="K", each displayUnit="K")=TSetZone_nominal, + Modelica.Blocks.Sources.Pulse setBakTSetZone[nZones]( + each amplitude=-dTSetBack, + each width=100*hoursSetBack/24, + each period=86400, + offset=TSetZone_nominal, + each startTime=startTimeSetBack, y(each unit="K", each displayUnit="K")) - "Constant room set temperature" annotation (Placement(transformation( + "Room set temperature with set-back option" annotation (Placement( + transformation( extent={{10,10},{-10,-10}}, rotation=180, origin={-10,-50}))); @@ -39,8 +51,8 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - connect(conTSetZone.y, useProBus.TZoneSet) annotation (Line(points={{1,-50},{ - 115,-50},{115,-1}}, color={0,0,127}), Text( + connect(setBakTSetZone.y, useProBus.TZoneSet) annotation (Line(points={{1,-50}, + {76,-50},{76,-1},{115,-1}}, color={0,0,127}), Text( string="%second", index=1, extent={{6,3},{6,3}}, diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo index 08a73cb4..31031d4a 100644 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo @@ -3,6 +3,7 @@ model ProfilesWithStep "User profile with a step and no internal gains" extends Systems.UserProfiles.BaseClasses.PartialUserProfiles; parameter Modelica.Units.SI.TemperatureDifference dTStep "Temperature difference of step"; parameter Modelica.Units.SI.Time startTime=0 "Start time of step"; + parameter Real hoursStep "Number of hours the step lasts, maximum 24"; Modelica.Blocks.Sources.Constant conIntGai[3](each final k=0) "Constant no internal gains" annotation (Placement(transformation( @@ -11,7 +12,7 @@ model ProfilesWithStep "User profile with a step and no internal gains" origin={-10,-10}))); Modelica.Blocks.Sources.Pulse nigSetBakTSetZone[nZones]( each amplitude=-dTStep, - each width=100*8/24, + each width=100*hoursStep /24, each period=86400, offset=TSetZone_nominal, each startTime=startTime) "Constant room set temperature" From ea455614419be175c4dadd9588aa2720fbece9f3 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Thu, 11 Apr 2024 11:23:52 +0200 Subject: [PATCH 125/131] rm parTheVal and add SG Ready to local control, as in reality --- BESMod/Examples/BAUSimStudy/PartialCase.mo | 3 - BESMod/Examples/DesignOptimization/BES.mo | 9 +- BESMod/Examples/GasBoilerBuildingOnly.mo | 3 - .../Examples/HeatPumpAndBoiler/BaseClasses.mo | 3 - BESMod/Examples/HighOrderModel/BES_HOM.mo | 3 - .../PartialModelicaConferenceUseCase.mo | 3 - .../PartialSolarThermalHPS.mo | 3 - BESMod/Resources/SGReady/EVU_Sperre_EON.txt | 53 +++ .../Resources/SGReady/EVU_Sperre_Westnetz.txt | 53 +++ .../PartialHeatPumpSystemController.mo | 62 +++- .../SetAndMeasuredValueSelector.mo | 29 +- .../Components/BuildingAndDHWControl.mo | 329 ++++++++++++------ .../Components/SetTemperatureSGReady.mo | 63 ++++ .../Control/Components/package.order | 1 + 14 files changed, 460 insertions(+), 157 deletions(-) create mode 100644 BESMod/Resources/SGReady/EVU_Sperre_EON.txt create mode 100644 BESMod/Resources/SGReady/EVU_Sperre_Westnetz.txt create mode 100644 BESMod/Systems/Hydraulical/Control/Components/SetTemperatureSGReady.mo diff --git a/BESMod/Examples/BAUSimStudy/PartialCase.mo b/BESMod/Examples/BAUSimStudy/PartialCase.mo index f9bdb678..cf4884ed 100644 --- a/BESMod/Examples/BAUSimStudy/PartialCase.mo +++ b/BESMod/Examples/BAUSimStudy/PartialCase.mo @@ -37,9 +37,6 @@ partial model PartialCase redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled valCtrl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - parTheVal, dTHysBui=10, dTHysDHW=10, redeclare model DHWHysteresis = diff --git a/BESMod/Examples/DesignOptimization/BES.mo b/BESMod/Examples/DesignOptimization/BES.mo index 2a8106b3..23c189e2 100644 --- a/BESMod/Examples/DesignOptimization/BES.mo +++ b/BESMod/Examples/DesignOptimization/BES.mo @@ -14,8 +14,8 @@ model BES redeclare model PerDataRevHP = AixLib.DataBase.Chiller.PerformanceData.PolynomalApproach (redeclare function PolyData = - AixLib.DataBase.HeatPump.Functions.Characteristics.ConstantCoP ( - powerCompressor=2000, CoP=2)), + AixLib.DataBase.HeatPump.Functions.Characteristics.ConstantCoP + ( powerCompressor=2000, CoP=2)), redeclare BESMod.Systems.Hydraulical.Components.Frosting.ZhuIceFacCalculation frost(density=200, redeclare function frostMapFunc = @@ -48,9 +48,6 @@ model BES redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled valCtrl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - parTheVal, redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.PartParallelBivalent ( @@ -69,6 +66,8 @@ model BES TRoom=systemParameters.TSetZone_nominal[1], QDem_flow_nominal=systemParameters.QBui_flow_nominal[1], QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff), + useSGReady=true, + useExtSGSig=false, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, diff --git a/BESMod/Examples/GasBoilerBuildingOnly.mo b/BESMod/Examples/GasBoilerBuildingOnly.mo index 8b861dde..e64596e0 100644 --- a/BESMod/Examples/GasBoilerBuildingOnly.mo +++ b/BESMod/Examples/GasBoilerBuildingOnly.mo @@ -20,9 +20,6 @@ model GasBoilerBuildingOnly redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled valCtrl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - parTheVal, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicBoilerPI parPID, diff --git a/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo b/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo index 2089afdb..537629fb 100644 --- a/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo +++ b/BESMod/Examples/HeatPumpAndBoiler/BaseClasses.mo @@ -15,9 +15,6 @@ package BaseClasses "Contains partial example case" redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled valCtrl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - parTheVal, dTHysBui=5, dTHysDHW=5, meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.GenerationSupplyTemperature, diff --git a/BESMod/Examples/HighOrderModel/BES_HOM.mo b/BESMod/Examples/HighOrderModel/BES_HOM.mo index 4ee8a9fc..9d52aceb 100644 --- a/BESMod/Examples/HighOrderModel/BES_HOM.mo +++ b/BESMod/Examples/HighOrderModel/BES_HOM.mo @@ -54,9 +54,6 @@ model BES_HOM redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI parPIDHeaPum, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - parTheVal, redeclare BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl safetyControl), diff --git a/BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo b/BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo index ba140fd2..42a53728 100644 --- a/BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo +++ b/BESMod/Examples/ModelicaConferencePaper/PartialModelicaConferenceUseCase.mo @@ -53,9 +53,6 @@ partial model PartialModelicaConferenceUseCase redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled valCtrl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - parTheVal, supCtrDHWTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Internal, redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater, diff --git a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo index 79706ab8..9c0ecf0f 100644 --- a/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo +++ b/BESMod/Examples/SolarThermalSystem/PartialSolarThermalHPS.mo @@ -16,9 +16,6 @@ partial model PartialSolarThermalHPS redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled valCtrl, - redeclare - BESMod.Systems.Hydraulical.Control.RecordsCollection.ThermostaticValveDataDefinition - parTheVal, redeclare model DHWHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.TimeBasedElectricHeater, redeclare model BuildingHysteresis = diff --git a/BESMod/Resources/SGReady/EVU_Sperre_EON.txt b/BESMod/Resources/SGReady/EVU_Sperre_EON.txt new file mode 100644 index 00000000..1dc404f5 --- /dev/null +++ b/BESMod/Resources/SGReady/EVU_Sperre_EON.txt @@ -0,0 +1,53 @@ +#1 +double SGReady(48,2) +#C1 Time in seconds. Beginning of a year is 0s. +#C3 SG-Ready signal between 1 and 4 +0 2 +1800 2 +3600 2 +5400 2 +7200 2 +9000 2 +10800 2 +12600 2 +14400 2 +16200 2 +18000 2 +19800 2 +21600 2 +23400 2 +25200 2 +27000 2 +28800 2 +30600 2 +32400 2 +34200 2 +36000 2 +37800 2 +39600 1 +41400 1 +43200 1 +45000 1 +46800 2 +48600 2 +50400 2 +52200 2 +54000 2 +55800 2 +57600 2 +59400 2 +61200 1 +63000 1 +64800 1 +66600 1 +68400 2 +70200 2 +72000 2 +73800 2 +75600 2 +77400 2 +79200 2 +81000 2 +82800 2 +84600 2 +86400 2 diff --git a/BESMod/Resources/SGReady/EVU_Sperre_Westnetz.txt b/BESMod/Resources/SGReady/EVU_Sperre_Westnetz.txt new file mode 100644 index 00000000..f79b0353 --- /dev/null +++ b/BESMod/Resources/SGReady/EVU_Sperre_Westnetz.txt @@ -0,0 +1,53 @@ +#1 +double SGReady(48,2) +#C1 Time in seconds. Beginning of a year is 0s. +#C3 SG-Ready signal between 1 and 4 +0 2 +1800 2 +3600 2 +5400 2 +7200 2 +9000 2 +10800 2 +12600 2 +14400 2 +16200 2 +18000 2 +19800 2 +21600 2 +23400 2 +25200 2 +27000 2 +28800 2 +30600 2 +32400 2 +34200 1 +36000 1 +37800 1 +39600 2 +41400 2 +43200 2 +45000 2 +46800 1 +48600 1 +50400 2 +52200 2 +54000 2 +55800 2 +57600 2 +59400 1 +61200 2 +63000 2 +64800 2 +66600 2 +68400 2 +70200 2 +72000 2 +73800 2 +75600 2 +77400 2 +79200 2 +81000 2 +82800 2 +84600 2 +86400 2 diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo index 5e697043..367885d7 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo @@ -3,6 +3,12 @@ partial model PartialHeatPumpSystemController "Partial model with replaceable blocks for rule based control of heat pump systems" extends BESMod.Systems.Hydraulical.Control.BaseClasses.PartialThermostaticValveControl; + parameter Components.BaseClasses.MeasuredValue meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.GenerationSupplyTemperature + "Control measurement value for primary device" + annotation (Dialog(group="Heat Pump")); + parameter Components.BaseClasses.MeasuredValue meaValSecGen + "Control measurement value for secondary device" + annotation (Dialog(group="Backup heater")); parameter Modelica.Units.SI.TemperatureDifference dTHysBui=10 "Hysteresis for building demand control" annotation (Dialog(group="Building control")); @@ -16,12 +22,7 @@ partial model PartialHeatPumpSystemController supCtrDHWTyp=BESMod.Utilities.SupervisoryControl.Types.SupervisoryControlType.Local "Supervisory control approach for DHW supply temperature " annotation(Dialog(group="DHW control")); - parameter Components.BaseClasses.MeasuredValue meaValPriGen=BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.GenerationSupplyTemperature - "Control measurement value for primary device" - annotation (Dialog(group="Component choices")); - parameter Components.BaseClasses.MeasuredValue meaValSecGen - "Control measurement value for secondary device" - annotation (Dialog(group="Component choices")); + replaceable model BuildingHysteresis = BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.BaseClasses.PartialOnOffController @@ -32,7 +33,8 @@ partial model PartialHeatPumpSystemController choicesAllMatching=true); replaceable model BuildingSupplySetTemperature = BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.IdealHeatingCurve - constrainedby BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.PartialSetpoint( + constrainedby + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.PartialSetpoint( final TSup_nominal=buiAndDHWCtr.TSup_nominal, final TRet_nominal=buiAndDHWCtr.TRet_nominal, final TOda_nominal=buiAndDHWCtr.TOda_nominal, @@ -57,14 +59,36 @@ partial model PartialHeatPumpSystemController replaceable model SummerMode = BESMod.Systems.Hydraulical.Control.Components.SummerMode.No constrainedby - BESMod.Systems.Hydraulical.Control.Components.SummerMode.BaseClasses.PartialSummerMode + BESMod.Systems.Hydraulical.Control.Components.SummerMode.BaseClasses.PartialSummerMode "Summer mode model" annotation(Dialog(group="Building control"), choicesAllMatching=true); + parameter Boolean useSGReady=false "=true to use SG Ready" + annotation (Dialog(group="SG Ready")); + parameter Boolean useExtSGSig=true "=true to use external SG ready signal" + annotation (Dialog(group="SG Ready", enable=useSGReady)); + parameter Modelica.Units.SI.TemperatureDifference TAddSta3Bui=5 + "Increase for SG-Ready state 3 for building supply" + annotation (Dialog(group="SG Ready", enable=useSGReady)); + parameter Modelica.Units.SI.TemperatureDifference TAddSta4Bui=10 + "Increase for SG-Ready state 4 for building supply" + annotation (Dialog(group="SG Ready", enable=useSGReady)); + parameter Modelica.Units.SI.TemperatureDifference TAddSta3DHW=5 + "Increase for SG-Ready state 3 for DHW supply" + annotation (Dialog(group="SG Ready", enable=useSGReady)); + parameter Modelica.Units.SI.TemperatureDifference TAddSta4DHW=10 + "Increase for SG-Ready state 4 for DHW supply" + annotation (Dialog(group="SG Ready", enable=useSGReady)); + parameter String filNamSGReady=ModelicaServices.ExternalReferences.loadResource("modelica://BESMod/Resources/SGReady/EVU_Sperre_EON.txt") + "Name of SG Ready scenario input file" + annotation (Dialog(group="SG Ready", enable=not useExtSGSig and useSGReady)); + SummerMode sumMod "Summer mode instance" + annotation (Placement(transformation(extent={{42,-18},{62,2}}))); + replaceable parameter BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition parPIDHeaPum constrainedby BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition "PID parameters of heat pump" annotation (choicesAllMatching=true, - Dialog(group="Primary device"), + Dialog(group="Heat Pump"), Placement(transformation(extent={{100,40},{120,60}}))); replaceable BESMod.Systems.Hydraulical.Control.RecordsCollection.HeatPumpSafetyControl @@ -84,8 +108,8 @@ partial model PartialHeatPumpSystemController final timeDer=parPIDHeaPum.timeDer, final Nd=parPIDHeaPum.Nd) constrainedby BESMod.Systems.Hydraulical.Control.Components.RelativeSpeedController.BaseClasses.PartialControler - "Control of primary generation device" annotation ( - Dialog(group="Primary device", tab="Advanced"), + "Control of heat pump" annotation ( + Dialog(group="Heat Pump", tab="Advanced"), choicesAllMatching=true, Placement(transformation(extent={{102,82},{118,98}}))); @@ -136,6 +160,7 @@ partial model PartialHeatPumpSystemController rotation=180, origin={170,64}))); Components.BuildingAndDHWControl buiAndDHWCtr( + final use_dhw=use_dhw, final nZones=parTra.nParallelDem, final TSup_nominal=max(parTra.TTra_nominal), final TRet_nominal=max(parTra.TTra_nominal .- parTra.dTTra_nominal), @@ -147,12 +172,20 @@ partial model PartialHeatPumpSystemController redeclare final model SummerMode = SummerMode, redeclare final model DHWHysteresis = DHWHysteresis, redeclare final model BuildingHysteresis = BuildingHysteresis, - redeclare final model DHWSetTemperature = DHWSetTemperature) + redeclare final model DHWSetTemperature = DHWSetTemperature, + final useExtSGSig=useExtSGSig, + final TAddSta3Bui=TAddSta3Bui, + final useSGReady=useSGReady, + final TAddSta4Bui=TAddSta4Bui, + final filNamSGReady=filNamSGReady, + final TAddSta3DHW=TAddSta3DHW, + final TAddSta4DHW=TAddSta4DHW) "Control for building and DHW system" annotation (Placement(transformation(extent={{-200,20},{-120,80}}))); Components.BaseClasses.SetAndMeasuredValueSelector setAndMeaSelPri( final meaVal=meaValPriGen, + final use_dhw=use_dhw, final dTTraToDis_nominal=parTra.dTLoss_nominal[1], final dTDisToGen_nominal=parDis.dTTra_nominal[1] + parGen.dTLoss_nominal[1], final dTDHWToGen_nominal=parDis.dTTraDHW_nominal, @@ -161,6 +194,7 @@ partial model PartialHeatPumpSystemController annotation (Placement(transformation(extent={{40,60},{60,80}}))); Components.BaseClasses.SetAndMeasuredValueSelector setAndMeaSelSec( final meaVal=meaValSecGen, + final use_dhw=use_dhw, final dTTraToDis_nominal=parTra.dTLoss_nominal[1], final dTDisToGen_nominal=parDis.dTTra_nominal[1] + parGen.dTLoss_nominal[1], final dTDHWToGen_nominal=parDis.dTTraDHW_nominal, @@ -310,7 +344,9 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - annotation (Diagram(graphics={ + annotation (Dialog(group="SG Ready"), + Dialog(group="SG Ready"), + Diagram(graphics={ Rectangle( extent={{4,100},{136,36}}, lineColor={28,108,200}, diff --git a/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/SetAndMeasuredValueSelector.mo b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/SetAndMeasuredValueSelector.mo index a566a165..31556dd9 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/SetAndMeasuredValueSelector.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/SetAndMeasuredValueSelector.mo @@ -4,6 +4,7 @@ model SetAndMeasuredValueSelector parameter BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue meaVal "Type of measurement to use in control"; + parameter Boolean use_dhw = true "=false to disable DHW"; parameter Modelica.Units.SI.TemperatureDifference dTTraToDis_nominal "Nominal temperature difference between transfer and distribution system"; @@ -22,24 +23,27 @@ model SetAndMeasuredValueSelector sigBusGen annotation (Placement(transformation(extent={{-116,-98},{-84,-66}}), iconTransformation(extent={{-116,-98},{-84,-66}}))); - Modelica.Blocks.Interfaces.BooleanInput DHW "=true for DHW loading" + Modelica.Blocks.Interfaces.BooleanInput DHW if use_dhw + "=true for DHW loading" annotation (Placement(transformation(extent={{-120,50},{-100,70}}))); Modelica.Blocks.Interfaces.RealInput TBuiSet(unit="K", displayUnit="degC") "Building supply set temperature" annotation (Placement(transformation(extent={{-120,18},{-100,38}}))); Modelica.Blocks.Interfaces.RealInput TDHWSet(unit="K", displayUnit="degC") + if use_dhw "DHW supply set temperature" annotation (Placement(transformation(extent={{-120,78},{-100,98}}))); BESMod.Systems.Hydraulical.Control.Components.BaseClasses.ConstantAdd constAddBuf(final k=dTBui_nominal) "Add temperature difference in DHW system" annotation (Placement(transformation(extent={{-60,30},{-40,50}}))); - Modelica.Blocks.Logical.Switch swiDHWBuiSet "Switch between building and DHW" + Modelica.Blocks.Logical.Switch swiDHWBuiSet if use_dhw + "Switch between building and DHW" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-10,60}))); BESMod.Systems.Hydraulical.Control.Components.BaseClasses.ConstantAdd - constAddDHW(final k=dTTraDHW_nominal + dTHysDHW/2) + constAddDHW(final k=dTTraDHW_nominal + dTHysDHW/2) if use_dhw "Add temperature difference in DHW system" annotation (Placement(transformation(extent={{-60,70},{-40,90}}))); Modelica.Blocks.Interfaces.RealOutput TMea(unit="K", displayUnit="degC") @@ -49,6 +53,7 @@ model SetAndMeasuredValueSelector "Set temperature" annotation (Placement(transformation(extent={{100,50},{120,70}}))); Modelica.Blocks.Logical.Switch swiDHWBuiMea if meaVal == BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.DistributionTemperature + and use_dhw "Switch between building and DHW" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -89,8 +94,8 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(swiDHWBuiMea.u3, sigBusDistr.TStoBufTopMea) annotation (Line(points={{-22, - -48},{-78,-48},{-78,-24},{-80,-24},{-80,-21},{-100,-21}}, color={0,0,127}), + connect(swiDHWBuiMea.u3, sigBusDistr.TStoBufTopMea) annotation (Line(points={{-22,-48}, + {-78,-48},{-78,-21},{-100,-21}}, color={0,0,127}), Text( string="%second", index=1, @@ -104,6 +109,20 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); + if not use_dhw then + connect(constAddBuf.y, TSet) annotation (Line( + points={{-39,40},{70,40},{70,60},{110,60}}, + color={0,0,127}, + pattern=LinePattern.Dash)); + connect(TMea, sigBusDistr.TStoBufTopMea) annotation (Line( + points={{110,-40},{26,-40},{26,-58},{-86,-58},{-86,-21},{-100,-21}}, + color={0,0,127}, + pattern=LinePattern.Dash), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + end if; annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); end SetAndMeasuredValueSelector; diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo index 5434f5b8..c6e02365 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Hydraulical.Control.Components; model BuildingAndDHWControl "Control model to control both building and DHW systems" - + parameter Boolean use_dhw = true "=false to disable DHW"; parameter Integer nZones "Number of heated zones"; parameter Modelica.Units.SI.Temperature TSup_nominal "Nominal supply temperature"; @@ -27,7 +27,8 @@ model BuildingAndDHWControl "Hysteresis for building" annotation (choicesAllMatching=true); replaceable model BuildingSupplySetTemperature = BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.IdealHeatingCurve - constrainedby BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.PartialSetpoint( + constrainedby + BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.PartialSetpoint( final TSup_nominal=TSup_nominal, final TRet_nominal=TRet_nominal, final TOda_nominal=TOda_nominal, @@ -51,40 +52,61 @@ model BuildingAndDHWControl constrainedby BESMod.Systems.Hydraulical.Control.Components.SummerMode.BaseClasses.PartialSummerMode "Summer mode model" annotation(choicesAllMatching=true); - + parameter Boolean useSGReady=false "=true to use SG Ready" + annotation (Dialog(group="SG Ready")); + parameter Boolean useExtSGSig=true "=true to use external SG ready signal" + annotation (Dialog(group="SG Ready", enable=useSGReady)); + parameter Modelica.Units.SI.TemperatureDifference TAddSta3Bui=5 + "Increase for SG-Ready state 3 for building supply" + annotation (Dialog(group="SG Ready", enable=useSGReady)); + parameter Modelica.Units.SI.TemperatureDifference TAddSta4Bui=10 + "Increase for SG-Ready state 4 for building supply" + annotation (Dialog(group="SG Ready", enable=useSGReady)); + parameter Modelica.Units.SI.TemperatureDifference TAddSta3DHW=5 + "Increase for SG-Ready state 3 for DHW supply" + annotation (Dialog(group="SG Ready", enable=useSGReady)); + parameter Modelica.Units.SI.TemperatureDifference TAddSta4DHW=10 + "Increase for SG-Ready state 4 for DHW supply" + annotation (Dialog(group="SG Ready", enable=useSGReady)); + parameter String filNamSGReady=ModelicaServices.ExternalReferences.loadResource("modelica://BESMod/Resources/SGReady/EVU_Sperre_EON.txt") + "Name of SG Ready scenario input file" + annotation (Dialog(group="SG Ready", enable=not useExtSGSig and useSGReady)); SummerMode sumMod "Summer mode instance" annotation (Placement(transformation(extent={{42,-18},{62,2}}))); BuildingHysteresis hysBui "Hysteresis for building" annotation (Placement( - transformation(extent={{42,-78},{58,-62}}))); + transformation(extent={{40,-80},{60,-60}}))); BuildingSupplySetTemperature TSetBuiSup "Building supply set temperature module" annotation ( - Placement(transformation(extent={{-60,-100},{-40,-80}}))); - DHWHysteresis hysDHW + Placement(transformation(extent={{-70,-80},{-50,-60}}))); + DHWHysteresis hysDHW if use_dhw "Hysteresis for DHW system" annotation (Placement( - transformation(extent={{62,62},{78,78}}))); - DHWSetTemperature TSetDHW "DHW set temperature module" annotation ( - Placement(transformation(extent={{-78,82},{-62,98}}))); + transformation(extent={{60,60},{80,80}}))); + DHWSetTemperature TSetDHW if use_dhw + "DHW set temperature module" annotation ( + Placement(transformation(extent={{-80,80},{-60,100}}))); Modelica.Blocks.Logical.Or priGenOn "Turn on primary generation device" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={250,-90}))); - Modelica.Blocks.MathBoolean.Or orDHW(nu=3) "If any is true, dhw is activated" + origin={232,-90}))); + Modelica.Blocks.MathBoolean.Or orDHW(nu=3) if use_dhw + "If any is true, dhw is activated" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={130,70}))); + origin={110,70}))); BESMod.Utilities.SupervisoryControl.SupervisoryControl supCtrDHW(ctrlType=supCtrDHWTyp) - "Supervisory control of DHW" + if use_dhw "Supervisory control of DHW" annotation (Placement(transformation(extent={{0,60},{20,80}}))); Modelica.Blocks.Interfaces.RealInput TOda(unit="K", displayUnit="degC") "Outdoor air temperature" annotation (Placement(transformation(extent={{-140,-20},{-100,20}}))); Modelica.Blocks.Interfaces.RealOutput TDHWSet(unit="K", displayUnit="degC") + if use_dhw "DHW supply set temperature" annotation (Placement(transformation(extent={{300,70},{320,90}}))); Modelica.Blocks.Math.MinMax maxSecHeaGen(nu=3) @@ -107,11 +129,11 @@ model BuildingAndDHWControl transformation( extent={{-10,-10},{10,10}}, rotation=0, - origin={210,-110}))); + origin={192,-112}))); Modelica.Blocks.Interfaces.BooleanOutput secGen "=true to activate secondary generator" annotation (Placement(transformation(extent={{300,-80},{320,-60}}))); - Modelica.Blocks.Logical.Switch swiAntLeg + Modelica.Blocks.Logical.Switch swiAntLeg if use_dhw "Switch to full load for anti legionella" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, @@ -128,33 +150,35 @@ model BuildingAndDHWControl annotation (Placement(transformation(extent={{-140,-100},{-100,-60}}))); Utilities.SupervisoryControl.SupervisoryControl supCtrHeaCur(ctrlType= supCtrHeaCurTyp) "Supervisory control of heating curve" - annotation (Placement(transformation(extent={{0,-100},{20,-80}}))); - Modelica.Blocks.Sources.Constant constAntLeg(final k=1) + annotation (Placement(transformation(extent={{10,-100},{30,-80}}))); + Modelica.Blocks.Sources.Constant constAntLeg(final k=1) if use_dhw "For anti legionella, run secondary device at full load" annotation (Placement(transformation(extent={{-80,50},{-60,70}}))); - Modelica.Blocks.Sources.Constant constAntLegOff(final k=0) + Modelica.Blocks.Sources.Constant constAntLegOff(final k=0) if use_dhw "Disable secondary device if no anti legionella" annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); Modelica.Blocks.Logical.Not bufOn "buffer is charged" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, - rotation=0, - origin={160,80}))); + rotation=90, + origin={260,62}))); Modelica.Blocks.Math.BooleanToReal booToReal(final realTrue=1, final realFalse= 0) "Convert singal to real" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, - rotation=0, - origin={200,80}))); - Modelica.Blocks.Interfaces.BooleanOutput DHW "=true for DHW loading" + rotation=90, + origin={260,92}))); + Modelica.Blocks.Interfaces.BooleanOutput DHW if use_dhw + "=true for DHW loading" annotation (Placement(transformation(extent={{300,42},{320,62}}))); Modelica.Blocks.Interfaces.RealOutput TBuiSet(unit="K", displayUnit="degC") "Building supply set temperature" annotation (Placement(transformation(extent={{300,10},{320,30}}))); - Modelica.Blocks.Logical.LogicalSwitch logSwiDHW "Logical switch" - annotation (Placement(transformation(extent={{240,10},{260,30}}))); - Modelica.Blocks.Sources.BooleanConstant conSumMod(final k=true) - "Constant summer mode" - annotation (Placement(transformation(extent={{180,20},{200,40}}))); + Modelica.Blocks.Logical.LogicalSwitch logSwiDHW if use_dhw + "Logical switch" + annotation (Placement(transformation(extent={{160,80},{180,60}}))); + Modelica.Blocks.Sources.BooleanConstant conSumMod(final k=true) if use_dhw + "Constant DHW true in summer mode" + annotation (Placement(transformation(extent={{130,80},{150,100}}))); Modelica.Blocks.Logical.LogicalSwitch logSwiSumModSecGen "Logical switch for second heat generator" annotation (Placement(transformation(extent={{120,-120},{140,-100}}))); @@ -171,28 +195,60 @@ model BuildingAndDHWControl rotation=0, origin={90,-10}))); Modelica.Blocks.Routing.RealPassThrough - realPassThrough + realPassThrough if use_dhw "Disable secondary device if no anti legionella" annotation (Placement(transformation(extent={{0,120},{20,140}}))); + Modelica.Blocks.Logical.And priGenOffSGRead "Turn off due to SG Ready" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={270,-78}))); + Modelica.Blocks.Logical.And secGenOffSGRead "Turn off due to SG Ready" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={276,-126}))); + SetTemperatureSGReady TSetBuiSupSGReady( + final useSGReady=useSGReady, + final filNam=filNamSGReady, + final TAddSta3=TAddSta3Bui, + final TAddSta4=TAddSta4Bui, + final useExtSGSig=useExtSGSig) + "Supply set temperature after SG Ready signal" + annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}))); + + SetTemperatureSGReady TSetDHWSGReady( + final useSGReady=useSGReady, + final filNam=filNamSGReady, + final TAddSta3=TAddSta3DHW, + final TAddSta4=TAddSta4DHW, + final useExtSGSig=useExtSGSig) + if use_dhw + "DHW set temperature after SG Ready signal" + annotation (Placement(transformation(extent={{-40,68},{-20,88}}))); + Modelica.Blocks.Sources.BooleanConstant conDHWOff(final k=false) + if not use_dhw "Constant DHW true in summer mode" + annotation (Placement(transformation(extent={{180,20},{200,40}}))); equation - connect(hysDHW.priGenOn, priGenOn.u1) annotation (Line(points={{79.12,75.6},{79.12, - 74},{108,74},{108,46},{230,46},{230,-90},{238,-90}}, color={255,0,255})); - connect(TSetDHW.y, orDHW.u[1]) annotation (Line(points={{-61.2,85.36},{-54, - 85.36},{-54,50},{-48,50},{-48,34},{90,34},{90,74},{108,74},{108, - 67.6667},{120,67.6667}}, color={255,0,255})); - connect(hysDHW.secGenOn, orDHW.u[2]) annotation (Line(points={{79.12,66},{90,66}, - {90,50},{120,50},{120,70}}, color={255,0,255})); - connect(TSetDHW.TSetDHW, supCtrDHW.uLoc) annotation (Line(points={{-61.2,90},{-10, - 90},{-10,62},{-2,62}}, color={0,0,127})); - connect(supCtrDHW.y, hysDHW.TSupSet) annotation (Line(points={{22,70},{22,56},{70, - 56},{70,61.2}}, color={0,0,127})); - connect(TSetBuiSup.TOda, TOda) annotation (Line(points={{-62,-90},{-90,-90},{-90, - 0},{-120,0}}, color={0,0,127})); + connect(hysDHW.priGenOn, priGenOn.u1) annotation (Line(points={{81.4,77},{81.4, + 76},{90,76},{90,32},{176,32},{176,-60},{194,-60},{194,-90},{220,-90}}, + color={255,0,255})); + connect(TSetDHW.y, orDHW.u[1]) annotation (Line(points={{-59,84.2},{-54,84.2}, + {-54,34},{94,34},{94,64},{100,64},{100,67.6667}}, + color={255,0,255})); + connect(hysDHW.secGenOn, orDHW.u[2]) annotation (Line(points={{81.4,65},{81.4, + 70},{100,70}}, color={255,0,255})); + connect(supCtrDHW.y, hysDHW.TSupSet) annotation (Line(points={{22,70},{22,56}, + {70,56},{70,59}}, + color={0,0,127})); + connect(TSetBuiSup.TOda, TOda) annotation (Line(points={{-72,-70},{-90,-70},{-90, + -38},{-54,-38},{-54,0},{-120,0}}, + color={0,0,127})); connect(TSetDHW.sigBusDistr, sigBusDistr) annotation (Line( - points={{-78,89.92},{-78,90},{-86,90},{-86,70},{-100,70}}, + points={{-80,89.9},{-80,90},{-86,90},{-86,70},{-100,70}}, color={255,204,51}, thickness=0.5)); - connect(hysBui.TOda, TOda) annotation (Line(points={{50,-61.04},{50,-54},{-54,-54}, + connect(hysBui.TOda, TOda) annotation (Line(points={{50,-58.8},{50,-54},{-54,-54}, {-54,0},{-120,0}}, color={0,0,127})); connect(supCtrDHW.uSup, sigBusHyd.TSetDHWOve) annotation (Line(points={{-2,78}, {-8,78},{-8,88},{78,88},{78,84},{100,84},{100,103}}, color={0,0,127}), @@ -202,46 +258,39 @@ equation extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(supCtrDHW.actInt, sigBusHyd.oveTSetDHW) annotation (Line(points={{-2,70}, - {-8,70},{-8,78},{-6,78},{-6,86},{78,86},{78,84},{100,84},{100,103}}, + {-8,70},{-8,88},{78,88},{78,84},{100,84},{100,103}}, color={255,0,255}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(hysDHW.priGenOn, orDHW.u[3]) annotation (Line(points={{79.12,75.6},{ - 79.12,74},{108,74},{108,72.3333},{120,72.3333}}, + connect(hysDHW.secGenOn, secGenOn.u[1]) annotation (Line(points={{81.4,65},{ + 88,65},{88,34},{176,34},{176,-114.333},{182,-114.333}}, color={255,0,255})); - connect(priGenOn.y, priGren) annotation (Line(points={{261,-90},{294,-90},{294, - -110},{310,-110}}, - color={255,0,255})); - connect(secGenOn.y, secGen) annotation (Line(points={{221.5,-110},{286,-110},{ - 286,-70},{310,-70}}, color={255,0,255})); - connect(hysDHW.secGenOn, secGenOn.u[1]) annotation (Line(points={{79.12,66},{ - 90,66},{90,34},{178,34},{178,-112.333},{200,-112.333}}, - color={255,0,255})); - connect(TSetDHW.y, secGenOn.u[2]) annotation (Line(points={{-61.2,85.36},{-54, - 85.36},{-54,50},{-48,50},{-48,34},{178,34},{178,-110},{200,-110}}, + connect(TSetDHW.y, secGenOn.u[2]) annotation (Line(points={{-59,84.2},{-54,84.2}, + {-54,34},{176,34},{176,-112},{182,-112}}, color={255,0,255})); connect(maxSecHeaGen.u[1], hysDHW.ySecGenSet) annotation (Line(points={{200, - -47.6667},{86,-47.6667},{86,63.12},{79.12,63.12}}, color={0, + -47.6667},{180,-47.6667},{180,-48},{164,-48},{164,42},{84,42},{84,58}, + {81.4,58},{81.4,61.4}}, color={0, 0,127})); connect(maxSecHeaGen.u[2], hysBui.ySecGenSet) annotation (Line(points={{200,-50}, - {66,-50},{66,-76.88},{59.12,-76.88}}, color={0,0,127})); - connect(swiAntLeg.y, maxSecHeaGen.u[3]) annotation (Line(points={{-19,50},{86, - 50},{86,-52.3333},{200,-52.3333}}, + {200,-44},{72,-44},{72,-78.6},{61.4,-78.6}}, + color={0,0,127})); + connect(swiAntLeg.y, maxSecHeaGen.u[3]) annotation (Line(points={{-19,50},{ + 164,50},{164,-52.3333},{200,-52.3333}}, color={0,0,127})); - connect(TSetDHW.y, swiAntLeg.u2) annotation (Line(points={{-61.2,85.36},{-54, - 85.36},{-54,50},{-42,50}}, - color={255,0,255})); - connect(hysDHW.TStoTop, sigBusDistr.TStoDHWTopMea) annotation (Line(points={{61.2, - 75.6},{48,75.6},{48,102},{-90,102},{-90,70},{-100,70}}, color={0,0,127}), + connect(TSetDHW.y, swiAntLeg.u2) annotation (Line(points={{-59,84.2},{-54,84.2}, + {-54,50},{-42,50}}, color={255,0,255})); + connect(hysDHW.TStoTop, sigBusDistr.TStoDHWTopMea) annotation (Line(points={{59,77}, + {48,77},{48,102},{-90,102},{-90,70},{-100,70}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(hysDHW.TStoBot, sigBusDistr.TStoDHWBotMea) annotation (Line(points={{61.2, - 66},{48,66},{48,102},{-90,102},{-90,70},{-100,70}}, color={0,0,127}), + connect(hysDHW.TStoBot, sigBusDistr.TStoDHWBotMea) annotation (Line(points={{59,65}, + {48,65},{48,102},{-90,102},{-90,70},{-100,70}}, color={0,0,127}), Text( string="%second", index=1, @@ -250,95 +299,95 @@ equation connect(maxSecHeaGen.yMax, ySecGenSet) annotation (Line(points={{221,-56},{286,-56},{286,-40},{310,-40}}, color={0,0,127})); - connect(TOda, hysDHW.TOda) annotation (Line(points={{-120,0},{-94,0},{-94,102},{ - 70,102},{70,78.96}}, color={0,0,127})); - connect(hysBui.TStoTop, sigBusDistr.TStoBufTopMea) annotation (Line(points={{41.2, - -64.4},{38,-64.4},{38,-64},{34,-64},{34,6},{-100,6},{-100,70}}, color={0, + connect(TOda, hysDHW.TOda) annotation (Line(points={{-120,0},{-94,0},{-94,102}, + {70,102},{70,81.2}}, color={0,0,127})); + connect(hysBui.TStoTop, sigBusDistr.TStoBufTopMea) annotation (Line(points={{39,-63}, + {38,-63},{38,-64},{34,-64},{34,6},{-100,6},{-100,70}}, color={0, 0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(hysBui.TStoBot, sigBusDistr.TStoBufBotMea) annotation (Line(points={{41.2, - -74},{34,-74},{34,6},{-100,6},{-100,70}}, color={0,0,127}), Text( + connect(hysBui.TStoBot, sigBusDistr.TStoBufBotMea) annotation (Line(points={{39,-75}, + {34,-75},{34,6},{-100,6},{-100,70}}, color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); connect(supCtrHeaCur.y, hysBui.TSupSet) - annotation (Line(points={{22,-90},{50,-90},{50,-78.8}}, color={0,0,127})); - connect(supCtrHeaCur.uLoc, TSetBuiSup.TSet) annotation (Line(points={{-2,-98},{-14, - -98},{-14,-90},{-39,-90}}, color={0,0,127})); + annotation (Line(points={{32,-90},{50,-90},{50,-81}}, color={0,0,127})); connect(constAntLegOff.y, swiAntLeg.u3) annotation (Line(points={{-59,30},{-50, 30},{-50,42},{-42,42}}, color={0,0,127})); connect(constAntLeg.y, swiAntLeg.u1) annotation (Line(points={{-59,60},{-59,58},{-42,58}}, color={0,0,127})); - connect(booToReal.y, sigBusDistr.uThrWayVal) annotation (Line(points={{211,80}, - {216,80},{216,116},{-100,116},{-100,70}}, color={0,0,127}), Text( + connect(booToReal.y, sigBusDistr.uThrWayVal) annotation (Line(points={{260,103}, + {260,112},{-118,112},{-118,70},{-100,70}},color={0,0,127}), Text( string="%second", index=1, extent={{-3,-6},{-3,-6}}, horizontalAlignment=TextAlignment.Right)); connect(booToReal.u, bufOn.y) - annotation (Line(points={{188,80},{171,80}}, color={255,0,255})); - connect(supCtrHeaCur.uSup, sigBusHyd.TBuiSupOve) annotation (Line(points={{-2,-82}, - {-16,-82},{-16,12},{-106,12},{-106,132},{100,132},{100,103}}, color={0,0, + annotation (Line(points={{260,80},{260,73}}, color={255,0,255})); + connect(supCtrHeaCur.uSup, sigBusHyd.TBuiSupOve) annotation (Line(points={{8,-82}, + {4,-82},{4,12},{-106,12},{-106,102},{100,102},{100,103}}, color={0,0, 127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(supCtrHeaCur.actInt, sigBusHyd.oveTBuiSup) annotation (Line(points={{-2, - -90},{-16,-90},{-16,12},{-106,12},{-106,132},{100,132},{100,103}}, + connect(supCtrHeaCur.actInt, sigBusHyd.oveTBuiSup) annotation (Line(points={{8,-90}, + {4,-90},{4,12},{-106,12},{-106,102},{100,102},{100,103}}, color={255,0,255}), Text( string="%second", index=1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(supCtrHeaCur.y, TBuiSet) annotation (Line(points={{22,-90},{56,-90},{56, - -134},{284,-134},{284,20},{310,20}}, color={0,0,127})); + connect(supCtrHeaCur.y, TBuiSet) annotation (Line(points={{32,-90},{90,-90},{90, + -30},{292,-30},{292,20},{310,20}}, color={0,0,127})); connect(supCtrDHW.y, TDHWSet) annotation (Line(points={{22,70},{22,42},{274,42}, {274,80},{310,80}}, color={0,0,127})); connect(logSwiSumModPriGen.y, priGenOn.u2) annotation (Line(points={{141,-70}, - {164,-70},{164,-98},{238,-98}}, color={255,0,255})); + {188,-70},{188,-98},{220,-98}}, color={255,0,255})); connect(logSwiSumModSecGen.y, secGenOn.u[3]) annotation (Line(points={{141, - -110},{140,-110},{140,-126},{200,-126},{200,-107.667}}, - color={255,0,255})); - connect(logSwiDHW.y, DHW) annotation (Line(points={{261,20},{282,20},{282,52}, - {310,52}}, color={255,0,255})); + -110},{141,-109.667},{182,-109.667}}, color={255,0,255})); + connect(logSwiDHW.y, DHW) annotation (Line(points={{181,70},{212,70},{212,44}, + {294,44},{294,52},{310,52}}, + color={255,0,255})); connect(logSwiSumModSecGen.u3, conSumModGen.y) annotation (Line(points={{118, -118},{102,-118},{102,-130},{41,-130}}, color={255,0,255})); - connect(hysBui.secGenOn, logSwiSumModSecGen.u1) annotation (Line(points={{ - 59.12,-74},{104,-74},{104,-102},{118,-102}}, color={255,0,255})); + connect(hysBui.secGenOn, logSwiSumModSecGen.u1) annotation (Line(points={{61.4, + -75},{104,-75},{104,-102},{118,-102}}, color={255,0,255})); connect(logSwiSumModPriGen.u3, conSumModGen.y) annotation (Line(points={{118, -78},{64,-78},{64,-130},{41,-130}}, color={255,0,255})); - connect(hysBui.priGenOn, logSwiSumModPriGen.u1) annotation (Line(points={{ - 59.12,-64.4},{59.12,-62},{118,-62}}, color={255,0,255})); - connect(conSumMod.y, logSwiDHW.u3) annotation (Line(points={{201,30},{232,30}, - {232,12},{238,12}}, color={255,0,255})); - connect(logSwiDHW.u1, orDHW.y) annotation (Line(points={{238,28},{234,28},{234,62}, - {141.5,62},{141.5,70}}, color={255,0,255})); + connect(hysBui.priGenOn, logSwiSumModPriGen.u1) annotation (Line(points={{61.4, + -63},{61.4,-62},{118,-62}}, color={255,0,255})); + connect(conSumMod.y, logSwiDHW.u3) annotation (Line(points={{151,90},{151,84}, + {158,84},{158,78}}, color={255,0,255})); + connect(logSwiDHW.u1, orDHW.y) annotation (Line(points={{158,62},{126,62},{126, + 70},{121.5,70}}, color={255,0,255})); connect(sumMod.TOda, TOda) annotation (Line(points={{40,-8},{-54,-8},{-54,0},{-120, 0}}, color={0,0,127})); - connect(winMod.y, logSwiSumModPriGen.u2) annotation (Line(points={{101,-10},{100, - -10},{100,-70},{118,-70}}, color={255,0,255})); - connect(winMod.y, logSwiSumModSecGen.u2) annotation (Line(points={{101,-10},{100, - -10},{100,-70},{112,-70},{112,-110},{118,-110}}, color={255,0,255})); + connect(winMod.y, logSwiSumModPriGen.u2) annotation (Line(points={{101,-10},{104, + -10},{104,-70},{118,-70}}, color={255,0,255})); + connect(winMod.y, logSwiSumModSecGen.u2) annotation (Line(points={{101,-10},{104, + -10},{104,-110},{118,-110}}, color={255,0,255})); connect(winMod.u, sumMod.sumMod) annotation (Line(points={{78,-10},{66,-10},{66, -8},{63,-8}}, color={255,0,255})); - connect(winMod.y, logSwiDHW.u2) annotation (Line(points={{101,-10},{228,-10},{228, - 20},{238,20}}, color={255,0,255})); - connect(logSwiDHW.y, bufOn.u) annotation (Line(points={{261,20},{266,20},{266, - 66},{148,66},{148,80}}, color={255,0,255})); - connect(TSetBuiSup.TSet, sigBusHyd.TBuiLoc) annotation (Line(points={{-39,-90},{-20, - -90},{-20,-24},{-112,-24},{-112,103},{100,103}}, color={0,0,127}), + connect(winMod.y, logSwiDHW.u2) annotation (Line(points={{101,-10},{108,-10},{ + 108,54},{132,54},{132,70},{158,70}}, + color={255,0,255})); + connect(logSwiDHW.y, bufOn.u) annotation (Line(points={{181,70},{212,70},{212, + 44},{260,44},{260,50}}, color={255,0,255})); + connect(TSetBuiSup.TSet, sigBusHyd.TBuiLoc) annotation (Line(points={{-49,-70}, + {4,-70},{4,12},{-106,12},{-106,102},{100,102},{100,103}}, + color={0,0,127}), Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(realPassThrough.y, sigBusHyd.TStoDHWTop) annotation (Line(points={{21, - 130},{21,100},{78,100},{78,84},{100,84},{100,103}}, color={0,0,127}), + connect(realPassThrough.y, sigBusHyd.TStoDHWTop) annotation (Line(points={{21,130}, + {100,130},{100,103}}, color={0,0,127}), Text( string="%second", index=1, @@ -350,11 +399,59 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(TSetBuiSup.TZoneMea, TZoneMea) annotation (Line(points={{-62,-82},{-86,-82}, - {-86,-40},{-120,-40}}, color={0,0,127})); - connect(TSetBuiSup.TZoneSet, TZoneSet) annotation (Line(points={{-62,-98},{-92,-98}, - {-92,-80},{-120,-80}}, color={0,0,127})); - annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140}, + connect(TSetBuiSup.TZoneMea, TZoneMea) annotation (Line(points={{-72,-62},{-92, + -62},{-92,-40},{-120,-40}}, + color={0,0,127})); + connect(TSetBuiSup.TZoneSet, TZoneSet) annotation (Line(points={{-72,-78},{-94, + -78},{-94,-80},{-120,-80}}, + color={0,0,127})); + connect(TSetDHW.TSetDHW, sigBusHyd.TSetDHW) annotation (Line(points={{-59,90}, + {78,90},{78,84},{100,84},{100,103}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(priGenOffSGRead.y, priGren) annotation (Line(points={{281,-78},{294, + -78},{294,-110},{310,-110}}, color={255,0,255})); + connect(secGenOffSGRead.y, secGen) annotation (Line(points={{287,-126},{290, + -126},{290,-70},{310,-70}}, color={255,0,255})); + connect(TSetBuiSupSGReady.TSet, supCtrHeaCur.uLoc) annotation (Line(points={{-18, + -85},{-8,-85},{-8,-98},{8,-98}}, color={0,0,127})); + connect(TSetBuiSup.TSet, TSetBuiSupSGReady.TSetLocCtrl) + annotation (Line(points={{-49,-70},{-49,-85},{-42,-85}}, color={0,0,127})); + connect(TSetBuiSupSGReady.signal, sigBusHyd.SGReady) annotation (Line(points={{-42,-97}, + {-44,-97},{-44,-98},{-46,-98},{-46,12},{-106,12},{-106,103},{100,103}}, + color={255,127,0}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(supCtrDHW.uLoc, TSetDHWSGReady.TSet) annotation (Line(points={{-2,62}, + {-12,62},{-12,83},{-18,83}}, color={0,0,127})); + connect(TSetDHWSGReady.TSetLocCtrl, TSetDHW.TSetDHW) annotation (Line(points={ + {-42,83},{-42,82},{-52,82},{-52,90},{-59,90}}, color={0,0,127})); + connect(TSetDHWSGReady.signal, sigBusHyd.SGReady) annotation (Line(points={{-42, + 71},{-48,71},{-48,103},{100,103}}, color={255,127,0}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(secGenOffSGRead.u1, secGenOn.y) annotation (Line(points={{264,-126},{208, + -126},{208,-112},{203.5,-112}}, color={255,0,255})); + connect(secGenOffSGRead.u2, TSetBuiSupSGReady.canRun) annotation (Line(points= + {{264,-134},{92,-134},{92,-110},{-12,-110},{-12,-97},{-18,-97}}, color= + {255,0,255})); + connect(TSetBuiSupSGReady.canRun, priGenOffSGRead.u2) annotation (Line(points= + {{-18,-97},{-16,-97},{-16,-100},{-12,-100},{-12,-110},{92,-110},{92,-134}, + {250,-134},{250,-86},{258,-86}}, color={255,0,255})); + connect(priGenOn.y, priGenOffSGRead.u1) annotation (Line(points={{243,-90},{246, + -90},{246,-78},{258,-78}}, color={255,0,255})); + connect(hysDHW.priGenOn, orDHW.u[3]) annotation (Line(points={{81.4,77},{81.4, + 76},{96,76},{96,72.3333},{100,72.3333}}, color={255,0,255})); + connect(conDHWOff.y, bufOn.u) + annotation (Line(points={{201,30},{260,30},{260,50}}, color={255,0,255})); + annotation (Dialog(group="SG Ready", enable=useSGReady), + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140}, {300,100}})), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140},{300,100}}), graphics={ Rectangle( diff --git a/BESMod/Systems/Hydraulical/Control/Components/SetTemperatureSGReady.mo b/BESMod/Systems/Hydraulical/Control/Components/SetTemperatureSGReady.mo new file mode 100644 index 00000000..5fdb356f --- /dev/null +++ b/BESMod/Systems/Hydraulical/Control/Components/SetTemperatureSGReady.mo @@ -0,0 +1,63 @@ +within BESMod.Systems.Hydraulical.Control.Components; +model SetTemperatureSGReady "Model for SG-Ready temperature setpoint" + parameter Boolean useSGReady=true "=true to use SG Ready"; + parameter Modelica.Units.SI.TemperatureDifference TAddSta3=5 "Increase for SG-Ready state 3"; + parameter Modelica.Units.SI.TemperatureDifference TAddSta4=10 "Increase for SG-Ready state 4"; + parameter Boolean useExtSGSig = false "=true to use external SG ready signal"; + parameter String filNam=ModelicaServices.ExternalReferences.loadResource("modelica://BESMod/Resources/EVU_Sperre_EON.txt") + "Name of SG Ready scenario input file" + annotation (Dialog(enable=not useExtSGSig and useSGReady)); + + Modelica.Blocks.Interfaces.RealInput TSetLocCtrl(unit="K") + "Set temperature of local control" + annotation (Placement(transformation(extent={{-140,30},{-100,70}}))); + Modelica.Blocks.Interfaces.RealOutput TSet(unit="K") "Set temperature" + annotation (Placement(transformation(extent={{100,30},{140,70}}))); + Modelica.Blocks.Interfaces.IntegerInput signal(final max=4, final min=1) + if useExtSGSig and useSGReady + "SG Ready signal" + annotation (Placement(transformation(extent={{-140,-90},{-100,-50}}))); + Modelica.Blocks.Routing.IntegerPassThrough internalSignal if useSGReady + "Internal SG Ready signal applied" + annotation (Placement(transformation(extent={{-20,-60},{0,-40}}))); + Modelica.Blocks.Interfaces.BooleanOutput canRun + "If SG Ready blocks operation" + annotation (Placement(transformation(extent={{100,-90},{140,-50}}))); + Modelica.Blocks.Math.RealToInteger realToInteger if not useExtSGSig and useSGReady + annotation(Placement(transformation(extent={{-60,-20}, + {-40,0}}))); + Modelica.Blocks.Sources.CombiTimeTable + datRea( + final tableOnFile=true, + final tableName="SGReady", + final fileName=filNam, + verboseRead=false, + columns={2}, + final smoothness=Modelica.Blocks.Types.Smoothness.ConstantSegments, + extrapolation=Modelica.Blocks.Types.Extrapolation.Periodic) + if not useExtSGSig + "Data reader" + annotation (Placement(transformation(extent={{-90,-20},{-70,0}}))); +equation + if useSGReady then + if internalSignal.y == 4 then + TSet = TSetLocCtrl + TAddSta4; + elseif internalSignal.y == 3 then + TSet = TSetLocCtrl + TAddSta3; + else + TSet = TSetLocCtrl; + end if; + canRun = internalSignal.y <> 1; + else + TSet = TSetLocCtrl; + canRun = true; + end if; + connect(internalSignal.u, signal) annotation (Line(points={{-22,-50},{-94,-50}, + {-94,-70},{-120,-70}}, color={255,127,0})); + connect(datRea.y[1], realToInteger.u) + annotation (Line(points={{-69,-10},{-62,-10}}, color={0,0,127})); + connect(realToInteger.y, internalSignal.u) annotation (Line(points={{-39,-10}, + {-32,-10},{-32,-50},{-22,-50}}, color={255,127,0})); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false))); +end SetTemperatureSGReady; diff --git a/BESMod/Systems/Hydraulical/Control/Components/package.order b/BESMod/Systems/Hydraulical/Control/Components/package.order index 785608dd..829a82e0 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/package.order +++ b/BESMod/Systems/Hydraulical/Control/Components/package.order @@ -1,5 +1,6 @@ BoilerInHybridSystem BuildingAndDHWControl +SetTemperatureSGReady BivalentOnOffControllers BuildingSupplyTemperatureSetpoints DHWSetControl From 5a23cb90d17f920fe0ba27fecca03d6ff40302ce Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Thu, 11 Apr 2024 12:32:26 +0200 Subject: [PATCH 126/131] add example for system wo dhw --- BESMod/Examples/DesignOptimization/BES.mo | 4 +- .../Examples/DesignOptimization/BESNoDHW.mo | 107 ++++++++++++++++++ .../Examples/DesignOptimization/package.order | 1 + .../PartialHeatPumpSystemController.mo | 6 +- .../SetAndMeasuredValueSelector.mo | 4 +- .../Components/BuildingAndDHWControl.mo | 43 ++++--- 6 files changed, 141 insertions(+), 24 deletions(-) create mode 100644 BESMod/Examples/DesignOptimization/BESNoDHW.mo diff --git a/BESMod/Examples/DesignOptimization/BES.mo b/BESMod/Examples/DesignOptimization/BES.mo index 23c189e2..fb4f784b 100644 --- a/BESMod/Examples/DesignOptimization/BES.mo +++ b/BESMod/Examples/DesignOptimization/BES.mo @@ -101,7 +101,7 @@ model BES redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), redeclare Systems.UserProfiles.TEASERProfiles userProfiles, - redeclare AachenSystem systemParameters(use_ventilation=true), + redeclare AachenSystem systemParameters, redeclare ParametersToChange parameterStudy, redeclare final package MediumDHW = AixLib.Media.Water, redeclare final package MediumZone = AixLib.Media.Air, @@ -111,7 +111,7 @@ model BES extends Modelica.Icons.Example; annotation (experiment( - StopTime=31536000, + StopTime=86400, Interval=600, __Dymola_Algorithm="Dassl")); end BES; diff --git a/BESMod/Examples/DesignOptimization/BESNoDHW.mo b/BESMod/Examples/DesignOptimization/BESNoDHW.mo new file mode 100644 index 00000000..b0ed55d9 --- /dev/null +++ b/BESMod/Examples/DesignOptimization/BESNoDHW.mo @@ -0,0 +1,107 @@ +within BESMod.Examples.DesignOptimization; +model BESNoDHW "Example to demonstrate usage without DHW" + extends Systems.BaseClasses.PartialBuildingEnergySystem( + redeclare BESMod.Systems.Electrical.DirectGridConnectionSystem electrical, + redeclare Systems.Demand.Building.TEASERThermalZone building( + ABui=sum(building.zoneParam.VAir)^(2/3), + hBui=sum(building.zoneParam.VAir)^(1/3), + ARoo=sum(building.zoneParam.ARoof), + redeclare BESMod.Systems.Demand.Building.RecordsCollection.RefAachen + oneZoneParam(heaLoadFacGrd=0, heaLoadFacOut=0)), + redeclare BESMod.Systems.Control.NoControl control, + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + redeclare Systems.Hydraulical.Generation.HeatPumpAndElectricHeater generation( + redeclare model PerDataRevHP = + AixLib.DataBase.Chiller.PerformanceData.PolynomalApproach (redeclare + function PolyData = + AixLib.DataBase.HeatPump.Functions.Characteristics.ConstantCoP + ( powerCompressor=2000, CoP=2)), + redeclare + BESMod.Systems.Hydraulical.Components.Frosting.ZhuIceFacCalculation + frost(density=200, redeclare function frostMapFunc = + BESMod.Systems.Hydraulical.Components.Frosting.Functions.ZhuFrostingMapCico), + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare package Medium_eva = AixLib.Media.Air, + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP + parHeaPum( + genDesTyp=BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.BivalentPartParallel, + TBiv=parameterStudy.TBiv, + scalingFactor=hydraulic.generation.parHeaPum.QPri_flow_nominal/ + parameterStudy.QHP_flow_biv, + dpCon_nominal=0, + dpEva_nominal=0, + use_refIne=false, + refIneFre_constant=0), + redeclare + BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater + parEleHea, + redeclare model PerDataMainHP = + AixLib.DataBase.HeatPump.PerformanceData.VCLibMap ( + QCon_flow_nominal=hydraulic.generation.parHeaPum.QPri_flow_nominal, + refrigerant="Propane", + flowsheet="VIPhaseSeparatorFlowsheet"), + redeclare + BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor + parTemSen), + redeclare Systems.Hydraulical.Control.MonoenergeticHeatPumpSystem control( + redeclare + BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled + valCtrl, + redeclare model DHWHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.PartParallelBivalent + ( + TCutOff=parameterStudy.TCutOff, + TBiv=parameterStudy.TBiv, + TOda_nominal=systemParameters.TOda_nominal, + TRoom=systemParameters.TSetZone_nominal[1], + QDem_flow_nominal=systemParameters.QBui_flow_nominal[1], + QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff), + redeclare model BuildingHysteresis = + BESMod.Systems.Hydraulical.Control.Components.BivalentOnOffControllers.PartParallelBivalent + ( + TCutOff=parameterStudy.TCutOff, + TBiv=parameterStudy.TBiv, + TOda_nominal=systemParameters.TOda_nominal, + TRoom=systemParameters.TSetZone_nominal[1], + QDem_flow_nominal=systemParameters.QBui_flow_nominal[1], + QHP_flow_cutOff=parameterStudy.QHP_flow_cutOff), + useSGReady=true, + useExtSGSig=false, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.BasicHeatPumpPI + parPIDHeaPum, + redeclare + BESMod.Systems.Hydraulical.Control.RecordsCollection.DefaultSafetyControl + safetyControl), + redeclare BESMod.Systems.Hydraulical.Distribution.BuildingOnly + distribution(nParallelDem=1), + redeclare Systems.Hydraulical.Transfer.IdealValveRadiator transfer( + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + parRad, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.SteelRadiatorStandardPressureLossData + parTra)), + redeclare Systems.Demand.DHW.StandardProfiles DHW( + redeclare BESMod.Systems.Demand.DHW.RecordsCollection.ProfileM DHWProfile, + redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, + redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic + calcmFlow), + redeclare Systems.UserProfiles.TEASERProfiles userProfiles, + redeclare AachenSystem systemParameters(use_ventilation=false, use_dhw= + false), + redeclare ParametersToChange parameterStudy, + redeclare final package MediumDHW = AixLib.Media.Water, + redeclare final package MediumZone = AixLib.Media.Air, + redeclare final package MediumHyd = AixLib.Media.Water, + redeclare BESMod.Systems.Ventilation.NoVentilation ventilation); + + extends Modelica.Icons.Example; + + annotation (experiment( + StopTime=86400, + Interval=600, + __Dymola_Algorithm="Dassl")); +end BESNoDHW; diff --git a/BESMod/Examples/DesignOptimization/package.order b/BESMod/Examples/DesignOptimization/package.order index 207c8038..842ae747 100644 --- a/BESMod/Examples/DesignOptimization/package.order +++ b/BESMod/Examples/DesignOptimization/package.order @@ -1,3 +1,4 @@ BES +BESNoDHW AachenSystem ParametersToChange diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo index 367885d7..d2225ffa 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialHeatPumpSystemController.mo @@ -80,8 +80,6 @@ partial model PartialHeatPumpSystemController parameter String filNamSGReady=ModelicaServices.ExternalReferences.loadResource("modelica://BESMod/Resources/SGReady/EVU_Sperre_EON.txt") "Name of SG Ready scenario input file" annotation (Dialog(group="SG Ready", enable=not useExtSGSig and useSGReady)); - SummerMode sumMod "Summer mode instance" - annotation (Placement(transformation(extent={{42,-18},{62,2}}))); replaceable parameter BESMod.Systems.Hydraulical.Control.RecordsCollection.PIDBaseDataDefinition parPIDHeaPum constrainedby @@ -344,9 +342,7 @@ equation index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left)); - annotation (Dialog(group="SG Ready"), - Dialog(group="SG Ready"), - Diagram(graphics={ + annotation (Diagram(graphics={ Rectangle( extent={{4,100},{136,36}}, lineColor={28,108,200}, diff --git a/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/SetAndMeasuredValueSelector.mo b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/SetAndMeasuredValueSelector.mo index 31556dd9..dc6ad8ec 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/SetAndMeasuredValueSelector.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BaseClasses/SetAndMeasuredValueSelector.mo @@ -114,7 +114,8 @@ equation points={{-39,40},{70,40},{70,60},{110,60}}, color={0,0,127}, pattern=LinePattern.Dash)); - connect(TMea, sigBusDistr.TStoBufTopMea) annotation (Line( + if meaVal == BESMod.Systems.Hydraulical.Control.Components.BaseClasses.MeasuredValue.DistributionTemperature then + connect(TMea, sigBusDistr.TStoBufTopMea) annotation (Line( points={{110,-40},{26,-40},{26,-58},{-86,-58},{-86,-21},{-100,-21}}, color={0,0,127}, pattern=LinePattern.Dash), Text( @@ -122,6 +123,7 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); + end if; end if; annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); diff --git a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo index c6e02365..c5c52bd2 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/BuildingAndDHWControl.mo @@ -88,7 +88,8 @@ model BuildingAndDHWControl Placement(transformation(extent={{-80,80},{-60,100}}))); - Modelica.Blocks.Logical.Or priGenOn "Turn on primary generation device" + Modelica.Blocks.Logical.Or priGenOn if use_dhw + "Turn on primary generation device" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -109,7 +110,7 @@ model BuildingAndDHWControl if use_dhw "DHW supply set temperature" annotation (Placement(transformation(extent={{300,70},{320,90}}))); - Modelica.Blocks.Math.MinMax maxSecHeaGen(nu=3) + Modelica.Blocks.Math.MinMax maxSecHeaGen(nu=if use_dhw then 3 else 1) "Maximal value suggested for secondary heat generator" annotation (Placement( transformation( extent={{10,-10},{-10,10}}, @@ -124,7 +125,7 @@ model BuildingAndDHWControl Modelica.Blocks.Interfaces.BooleanOutput priGren "=true to activate primary generation device" annotation (Placement(transformation(extent={{300,-120},{320,-100}}))); - Modelica.Blocks.MathBoolean.Or secGenOn(nu=3) + Modelica.Blocks.MathBoolean.Or secGenOn(nu=3) if use_dhw "If any is true, secondary heater is activated" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, @@ -244,10 +245,6 @@ equation connect(TSetBuiSup.TOda, TOda) annotation (Line(points={{-72,-70},{-90,-70},{-90, -38},{-54,-38},{-54,0},{-120,0}}, color={0,0,127})); - connect(TSetDHW.sigBusDistr, sigBusDistr) annotation (Line( - points={{-80,89.9},{-80,90},{-86,90},{-86,70},{-100,70}}, - color={255,204,51}, - thickness=0.5)); connect(hysBui.TOda, TOda) annotation (Line(points={{50,-58.8},{50,-54},{-54,-54}, {-54,0},{-120,0}}, color={0,0,127})); connect(supCtrDHW.uSup, sigBusHyd.TSetDHWOve) annotation (Line(points={{-2,78}, @@ -270,16 +267,15 @@ equation connect(TSetDHW.y, secGenOn.u[2]) annotation (Line(points={{-59,84.2},{-54,84.2}, {-54,34},{176,34},{176,-112},{182,-112}}, color={255,0,255})); - connect(maxSecHeaGen.u[1], hysDHW.ySecGenSet) annotation (Line(points={{200, - -47.6667},{180,-47.6667},{180,-48},{164,-48},{164,42},{84,42},{84,58}, - {81.4,58},{81.4,61.4}}, color={0, + connect(maxSecHeaGen.u[2], hysDHW.ySecGenSet) annotation (Line(points={{200,-50}, + {180,-50},{180,-48},{164,-48},{164,42},{84,42},{84,58},{81.4,58},{81.4, + 61.4}}, color={0, 0,127})); - connect(maxSecHeaGen.u[2], hysBui.ySecGenSet) annotation (Line(points={{200,-50}, + connect(maxSecHeaGen.u[1], hysBui.ySecGenSet) annotation (Line(points={{200,-50}, {200,-44},{72,-44},{72,-78.6},{61.4,-78.6}}, color={0,0,127})); - connect(swiAntLeg.y, maxSecHeaGen.u[3]) annotation (Line(points={{-19,50},{ - 164,50},{164,-52.3333},{200,-52.3333}}, - color={0,0,127})); + connect(swiAntLeg.y, maxSecHeaGen.u[3]) annotation (Line(points={{-19,50},{164, + 50},{164,-50},{200,-50}}, color={0,0,127})); connect(TSetDHW.y, swiAntLeg.u2) annotation (Line(points={{-59,84.2},{-54,84.2}, {-54,50},{-42,50}}, color={255,0,255})); connect(hysDHW.TStoTop, sigBusDistr.TStoDHWTopMea) annotation (Line(points={{59,77}, @@ -450,8 +446,23 @@ equation 76},{96,76},{96,72.3333},{100,72.3333}}, color={255,0,255})); connect(conDHWOff.y, bufOn.u) annotation (Line(points={{201,30},{260,30},{260,50}}, color={255,0,255})); - annotation (Dialog(group="SG Ready", enable=useSGReady), - Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140}, + if use_dhw then + connect(TSetDHW.sigBusDistr, sigBusDistr) annotation (Line( + points={{-80,89.9},{-80,90},{-86,90},{-86,70},{-100,70}}, + color={255,204,51}, + thickness=0.5)); + else + connect(secGenOffSGRead.u1, logSwiSumModSecGen.y) annotation (Line( + points={{264,-126},{148,-126},{148,-110},{141,-110}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + connect(logSwiSumModPriGen.y, priGenOffSGRead.u1) annotation (Line( + points={{141,-70},{250,-70},{250,-78},{258,-78}}, + color={255,0,255}, + pattern=LinePattern.Dash)); + end if; + + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140}, {300,100}})), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-140},{300,100}}), graphics={ Rectangle( From 5f9954302373509b9f3b4a6af5c1a79988715ec1 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 17 Apr 2024 10:24:36 +0200 Subject: [PATCH 127/131] add set-back, custom radiator, and rm old files --- .../Transfer/RadiatorPressureBased.mo | 16 +++ BESMod/Systems/UserProfiles/TEASERProfiles.mo | 4 +- .../HeatGeneration/GetHeatPumpCurveVCLib.mo | 25 ---- .../PartialGetHeatGenerationCurve.mo | 109 -------------- BESMod/Utilities/HeatGeneration/package.order | 2 - .../BaseClasses/CustomRadiator.mo | 18 +-- .../BaseClasses/PartialEstimation.mo | 14 +- .../BaseClasses/ProfilesWithStep.mo | 36 ----- .../BaseClasses/RadiatorEN442_2.mo | 9 +- .../BaseClasses/TestRadiatorEN442_2.mo | 136 ++++++++++++++++++ .../BaseClasses/package.order | 2 +- .../Radiator/HeatingCurve.mo | 11 +- .../Radiator/SmartThermostat.mo | 4 +- 13 files changed, 187 insertions(+), 199 deletions(-) delete mode 100644 BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo delete mode 100644 BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo delete mode 100644 BESMod/Utilities/HeatGeneration/package.order delete mode 100644 BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo create mode 100644 BESMod/Utilities/TimeConstantEstimation/BaseClasses/TestRadiatorEN442_2.mo diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index 9f71e3ad..112b2d6c 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -130,6 +130,10 @@ model RadiatorPressureBased "Pressure Based transfer system" extent={{10,-10},{-10,10}}, rotation=90, origin={-90,-10}))); + Modelica.Blocks.Routing.RealPassThrough reaPasThrOpe[nParallelDem] annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={30,70}))); equation connect(rad.heatPortRad, heatPortRad) annotation (Line(points={{-5.08,-27.2}, {40,-27.2},{40,-40},{100,-40}}, color={191,0,0})); @@ -172,4 +176,16 @@ equation {-90,-42},{-100,-42}}, color={0,127,255})); connect(pump.port_b, pressureReliefValve.port_a) annotation (Line(points={{-64,38}, {-60,38},{-60,30},{-90,30},{-90,0}}, color={0,127,255})); + connect(reaPasThrOpe.u, traControlBus.opening) annotation (Line(points={{30, + 82},{30,94},{0,94},{0,100}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(reaPasThrOpe.y, outBusTra.opening) annotation (Line(points={{30,59},{ + 30,-32},{4,-32},{4,-90},{0,-90},{0,-104}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); end RadiatorPressureBased; diff --git a/BESMod/Systems/UserProfiles/TEASERProfiles.mo b/BESMod/Systems/UserProfiles/TEASERProfiles.mo index 4756efa7..f677b642 100644 --- a/BESMod/Systems/UserProfiles/TEASERProfiles.mo +++ b/BESMod/Systems/UserProfiles/TEASERProfiles.mo @@ -1,5 +1,5 @@ within BESMod.Systems.UserProfiles; -model TEASERProfiles "Standard TEASER Profiles" +model TEASERProfiles "TEASER Profiles with possible set-back temperature" extends BaseClasses.PartialUserProfiles; parameter String fileNameIntGains=Modelica.Utilities.Files.loadResource("modelica://BESMod/Resources/InternalGains.txt") "File where matrix is stored"; @@ -8,7 +8,7 @@ model TEASERProfiles "Standard TEASER Profiles" parameter Modelica.Units.SI.TemperatureDifference dTSetBack=0 "Temperature difference of set-back"; parameter Modelica.Units.SI.Time startTimeSetBack(displayUnit="h")=79200 - "Start time of day of set back"; + "Start time of set back"; parameter Real hoursSetBack(max=24, min=0)=8 "Number of hours the set-back lasts, maximum 24"; diff --git a/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo b/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo deleted file mode 100644 index fdc4b582..00000000 --- a/BESMod/Utilities/HeatGeneration/GetHeatPumpCurveVCLib.mo +++ /dev/null @@ -1,25 +0,0 @@ -within BESMod.Utilities.HeatGeneration; -model GetHeatPumpCurveVCLib - extends PartialGetHeatGenerationCurve( - redeclare Examples.DesignOptimization.AachenSystem systemParameters, - redeclare Systems.Hydraulical.Generation.HeatPumpAndElectricHeater generation( - redeclare package Medium_eva = IBPSA.Media.Air, - redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultHP - parHeaPum, - redeclare model PerDataMainHP = - AixLib.DataBase.HeatPump.PerformanceData.VCLibMap (refrigerant= - "Propane", flowsheet="VIPhaseSeparatorFlowsheet"), - redeclare BESMod.Systems.RecordsCollection.TemperatureSensors.DefaultSensor - parTemSen, - redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, - redeclare BESMod.Systems.Hydraulical.Generation.RecordsCollection.DefaultElectricHeater - parEleHea), - ramp( - height=35, - duration=84400, - offset=273.15 - 15, - startTime=1000), - realExpression(y=generation.heatPump.con.QFlow_in)); - - annotation (experiment(StopTime=86400, __Dymola_Algorithm="Dassl")); -end GetHeatPumpCurveVCLib; diff --git a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo b/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo deleted file mode 100644 index a304d080..00000000 --- a/BESMod/Utilities/HeatGeneration/PartialGetHeatGenerationCurve.mo +++ /dev/null @@ -1,109 +0,0 @@ -within BESMod.Utilities.HeatGeneration; -partial model PartialGetHeatGenerationCurve - extends BESMod.Systems.BaseClasses.PartialBESExample; - replaceable Systems.Hydraulical.Generation.BaseClasses.PartialGeneration - generation constrainedby - Systems.Hydraulical.Generation.BaseClasses.PartialGeneration( - redeclare final package Medium = IBPSA.Media.Water, - final Q_flow_nominal={sum(systemParameters.QBui_flow_nominal)}, - final TDem_nominal=systemParameters.THydSup_nominal, - final TOda_nominal=systemParameters.TOda_nominal, - final TAmb=systemParameters.TAmbHyd, - final dpDem_nominal={0}) annotation (choicesAllMatching=true, Placement( - transformation(extent={{-36,-36},{34,36}}))); - Systems.Hydraulical.Interfaces.GenerationControlBus sigBusGen - annotation (Placement(transformation(extent={{-72,54},{-52,74}}))); - Modelica.Blocks.Sources.Constant const1(k=0) - annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); - Modelica.Blocks.Sources.Constant const2(k=1) - annotation (Placement(transformation(extent={{-100,-40},{-80,-20}}))); - Modelica.Blocks.Sources.Ramp ramp - annotation (Placement(transformation(extent={{-100,-70},{-80,-50}}))); - IBPSA.Fluid.MixingVolumes.MixingVolume - vol( - redeclare package Medium = IBPSA.Media.Water, - m_flow_nominal=generation.m_flow_nominal[1], - V=0.01, - nPorts=2) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={82,10}))); - Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.IdealHeatingCurve - heatingCurve( - TSup_nominal=systemParameters.THydSup_nominal[1], - TRet_nominal=systemParameters.THydSup_nominal[1] - 7, - TOda_nominal=systemParameters.TOda_nominal, - nHeaTra=1.3) annotation (Placement(transformation( - extent={{-11,11},{11,-11}}, - rotation=0, - origin={-9,-71}))); - Modelica.Blocks.Interfaces.RealOutput TOda(unit="K", displayUnit="degC") - "Connector of Real output signal" - annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); - Modelica.Blocks.Interfaces.RealOutput QCon_flow(unit="W", displayUnit="kW") - "Connector of Real output signal" - annotation (Placement(transformation(extent={{100,50},{120,70}}))); - Modelica.Blocks.Sources.RealExpression - realExpression - annotation (Placement(transformation(extent={{30,72},{50,92}}))); - Modelica.Blocks.Sources.Constant const3(k=max(systemParameters.TSetZone_nominal)) - annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); - IBPSA.BoundaryConditions.WeatherData.Bus weaBus "Weather data bus" - annotation (Placement(transformation(extent={{-46,66},{-26,86}}))); - Modelica.Thermal.HeatTransfer.Sources.PrescribedTemperature - prescribedTemperature - annotation (Placement(transformation(extent={{40,-80},{60,-60}}))); -equation - connect(sigBusGen, generation.sigBusGen) annotation (Line( - points={{-62,64},{-0.3,64},{-0.3,35.28}}, - color={255,204,51}, - thickness=0.5), Text( - string="%first", - index=-1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); - connect(generation.portGen_in, vol.ports[1:1]) annotation (Line(points={{34,14.4}, - {62,14.4},{62,20},{83,20}}, color={0,127,255})); - connect(heatingCurve.TOda, ramp.y) annotation (Line(points={{-22.2,-71},{-26, - -71},{-26,-92},{-79,-92},{-79,-60}}, - color={0,0,127})); - connect(ramp.y, TOda) annotation (Line(points={{-79,-60},{-79,-92},{-26,-92}, - {-26,-44},{94,-44},{94,-40},{110,-40}}, color={0,0, - 127})); - connect(realExpression.y, QCon_flow) annotation (Line(points={{51,82},{88,82}, - {88,60},{110,60}}, color={0,0,127})); - connect(const3.y,heatingCurve.TZoneSet) annotation (Line(points={{-79,-90},{ - -78,-90},{-78,-92},{-9,-92},{-9,-84.2}}, color={0,0, - 127})); - connect(generation.weaBus, weaBus) annotation (Line( - points={{-35.3,21.6},{-35.3,76},{-36,76}}, - color={255,204,51}, - thickness=0.5)); - connect(ramp.y, weaBus.TDryBul) annotation (Line(points={{-79,-60},{-44,-60}, - {-44,62},{-36,62},{-36,76}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(prescribedTemperature.port, vol.heatPort) annotation (Line(points={{ - 60,-70},{66,-70},{66,-4},{96,-4},{96,10},{92,10}}, color={191,0,0})); - connect(generation.portGen_out[1], vol.ports[2]) - annotation (Line(points={{34,28.8},{81,28.8},{81,20}}, color={0,127,255})); - connect(heatingCurve.TSet, prescribedTemperature.T) annotation (Line(points={ - {3.1,-71},{20.55,-71},{20.55,-70},{38,-70}}, color={0,0,127})); - connect(const2.y, sigBusGen.yHeaPumSet) annotation (Line(points={{-79,-30},{ - -72,-30},{-72,64},{-62,64}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(const1.y, sigBusGen.uEleHea) annotation (Line(points={{-79,30},{-62, - 30},{-62,64}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - annotation (Icon(graphics, - coordinateSystem(preserveAspectRatio=false)), Diagram( - coordinateSystem(preserveAspectRatio=false))); -end PartialGetHeatGenerationCurve; diff --git a/BESMod/Utilities/HeatGeneration/package.order b/BESMod/Utilities/HeatGeneration/package.order deleted file mode 100644 index 00df9b9a..00000000 --- a/BESMod/Utilities/HeatGeneration/package.order +++ /dev/null @@ -1,2 +0,0 @@ -GetHeatPumpCurveVCLib -PartialGetHeatGenerationCurve diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo index bd550592..bfb3ab09 100644 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo @@ -44,7 +44,8 @@ model CustomRadiator "Custom radiator with radiative fractions" each final energyDynamics=energyDynamics, each final p_start=p_start, each final nEle=parRad.nEle, - fraRad_nominal=parRad.fraRad, + each fraRad_nominal=parRad.fraRad, + each use_dynamicFraRad=use_dynamicFraRad, final Q_flow_nominal=Q_flow_nominal .* f_design, final T_a_nominal=TTra_nominal, final T_b_nominal=TTra_nominal .- dTTra_nominal, @@ -57,7 +58,7 @@ model CustomRadiator "Custom radiator with radiative fractions" each final T_start=T_start) "Radiator" annotation (Placement(transformation( extent={{11,11},{-11,-11}}, rotation=90, - origin={-13,-25}))); + origin={-13,-27}))); IBPSA.Fluid.FixedResistances.PressureDrop res[nParallelDem]( redeclare package Medium = Medium, @@ -133,22 +134,23 @@ model CustomRadiator "Custom radiator with radiative fractions" extent={{10,-10},{-10,10}}, rotation=90, origin={-90,-10}))); + parameter Boolean use_dynamicFraRad=true; equation - connect(rad.heatPortRad, heatPortRad) annotation (Line(points={{-5.08,-27.2}, - {40,-27.2},{40,-40},{100,-40}}, color={191,0,0})); - connect(rad.heatPortCon, heatPortCon) annotation (Line(points={{-5.08,-22.8}, + connect(rad.heatPortRad, heatPortRad) annotation (Line(points={{-5.08,-29.2}, + {40,-29.2},{40,-40},{100,-40}}, color={191,0,0})); + connect(rad.heatPortCon, heatPortCon) annotation (Line(points={{-5.08,-24.8}, {-5.08,-26},{40,-26},{40,40},{100,40}}, color={191,0,0})); for i in 1:nParallelDem loop - connect(rad[i].port_b, portTra_out[1]) annotation (Line(points={{-13,-36},{-13, - -42},{-100,-42}}, + connect(rad[i].port_b, portTra_out[1]) annotation (Line(points={{-13,-38},{ + -13,-42},{-100,-42}}, color={0,127,255})); connect(res[i].port_a, vol.ports[i + 1]) annotation (Line(points={{-47,37.5}, {-56,37.5},{-56,28},{-58,28}}, color={0,127,255})); end for; connect(val.port_b, rad.port_a) annotation (Line(points={{-12,-9},{-12,-13.5}, - {-13,-13.5},{-13,-14}}, color={0,127,255})); + {-13,-13.5},{-13,-16}}, color={0,127,255})); connect(res.port_b, val.port_a) annotation (Line(points={{-22,37.5},{-12,37.5}, {-12,11}}, color={0,127,255})); connect(portTra_in[1],pump.port_a) diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo index 7dfd660d..fa58dafa 100644 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo @@ -11,9 +11,11 @@ partial model PartialEstimation "Partial model for estimation of time constants" hBui=sum(building.zoneParam.VAir)^(1/3), ABui=sum(building.zoneParam.VAir)^(2/3), ventRate={0.3}, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, T_start=293.15 - dTStepSet), redeclare BESMod.Systems.Control.NoControl control, - redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic(redeclare + redeclare BESMod.Systems.Hydraulical.HydraulicSystem hydraulic( + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare BESMod.Systems.Hydraulical.Generation.ElectricalHeater generation( dTTra_nominal={max(hydraulic.transfer.dTTra_nominal)}, f_design={2}, @@ -25,13 +27,15 @@ partial model PartialEstimation "Partial model for estimation of time constants" BESMod.Utilities.TimeConstantEstimation.BaseClasses.TimeConstantEstimationControl control), redeclare Systems.Demand.DHW.StandardProfiles DHW( + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, redeclare BESMod.Systems.Demand.DHW.RecordsCollection.NoDHW DHWProfile, redeclare BESMod.Systems.RecordsCollection.Movers.DefaultMover parPum, redeclare BESMod.Systems.Demand.DHW.TappingProfiles.calcmFlowEquStatic calcmFlow), - redeclare - BESMod.Utilities.TimeConstantEstimation.BaseClasses.ProfilesWithStep - userProfiles(dTStep=dTStepSet, startTime=startTimeTSet), + redeclare BESMod.Systems.UserProfiles.TEASERProfiles userProfiles(gain={0,0, + 0}, + dTSetBack=dTStepSet, + startTimeSetBack=startTimeTSet), redeclare BESMod.Systems.RecordsCollection.ParameterStudy.NoStudy parameterStudy, redeclare final package MediumDHW = AixLib.Media.Water, @@ -53,7 +57,7 @@ partial model PartialEstimation "Partial model for estimation of time constants" extends Modelica.Icons.Example; parameter Modelica.Units.SI.TemperatureDifference dTStepSet=2 - "Temperature difference of step"; + "Temperature difference of set temperature"; parameter Modelica.Units.SI.TemperatureDifference dTStepOda=2 "Temperature difference of step"; parameter Modelica.Units.SI.Temperature TOda_start=systemParameters.TSetZone_nominal[1] annotation (Evaluate=false); diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo deleted file mode 100644 index 31031d4a..00000000 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/ProfilesWithStep.mo +++ /dev/null @@ -1,36 +0,0 @@ -within BESMod.Utilities.TimeConstantEstimation.BaseClasses; -model ProfilesWithStep "User profile with a step and no internal gains" - extends Systems.UserProfiles.BaseClasses.PartialUserProfiles; - parameter Modelica.Units.SI.TemperatureDifference dTStep "Temperature difference of step"; - parameter Modelica.Units.SI.Time startTime=0 "Start time of step"; - parameter Real hoursStep "Number of hours the step lasts, maximum 24"; - - Modelica.Blocks.Sources.Constant conIntGai[3](each final k=0) - "Constant no internal gains" annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={-10,-10}))); - Modelica.Blocks.Sources.Pulse nigSetBakTSetZone[nZones]( - each amplitude=-dTStep, - each width=100*hoursStep /24, - each period=86400, - offset=TSetZone_nominal, - each startTime=startTime) "Constant room set temperature" - annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=180, - origin={-10,-50}))); -equation - connect(conIntGai.y, useProBus.intGains) annotation (Line(points={{1,-10},{62,-10}, - {62,-1},{115,-1}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(nigSetBakTSetZone.y, useProBus.TZoneSet) annotation (Line(points={{1, - -50},{116,-50},{116,-54},{115,-54},{115,-1}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); -end ProfilesWithStep; diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/RadiatorEN442_2.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/RadiatorEN442_2.mo index ed96086a..65ee1470 100644 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/RadiatorEN442_2.mo +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/RadiatorEN442_2.mo @@ -21,12 +21,13 @@ model RadiatorEN442_2 "Dynamic radiator for space heating" parameter Modelica.Units.SI.Temperature TMean_nominal = (T_a_nominal + T_b_nominal)/2; parameter Boolean use_dynamicFraRad = true; Real fraRad[nEle](each min=0, each max=1) = if use_dynamicFraRad then - {max(0, min(1, fraRad_nominal * - (vol[i].T^4 - heatPortRad.T^4) /( - (dTRad_nominal[i] + TRad_nominal)^4 - TRad_nominal^4) * - (dTCon_nominal[i]/(vol[i].T - heatPortCon.T))^n)) + {max(fraRad_nominal, min(1, helper[i])) for i in 1:nEle} else fill(fraRad_nominal, nEle) "Fraction radiant heat transfer"; // Assumptions + Real helper[nEle] = {fraRad_nominal * dTRadiationToWalls4[i]/dTRadiationToWalls4Nom[i] * (dTCon_nominal[i]/dT[i])^n for i in 1:nEle}; + Real dTRadiationToWalls4Nom[nEle] = {(dTRad_nominal[i] + TRad_nominal)^4 - TRad_nominal^4 for i in 1:nEle}; + Real dTRadiationToWalls4[nEle] = {(vol[i].T^4 - heatPortRad.T^4) for i in 1:nEle}; + Real dT[nEle] = {(vol[i].T - heatPortCon.T) for i in 1:nEle}; parameter Modelica.Units.SI.Power Q_flow_nominal "Nominal heating power (positive for heating)" diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/TestRadiatorEN442_2.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/TestRadiatorEN442_2.mo new file mode 100644 index 00000000..7e787964 --- /dev/null +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/TestRadiatorEN442_2.mo @@ -0,0 +1,136 @@ +within BESMod.Utilities.TimeConstantEstimation.BaseClasses; +model TestRadiatorEN442_2 "Test model for radiator" + extends Modelica.Icons.Example; + package Medium = IBPSA.Media.Water "Medium model"; + parameter Modelica.Units.SI.Temperature TRoo=20 + 273.15 "Room temperature" + annotation (Evaluate=false); + parameter Modelica.Units.SI.Power Q_flow_nominal=500 "Nominal power"; + parameter Modelica.Units.SI.Temperature T_a_nominal=313.15 + "Radiator inlet temperature at nominal condition"; + parameter Modelica.Units.SI.Temperature T_b_nominal=303.15 + "Radiator outlet temperature at nominal condition"; + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=Q_flow_nominal/( + T_a_nominal - T_b_nominal)/Medium.cp_const "Nominal mass flow rate"; + parameter Modelica.Units.SI.PressureDifference dp_nominal=3000 + "Pressure drop at m_flow_nominal"; + + IBPSA.Fluid.Sources.Boundary_pT sou( + use_T_in=true, + nPorts=2, + redeclare package Medium = Medium, + use_p_in=true, + T=T_a_nominal) + annotation (Placement(transformation(extent={{-64,-68},{-44,-48}}))); + IBPSA.Fluid.FixedResistances.PressureDrop res2( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + dp_nominal=dp_nominal) + annotation (Placement(transformation(extent={{20,-70},{40,-50}}))); + IBPSA.Fluid.FixedResistances.PressureDrop res1( + redeclare package Medium = Medium, + m_flow_nominal=m_flow_nominal, + dp_nominal=dp_nominal) + annotation (Placement(transformation(extent={{20,-2},{40,18}}))); + IBPSA.Fluid.Sources.Boundary_pT sin( + redeclare package Medium = Medium, + nPorts=2, + p(displayUnit="Pa") = 300000, + T=T_b_nominal) "Sink" + annotation (Placement(transformation(extent={{90,-68},{70,-48}}))); + + RadiatorEN442_2 radDyn( + redeclare package Medium = Medium, + T_start=T_a_nominal, + T_a_nominal=T_a_nominal, + T_b_nominal=T_b_nominal, + Q_flow_nominal=Q_flow_nominal, + TAir_nominal=TRoo, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) "Radiator" + annotation (Placement(transformation(extent={{-10,-2},{10,18}}))); + RadiatorEN442_2 radCon( + redeclare package Medium = Medium, + energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, + T_start=T_a_nominal, + use_dynamicFraRad=false, + T_a_nominal=T_a_nominal, + T_b_nominal=T_b_nominal, + Q_flow_nominal=Q_flow_nominal, + TAir_nominal=TRoo) "Radiator" + annotation (Placement(transformation(extent={{-10,-70},{10,-50}}))); + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TBCCon1(T=TRoo) + annotation (Placement(transformation(extent={{-32,28},{-20,40}}))); + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TBCCon2(T=TRoo) + annotation (Placement(transformation(extent={{-32,-40},{-20,-28}}))); + Modelica.Blocks.Sources.Step step( + startTime=3600, + offset=300000 + dp_nominal, + height=-dp_nominal) + annotation (Placement(transformation(extent={{-100,-60},{-80,-40}}))); + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TBCRad2(T=TRoo) + annotation (Placement(transformation(extent={{-32,-20},{-20,-8}}))); + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature TBCRad1(T=TRoo) + annotation (Placement(transformation(extent={{-32,48},{-20,60}}))); + Modelica.Blocks.Sources.Ramp ramp( + duration=3600, + startTime=3600, + offset=T_a_nominal, + height=-(T_a_nominal - TRoo - 1)) + annotation (Placement(transformation(extent={{-100,-100},{-80,-80}}))); +equation + connect(sou.ports[1], radDyn.port_a) annotation (Line(points={{-44,-59},{-40, + -59},{-40,8},{-10,8}}, color={0,127,255})); + connect(sou.ports[2], radCon.port_a) annotation (Line(points={{-44,-57},{-28, + -57},{-28,-60},{-10,-60}}, color={0,127,255})); + connect(radDyn.port_b, res1.port_a) + annotation (Line(points={{10,8},{20,8}}, color={0,127,255})); + connect(radCon.port_b, res2.port_a) + annotation (Line(points={{10,-60},{20,-60}}, color={0,127,255})); + connect(res1.port_b, sin.ports[1]) annotation (Line( + points={{40,8},{56,8},{56,-59},{70,-59}}, + color={0,127,255})); + connect(res2.port_b, sin.ports[2]) annotation (Line( + points={{40,-60},{56,-60},{56,-57},{70,-57}}, + color={0,127,255})); + connect(step.y, sou.p_in) annotation (Line( + points={{-79,-50},{-66,-50}}, + color={0,0,127})); + connect(TBCRad2.port, radCon.heatPortRad) + annotation (Line(points={{-20,-14},{2,-14},{2,-52.8}}, color={191,0,0})); + connect(TBCRad1.port, radDyn.heatPortRad) + annotation (Line(points={{-20,54},{2,54},{2,15.2}}, color={191,0,0})); + connect(TBCCon2.port, radCon.heatPortCon) + annotation (Line(points={{-20,-34},{-2,-34},{-2,-52.8}}, color={191,0,0})); + connect(TBCCon1.port, radDyn.heatPortCon) + annotation (Line(points={{-20,34},{-2,34},{-2,15.2}}, color={191,0,0})); + connect(ramp.y, sou.T_in) annotation (Line(points={{-79,-90},{-76,-90},{-76, + -54},{-66,-54}}, color={0,0,127})); + annotation ( + __Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Fluid/HeatExchangers/Radiators/Examples/RadiatorEN442_2.mos" + "Simulate and plot"), + experiment(Tolerance=1e-6, StopTime=10800), + Documentation(info=" +This test model compares the radiator model when +used as a steady-state and a dynamic model. +", revisions=" +
    +
  • +January 22, 2016, by Michael Wetter:
    +Corrected type declaration of pressure difference. +This is +for #404. +
  • +
  • +June 5, 2015 by Michael Wetter:
    +Removed annotation(Evaluate=true) from instances +T_a_nominal and T_b_nominal +to avoid the warning about non-literal nominal values. +This fixes +#128. +
  • +
  • +January 30, 2009 by Michael Wetter:
    +First implementation. +
  • +
+")); +end TestRadiatorEN442_2; diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.order b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.order index 22d4a3ea..3bc31488 100644 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.order +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/package.order @@ -1,5 +1,5 @@ -ProfilesWithStep PartialEstimation TimeConstantEstimationControl RadiatorEN442_2 CustomRadiator +TestRadiatorEN442_2 diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo b/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo index 463fece1..8c43b4d5 100644 --- a/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo @@ -3,18 +3,19 @@ model HeatingCurve extends Partial( dTStepSet=0, TOda_start=273.15, - dTStepOda=5, + dTStepOda=0, QBuiNoRetrofit_flow_nominal=systemParameters.QBui_flow_nominal, - hydraulic(T_start=293.15, - control( + hydraulic( + T_start=333.15, control( useOpeTemCtrl=true, redeclare BESMod.Systems.Hydraulical.Control.Components.ThermostaticValveController.ThermostaticValvePIControlled valCtrl(Ti={200}), redeclare BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.IdealHeatingCurve - supTSet(dTAddCon=dTAddCon))), + supTSet(dTAddCon=dTAddCon)), + transfer(parRad(nEle=4))), systemParameters(QBui_flow_nominal={11000}, THydSup_nominal={312.15})); - parameter Modelica.Units.SI.TemperatureDifference dTAddCon=5 + parameter Modelica.Units.SI.TemperatureDifference dTAddCon=0 "Constant supply temperature" annotation (Evaluate=false); end HeatingCurve; diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo b/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo index 95b4a638..09a2692b 100644 --- a/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo @@ -2,7 +2,7 @@ within BESMod.Utilities.TimeConstantEstimation.Radiator; model SmartThermostat "Smart thermotat PI control estimation" extends Partial( QBuiNoRetrofit_flow_nominal=systemParameters.QBui_flow_nominal*3, - dTStepSet=2, hydraulic( + dTStepSet=0, hydraulic( T_start=333.15, control( useOpeTemCtrl=true, @@ -16,7 +16,7 @@ model SmartThermostat "Smart thermotat PI control estimation" parPID( yMax=273.15 + 75, P=P, - timeInt=timeInt))), transfer(rad(use_dynamicFraRad=false), parRad( + timeInt=timeInt))), transfer(use_dynamicFraRad=true, parRad( nEle=4))), systemParameters(QBui_flow_nominal={11000}, THydSup_nominal={343.15})); parameter Modelica.Units.SI.Time timeInt=400 From 3c2aa9fb38857c47743f79f19f78fefa638c2461 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 17 Apr 2024 10:28:34 +0200 Subject: [PATCH 128/131] fix SG Ready case false --- .../Components/SetTemperatureSGReady.mo | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Control/Components/SetTemperatureSGReady.mo b/BESMod/Systems/Hydraulical/Control/Components/SetTemperatureSGReady.mo index 5fdb356f..a20a2c9e 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/SetTemperatureSGReady.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/SetTemperatureSGReady.mo @@ -17,7 +17,7 @@ model SetTemperatureSGReady "Model for SG-Ready temperature setpoint" if useExtSGSig and useSGReady "SG Ready signal" annotation (Placement(transformation(extent={{-140,-90},{-100,-50}}))); - Modelica.Blocks.Routing.IntegerPassThrough internalSignal if useSGReady + Modelica.Blocks.Routing.IntegerPassThrough internalSignal "Internal SG Ready signal applied" annotation (Placement(transformation(extent={{-20,-60},{0,-40}}))); Modelica.Blocks.Interfaces.BooleanOutput canRun @@ -38,26 +38,27 @@ model SetTemperatureSGReady "Model for SG-Ready temperature setpoint" if not useExtSGSig "Data reader" annotation (Placement(transformation(extent={{-90,-20},{-70,0}}))); + Modelica.Blocks.Sources.IntegerConstant conIntSig2(final k=2) + if not useSGReady "Constant integer signal for normal operation" + annotation (Placement(transformation(extent={{-60,-82},{-40,-62}}))); equation - if useSGReady then - if internalSignal.y == 4 then - TSet = TSetLocCtrl + TAddSta4; - elseif internalSignal.y == 3 then - TSet = TSetLocCtrl + TAddSta3; - else - TSet = TSetLocCtrl; - end if; - canRun = internalSignal.y <> 1; + if internalSignal.y == 4 then + TSet = TSetLocCtrl + TAddSta4; + elseif internalSignal.y == 3 then + TSet = TSetLocCtrl + TAddSta3; else TSet = TSetLocCtrl; - canRun = true; end if; + canRun = internalSignal.y <> 1; + connect(internalSignal.u, signal) annotation (Line(points={{-22,-50},{-94,-50}, {-94,-70},{-120,-70}}, color={255,127,0})); connect(datRea.y[1], realToInteger.u) annotation (Line(points={{-69,-10},{-62,-10}}, color={0,0,127})); connect(realToInteger.y, internalSignal.u) annotation (Line(points={{-39,-10}, {-32,-10},{-32,-50},{-22,-50}}, color={255,127,0})); + connect(conIntSig2.y, internalSignal.u) annotation (Line(points={{-39,-72},{-32, + -72},{-32,-50},{-22,-50}}, color={255,127,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); end SetTemperatureSGReady; From e2c45f8c6071cfeb49763a49263b04e60a24f624 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 17 Apr 2024 10:32:18 +0200 Subject: [PATCH 129/131] fix partial PID parameters --- .../Control/RecordsCollection/PIDBaseDataDefinition.mo | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Control/RecordsCollection/PIDBaseDataDefinition.mo b/BESMod/Systems/Hydraulical/Control/RecordsCollection/PIDBaseDataDefinition.mo index 9dbac604..cbfaf63b 100644 --- a/BESMod/Systems/Hydraulical/Control/RecordsCollection/PIDBaseDataDefinition.mo +++ b/BESMod/Systems/Hydraulical/Control/RecordsCollection/PIDBaseDataDefinition.mo @@ -4,9 +4,12 @@ partial record PIDBaseDataDefinition "Record for a PID controller" parameter Real yMax=1 "Upper limit of output"; parameter Real yOff=0 "Constant output value if device is turned off"; parameter Real y_start=0 "Initial value of output"; - parameter Real yMin "Lower limit of relative speed"; - parameter Real P "Gain of PID-controller"; - parameter Modelica.Units.SI.Time timeInt "Time constant of Integrator block"; + parameter Real yMin=0 + "Lower limit of relative speed"; + parameter Real P=1 + "Gain of PID-controller"; + parameter Modelica.Units.SI.Time timeInt=Modelica.Constants.inf + "Time constant of Integrator block"; parameter Real Ni=0.9 "Ni*Ti is time constant of anti-windup compensation"; parameter Modelica.Units.SI.Time timeDer "Time constant of Derivative block"; parameter Real Nd=10 "The higher Nd, the more ideal the derivative block"; From 880ca4f2c3a657abf1287a275e7a0c190e21cf33 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 17 Apr 2024 10:59:59 +0200 Subject: [PATCH 130/131] fix function and default parameters --- .../Components/Frosting/ZhuIceFacCalculation.mo | 4 ++-- .../Control/Components/RelativeSpeedController/PID.mo | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo b/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo index f3ccba74..a5dc479a 100644 --- a/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo +++ b/BESMod/Systems/Hydraulical/Components/Frosting/ZhuIceFacCalculation.mo @@ -46,8 +46,8 @@ model ZhuIceFacCalculation "IceFac based on Zhus Frosting Map" Real CICO(unit="s/m") "CICO value"; replaceable function frostMapFunc = - BESMod.Systems.Hydraulical.Components.Frosting.Functions.partialFrostingMap - annotation(choicesAllMatching=true); + BESMod.Systems.Hydraulical.Components.Frosting.Functions.ZhuFrostingMapCico + constrainedby BESMod.Systems.Hydraulical.Components.Frosting.Functions.partialFrostingMap annotation(choicesAllMatching=true); Modelica.Blocks.Logical.Hysteresis hys(uLow=minIceFac, uHigh=1) "For the iceFac control. Output signal is used internally" diff --git a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo index 3b6b6c70..6ea214b7 100644 --- a/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo +++ b/BESMod/Systems/Hydraulical/Control/Components/RelativeSpeedController/PID.mo @@ -3,9 +3,12 @@ model PID "PID controller for inverter controlled devices" extends BaseClasses.PartialControler; parameter Real yOff=0 "Constant output value if device is turned off"; parameter Real y_start=0 "Initial value of output"; - parameter Real yMin "Lower limit of relative speed"; - parameter Real P "Gain of PID-controller"; - parameter Modelica.Units.SI.Time timeInt "Time constant of Integrator block"; + parameter Real yMin=0 + "Lower limit of relative speed"; + parameter Real P=1 + "Gain of PID-controller"; + parameter Modelica.Units.SI.Time timeInt=Modelica.Constants.inf + "Time constant of Integrator block"; parameter Real Ni=0.9 "Ni*Ti is time constant of anti-windup compensation"; parameter Modelica.Units.SI.Time timeDer "Time constant of Derivative block"; parameter Real Nd=10 "The higher Nd, the more ideal the derivative block"; From d88b31eeb76f3fcffb18f0b865d89a082b7c2bd8 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Wed, 17 Apr 2024 11:34:07 +0200 Subject: [PATCH 131/131] fix example specification --- .../TimeConstantEstimation/BaseClasses/PartialEstimation.mo | 2 -- .../Utilities/TimeConstantEstimation/Radiator/ConstantSupply.mo | 1 + .../Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo | 1 + .../TimeConstantEstimation/Radiator/SmartThermostat.mo | 2 ++ .../TimeConstantEstimation/UnderfloorHeating/ConstantSupply.mo | 1 + .../TimeConstantEstimation/UnderfloorHeating/HeatingCurve.mo | 1 + .../TimeConstantEstimation/UnderfloorHeating/SmartThermostat.mo | 1 + 7 files changed, 7 insertions(+), 2 deletions(-) diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo index fa58dafa..666e7027 100644 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/PartialEstimation.mo @@ -54,8 +54,6 @@ partial model PartialEstimation "Partial model for estimation of time constants" HInfHor=0, HSou=if use_solGai then IBPSA.BoundaryConditions.Types.RadiationDataSource.File else IBPSA.BoundaryConditions.Types.RadiationDataSource.Input_HGloHor_HDifHor)); - extends Modelica.Icons.Example; - parameter Modelica.Units.SI.TemperatureDifference dTStepSet=2 "Temperature difference of set temperature"; parameter Modelica.Units.SI.TemperatureDifference dTStepOda=2 diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/ConstantSupply.mo b/BESMod/Utilities/TimeConstantEstimation/Radiator/ConstantSupply.mo index 042dcd63..6f4ecf56 100644 --- a/BESMod/Utilities/TimeConstantEstimation/Radiator/ConstantSupply.mo +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/ConstantSupply.mo @@ -12,6 +12,7 @@ model ConstantSupply "Smart thermotat PI control estimation" supTSet(TConSup=TConSup)), transfer(rad(use_dynamicFraRad=true))), systemParameters(QBui_flow_nominal={11000}, THydSup_nominal={343.15})); + extends Modelica.Icons.Example; parameter Modelica.Units.SI.Time timeInt=1200 "Time constant of Integrator block"; parameter Real P=0.3 "Gain of PID-controller"; diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo b/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo index 8c43b4d5..b6041127 100644 --- a/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/HeatingCurve.mo @@ -16,6 +16,7 @@ model HeatingCurve supTSet(dTAddCon=dTAddCon)), transfer(parRad(nEle=4))), systemParameters(QBui_flow_nominal={11000}, THydSup_nominal={312.15})); + extends Modelica.Icons.Example; parameter Modelica.Units.SI.TemperatureDifference dTAddCon=0 "Constant supply temperature" annotation (Evaluate=false); end HeatingCurve; diff --git a/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo b/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo index 09a2692b..34fff895 100644 --- a/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo +++ b/BESMod/Utilities/TimeConstantEstimation/Radiator/SmartThermostat.mo @@ -19,6 +19,8 @@ model SmartThermostat "Smart thermotat PI control estimation" timeInt=timeInt))), transfer(use_dynamicFraRad=true, parRad( nEle=4))), systemParameters(QBui_flow_nominal={11000}, THydSup_nominal={343.15})); + extends Modelica.Icons.Example; + parameter Modelica.Units.SI.Time timeInt=400 "Time constant of Integrator block"; parameter Real P=0.03 diff --git a/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/ConstantSupply.mo b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/ConstantSupply.mo index a62086ea..2149af99 100644 --- a/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/ConstantSupply.mo +++ b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/ConstantSupply.mo @@ -3,6 +3,7 @@ model ConstantSupply extends Partial(hydraulic(control(redeclare BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.Constant supTSet(TConSup=TConSup)))); + extends Modelica.Icons.Example; parameter Modelica.Units.SI.Temperature TConSup=45 "Constant supply temperature" annotation (Evaluate=false); end ConstantSupply; diff --git a/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/HeatingCurve.mo b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/HeatingCurve.mo index ebf71af4..72b79821 100644 --- a/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/HeatingCurve.mo +++ b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/HeatingCurve.mo @@ -3,6 +3,7 @@ model HeatingCurve extends Partial(hydraulic(control(redeclare BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.IdealHeatingCurve supTSet(dTAddCon=dTAddCon)))); + extends Modelica.Icons.Example; parameter Modelica.Units.SI.TemperatureDifference dTAddCon=5 "Constant supply temperature" annotation (Evaluate=false); end HeatingCurve; diff --git a/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/SmartThermostat.mo b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/SmartThermostat.mo index 6a5040b7..12e629dc 100644 --- a/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/SmartThermostat.mo +++ b/BESMod/Utilities/TimeConstantEstimation/UnderfloorHeating/SmartThermostat.mo @@ -8,6 +8,7 @@ model SmartThermostat "Smart thermotat PI control estimation" yMax=273.15 + 45, P=P, timeInt=timeInt)))), systemParameters(QBui_flow_nominal={11000})); + extends Modelica.Icons.Example; parameter Modelica.Units.SI.Time timeInt=1200 "Time constant of Integrator block"; parameter Real P=0.3 "Gain of PID-controller";