Multizone model fails if `CoolerOn` has different settings for different zones
Created by: marcusfuchs
Describe the bug
In multizone building models like AixLib.ThermalZones.ReducedOrder.Examples.Multizone
, each zone can have active cooling or not, depending on the value of CoolerOn
in the zone records. If all zones have CoolerOn
set to the same value (i.e. all true
or all false
) the model works. But when setting some zones to CoolerOn = true
and others to false
, the model fails with the following message:
Failed to expand connect(multizone.TSetCool, multizone.zone.TSetCool);
Found in class AixLib.ThermalZones.ReducedOrder.Multizone.BaseClasses.PartialMultizone, C:/git/AixLib/AixLib/ThermalZones/ReducedOrder/Multizone/BaseClasses/PartialMultizone.mo at line 229, and used in component multizone.
Expansion failed for heterogeneous array caused by conditionally removed variables.
To Reproduce
In AixLib.ThermalZones.ReducedOrder.Examples.Multizone
, simply change
AixLib.ThermalZones.ReducedOrder.Multizone.Multizone multizone(
buildingID=1,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
VAir=33500,
ABuilding=8375,
ASurTot=12744.27,
numZones=5,
zoneParam={AixLib.DataBase.ThermalZones.OfficePassiveHouse.OPH_1_Office(),
AixLib.DataBase.ThermalZones.OfficePassiveHouse.OPH_1_Office(),
AixLib.DataBase.ThermalZones.OfficePassiveHouse.OPH_1_Office(),
AixLib.DataBase.ThermalZones.OfficePassiveHouse.OPH_1_Office(),
AixLib.DataBase.ThermalZones.OfficePassiveHouse.OPH_1_Office()},
redeclare package Medium = Modelica.Media.Air.SimpleAir,
T_start=293.15,
zone(ROM(extWallRC(thermCapExt(each der_T(fixed=true))), intWallRC(
thermCapInt(each der_T(fixed=true))))),
internalGainsMode=1)
"Multizone"
annotation (Placement(transformation(extent={{32,-8},{52,12}})));
to
AixLib.ThermalZones.ReducedOrder.Multizone.Multizone multizone(
buildingID=1,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial,
VAir=33500,
ABuilding=8375,
ASurTot=12744.27,
numZones=5,
zoneParam={AixLib.DataBase.ThermalZones.OfficePassiveHouse.OPH_1_Office(),
AixLib.DataBase.ThermalZones.OfficePassiveHouse.OPH_1_Office(),
AixLib.DataBase.ThermalZones.OfficePassiveHouse.OPH_1_Office(CoolerOn=true),
AixLib.DataBase.ThermalZones.OfficePassiveHouse.OPH_1_Office(),
AixLib.DataBase.ThermalZones.OfficePassiveHouse.OPH_1_Office()},
redeclare package Medium = Modelica.Media.Air.SimpleAir,
T_start=293.15,
zone(ROM(extWallRC(thermCapExt(each der_T(fixed=true))), intWallRC(
thermCapInt(each der_T(fixed=true))))),
internalGainsMode=1)
"Multizone"
annotation (Placement(transformation(extent={{32,-8},{52,12}})));
I can also upload a branch with a demo example
Expected behavior The model should simulate successfully even if some zones have cooling and others don't
Desktop (please complete the following information):
- Dymola 2020x
Additional context
I think it would be good to include at least one example with at least 1 zone with active cooling in the unit tests to make sure this is covered. If I understand the existing code correctly, there is no example with CoolerOn = true
in the library