From 08858b4b44ffd04bc39e889ef5a9a3e8c1f64ad2 Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 12 Jul 2023 09:25:36 -0700 Subject: [PATCH 1/2] Add None default to idd. --- resources/model/OpenStudio.idd | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/model/OpenStudio.idd b/resources/model/OpenStudio.idd index c5721bd7bef..176a4f71c3f 100644 --- a/resources/model/OpenStudio.idd +++ b/resources/model/OpenStudio.idd @@ -11902,6 +11902,7 @@ OS:AirLoopHVAC:UnitarySystem, \key FlowPerFloorArea \key FractionOfAutosizedCoolingValue \key FlowPerCoolingCapacity + \default None \note Enter the method used to determine the cooling supply air volume flow rate. \note None is used when a cooling coil is not included in the unitary system or this field may be blank. \note SupplyAirFlowRate is selected when the magnitude of the supply air volume is used. From fa7543ae41f80e190dd98d78c31d4cce4f19d9bf Mon Sep 17 00:00:00 2001 From: Joe Robertson Date: Wed, 12 Jul 2023 09:26:32 -0700 Subject: [PATCH 2/2] Simplify method getter after introducing None default. --- src/model/AirLoopHVACUnitarySystem.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/model/AirLoopHVACUnitarySystem.cpp b/src/model/AirLoopHVACUnitarySystem.cpp index d72cff38ebb..99149ccab3c 100644 --- a/src/model/AirLoopHVACUnitarySystem.cpp +++ b/src/model/AirLoopHVACUnitarySystem.cpp @@ -370,13 +370,9 @@ namespace model { } std::string AirLoopHVACUnitarySystem_Impl::supplyAirFlowRateMethodDuringCoolingOperation() const { - // No default, and return uninitialized if empty - boost::optional result_ = - getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation, false, true); - if (result_) { - return *result_; - } - return "None"; + boost::optional value = getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation, true); + OS_ASSERT(value); + return value.get(); } boost::optional AirLoopHVACUnitarySystem_Impl::supplyAirFlowRateDuringCoolingOperation() const {