diff --git a/src/model/FanComponentModel.cpp b/src/model/FanComponentModel.cpp index b949cc3863..c0129635a1 100644 --- a/src/model/FanComponentModel.cpp +++ b/src/model/FanComponentModel.cpp @@ -39,8 +39,8 @@ #include "AirTerminalSingleDuctSeriesPIUReheat_Impl.hpp" // containing ZoneHVAC Component -// #include "ZoneHVACEvaporativeCoolerUnit.hpp" -// #include "ZoneHVACEvaporativeCoolerUnit_Impl.hpp" +#include "ZoneHVACEvaporativeCoolerUnit.hpp" +#include "ZoneHVACEvaporativeCoolerUnit_Impl.hpp" #include #include @@ -386,23 +386,21 @@ namespace model { boost::optional FanComponentModel_Impl::containingZoneHVACComponent() const { - // Note JM 2021-01-26: Only ZoneHVAC:EvaporativeCoolerUnit apparently, which isn't wrapped in the OS SDK currently - - //std::vector zoneHVACComponent = this->model().getModelObjects(); - //for (const auto& elem : zoneHVACComponent) { - //switch (elem.iddObject().type().value()) { - - //// ZoneHVAC:EvaporativeCoolerUnit: not wrapped - //case openstudio::IddObjectType::OS_ZoneHVAC_EvaporativeCoolerUnit: { - //ZoneHVACEnergyRecoveryVentilator component = elem.cast(); - //if (component.supplyAirFan().handle() == this->handle()) return elem; - //break; - //} - //default: { - //break; - //} - //} - //} + std::vector zoneHVACComponent = this->model().getModelObjects(); + for (const auto& elem : zoneHVACComponent) { + switch (elem.iddObject().type().value()) { + case openstudio::IddObjectType::OS_ZoneHVAC_EvaporativeCoolerUnit: { + auto component = elem.cast(); + if (component.supplyAirFan().handle() == this->handle()) { + return elem; + } + break; + } + default: { + break; + } + } + } return boost::none; } diff --git a/src/model/FanConstantVolume.cpp b/src/model/FanConstantVolume.cpp index 9471406bea..045d7f4c3d 100644 --- a/src/model/FanConstantVolume.cpp +++ b/src/model/FanConstantVolume.cpp @@ -19,6 +19,8 @@ #include "ZoneHVACUnitHeater_Impl.hpp" #include "ZoneHVACUnitVentilator.hpp" #include "ZoneHVACUnitVentilator_Impl.hpp" +#include "ZoneHVACEvaporativeCoolerUnit.hpp" +#include "ZoneHVACEvaporativeCoolerUnit_Impl.hpp" #include "AirLoopHVACOutdoorAirSystem.hpp" #include "AirLoopHVACOutdoorAirSystem_Impl.hpp" #include "AirTerminalSingleDuctParallelPIUReheat.hpp" @@ -344,6 +346,19 @@ namespace model { } } + // ZoneHVACEvaporativeCoolerUnit + std::vector zoneHVACEvaporativeCoolerUnit; + + zoneHVACEvaporativeCoolerUnit = this->model().getConcreteModelObjects(); + + for (const auto& elem : zoneHVACEvaporativeCoolerUnit) { + if (boost::optional fan = elem.supplyAirFan()) { + if (fan->handle() == this->handle()) { + return elem; + } + } + } + return boost::none; } diff --git a/src/model/FanOnOff.cpp b/src/model/FanOnOff.cpp index 326bc8c5df..9c092fba30 100644 --- a/src/model/FanOnOff.cpp +++ b/src/model/FanOnOff.cpp @@ -37,6 +37,8 @@ #include "ZoneHVACUnitHeater_Impl.hpp" #include "ZoneHVACUnitVentilator.hpp" #include "ZoneHVACUnitVentilator_Impl.hpp" +#include "ZoneHVACEvaporativeCoolerUnit.hpp" +#include "ZoneHVACEvaporativeCoolerUnit_Impl.hpp" #include "AirLoopHVACUnitaryHeatPumpAirToAir.hpp" #include "AirLoopHVACUnitaryHeatPumpAirToAir_Impl.hpp" #include "AirLoopHVACUnitarySystem.hpp" @@ -424,6 +426,13 @@ namespace model { } break; } + case openstudio::IddObjectType::OS_ZoneHVAC_EvaporativeCoolerUnit: { + auto component = elem.cast(); + if (component.supplyAirFan().handle() == this->handle()) { + return elem; + } + break; + } default: { break; } diff --git a/src/model/FanSystemModel.cpp b/src/model/FanSystemModel.cpp index 6076457f83..0633fee2f2 100644 --- a/src/model/FanSystemModel.cpp +++ b/src/model/FanSystemModel.cpp @@ -47,6 +47,8 @@ #include "ZoneHVACUnitHeater_Impl.hpp" #include "ZoneHVACUnitVentilator.hpp" #include "ZoneHVACUnitVentilator_Impl.hpp" +#include "ZoneHVACEvaporativeCoolerUnit.hpp" +#include "ZoneHVACEvaporativeCoolerUnit_Impl.hpp" #include "ZoneHVACWaterToAirHeatPump.hpp" #include "ZoneHVACWaterToAirHeatPump_Impl.hpp" // These are supposed to be ZoneHVACComponents @@ -484,6 +486,13 @@ namespace model { } break; } + case openstudio::IddObjectType::OS_ZoneHVAC_EvaporativeCoolerUnit: { + auto component = elem.cast(); + if (component.supplyAirFan().handle() == this->handle()) { + return elem; + } + break; + } case openstudio::IddObjectType::OS_ZoneHVAC_WaterToAirHeatPump: { auto component = elem.cast(); if (component.supplyAirFan().handle() == this->handle()) { diff --git a/src/model/FanVariableVolume.cpp b/src/model/FanVariableVolume.cpp index 993893f753..185790c78c 100644 --- a/src/model/FanVariableVolume.cpp +++ b/src/model/FanVariableVolume.cpp @@ -20,6 +20,8 @@ #include "ZoneHVACUnitHeater_Impl.hpp" #include "ZoneHVACUnitVentilator.hpp" #include "ZoneHVACUnitVentilator_Impl.hpp" +#include "ZoneHVACEvaporativeCoolerUnit.hpp" +#include "ZoneHVACEvaporativeCoolerUnit_Impl.hpp" #include "AirLoopHVACUnitarySystem.hpp" #include "AirLoopHVACUnitarySystem_Impl.hpp" #include "SetpointManagerMixedAir.hpp" @@ -492,6 +494,19 @@ namespace model { } } + // ZoneHVACEvaporativeCoolerUnit + std::vector zoneHVACEvaporativeCoolerUnit; + + zoneHVACEvaporativeCoolerUnit = this->model().getConcreteModelObjects(); + + for (const auto& elem : zoneHVACEvaporativeCoolerUnit) { + if (boost::optional fan = elem.supplyAirFan()) { + if (fan->handle() == this->handle()) { + return elem; + } + } + } + return boost::none; }