diff --git a/CMakeLists.txt b/CMakeLists.txt index 96528cd330e..7777bfd0aca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -377,8 +377,9 @@ if(APPLE) # This appears to be a legacy choice by the cmake developers, and seems out of place, # so the OpenStudio project will use the library suffix ".dylib" find_library(COREFOUNDATION_LIBRARY CoreFoundation) - add_definitions(-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR) - #add_definitions(-DBOOST_SYSTEM_NO_DEPRECATED) + # TODO: remove when bumping Boost to 1.81+, cf https://github.com/NREL/OpenStudio/issues/4978 + add_definitions(-DBOOST_NO_CXX98_FUNCTION_BASE) + add_definitions(-D_HAS_AUTO_PTR_ETC=0) endif() if(UNIX AND NOT APPLE) @@ -833,19 +834,19 @@ if(BUILD_CLI) if(UNIX) if(APPLE) if (ARCH MATCHES arm64) - set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230427-darwin_arm64.tar.gz") - set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "27ca992c6e5fe5347a7e342eb5b91511") + set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230918-darwin_arm64.tar.gz") + set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "404783d585a63a07f2f9d5b4ba445d99") else() - set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230427-darwin.tar.gz") - set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "b6bf19e6958bd41be9788a7f16fd7f27") + set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230918-darwin.tar.gz") + set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "71282202360c68cf9dd0f0d585d560f2") endif() else() if (ARCH MATCHES "arm64") - set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230427-linux_arm64.tar.gz") - set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "979a8839facf2fa1c4096dcbae39ddc2") + set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230918-linux_arm64.tar.gz") + set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "c28e1b84051fbae2ae0a9f7a27416951") else() - set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230427-linux.tar.gz") - set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "957681cb4f3b5cf8ad95103a5fae9a72") + set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230918-linux.tar.gz") + set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "f7279e86e0a9f41cfd0ce89060c4d836") endif() if (USE_OPENSTUDIO_GEMS_PR) set(OPENSTUDIO_GEMS_BASEURL "${OPENSTUDIO_GEMS_BASEURL}/openstudio-gems-linux/${OPENSTUDIO_GEMS_PR_NUMBER}") @@ -853,8 +854,8 @@ if(BUILD_CLI) endif() elseif(WIN32) # OpenStudio gems are only supported on 64 bit windows - set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230427-windows.tar.gz") - set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "e82889c296b7b76eb1f7b3fc7e22d2aa") + set(OPENSTUDIO_GEMS_ZIP_FILENAME "openstudio3-gems-20230918-windows.tar.gz") + set(OPENSTUDIO_GEMS_ZIP_EXPECTED_MD5 "1606f5db801064864c1dc22e8e23459e") if (USE_OPENSTUDIO_GEMS_PR) set(OPENSTUDIO_GEMS_BASEURL "${OPENSTUDIO_GEMS_BASEURL}/openstudio-gems-windows/${OPENSTUDIO_GEMS_PR_NUMBER}") endif() diff --git a/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md b/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md index f7b106c0311..77b8e6ce1d9 100644 --- a/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md +++ b/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md @@ -74,14 +74,19 @@ You can also refer to the [OpenStudio SDK Python Binding Version Compatibility M ## New Features, Major Fixes and API-breaking changes * [#4827](https://github.com/NREL/OpenStudio/pull/4827) - #4748 #4817 - Validate BCLXML with schema when loading + make sorting of files in measure.xml consistent when saving -* [#4873](https://github.com/NREL/OpenStudio/pull/4873) - AirLoopHVACUnitarySystem set Method During XXX Operation +* [#4873](https://github.com/NREL/OpenStudio/pull/4873) & [#4971](https://github.com/NREL/OpenStudio/pull/4971) - AirLoopHVACUnitarySystem set Method During XXX Operation * Fix #4695 - AirLoopHVACUnitarySystem: Supply Air Flow Rate Method During Operation should be set via related setters/autosize - * Breaks the return of `supplyAirFlowRateMethodDuringCoolingOperation` and `supplyAirFlowRateMethodDuringHeatingOperation`: now returns `std::string` instead of `boost::optional` + * Breaks the return of `supplyAirFlowRateMethodDuringCoolingOperation`, `supplyAirFlowRateMethodDuringHeatingOperation` and `supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()`: now returns `std::string` instead of `boost::optional` * Deprecates many set/reset methods + * These fields are now non-optional, and are set via the flow field setters and reset when the heating/cooling coils are reset. + * Example: `unitary.setSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(1.0)` will set the "Supply Air Flow Rate Method During Cooling Operation" to "FlowPerFloorArea" + * [#4932](https://github.com/NREL/OpenStudio/pull/4932) - Support undisturbed ground temperature models on GroundHeatExchangerVertical * Fix #4930 - Support undisturbed ground temperature models on GroundHeatExchangerVertical * Update `GroundHeatExchanger:Vertical` to actually use the Ground Temeprature Model field * [#4923](https://github.com/NREL/OpenStudio/pull/4923) - Fix #4692 - Modify `Model::load` to use the VersionTranslator instead of loading it assuming the version of the loaded OSM is the same as the current SDK version being used. +* [#4950](https://github.com/NREL/OpenStudio/pull/4950) - Addresses #4946, allow Table:Lookup curves for Coil:*:WaterToAirHeatPumpEquationFit objects + * `Coil:Cooling:WaterToAirHeatPumpEquationFit` and `Coil:Heating:WaterToAirHeatPumpEquationFit` have a few API-breaking changes related to its Curves. The types for the constructor, getters, and setters used to be explicit (e.g., `CurveQuadLinear`); it is now the base class, more generic, `Curve` type for added flexibility. * [#4972](https://github.com/NREL/OpenStudio/pull/4972) - V23.2.0-IOFreeze - wrap `DistrictHeating:Steam` and rename `DistrictHeating` to `DistrictHeatingWater` * The `DistrictHeating` class (and related Model getters such as `Model::getDistrictHeatings`) are deprecated but kept for backward Compatibility for now. diff --git a/resources/model/OpenStudio.idd b/resources/model/OpenStudio.idd index 150a093f1dd..315a9029242 100644 --- a/resources/model/OpenStudio.idd +++ b/resources/model/OpenStudio.idd @@ -11901,7 +11901,7 @@ OS:AirLoopHVAC:UnitarySystem, \key FlowPerFloorArea \key FractionOfAutosizedCoolingValue \key FlowPerCoolingCapacity - \default None + \required-field \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. @@ -11946,7 +11946,7 @@ OS:AirLoopHVAC:UnitarySystem, \key FlowPerFloorArea \key FractionOfAutosizedHeatingValue \key FlowPerHeatingCapacity - \default None + \required-field \note Enter the method used to determine the heating supply air volume flow rate. \note None is used when a heating 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. @@ -11993,6 +11993,7 @@ OS:AirLoopHVAC:UnitarySystem, \key FractionOfAutosizedHeatingValue \key FlowPerCoolingCapacity \key FlowPerHeatingCapacity + \required-field \note Enter the method used to determine the supply air volume flow rate when no cooling or heating is required. \note None is used when a cooling and heating 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. diff --git a/src/cli/UpdateCommand.cpp b/src/cli/UpdateCommand.cpp index 1a5ede67111..ba65fb8be6f 100644 --- a/src/cli/UpdateCommand.cpp +++ b/src/cli/UpdateCommand.cpp @@ -104,8 +104,10 @@ sys.argv.append("{}") } cmd += fmt::format(R"python( import importlib.util -spec = importlib.util.spec_from_file_location('__main__', r'{}') +module_name = '__main__' +spec = importlib.util.spec_from_file_location(module_name, r'{}') module = importlib.util.module_from_spec(spec) +sys.modules[module_name] = module spec.loader.exec_module(module) )python", pythonScriptPath.generic_string()); diff --git a/src/cli/test/test_embedded_ruby.rb b/src/cli/test/test_embedded_ruby.rb index ccb0c4bcd7b..8a8c4fd5e81 100644 --- a/src/cli/test/test_embedded_ruby.rb +++ b/src/cli/test/test_embedded_ruby.rb @@ -233,4 +233,21 @@ def test_msgpack assert(data == data2) end + def test_json_schemer + require 'json_schemer' + + schema = { + 'type' => 'object', + 'properties' => { + 'abc' => { + 'type' => 'integer', + 'minimum' => 11 + } + } + } + schemer = JSONSchemer.schema(schema) + assert(schemer.valid?({ 'abc' => 11 })) + assert(!schemer.valid?({ 'abc' => 10 })) + end + end diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACUnitarySystem.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACUnitarySystem.cpp index d2265c8024c..9da36f59a72 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACUnitarySystem.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACUnitarySystem.cpp @@ -309,10 +309,8 @@ namespace energyplus { } // Supply Air Flow Rate Method When No Cooling or Heating is Required - s = modelObject.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); - if (s) { - unitarySystem.setString(AirLoopHVAC_UnitarySystemFields::NoLoadSupplyAirFlowRateMethod, s.get()); - } + unitarySystem.setString(AirLoopHVAC_UnitarySystemFields::NoLoadSupplyAirFlowRateMethod, + modelObject.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); // Supply Air Flow Rate When No Cooling or Heating is Required if (modelObject.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()) { diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingWaterToAirHeatPumpEquationFit.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingWaterToAirHeatPumpEquationFit.cpp index f1ed34fac40..4840c5de6c8 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingWaterToAirHeatPumpEquationFit.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingWaterToAirHeatPumpEquationFit.cpp @@ -11,8 +11,7 @@ #include "../../model/Node_Impl.hpp" #include "../../model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp" #include "../../model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp" -#include "../../model/CurveQuadLinear.hpp" -#include "../../model/CurveQuintLinear.hpp" +#include "../../model/Curve.hpp" #include "../../utilities/core/Logger.hpp" #include "../../utilities/core/Assert.hpp" diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingWaterToAirHeatPumpEquationFit.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingWaterToAirHeatPumpEquationFit.cpp index 9a3672d63a7..f3709ccb964 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingWaterToAirHeatPumpEquationFit.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingWaterToAirHeatPumpEquationFit.cpp @@ -11,7 +11,7 @@ #include "../../model/Node_Impl.hpp" #include "../../model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp" #include "../../model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp" -#include "../../model/CurveQuadLinear.hpp" +#include "../../model/Curve.hpp" #include "../../utilities/core/Logger.hpp" #include "../../utilities/core/Assert.hpp" diff --git a/src/model/AirLoopHVACUnitarySystem.cpp b/src/model/AirLoopHVACUnitarySystem.cpp index 5d333e72712..abc015dfa37 100644 --- a/src/model/AirLoopHVACUnitarySystem.cpp +++ b/src/model/AirLoopHVACUnitarySystem.cpp @@ -24,7 +24,8 @@ #include "../utilities/core/Assert.hpp" #include "../utilities/data/DataEnums.hpp" -#include "utilities/core/Exception.hpp" +#include "../utilities/core/Compare.hpp" +#include "../utilities/core/Exception.hpp" #include #include @@ -95,23 +96,22 @@ namespace model { } std::vector AirLoopHVACUnitarySystem_Impl::getScheduleTypeKeys(const Schedule& schedule) const { - // TODO: Check schedule display names. std::vector result; - UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); - UnsignedVector::const_iterator b(fieldIndices.begin()); - UnsignedVector::const_iterator e(fieldIndices.end()); + const UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); + const auto b = fieldIndices.cbegin(); + const auto e = fieldIndices.cend(); if (std::find(b, e, OS_AirLoopHVAC_UnitarySystemFields::AvailabilityScheduleName) != e) { - result.push_back(ScheduleTypeKey("AirLoopHVACUnitarySystem", "Availability")); + result.emplace_back("AirLoopHVACUnitarySystem", "Availability"); } if (std::find(b, e, OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFanOperatingModeScheduleName) != e) { - result.push_back(ScheduleTypeKey("AirLoopHVACUnitarySystem", "Supply Air Fan Operating Mode")); + result.emplace_back("AirLoopHVACUnitarySystem", "Supply Air Fan Operating Mode"); } return result; } ModelObject AirLoopHVACUnitarySystem_Impl::clone(Model model) const { // Mimic what StraightComponent_Impl::clone would do (we inherit ZoneHVACComponent here...) - auto modelObjectClone = ModelObject_Impl::clone(model).cast(); + auto modelObjectClone = ModelObject_Impl::clone(model).cast(); // NOLINT(bugprone-parent-virtual-call) modelObjectClone.setString(modelObjectClone.inletPort(), ""); modelObjectClone.setString(modelObjectClone.outletPort(), ""); @@ -440,9 +440,11 @@ namespace model { return getDouble(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation, true); } - boost::optional AirLoopHVACUnitarySystem_Impl::supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const { - // No default, and return uninitialized if empty - return getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired, false, true); + std::string AirLoopHVACUnitarySystem_Impl::supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const { + boost::optional value = + getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired, true); + OS_ASSERT(value); + return value.get(); } boost::optional AirLoopHVACUnitarySystem_Impl::supplyAirFlowRateWhenNoCoolingorHeatingisRequired() const { @@ -560,91 +562,74 @@ namespace model { } bool AirLoopHVACUnitarySystem_Impl::setControlType(const std::string& controlType) { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::ControlType, controlType); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::ControlType, controlType); return result; } void AirLoopHVACUnitarySystem_Impl::resetControlType() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::ControlType, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::ControlType, ""); OS_ASSERT(result); } - bool AirLoopHVACUnitarySystem_Impl::setControllingZoneorThermostatLocation(const boost::optional& thermalZone) { - bool result(false); - if (thermalZone) { - result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::ControllingZoneorThermostatLocation, thermalZone.get().handle()); - } else { - resetControllingZoneorThermostatLocation(); - result = true; - } + bool AirLoopHVACUnitarySystem_Impl::setControllingZoneorThermostatLocation(const ThermalZone& thermalZone) { + const bool result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::ControllingZoneorThermostatLocation, thermalZone.handle()); return result; } void AirLoopHVACUnitarySystem_Impl::resetControllingZoneorThermostatLocation() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::ControllingZoneorThermostatLocation, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::ControllingZoneorThermostatLocation, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setDehumidificationControlType(const std::string& dehumidificationControlType) { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DehumidificationControlType, dehumidificationControlType); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DehumidificationControlType, dehumidificationControlType); return result; } void AirLoopHVACUnitarySystem_Impl::resetDehumidificationControlType() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DehumidificationControlType, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DehumidificationControlType, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setAvailabilitySchedule(Schedule& schedule) { - bool result = setSchedule(OS_AirLoopHVAC_UnitarySystemFields::AvailabilityScheduleName, "AirLoopHVACUnitarySystem", "Availability", schedule); + const bool result = + setSchedule(OS_AirLoopHVAC_UnitarySystemFields::AvailabilityScheduleName, "AirLoopHVACUnitarySystem", "Availability", schedule); return result; } void AirLoopHVACUnitarySystem_Impl::resetAvailabilitySchedule() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::AvailabilityScheduleName, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::AvailabilityScheduleName, ""); OS_ASSERT(result); } - bool AirLoopHVACUnitarySystem_Impl::setSupplyFan(const boost::optional& supplyFan) { - bool result(false); - if (supplyFan) { - result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::SupplyFanName, supplyFan.get().handle()); - } else { - resetSupplyFan(); - result = true; - } + bool AirLoopHVACUnitarySystem_Impl::setSupplyFan(const HVACComponent& supplyFan) { + const bool result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::SupplyFanName, supplyFan.handle()); return result; } void AirLoopHVACUnitarySystem_Impl::resetSupplyFan() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyFanName, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyFanName, ""); OS_ASSERT(result); } - bool AirLoopHVACUnitarySystem_Impl::setFanPlacement(boost::optional fanPlacement) { - bool result(false); - if (fanPlacement) { - result = setString(OS_AirLoopHVAC_UnitarySystemFields::FanPlacement, fanPlacement.get()); - } else { - resetFanPlacement(); - result = true; - } + bool AirLoopHVACUnitarySystem_Impl::setFanPlacement(const std::string& fanPlacement) { + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::FanPlacement, fanPlacement); return result; } void AirLoopHVACUnitarySystem_Impl::resetFanPlacement() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::FanPlacement, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::FanPlacement, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setSupplyAirFanOperatingModeSchedule(Schedule& schedule) { - bool result = setSchedule(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFanOperatingModeScheduleName, "AirLoopHVACUnitarySystem", - "Supply Air Fan Operating Mode", schedule); + const bool result = setSchedule(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFanOperatingModeScheduleName, "AirLoopHVACUnitarySystem", + "Supply Air Fan Operating Mode", schedule); return result; } void AirLoopHVACUnitarySystem_Impl::resetSupplyAirFanOperatingModeSchedule() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFanOperatingModeScheduleName, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFanOperatingModeScheduleName, ""); OS_ASSERT(result); } @@ -665,15 +650,24 @@ namespace model { resetSupplyAirFlowRatePerFloorAreaduringHeatingOperation(); resetFractionofAutosizedDesignHeatingSupplyAirFlowRate(); resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation(); + if (!hasCoolingCoil()) { + setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("None"); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + } } bool AirLoopHVACUnitarySystem_Impl::setDXHeatingCoilSizingRatio(double dXHeatingCoilSizingRatio) { - bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::DXHeatingCoilSizingRatio, dXHeatingCoilSizingRatio); + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::DXHeatingCoilSizingRatio, dXHeatingCoilSizingRatio); return result; } void AirLoopHVACUnitarySystem_Impl::resetDXHeatingCoilSizingRatio() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DXHeatingCoilSizingRatio, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DXHeatingCoilSizingRatio, ""); OS_ASSERT(result); } @@ -694,6 +688,15 @@ namespace model { resetSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(); resetFractionofAutosizedDesignCoolingSupplyAirFlowRate(); resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation(); + if (!hasHeatingCoil()) { + setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("None"); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + } } bool AirLoopHVACUnitarySystem_Impl::setUseDOASDXCoolingCoil(bool useDOASDXCoolingCoil) { @@ -701,49 +704,43 @@ namespace model { } void AirLoopHVACUnitarySystem_Impl::resetUseDOASDXCoolingCoil() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::UseDOASDXCoolingCoil, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::UseDOASDXCoolingCoil, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setDOASDXCoolingCoilLeavingMinimumAirTemperature(double dOASDXCoolingCoilLeavingMinimumAirTemperature) { - bool result = + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::DOASDXCoolingCoilLeavingMinimumAirTemperature, dOASDXCoolingCoilLeavingMinimumAirTemperature); return result; } void AirLoopHVACUnitarySystem_Impl::resetDOASDXCoolingCoilLeavingMinimumAirTemperature() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DOASDXCoolingCoilLeavingMinimumAirTemperature, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DOASDXCoolingCoilLeavingMinimumAirTemperature, ""); OS_ASSERT(result); } void AirLoopHVACUnitarySystem_Impl::autosizeDOASDXCoolingCoilLeavingMinimumAirTemperature() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DOASDXCoolingCoilLeavingMinimumAirTemperature, "Autosize"); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DOASDXCoolingCoilLeavingMinimumAirTemperature, "Autosize"); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setLatentLoadControl(const std::string& latentLoadControl) { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::LatentLoadControl, latentLoadControl); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::LatentLoadControl, latentLoadControl); return result; } void AirLoopHVACUnitarySystem_Impl::resetLatentLoadControl() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::LatentLoadControl, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::LatentLoadControl, ""); OS_ASSERT(result); } - bool AirLoopHVACUnitarySystem_Impl::setSupplementalHeatingCoil(const boost::optional& supplementalHeatingCoil) { - bool result(false); - if (supplementalHeatingCoil) { - result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::SupplementalHeatingCoilName, supplementalHeatingCoil.get().handle()); - } else { - resetSupplementalHeatingCoil(); - result = true; - } + bool AirLoopHVACUnitarySystem_Impl::setSupplementalHeatingCoil(const HVACComponent& supplementalHeatingCoil) { + const bool result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::SupplementalHeatingCoilName, supplementalHeatingCoil.handle()); return result; } void AirLoopHVACUnitarySystem_Impl::resetSupplementalHeatingCoil() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplementalHeatingCoilName, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplementalHeatingCoilName, ""); OS_ASSERT(result); } @@ -916,264 +913,278 @@ namespace model { } bool AirLoopHVACUnitarySystem_Impl::setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired( - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired) { - bool result(false); - if (supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired) { - result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired, - supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired.get()); - } else { - resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); - result = true; - } + const std::string& supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired) { + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired, + supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); return result; } void AirLoopHVACUnitarySystem_Impl::resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired, "None"); OS_ASSERT(result); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); } - bool AirLoopHVACUnitarySystem_Impl::setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( - boost::optional supplyAirFlowRateWhenNoCoolingorHeatingisRequired) { - bool result(false); - if (supplyAirFlowRateWhenNoCoolingorHeatingisRequired) { - result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired, - supplyAirFlowRateWhenNoCoolingorHeatingisRequired.get()); - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("SupplyAirFlowRate"); - result = result && setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); - } else { - resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - result = true; + bool + AirLoopHVACUnitarySystem_Impl::setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(double supplyAirFlowRateWhenNoCoolingorHeatingisRequired) { + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired, + supplyAirFlowRateWhenNoCoolingorHeatingisRequired); + if (!result) { + return false; } - return result; + + OS_ASSERT(setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("SupplyAirFlowRate")); + // resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + + return true; } void AirLoopHVACUnitarySystem_Impl::resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired, ""); OS_ASSERT(result); } void AirLoopHVACUnitarySystem_Impl::autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired, "Autosize"); - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("SupplyAirFlowRate"); - result = result && setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired, "Autosize"); OS_ASSERT(result); + OS_ASSERT(setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("SupplyAirFlowRate")); + // resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); } bool AirLoopHVACUnitarySystem_Impl::setSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired( - boost::optional supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired) { - bool result(false); - if (supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired) { - result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired, - supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired.get()); - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FlowPerFloorArea"); - result = result && setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); - } else { - resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); - result = true; + double supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired) { + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired, + supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired); + if (!result) { + return false; } - return result; + + OS_ASSERT(setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FlowPerFloorArea")); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + // resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + + return true; } void AirLoopHVACUnitarySystem_Impl::resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( - boost::optional fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { - bool result(false); - if (fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { - result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, - fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired.get()); - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FractionOfAutosizedCoolingValue"); - result = result && setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); - } else { - resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - result = true; + double fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { + const bool result = + setDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, + fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); + + if (!result) { + return false; } - return result; + + OS_ASSERT(setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FractionOfAutosizedCoolingValue")); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + // resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + + return true; } void AirLoopHVACUnitarySystem_Impl::resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { - bool result = + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( - boost::optional fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { - bool result(false); - if (fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { - result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, - fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired.get()); - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FractionOfAutosizedHeatingValue"); - result = result && setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); - } else { - resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - result = true; + double fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { + const bool result = + setDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, + fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); + + if (!result) { + return false; } - return result; + + OS_ASSERT(setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FractionOfAutosizedHeatingValue")); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + // resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + + return true; } void AirLoopHVACUnitarySystem_Impl::resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { - bool result = + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired( - boost::optional designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) { - bool result(false); - if (designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) { - result = setDouble( - OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired, - designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired.get()); - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FlowPerCoolingCapacity"); - result = result && setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); - } else { - resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); - result = true; + double designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) { + const bool result = + setDouble(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired, + designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired); + + if (!result) { + return false; } - return result; + + OS_ASSERT(setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FlowPerCoolingCapacity")); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + // resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + + return true; } void AirLoopHVACUnitarySystem_Impl::resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired() { - bool result = setString( + const bool result = setString( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired( - boost::optional designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired) { - bool result(false); - if (designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired) { - result = setDouble( - OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired, - designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired.get()); - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FlowPerHeatingCapacity"); - result = result && setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); - } else { - resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); - result = true; + double designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired) { + const bool result = + setDouble(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired, + designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired); + + if (!result) { + return false; } - return result; + + OS_ASSERT(setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FlowPerHeatingCapacity")); + resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + // resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + + return true; } void AirLoopHVACUnitarySystem_Impl::resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired() { - bool result = setString( + const bool result = setString( OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired, ""); OS_ASSERT(result); } - bool AirLoopHVACUnitarySystem_Impl::setMaximumSupplyAirTemperature(boost::optional maximumSupplyAirTemperature) { - bool result(false); - if (maximumSupplyAirTemperature) { - result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::MaximumSupplyAirTemperature, maximumSupplyAirTemperature.get()); - } else { - resetMaximumSupplyAirTemperature(); - result = true; - } - OS_ASSERT(result); + bool AirLoopHVACUnitarySystem_Impl::setMaximumSupplyAirTemperature(double maximumSupplyAirTemperature) { + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::MaximumSupplyAirTemperature, maximumSupplyAirTemperature); return result; } void AirLoopHVACUnitarySystem_Impl::resetMaximumSupplyAirTemperature() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumSupplyAirTemperature, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumSupplyAirTemperature, ""); OS_ASSERT(result); } void AirLoopHVACUnitarySystem_Impl::autosizeMaximumSupplyAirTemperature() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumSupplyAirTemperature, "Autosize"); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumSupplyAirTemperature, "Autosize"); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation( double maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation) { - bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation, - maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation); - OS_ASSERT(result); + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation, + maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation); return result; } void AirLoopHVACUnitarySystem_Impl::resetMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation, ""); OS_ASSERT(result); } - bool AirLoopHVACUnitarySystem_Impl::setOutdoorDryBulbTemperatureSensorNodeName( - boost::optional outdoorDryBulbTemperatureSensorNodeName) { - bool result(false); - if (outdoorDryBulbTemperatureSensorNodeName) { - result = - setString(OS_AirLoopHVAC_UnitarySystemFields::OutdoorDryBulbTemperatureSensorNodeName, outdoorDryBulbTemperatureSensorNodeName.get()); - } else { - resetOutdoorDryBulbTemperatureSensorNodeName(); - result = true; - } + bool AirLoopHVACUnitarySystem_Impl::setOutdoorDryBulbTemperatureSensorNodeName(const std::string& outdoorDryBulbTemperatureSensorNodeName) { + const bool result = + setString(OS_AirLoopHVAC_UnitarySystemFields::OutdoorDryBulbTemperatureSensorNodeName, outdoorDryBulbTemperatureSensorNodeName); OS_ASSERT(result); return result; } void AirLoopHVACUnitarySystem_Impl::resetOutdoorDryBulbTemperatureSensorNodeName() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::OutdoorDryBulbTemperatureSensorNodeName, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::OutdoorDryBulbTemperatureSensorNodeName, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setAncilliaryOnCycleElectricPower(double ancilliaryOnCycleElectricPower) { - bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOnCycleElectricPower, ancilliaryOnCycleElectricPower); + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOnCycleElectricPower, ancilliaryOnCycleElectricPower); return result; } void AirLoopHVACUnitarySystem_Impl::resetAncilliaryOnCycleElectricPower() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOnCycleElectricPower, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOnCycleElectricPower, ""); OS_ASSERT(result); } bool AirLoopHVACUnitarySystem_Impl::setAncilliaryOffCycleElectricPower(double ancilliaryOffCycleElectricPower) { - bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOffCycleElectricPower, ancilliaryOffCycleElectricPower); + const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOffCycleElectricPower, ancilliaryOffCycleElectricPower); return result; } void AirLoopHVACUnitarySystem_Impl::resetAncilliaryOffCycleElectricPower() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOffCycleElectricPower, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::AncilliaryOffCycleElectricPower, ""); OS_ASSERT(result); } // bool AirLoopHVACUnitarySystem_Impl::setDesignHeatRecoveryWaterFlowRate(double designHeatRecoveryWaterFlowRate) { - // bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::DesignHeatRecoveryWaterFlowRate, designHeatRecoveryWaterFlowRate); + // const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::DesignHeatRecoveryWaterFlowRate, designHeatRecoveryWaterFlowRate); // return result; // } // void AirLoopHVACUnitarySystem_Impl::resetDesignHeatRecoveryWaterFlowRate() { - // bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DesignHeatRecoveryWaterFlowRate, ""); + // const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DesignHeatRecoveryWaterFlowRate, ""); // OS_ASSERT(result); // } // bool AirLoopHVACUnitarySystem_Impl::setMaximumTemperatureforHeatRecovery(double maximumTemperatureforHeatRecovery) { - // bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::MaximumTemperatureforHeatRecovery, maximumTemperatureforHeatRecovery); + // const bool result = setDouble(OS_AirLoopHVAC_UnitarySystemFields::MaximumTemperatureforHeatRecovery, maximumTemperatureforHeatRecovery); // return result; // } // void AirLoopHVACUnitarySystem_Impl::resetMaximumTemperatureforHeatRecovery() { - // bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumTemperatureforHeatRecovery, ""); + // const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::MaximumTemperatureforHeatRecovery, ""); // OS_ASSERT(result); // } - bool AirLoopHVACUnitarySystem_Impl::setDesignSpecificationMultispeedObject( - const boost::optional& unitarySystemPerformace) { - bool result(false); - if (unitarySystemPerformace) { - result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::DesignSpecificationMultispeedObjectName, unitarySystemPerformace.get().handle()); - } else { - resetDesignSpecificationMultispeedObject(); - result = true; - } + bool AirLoopHVACUnitarySystem_Impl::setDesignSpecificationMultispeedObject(const UnitarySystemPerformanceMultispeed& unitarySystemPerformace) { + const bool result = setPointer(OS_AirLoopHVAC_UnitarySystemFields::DesignSpecificationMultispeedObjectName, unitarySystemPerformace.handle()); return result; } void AirLoopHVACUnitarySystem_Impl::resetDesignSpecificationMultispeedObject() { - bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DesignSpecificationMultispeedObjectName, ""); + const bool result = setString(OS_AirLoopHVAC_UnitarySystemFields::DesignSpecificationMultispeedObjectName, ""); OS_ASSERT(result); } @@ -1318,7 +1329,7 @@ namespace model { OS_ASSERT(ok); getImpl()->setSupplyAirFlowRateMethodDuringCoolingOperation("None"); getImpl()->setSupplyAirFlowRateMethodDuringHeatingOperation("None"); - autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + getImpl()->setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("None"); setMaximumSupplyAirTemperature(80.0); setMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(21.0); ok = setAncilliaryOnCycleElectricPower(0.0); @@ -1496,7 +1507,7 @@ namespace model { return getImpl()->designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation(); } - boost::optional AirLoopHVACUnitarySystem::supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const { + std::string AirLoopHVACUnitarySystem::supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const { return getImpl()->supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); } @@ -1758,12 +1769,6 @@ namespace model { designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation); } - bool AirLoopHVACUnitarySystem::setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired( - const std::string& supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired) { - return getImpl()->setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired( - supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); - } - void AirLoopHVACUnitarySystem::resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() { getImpl()->resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); } @@ -1773,10 +1778,6 @@ namespace model { supplyAirFlowRateWhenNoCoolingorHeatingisRequired); } - void AirLoopHVACUnitarySystem::resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { - getImpl()->resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - } - void AirLoopHVACUnitarySystem::autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { getImpl()->autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); } @@ -1787,30 +1788,18 @@ namespace model { supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired); } - void AirLoopHVACUnitarySystem::resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired() { - getImpl()->resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); - } - bool AirLoopHVACUnitarySystem::setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( double fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { return getImpl()->setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); } - void AirLoopHVACUnitarySystem::resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { - getImpl()->resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - } - bool AirLoopHVACUnitarySystem::setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( double fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) { return getImpl()->setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); } - void AirLoopHVACUnitarySystem::resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { - getImpl()->resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - } - bool AirLoopHVACUnitarySystem::setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired( double designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) { return getImpl() @@ -1818,11 +1807,6 @@ namespace model { designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired); } - void AirLoopHVACUnitarySystem::resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired() { - getImpl() - ->resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); - } - bool AirLoopHVACUnitarySystem::setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired( double designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired) { return getImpl() @@ -1830,11 +1814,6 @@ namespace model { designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired); } - void AirLoopHVACUnitarySystem::resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired() { - getImpl() - ->resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); - } - bool AirLoopHVACUnitarySystem::setMaximumSupplyAirTemperature(double maximumSupplyAirTemperature) { return getImpl()->setMaximumSupplyAirTemperature(maximumSupplyAirTemperature); } @@ -2012,6 +1991,48 @@ namespace model { "setSupplyAirFlowRatePerFloorAreaduringHeatingOperation, or setFractionofAutosizedDesignHeatingSupplyAirFlowRate instead."); } + bool AirLoopHVACUnitarySystem::setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(const std::string& noCoolHeatMethod) { + // setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, setSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired, setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired, setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired, setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired + DEPRECATED_AT_MSG(3, 7, 0, + "Use resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired For 'None', one of the flow rate setters otherwise."); + + if (openstudio::istringEqual("None", noCoolHeatMethod)) { + resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); + return true; + } + return false; + } + + void AirLoopHVACUnitarySystem::resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { + DEPRECATED_AT_MSG( + 3, 7, 0, "Use resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired to clear all fields, one of the flow rate setters otherwise."); + } + + void AirLoopHVACUnitarySystem::resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired() { + DEPRECATED_AT_MSG( + 3, 7, 0, "Use resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired to clear all fields, one of the flow rate setters otherwise."); + } + + void AirLoopHVACUnitarySystem::resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { + DEPRECATED_AT_MSG( + 3, 7, 0, "Use resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired to clear all fields, one of the flow rate setters otherwise."); + } + + void AirLoopHVACUnitarySystem::resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired() { + DEPRECATED_AT_MSG( + 3, 7, 0, "Use resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired to clear all fields, one of the flow rate setters otherwise."); + } + + void AirLoopHVACUnitarySystem::resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired() { + DEPRECATED_AT_MSG( + 3, 7, 0, "Use resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired to clear all fields, one of the flow rate setters otherwise."); + } + + void AirLoopHVACUnitarySystem::resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired() { + DEPRECATED_AT_MSG( + 3, 7, 0, "Use resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired to clear all fields, one of the flow rate setters otherwise."); + } + double AirLoopHVACUnitarySystem::maximumCyclingRate() const { DEPRECATED_AT_MSG(3, 7, 0, "As of EnergyPlus 23.2.0, this property is on the child cooling coil. Use coolingCoil()->maximumCyclingRate() instead."); diff --git a/src/model/AirLoopHVACUnitarySystem.hpp b/src/model/AirLoopHVACUnitarySystem.hpp index 50b08876329..087db00c932 100644 --- a/src/model/AirLoopHVACUnitarySystem.hpp +++ b/src/model/AirLoopHVACUnitarySystem.hpp @@ -142,7 +142,7 @@ namespace model { boost::optional designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation() const; /** In EnergyPlus 8.3.0 and above this property maps to the EnergyPlus field "No Load Supply Air Flow Rate Method" **/ - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const; + std::string supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const; /** In EnergyPlus 8.3.0 and above this property maps to the EnergyPlus field "No Load Supply Air Flow Rate" **/ boost::optional supplyAirFlowRateWhenNoCoolingorHeatingisRequired() const; @@ -244,16 +244,26 @@ namespace model { void resetSupplyAirFanOperatingModeSchedule(); + /** Sets the Heating Coil. If the "Supply Air Flow Rate Method During Heating Operation" was "None", switch to "SupplyAirFlowRate" + * and autosize the "Supply Air Flow Rate During Heating Operation" field */ bool setHeatingCoil(const HVACComponent& heatingCoil); + /** This will switch the "Supply Air Flow Rate Method During Heating Operation" to "None" and clear all heating flow fields + * If the Unitary is left with no coils, the "Supply Air Flow Rate Method When No Heating Or Cooling" is also set to None + * and all NoCoolHeat flow fields are reset */ void resetHeatingCoil(); bool setDXHeatingCoilSizingRatio(double dXHeatingCoilSizingRatio); void resetDXHeatingCoilSizingRatio(); + /** Sets the Cooling Coil. If the "Supply Air Flow Rate Method During Cooling Operation" was "None", switch to "SupplyAirFlowRate" + * and autosize the "Supply Air Flow Rate During Cooling Operation" field */ bool setCoolingCoil(const HVACComponent& coolingCoil); + /** This will switch the "Supply Air Flow Rate Method During Cooling Operation" to "None" and clear all cooling flow fields + * If the Unitary is left with no coils, the "Supply Air Flow Rate Method When No Heating Or Cooling" is also set to None + * and all NoCoolHeat flow fields are reset */ void resetCoolingCoil(); bool setUseDOASDXCoolingCoil(bool useDOASDXCoolingCoil); @@ -276,71 +286,93 @@ namespace model { void resetSupplementalHeatingCoil(); - OS_DEPRECATED(3, 7, 0) bool setSupplyAirFlowRateMethodDuringCoolingOperation(const std::string& supplyAirFlowRateMethodDuringCoolingOperation); - OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateMethodDuringCoolingOperation(); + // During Cooling + /** Sets the field and switches "Supply Air Flow Rate Method During Cooling Operation" (coolingSAFMethod) to "SupplyAirFlowRate" */ bool setSupplyAirFlowRateDuringCoolingOperation(double supplyAirFlowRateDuringCoolingOperation); - OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateDuringCoolingOperation(); + /** Sets the field and switches the coolingSAFMethod to "SupplyAirFlowRate" */ void autosizeSupplyAirFlowRateDuringCoolingOperation(); + /** Sets the field and switches the coolingSAFMethod to "FlowPerFloorArea" */ bool setSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(double supplyAirFlowRatePerFloorAreaDuringCoolingOperation); - OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(); + /** Sets the field and switches the coolingSAFMethod to "FractionOfAutosizedCoolingValue" */ bool setFractionofAutosizedDesignCoolingSupplyAirFlowRate(double fractionofAutosizedDesignCoolingSupplyAirFlowRate); - OS_DEPRECATED(3, 7, 0) void resetFractionofAutosizedDesignCoolingSupplyAirFlowRate(); + /** Sets the field and switches the coolingSAFMethod to "FlowPerCoolingCapacity" */ bool setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation(double designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation); + + OS_DEPRECATED(3, 7, 0) bool setSupplyAirFlowRateMethodDuringCoolingOperation(const std::string& supplyAirFlowRateMethodDuringCoolingOperation); + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateMethodDuringCoolingOperation(); + + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateDuringCoolingOperation(); + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(); + OS_DEPRECATED(3, 7, 0) void resetFractionofAutosizedDesignCoolingSupplyAirFlowRate(); OS_DEPRECATED(3, 7, 0) void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation(); - OS_DEPRECATED(3, 7, 0) bool setSupplyAirFlowRateMethodDuringHeatingOperation(const std::string& supplyAirFlowRateMethodDuringHeatingOperation); - OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateMethodDuringHeatingOperation(); + // During Heating + /** Sets the field and switches "Supply Air Flow Rate Method During Heating Operation" (heatingSAFMethod) to "SupplyAirFlowRate" */ bool setSupplyAirFlowRateDuringHeatingOperation(double supplyAirFlowRateDuringHeatingOperation); - OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateDuringHeatingOperation(); + /** Sets the field and switches the heatingSAFMethod to "SupplyAirFlowRate" */ void autosizeSupplyAirFlowRateDuringHeatingOperation(); + /** Sets the field and switches the heatingSAFMethod to "FlowPerFloorArea" */ bool setSupplyAirFlowRatePerFloorAreaduringHeatingOperation(double supplyAirFlowRatePerFloorAreaduringHeatingOperation); - OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRatePerFloorAreaduringHeatingOperation(); + /** Sets the field and switches the heatingSAFMethod to "FractionOfAutosizedHeatingValue" */ bool setFractionofAutosizedDesignHeatingSupplyAirFlowRate(double fractionofAutosizedDesignHeatingSupplyAirFlowRate); - OS_DEPRECATED(3, 7, 0) void resetFractionofAutosizedDesignHeatingSupplyAirFlowRate(); + /** Sets the field and switches the heatingSAFMethod to "FlowPerHeatingCapacity" */ bool setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation(double designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation); + + OS_DEPRECATED(3, 7, 0) bool setSupplyAirFlowRateMethodDuringHeatingOperation(const std::string& supplyAirFlowRateMethodDuringHeatingOperation); + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateMethodDuringHeatingOperation(); + + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateDuringHeatingOperation(); + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRatePerFloorAreaduringHeatingOperation(); + OS_DEPRECATED(3, 7, 0) void resetFractionofAutosizedDesignHeatingSupplyAirFlowRate(); OS_DEPRECATED(3, 7, 0) void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation(); - bool setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(const std::string& supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); + // When no Heating or Cooling is Required + // Sets the "Supply Air Flow Rate Method When No Cooling or Heating is Required" (noCoolHeatSAFMethod) to "None" and clears the NoCoolHeat flow rate fields void resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); + /** Sets the field and switches the noCoolHeatSAFMethod) to "SupplyAirFlowRate" */ bool setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(double supplyAirFlowRateWhenNoCoolingorHeatingisRequired); - - void resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - + /** Sets the field and switches the noCoolHeatSAFMethod) to "SupplyAirFlowRate" */ void autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + /** Sets the field and switches the noCoolHeatSAFMethod) to "FlowPerFloorArea" */ bool setSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(double supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired); - void resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); - + /** Sets the field and switches the noCoolHeatSAFMethod) to "FractionOfAutosizedCoolingValue" */ bool setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( double fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); - void resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - + /** Sets the field and switches the noCoolHeatSAFMethod) to "FractionOfAutosizedHeatingValue" */ bool setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( double fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); - void resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - + /** Sets the field and switches the noCoolHeatSAFMethod) to "FlowPerCoolingCapacity" */ bool setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired( double designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired); - void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); - + /** Sets the field and switches the noCoolHeatSAFMethod) to "FlowPerHeatingCapacity" */ bool setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired( double designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired); - void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + OS_DEPRECATED(3, 7, 0) bool setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(const std::string& noCoolHeatMethod); + + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); + OS_DEPRECATED(3, 7, 0) void resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + OS_DEPRECATED(3, 7, 0) void resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + OS_DEPRECATED(3, 7, 0) void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); + OS_DEPRECATED(3, 7, 0) void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); + + // End SAF methods bool setMaximumSupplyAirTemperature(double maximumSupplyAirTemperature); diff --git a/src/model/AirLoopHVACUnitarySystem_Impl.hpp b/src/model/AirLoopHVACUnitarySystem_Impl.hpp index 259c897c36f..177cfafc7c2 100644 --- a/src/model/AirLoopHVACUnitarySystem_Impl.hpp +++ b/src/model/AirLoopHVACUnitarySystem_Impl.hpp @@ -134,7 +134,7 @@ namespace model { boost::optional designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation() const; - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const; + std::string supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const; boost::optional supplyAirFlowRateWhenNoCoolingorHeatingisRequired() const; @@ -206,7 +206,7 @@ namespace model { void resetControlType(); - bool setControllingZoneorThermostatLocation(const boost::optional& thermalZone); + bool setControllingZoneorThermostatLocation(const ThermalZone& thermalZone); void resetControllingZoneorThermostatLocation(); @@ -218,11 +218,11 @@ namespace model { void resetAvailabilitySchedule(); - bool setSupplyFan(const boost::optional& supplyFan); + bool setSupplyFan(const HVACComponent& supplyFan); void resetSupplyFan(); - bool setFanPlacement(boost::optional fanPlacement); + bool setFanPlacement(const std::string& fanPlacement); void resetFanPlacement(); @@ -256,7 +256,7 @@ namespace model { void resetLatentLoadControl(); - bool setSupplementalHeatingCoil(const boost::optional& supplementalHeatingCoil); + bool setSupplementalHeatingCoil(const HVACComponent& supplementalHeatingCoil); void resetSupplementalHeatingCoil(); @@ -302,43 +302,41 @@ namespace model { void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation(); - bool setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired( - boost::optional supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); + bool setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(const std::string& supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired); void resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); - bool setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(boost::optional supplyAirFlowRateWhenNoCoolingorHeatingisRequired); + bool setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(double supplyAirFlowRateWhenNoCoolingorHeatingisRequired); void resetSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); void autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); - bool setSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired( - boost::optional supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired); + bool setSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(double supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired); void resetSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(); bool setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( - boost::optional fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); + double fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); void resetFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); bool setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired( - boost::optional fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); + double fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired); void resetFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); bool setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired( - boost::optional designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired); + double designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired); void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(); bool setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired( - boost::optional designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired); + double designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired); void resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(); - bool setMaximumSupplyAirTemperature(boost::optional maximumSupplyAirTemperature); + bool setMaximumSupplyAirTemperature(double maximumSupplyAirTemperature); void resetMaximumSupplyAirTemperature(); @@ -348,7 +346,7 @@ namespace model { void resetMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(); - bool setOutdoorDryBulbTemperatureSensorNodeName(boost::optional outdoorDryBulbTemperatureSensorNodeName); + bool setOutdoorDryBulbTemperatureSensorNodeName(const std::string& outdoorDryBulbTemperatureSensorNodeName); void resetOutdoorDryBulbTemperatureSensorNodeName(); @@ -368,7 +366,7 @@ namespace model { // void resetMaximumTemperatureforHeatRecovery(); - bool setDesignSpecificationMultispeedObject(const boost::optional& unitarySystemPerformace); + bool setDesignSpecificationMultispeedObject(const UnitarySystemPerformanceMultispeed& unitarySystemPerformace); void resetDesignSpecificationMultispeedObject(); diff --git a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp index 495806a67ae..30c70fa6316 100644 --- a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp +++ b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.cpp @@ -20,6 +20,8 @@ #include "CurveQuadLinear_Impl.hpp" #include "CurveQuintLinear.hpp" #include "CurveQuintLinear_Impl.hpp" +#include "Curve.hpp" +#include "Curve_Impl.hpp" #include #include @@ -190,15 +192,15 @@ namespace model { OS_Coil_Cooling_WaterToAirHeatPump_EquationFitFields::TotalCoolingCapacityCurveName); } - CurveQuadLinear CoilCoolingWaterToAirHeatPumpEquationFit_Impl::totalCoolingCapacityCurve() const { + Curve CoilCoolingWaterToAirHeatPumpEquationFit_Impl::totalCoolingCapacityCurve() const { boost::optional value = optionalTotalCoolingCapacityCurve(); if (!value) { LOG_AND_THROW(briefDescription() << " does not have a Total Cooling Capacity Curve attached."); } - return value->cast(); + return *value; } - bool CoilCoolingWaterToAirHeatPumpEquationFit_Impl::setTotalCoolingCapacityCurve(const CurveQuadLinear& totalCoolingCapacityCurve) { + bool CoilCoolingWaterToAirHeatPumpEquationFit_Impl::setTotalCoolingCapacityCurve(const Curve& totalCoolingCapacityCurve) { const bool result = setPointer(OS_Coil_Cooling_WaterToAirHeatPump_EquationFitFields::TotalCoolingCapacityCurveName, totalCoolingCapacityCurve.handle()); return result; @@ -209,15 +211,15 @@ namespace model { OS_Coil_Cooling_WaterToAirHeatPump_EquationFitFields::SensibleCoolingCapacityCurveName); } - CurveQuintLinear CoilCoolingWaterToAirHeatPumpEquationFit_Impl::sensibleCoolingCapacityCurve() const { + Curve CoilCoolingWaterToAirHeatPumpEquationFit_Impl::sensibleCoolingCapacityCurve() const { boost::optional value = optionalSensibleCoolingCapacityCurve(); if (!value) { LOG_AND_THROW(briefDescription() << " does not have a Sensible Cooling Capacity Curve attached."); } - return value->cast(); + return *value; } - bool CoilCoolingWaterToAirHeatPumpEquationFit_Impl::setSensibleCoolingCapacityCurve(const CurveQuintLinear& sensibleCoolingCapacityCurve) { + bool CoilCoolingWaterToAirHeatPumpEquationFit_Impl::setSensibleCoolingCapacityCurve(const Curve& sensibleCoolingCapacityCurve) { const bool result = setPointer(OS_Coil_Cooling_WaterToAirHeatPump_EquationFitFields::SensibleCoolingCapacityCurveName, sensibleCoolingCapacityCurve.handle()); return result; @@ -228,15 +230,15 @@ namespace model { OS_Coil_Cooling_WaterToAirHeatPump_EquationFitFields::CoolingPowerConsumptionCurveName); } - CurveQuadLinear CoilCoolingWaterToAirHeatPumpEquationFit_Impl::coolingPowerConsumptionCurve() const { + Curve CoilCoolingWaterToAirHeatPumpEquationFit_Impl::coolingPowerConsumptionCurve() const { boost::optional value = optionalCoolingPowerConsumptionCurve(); if (!value) { LOG_AND_THROW(briefDescription() << " does not have a Cooling Power Consumption Curve attached."); } - return value->cast(); + return *value; } - bool CoilCoolingWaterToAirHeatPumpEquationFit_Impl::setCoolingPowerConsumptionCurve(const CurveQuadLinear& coolingPowerConsumptionCurve) { + bool CoilCoolingWaterToAirHeatPumpEquationFit_Impl::setCoolingPowerConsumptionCurve(const Curve& coolingPowerConsumptionCurve) { const bool result = setPointer(OS_Coil_Cooling_WaterToAirHeatPump_EquationFitFields::CoolingPowerConsumptionCurveName, coolingPowerConsumptionCurve.handle()); return result; @@ -252,7 +254,7 @@ namespace model { if (!value) { LOG_AND_THROW(briefDescription() << " does not have a Part Load Fraction Correlation Curve attached."); } - return value.get(); + return *value; } bool CoilCoolingWaterToAirHeatPumpEquationFit_Impl::setPartLoadFractionCorrelationCurve(const Curve& partLoadFractionCorrelationCurve) { @@ -597,10 +599,9 @@ namespace model { } // namespace detail // Ctors - CoilCoolingWaterToAirHeatPumpEquationFit::CoilCoolingWaterToAirHeatPumpEquationFit(const Model& model, - const CurveQuadLinear& totalCoolingCapacityCurve, - const CurveQuintLinear& sensibleCoolingCapacityCurve, - const CurveQuadLinear& coolingPowerConsumptionCurve) + CoilCoolingWaterToAirHeatPumpEquationFit::CoilCoolingWaterToAirHeatPumpEquationFit(const Model& model, const Curve& totalCoolingCapacityCurve, + const Curve& sensibleCoolingCapacityCurve, + const Curve& coolingPowerConsumptionCurve) : WaterToAirComponent(CoilCoolingWaterToAirHeatPumpEquationFit::iddObjectType(), model) { OS_ASSERT(getImpl()); @@ -845,27 +846,27 @@ namespace model { return getImpl()->autosizedRatedSensibleCoolingCapacity(); } - CurveQuadLinear CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve() const { + Curve CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve() const { return getImpl()->totalCoolingCapacityCurve(); } - CurveQuintLinear CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve() const { + Curve CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve() const { return getImpl()->sensibleCoolingCapacityCurve(); } - CurveQuadLinear CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve() const { + Curve CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve() const { return getImpl()->coolingPowerConsumptionCurve(); } - bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCurve(const CurveQuadLinear& totalCoolingCapacityCurve) { + bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCurve(const Curve& totalCoolingCapacityCurve) { return getImpl()->setTotalCoolingCapacityCurve(totalCoolingCapacityCurve); } - bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCurve(const CurveQuintLinear& sensibleCoolingCapacityCurve) { + bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCurve(const Curve& sensibleCoolingCapacityCurve) { return getImpl()->setSensibleCoolingCapacityCurve(sensibleCoolingCapacityCurve); } - bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCurve(const CurveQuadLinear& coolingPowerConsumptionCurve) { + bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCurve(const Curve& coolingPowerConsumptionCurve) { return getImpl()->setCoolingPowerConsumptionCurve(coolingPowerConsumptionCurve); } @@ -910,199 +911,231 @@ namespace model { double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient1Constant() instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); - return curve.coefficient1Constant(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient1Constant(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCoefficient1(double totalCoolingCapacityCoefficient1) { DEPRECATED_AT_MSG(3, 2, 0, "Use " "CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient1Constant(double) instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); - return curve.setCoefficient1Constant(totalCoolingCapacityCoefficient1); + Curve curve = getImpl()->totalCoolingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient1Constant(totalCoolingCapacityCoefficient1); } double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient2w() instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); - return curve.coefficient2w(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient2w(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCoefficient2(double totalCoolingCapacityCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient2w(double) instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); - return curve.setCoefficient2w(totalCoolingCapacityCoefficient2); + Curve curve = getImpl()->totalCoolingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient2w(totalCoolingCapacityCoefficient2); } double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient3x() instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); - return curve.coefficient3x(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient3x(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCoefficient3(double totalCoolingCapacityCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient3x(double) instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); - return curve.setCoefficient3x(totalCoolingCapacityCoefficient3); + Curve curve = getImpl()->totalCoolingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient3x(totalCoolingCapacityCoefficient3); } double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient4y() instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); - return curve.coefficient4y(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient4y(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCoefficient4(double totalCoolingCapacityCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient4y(double) instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); - return curve.setCoefficient4y(totalCoolingCapacityCoefficient4); + Curve curve = getImpl()->totalCoolingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient4y(totalCoolingCapacityCoefficient4); } double CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().coefficient5z() instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); - return curve.coefficient5z(); + Curve curve = getImpl()->totalCoolingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient5z(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setTotalCoolingCapacityCoefficient5(double totalCoolingCapacityCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::totalCoolingCapacityCurve().setCoefficient5z(double) instead."); - CurveQuadLinear curve = getImpl()->totalCoolingCapacityCurve(); - return curve.setCoefficient5z(totalCoolingCapacityCoefficient5); + Curve curve = getImpl()->totalCoolingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient5z(totalCoolingCapacityCoefficient5); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient1Constant() instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.coefficient1Constant(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->coefficient1Constant(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient1(double sensibleCoolingCapacityCoefficient1) { DEPRECATED_AT_MSG(3, 2, 0, "Use " "CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient1Constant(double) instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.setCoefficient1Constant(sensibleCoolingCapacityCoefficient1); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->setCoefficient1Constant(sensibleCoolingCapacityCoefficient1); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient2v() instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.coefficient2v(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->coefficient2v(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient2(double sensibleCoolingCapacityCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient2v(double) instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.setCoefficient2v(sensibleCoolingCapacityCoefficient2); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->setCoefficient2v(sensibleCoolingCapacityCoefficient2); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient3w() instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.coefficient3w(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->coefficient3w(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient3(double sensibleCoolingCapacityCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient3w(double) instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.setCoefficient3w(sensibleCoolingCapacityCoefficient3); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->setCoefficient3w(sensibleCoolingCapacityCoefficient3); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient4x() instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.coefficient4x(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->coefficient4x(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient4(double sensibleCoolingCapacityCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient4x(double) instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.setCoefficient4x(sensibleCoolingCapacityCoefficient4); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->setCoefficient4x(sensibleCoolingCapacityCoefficient4); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient5y() instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.coefficient5y(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->coefficient5y(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient5(double sensibleCoolingCapacityCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient5y(double) instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.setCoefficient5y(sensibleCoolingCapacityCoefficient5); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->setCoefficient5y(sensibleCoolingCapacityCoefficient5); } double CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCoefficient6() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().coefficient6z() instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.coefficient6z(); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->coefficient6z(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setSensibleCoolingCapacityCoefficient6(double sensibleCoolingCapacityCoefficient6) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::sensibleCoolingCapacityCurve().setCoefficient6z(double) instead."); - CurveQuintLinear curve = getImpl()->sensibleCoolingCapacityCurve(); - return curve.setCoefficient6z(sensibleCoolingCapacityCoefficient6); + Curve curve = getImpl()->sensibleCoolingCapacityCurve(); + boost::optional curveQuintLinear = curve.optionalCast(); + return curveQuintLinear->setCoefficient6z(sensibleCoolingCapacityCoefficient6); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient1Constant() instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.coefficient1Constant(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient1Constant(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient1(double coolingPowerConsumptionCoefficient1) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient1Constant(double) instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.setCoefficient1Constant(coolingPowerConsumptionCoefficient1); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient1Constant(coolingPowerConsumptionCoefficient1); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient2w() instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.coefficient2w(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient2w(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient2(double coolingPowerConsumptionCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient2w(double) instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.setCoefficient2w(coolingPowerConsumptionCoefficient2); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient2w(coolingPowerConsumptionCoefficient2); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient3x() instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.coefficient3x(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient3x(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient3(double coolingPowerConsumptionCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient3x(double) instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.setCoefficient3x(coolingPowerConsumptionCoefficient3); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient3x(coolingPowerConsumptionCoefficient3); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient4y() instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.coefficient4y(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient4y(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient4(double coolingPowerConsumptionCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient4y(double) instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.setCoefficient4y(coolingPowerConsumptionCoefficient4); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient4y(coolingPowerConsumptionCoefficient4); } double CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().coefficient5z() instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.coefficient5z(); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient5z(); } bool CoilCoolingWaterToAirHeatPumpEquationFit::setCoolingPowerConsumptionCoefficient5(double coolingPowerConsumptionCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilCoolingWaterToAirHeatPumpEquationFit::coolingPowerConsumptionCurve().setCoefficient5z(double) instead."); - CurveQuadLinear curve = getImpl()->coolingPowerConsumptionCurve(); - return curve.setCoefficient5z(coolingPowerConsumptionCoefficient5); + Curve curve = getImpl()->coolingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient5z(coolingPowerConsumptionCoefficient5); } /// @endcond diff --git a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp index 243c62fc230..72dede279f2 100644 --- a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp +++ b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit.hpp @@ -16,8 +16,6 @@ namespace openstudio { namespace model { class Curve; - class CurveQuadLinear; - class CurveQuintLinear; namespace detail { class CoilCoolingWaterToAirHeatPumpEquationFit_Impl; @@ -30,9 +28,8 @@ namespace model { /** @name Constructors and Destructors */ /** Constructs a new CoilCoolingWaterToAirHeatPumpEquationFit with required curve objects */ - CoilCoolingWaterToAirHeatPumpEquationFit(const Model& model, const CurveQuadLinear& totalCoolingCapacityCurve, - const CurveQuintLinear& sensibleCoolingCapacityCurve, - const CurveQuadLinear& coolingPowerConsumptionCurve); + CoilCoolingWaterToAirHeatPumpEquationFit(const Model& model, const Curve& totalCoolingCapacityCurve, const Curve& sensibleCoolingCapacityCurve, + const Curve& coolingPowerConsumptionCurve); /** Constructs a new CoilCoolingWaterToAirHeatPumpEquationFit object and places it inside the model. The coil is fully initialized with all companion objects. */ CoilCoolingWaterToAirHeatPumpEquationFit(const Model& model); @@ -82,7 +79,7 @@ namespace model { double ratedEnteringAirWetBulbTemperature() const; - CurveQuadLinear totalCoolingCapacityCurve() const; + Curve totalCoolingCapacityCurve() const; OS_DEPRECATED(3, 2, 0) double totalCoolingCapacityCoefficient1() const; OS_DEPRECATED(3, 2, 0) double totalCoolingCapacityCoefficient2() const; @@ -90,7 +87,7 @@ namespace model { OS_DEPRECATED(3, 2, 0) double totalCoolingCapacityCoefficient4() const; OS_DEPRECATED(3, 2, 0) double totalCoolingCapacityCoefficient5() const; - CurveQuintLinear sensibleCoolingCapacityCurve() const; + Curve sensibleCoolingCapacityCurve() const; OS_DEPRECATED(3, 2, 0) double sensibleCoolingCapacityCoefficient1() const; OS_DEPRECATED(3, 2, 0) double sensibleCoolingCapacityCoefficient2() const; @@ -99,7 +96,7 @@ namespace model { OS_DEPRECATED(3, 2, 0) double sensibleCoolingCapacityCoefficient5() const; OS_DEPRECATED(3, 2, 0) double sensibleCoolingCapacityCoefficient6() const; - CurveQuadLinear coolingPowerConsumptionCurve() const; + Curve coolingPowerConsumptionCurve() const; OS_DEPRECATED(3, 2, 0) double coolingPowerConsumptionCoefficient1() const; OS_DEPRECATED(3, 2, 0) double coolingPowerConsumptionCoefficient2() const; @@ -157,7 +154,7 @@ namespace model { bool setRatedEnteringAirWetBulbTemperature(double ratedEnteringAirWetBulbTemperature); - bool setTotalCoolingCapacityCurve(const CurveQuadLinear& totalCoolingCapacityCurve); + bool setTotalCoolingCapacityCurve(const Curve& totalCoolingCapacityCurve); OS_DEPRECATED(3, 2, 0) bool setTotalCoolingCapacityCoefficient1(double totalCoolingCapacityCoefficient1); OS_DEPRECATED(3, 2, 0) bool setTotalCoolingCapacityCoefficient2(double totalCoolingCapacityCoefficient2); @@ -165,7 +162,7 @@ namespace model { OS_DEPRECATED(3, 2, 0) bool setTotalCoolingCapacityCoefficient4(double totalCoolingCapacityCoefficient4); OS_DEPRECATED(3, 2, 0) bool setTotalCoolingCapacityCoefficient5(double totalCoolingCapacityCoefficient5); - bool setSensibleCoolingCapacityCurve(const CurveQuintLinear& sensibleCoolingCapacityCurve); + bool setSensibleCoolingCapacityCurve(const Curve& sensibleCoolingCapacityCurve); OS_DEPRECATED(3, 2, 0) bool setSensibleCoolingCapacityCoefficient1(double sensibleCoolingCapacityCoefficient1); OS_DEPRECATED(3, 2, 0) bool setSensibleCoolingCapacityCoefficient2(double sensibleCoolingCapacityCoefficient2); @@ -174,7 +171,7 @@ namespace model { OS_DEPRECATED(3, 2, 0) bool setSensibleCoolingCapacityCoefficient5(double sensibleCoolingCapacityCoefficient5); OS_DEPRECATED(3, 2, 0) bool setSensibleCoolingCapacityCoefficient6(double sensibleCoolingCapacityCoefficient6); - bool setCoolingPowerConsumptionCurve(const CurveQuadLinear& coolingPowerConsumptionCurve); + bool setCoolingPowerConsumptionCurve(const Curve& coolingPowerConsumptionCurve); OS_DEPRECATED(3, 2, 0) bool setCoolingPowerConsumptionCoefficient1(double coolingPowerConsumptionCoefficient1); OS_DEPRECATED(3, 2, 0) bool setCoolingPowerConsumptionCoefficient2(double coolingPowerConsumptionCoefficient2); diff --git a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp index de558e9cfea..688cc79c7bd 100644 --- a/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp +++ b/src/model/CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp @@ -13,8 +13,6 @@ namespace openstudio { namespace model { class Curve; - class CurveQuadLinear; - class CurveQuintLinear; namespace detail { @@ -99,11 +97,11 @@ namespace model { double ratedEnteringAirWetBulbTemperature() const; - CurveQuadLinear totalCoolingCapacityCurve() const; + Curve totalCoolingCapacityCurve() const; - CurveQuintLinear sensibleCoolingCapacityCurve() const; + Curve sensibleCoolingCapacityCurve() const; - CurveQuadLinear coolingPowerConsumptionCurve() const; + Curve coolingPowerConsumptionCurve() const; Curve partLoadFractionCorrelationCurve() const; @@ -167,11 +165,11 @@ namespace model { bool setRatedEnteringAirWetBulbTemperature(double ratedEnteringAirWetBulbTemperature); - bool setTotalCoolingCapacityCurve(const CurveQuadLinear& totalCoolingCapacityCurve); + bool setTotalCoolingCapacityCurve(const Curve& totalCoolingCapacityCurve); - bool setSensibleCoolingCapacityCurve(const CurveQuintLinear& sensibleCoolingCapacityCurve); + bool setSensibleCoolingCapacityCurve(const Curve& sensibleCoolingCapacityCurve); - bool setCoolingPowerConsumptionCurve(const CurveQuadLinear& coolingPowerConsumptionCurve); + bool setCoolingPowerConsumptionCurve(const Curve& coolingPowerConsumptionCurve); bool setNominalTimeforCondensateRemovaltoBegin(double nominalTimeforCondensateRemovaltoBegin); diff --git a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.cpp b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.cpp index ab95541f26b..275d9f1b203 100644 --- a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.cpp +++ b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.cpp @@ -17,6 +17,8 @@ #include "CurveQuadLinear.hpp" #include "CurveQuadLinear_Impl.hpp" #include "CurveLinear.hpp" +#include "Curve.hpp" +#include "Curve_Impl.hpp" #include #include @@ -309,15 +311,15 @@ namespace model { return getObject().getModelObjectTarget(OS_Coil_Heating_WaterToAirHeatPump_EquationFitFields::HeatingCapacityCurveName); } - CurveQuadLinear CoilHeatingWaterToAirHeatPumpEquationFit_Impl::heatingCapacityCurve() const { + Curve CoilHeatingWaterToAirHeatPumpEquationFit_Impl::heatingCapacityCurve() const { boost::optional value = optionalHeatingCapacityCurve(); if (!value) { LOG_AND_THROW(briefDescription() << " does not have a Heating Capacity Curve attached."); } - return value->cast(); + return *value; } - bool CoilHeatingWaterToAirHeatPumpEquationFit_Impl::setHeatingCapacityCurve(const CurveQuadLinear& heatingCapacityCurve) { + bool CoilHeatingWaterToAirHeatPumpEquationFit_Impl::setHeatingCapacityCurve(const Curve& heatingCapacityCurve) { const bool result = setPointer(OS_Coil_Heating_WaterToAirHeatPump_EquationFitFields::HeatingCapacityCurveName, heatingCapacityCurve.handle()); return result; } @@ -327,15 +329,15 @@ namespace model { OS_Coil_Heating_WaterToAirHeatPump_EquationFitFields::HeatingPowerConsumptionCurveName); } - CurveQuadLinear CoilHeatingWaterToAirHeatPumpEquationFit_Impl::heatingPowerConsumptionCurve() const { + Curve CoilHeatingWaterToAirHeatPumpEquationFit_Impl::heatingPowerConsumptionCurve() const { boost::optional value = optionalHeatingPowerConsumptionCurve(); if (!value) { LOG_AND_THROW(briefDescription() << " does not have a Heating Power Consumption Curve attached."); } - return value->cast(); + return *value; } - bool CoilHeatingWaterToAirHeatPumpEquationFit_Impl::setHeatingPowerConsumptionCurve(const CurveQuadLinear& heatingPowerConsumptionCurve) { + bool CoilHeatingWaterToAirHeatPumpEquationFit_Impl::setHeatingPowerConsumptionCurve(const Curve& heatingPowerConsumptionCurve) { const bool result = setPointer(OS_Coil_Heating_WaterToAirHeatPump_EquationFitFields::HeatingPowerConsumptionCurveName, heatingPowerConsumptionCurve.handle()); return result; @@ -351,7 +353,7 @@ namespace model { if (!value) { LOG_AND_THROW(briefDescription() << " does not have a Part Load Fraction Correlation Curve attached."); } - return value.get(); + return *value; } bool CoilHeatingWaterToAirHeatPumpEquationFit_Impl::setPartLoadFractionCorrelationCurve(const Curve& partLoadFractionCorrelationCurve) { @@ -432,8 +434,8 @@ namespace model { } // namespace detail // create a new CoilHeatingWaterToAirHeatPumpEquationFit object in the model's workspace - CoilHeatingWaterToAirHeatPumpEquationFit::CoilHeatingWaterToAirHeatPumpEquationFit(const Model& model, const CurveQuadLinear& heatingCapacityCurve, - const CurveQuadLinear& heatingPowerConsumptionCurve) + CoilHeatingWaterToAirHeatPumpEquationFit::CoilHeatingWaterToAirHeatPumpEquationFit(const Model& model, const Curve& heatingCapacityCurve, + const Curve& heatingPowerConsumptionCurve) : WaterToAirComponent(CoilHeatingWaterToAirHeatPumpEquationFit::iddObjectType(), model) { OS_ASSERT(getImpl()); @@ -647,19 +649,19 @@ namespace model { return getImpl()->autosizedRatedHeatingCapacity(); } - CurveQuadLinear CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve() const { + Curve CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve() const { return getImpl()->heatingCapacityCurve(); } - bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCurve(const CurveQuadLinear& heatingCapacityCurve) { + bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCurve(const Curve& heatingCapacityCurve) { return getImpl()->setHeatingCapacityCurve(heatingCapacityCurve); } - CurveQuadLinear CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve() const { + Curve CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve() const { return getImpl()->heatingPowerConsumptionCurve(); } - bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCurve(const CurveQuadLinear& heatingPowerConsumptionCurve) { + bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCurve(const Curve& heatingPowerConsumptionCurve) { return getImpl()->setHeatingPowerConsumptionCurve(heatingPowerConsumptionCurve); } @@ -679,124 +681,144 @@ namespace model { // DEPRECATED double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient1Constant() instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); - return curve.coefficient1Constant(); + Curve curve = getImpl()->heatingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient1Constant(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient1(double heatingCapacityCoefficient1) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient1Constant(double) instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); - return curve.setCoefficient1Constant(heatingCapacityCoefficient1); + Curve curve = getImpl()->heatingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient1Constant(heatingCapacityCoefficient1); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient2w() instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); - return curve.coefficient2w(); + Curve curve = getImpl()->heatingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient2w(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient2(double heatingCapacityCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient2w(double) instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); - return curve.setCoefficient2w(heatingCapacityCoefficient2); + Curve curve = getImpl()->heatingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient2w(heatingCapacityCoefficient2); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient3x() instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); - return curve.coefficient3x(); + Curve curve = getImpl()->heatingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient3x(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient3(double heatingCapacityCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient3x(double) instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); - return curve.setCoefficient3x(heatingCapacityCoefficient3); + Curve curve = getImpl()->heatingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient3x(heatingCapacityCoefficient3); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient4y() instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); - return curve.coefficient4y(); + Curve curve = getImpl()->heatingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient4y(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient4(double heatingCapacityCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient4y(double) instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); - return curve.setCoefficient4y(heatingCapacityCoefficient4); + Curve curve = getImpl()->heatingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient4y(heatingCapacityCoefficient4); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().coefficient5z() instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); - return curve.coefficient5z(); + Curve curve = getImpl()->heatingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient5z(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingCapacityCoefficient5(double heatingCapacityCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingCapacityCurve().setCoefficient5z(double) instead."); - CurveQuadLinear curve = getImpl()->heatingCapacityCurve(); - return curve.setCoefficient5z(heatingCapacityCoefficient5); + Curve curve = getImpl()->heatingCapacityCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient5z(heatingCapacityCoefficient5); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient1() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient1Constant() instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.coefficient1Constant(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient1Constant(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCoefficient1(double heatingPowerConsumptionCoefficient1) { DEPRECATED_AT_MSG(3, 2, 0, "Use " "CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient1Constant(double) instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.setCoefficient1Constant(heatingPowerConsumptionCoefficient1); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient1Constant(heatingPowerConsumptionCoefficient1); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient2() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient2w() instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.coefficient2w(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient2w(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCoefficient2(double heatingPowerConsumptionCoefficient2) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient2w(double) instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.setCoefficient2w(heatingPowerConsumptionCoefficient2); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient2w(heatingPowerConsumptionCoefficient2); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient3() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient3x() instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.coefficient3x(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient3x(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCoefficient3(double heatingPowerConsumptionCoefficient3) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient3x(double) instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.setCoefficient3x(heatingPowerConsumptionCoefficient3); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient3x(heatingPowerConsumptionCoefficient3); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient4() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient4y() instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.coefficient4y(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient4y(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCoefficient4(double heatingPowerConsumptionCoefficient4) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient4y(double) instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.setCoefficient4y(heatingPowerConsumptionCoefficient4); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient4y(heatingPowerConsumptionCoefficient4); } double CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCoefficient5() const { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().coefficient5z() instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.coefficient5z(); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->coefficient5z(); } bool CoilHeatingWaterToAirHeatPumpEquationFit::setHeatingPowerConsumptionCoefficient5(double heatingPowerConsumptionCoefficient5) { DEPRECATED_AT_MSG(3, 2, 0, "Use CoilHeatingWaterToAirHeatPumpEquationFit::heatingPowerConsumptionCurve().setCoefficient5z(double) instead."); - CurveQuadLinear curve = getImpl()->heatingPowerConsumptionCurve(); - return curve.setCoefficient5z(heatingPowerConsumptionCoefficient5); + Curve curve = getImpl()->heatingPowerConsumptionCurve(); + boost::optional curveQuadLinear = curve.optionalCast(); + return curveQuadLinear->setCoefficient5z(heatingPowerConsumptionCoefficient5); } /// @endcond diff --git a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp index 8db7f167a11..327db8416ca 100644 --- a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp +++ b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit.hpp @@ -16,7 +16,6 @@ namespace openstudio { namespace model { class Curve; - class CurveQuadLinear; namespace detail { @@ -32,8 +31,7 @@ namespace model { //@{ /** Constructs a new CoilCoolingWaterToAirHeatPumpEquationFit with required curve objects */ - CoilHeatingWaterToAirHeatPumpEquationFit(const Model& model, const CurveQuadLinear& heatingCapacityCurve, - const CurveQuadLinear& heatingPowerConsumptionCurve); + CoilHeatingWaterToAirHeatPumpEquationFit(const Model& model, const Curve& heatingCapacityCurve, const Curve& heatingPowerConsumptionCurve); CoilHeatingWaterToAirHeatPumpEquationFit(const Model& model); @@ -79,7 +77,7 @@ namespace model { double ratioofRatedHeatingCapacitytoRatedCoolingCapacity() const; - CurveQuadLinear heatingCapacityCurve() const; + Curve heatingCapacityCurve() const; OS_DEPRECATED(3, 2, 0) double heatingCapacityCoefficient1() const; OS_DEPRECATED(3, 2, 0) double heatingCapacityCoefficient2() const; @@ -87,7 +85,7 @@ namespace model { OS_DEPRECATED(3, 2, 0) double heatingCapacityCoefficient4() const; OS_DEPRECATED(3, 2, 0) double heatingCapacityCoefficient5() const; - CurveQuadLinear heatingPowerConsumptionCurve() const; + Curve heatingPowerConsumptionCurve() const; OS_DEPRECATED(3, 2, 0) double heatingPowerConsumptionCoefficient1() const; OS_DEPRECATED(3, 2, 0) double heatingPowerConsumptionCoefficient2() const; @@ -135,7 +133,7 @@ namespace model { bool setRatioofRatedHeatingCapacitytoRatedCoolingCapacity(double ratioofRatedHeatingCapacitytoRatedCoolingCapacity); - bool setHeatingCapacityCurve(const CurveQuadLinear& heatingCapacityCurve); + bool setHeatingCapacityCurve(const Curve& heatingCapacityCurve); OS_DEPRECATED(3, 2, 0) bool setHeatingCapacityCoefficient1(double heatingCapacityCoefficient1); OS_DEPRECATED(3, 2, 0) bool setHeatingCapacityCoefficient2(double heatingCapacityCoefficient2); @@ -143,7 +141,7 @@ namespace model { OS_DEPRECATED(3, 2, 0) bool setHeatingCapacityCoefficient4(double heatingCapacityCoefficient4); OS_DEPRECATED(3, 2, 0) bool setHeatingCapacityCoefficient5(double heatingCapacityCoefficient5); - bool setHeatingPowerConsumptionCurve(const CurveQuadLinear& heatingPowerConsumptionCurve); + bool setHeatingPowerConsumptionCurve(const Curve& heatingPowerConsumptionCurve); OS_DEPRECATED(3, 2, 0) bool setHeatingPowerConsumptionCoefficient1(double heatingPowerConsumptionCoefficient1); OS_DEPRECATED(3, 2, 0) bool setHeatingPowerConsumptionCoefficient2(double heatingPowerConsumptionCoefficient2); diff --git a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp index 73076df50bc..faf83108188 100644 --- a/src/model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp +++ b/src/model/CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp @@ -13,7 +13,6 @@ namespace openstudio { namespace model { class Curve; - class CurveQuadLinear; namespace detail { @@ -88,9 +87,9 @@ namespace model { double ratioofRatedHeatingCapacitytoRatedCoolingCapacity() const; - CurveQuadLinear heatingCapacityCurve() const; + Curve heatingCapacityCurve() const; - CurveQuadLinear heatingPowerConsumptionCurve() const; + Curve heatingPowerConsumptionCurve() const; Curve partLoadFractionCorrelationCurve() const; @@ -142,9 +141,9 @@ namespace model { bool setRatioofRatedHeatingCapacitytoRatedCoolingCapacity(double ratioofRatedHeatingCapacitytoRatedCoolingCapacity); - bool setHeatingCapacityCurve(const CurveQuadLinear& heatingCapacityCurve); + bool setHeatingCapacityCurve(const Curve& heatingCapacityCurve); - bool setHeatingPowerConsumptionCurve(const CurveQuadLinear& heatingPowerConsumptionCurve); + bool setHeatingPowerConsumptionCurve(const Curve& heatingPowerConsumptionCurve); bool setPartLoadFractionCorrelationCurve(const Curve& partLoadFractionCorrelationCurve); diff --git a/src/model/test/AirLoopHVACUnitarySystem_GTest.cpp b/src/model/test/AirLoopHVACUnitarySystem_GTest.cpp index 34490302156..ef16e5c32f2 100644 --- a/src/model/test/AirLoopHVACUnitarySystem_GTest.cpp +++ b/src/model/test/AirLoopHVACUnitarySystem_GTest.cpp @@ -121,6 +121,7 @@ TEST_F(ModelFixture, AirLoopHVACUnitarySystem_CloneOneModelWithDefaultData) { testObject.setCoolingCoil(coolingCoil); testObject.setHeatingCoil(heatingCoil); testObject.setSupplementalHeatingCoil(suppHeatingCoil); + testObject.autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); auto testObjectClone = testObject.clone(m).cast(); @@ -706,8 +707,8 @@ TEST_F(ModelFixture, AirLoopHVACUnitarySystem_SupplyAirFlowRateMethodDuringOpera EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation()); // Setting a coil changes things - CoilHeatingDXSingleSpeed cc(m); - EXPECT_TRUE(unitary.setHeatingCoil(cc)); + CoilHeatingDXSingleSpeed hc(m); + EXPECT_TRUE(unitary.setHeatingCoil(hc)); EXPECT_EQ("SupplyAirFlowRate", unitary.supplyAirFlowRateMethodDuringHeatingOperation()); EXPECT_TRUE(unitary.isSupplyAirFlowRateDuringHeatingOperationAutosized()); EXPECT_FALSE(unitary.supplyAirFlowRateDuringHeatingOperation()); @@ -723,7 +724,7 @@ TEST_F(ModelFixture, AirLoopHVACUnitarySystem_SupplyAirFlowRateMethodDuringOpera EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRate()); EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation()); // Put it back - EXPECT_TRUE(unitary.setHeatingCoil(cc)); + EXPECT_TRUE(unitary.setHeatingCoil(hc)); // SupplyAirFlowRate EXPECT_TRUE(unitary.setSupplyAirFlowRateDuringHeatingOperation(1.0)); @@ -766,6 +767,129 @@ TEST_F(ModelFixture, AirLoopHVACUnitarySystem_SupplyAirFlowRateMethodDuringOpera EXPECT_EQ(1.0, unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation().get()); } +TEST_F(ModelFixture, AirLoopHVACUnitarySystem_SupplyAirFlowRateMethodDuringOperation_NoCoolHeat) { + // Test for #4695 - AirLoopHVACUnitarySystem: Supply Air Flow Rate Method During Operation should be set via related setters/autosize + + Model m; + AirLoopHVACUnitarySystem unitary = AirLoopHVACUnitarySystem(m); + CoilCoolingDXSingleSpeed cc(m); + EXPECT_TRUE(unitary.setCoolingCoil(cc)); + CoilHeatingDXSingleSpeed hc(m); + EXPECT_TRUE(unitary.setHeatingCoil(hc)); + + EXPECT_EQ("None", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + EXPECT_TRUE(unitary.setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(1.0)); + EXPECT_EQ("SupplyAirFlowRate", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + ASSERT_TRUE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_EQ(1.0, unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired().get()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + EXPECT_TRUE(unitary.setSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(1.0)); + EXPECT_EQ("FlowPerFloorArea", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + ASSERT_TRUE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_EQ(1.0, unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired().get()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + unitary.autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); + EXPECT_EQ("SupplyAirFlowRate", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_TRUE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + EXPECT_TRUE(unitary.setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(1.0)); + EXPECT_EQ("FractionOfAutosizedCoolingValue", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + ASSERT_TRUE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_EQ(1.0, unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired().get()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + EXPECT_TRUE(unitary.setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(1.0)); + EXPECT_EQ("FractionOfAutosizedHeatingValue", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + ASSERT_TRUE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_EQ(1.0, unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired().get()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + EXPECT_TRUE(unitary.setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(1.0)); + EXPECT_EQ("FlowPerCoolingCapacity", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + ASSERT_TRUE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_EQ(1.0, unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired().get()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + EXPECT_TRUE(unitary.setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(1.0)); + EXPECT_EQ("FlowPerHeatingCapacity", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + ASSERT_TRUE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_EQ(1.0, unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired().get()); + + // Reset both coils => back to None + unitary.resetHeatingCoil(); + EXPECT_EQ("FlowPerHeatingCapacity", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + + unitary.resetCoolingCoil(); + EXPECT_EQ("None", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); + + EXPECT_TRUE(unitary.setHeatingCoil(hc)); + EXPECT_TRUE(unitary.setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(1.0)); + EXPECT_EQ("FlowPerHeatingCapacity", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + unitary.resetSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired(); + EXPECT_EQ("None", unitary.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.isSupplyAirFlowRateWhenNoCoolingorHeatingisRequiredAutosized()); + EXPECT_FALSE(unitary.supplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.supplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.fractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired()); + EXPECT_FALSE(unitary.designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired()); +} + TEST_F(ModelFixture, AirLoopHVACUnitarySystem_needToRemoveDeprecated) { Model m; AirLoopHVACUnitarySystem unitary = AirLoopHVACUnitarySystem(m); diff --git a/src/model/test/TableLookup_GTest.cpp b/src/model/test/TableLookup_GTest.cpp index 0711d2c9fbd..4156343639d 100644 --- a/src/model/test/TableLookup_GTest.cpp +++ b/src/model/test/TableLookup_GTest.cpp @@ -15,6 +15,14 @@ #include "../ModelObjectList_Impl.hpp" #include "../BoilerHotWater.hpp" #include "../BoilerHotWater_Impl.hpp" +#include "../CoilCoolingWaterToAirHeatPumpEquationFit.hpp" +#include "../CoilCoolingWaterToAirHeatPumpEquationFit_Impl.hpp" +#include "../CoilHeatingWaterToAirHeatPumpEquationFit.hpp" +#include "../CoilHeatingWaterToAirHeatPumpEquationFit_Impl.hpp" +#include "../CurveQuadLinear.hpp" +#include "../CurveQuadLinear_Impl.hpp" +#include "../CurveQuintLinear.hpp" +#include "../CurveQuintLinear_Impl.hpp" using namespace openstudio; using namespace openstudio::model; @@ -263,3 +271,125 @@ TEST_F(ModelFixture, TableLookup_Remove) { EXPECT_EQ(independentVariable1, tableLookup2.independentVariables().front()); } } + +TEST_F(ModelFixture, TableLookup_CoilWaterToAirHeatPumpEquationFit) { + // Test for #4946 - WaterToAirHeatPumpEquationFit curves do not support Table:Lookup + + Model m; + + // test ctor 1 + { + // ctor maintains backward compatibility + CoilCoolingWaterToAirHeatPumpEquationFit cc(m); + ASSERT_TRUE(cc.totalCoolingCapacityCurve().optionalCast()); + ASSERT_TRUE(cc.sensibleCoolingCapacityCurve().optionalCast()); + ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); + + CoilHeatingWaterToAirHeatPumpEquationFit ch(m); + ASSERT_TRUE(ch.heatingCapacityCurve().optionalCast()); + ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); + } + + // test ctor 2 + { + // ctor maintains backward compatibility + CurveQuadLinear tccc(m); + CurveQuintLinear sccc(m); + CurveQuadLinear cpcc(m); + CoilCoolingWaterToAirHeatPumpEquationFit cc(m, tccc, sccc, cpcc); + ASSERT_TRUE(cc.totalCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(tccc, cc.totalCoolingCapacityCurve()); + ASSERT_TRUE(cc.sensibleCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(sccc, cc.sensibleCoolingCapacityCurve()); + ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(cpcc, cc.coolingPowerConsumptionCurve()); + + CurveQuadLinear hcc(m); + CurveQuadLinear hpcc(m); + CoilHeatingWaterToAirHeatPumpEquationFit ch(m, hcc, hpcc); + ASSERT_TRUE(ch.heatingCapacityCurve().optionalCast()); + EXPECT_EQ(hcc, ch.heatingCapacityCurve()); + ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(hpcc, ch.heatingPowerConsumptionCurve()); + } + + { + // ctor can now handle table lookup curves + TableLookup tl1(m); + TableLookup tl2(m); + TableLookup tl3(m); + CoilCoolingWaterToAirHeatPumpEquationFit cc(m, tl1, tl2, tl3); + ASSERT_TRUE(cc.totalCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(tl1, cc.totalCoolingCapacityCurve()); + ASSERT_TRUE(cc.sensibleCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(tl2, cc.sensibleCoolingCapacityCurve()); + ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(tl3, cc.coolingPowerConsumptionCurve()); + + TableLookup tl4(m); + TableLookup tl5(m); + CoilHeatingWaterToAirHeatPumpEquationFit ch(m, tl4, tl5); + ASSERT_TRUE(ch.heatingCapacityCurve().optionalCast()); + EXPECT_EQ(tl4, ch.heatingCapacityCurve()); + ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(tl5, ch.heatingPowerConsumptionCurve()); + } + + // test new setter/getter + { + CoilCoolingWaterToAirHeatPumpEquationFit cc(m); + CoilHeatingWaterToAirHeatPumpEquationFit ch(m); + + // setter maintains backward compatibility + CurveQuadLinear cql1(m); + EXPECT_TRUE(cc.setTotalCoolingCapacityCurve(cql1)); + ASSERT_TRUE(cc.totalCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(cql1, cc.totalCoolingCapacityCurve()); + + CurveQuintLinear cql2(m); + EXPECT_TRUE(cc.setSensibleCoolingCapacityCurve(cql2)); + ASSERT_TRUE(cc.sensibleCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(cql2, cc.sensibleCoolingCapacityCurve()); + + CurveQuadLinear cql3(m); + EXPECT_TRUE(cc.setCoolingPowerConsumptionCurve(cql3)); + ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(cql3, cc.coolingPowerConsumptionCurve()); + + CurveQuadLinear cql4(m); + EXPECT_TRUE(ch.setHeatingCapacityCurve(cql4)); + ASSERT_TRUE(ch.heatingCapacityCurve().optionalCast()); + EXPECT_EQ(cql4, ch.heatingCapacityCurve()); + + CurveQuadLinear cql5(m); + EXPECT_TRUE(ch.setHeatingPowerConsumptionCurve(cql5)); + ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(cql5, ch.heatingPowerConsumptionCurve()); + + // setter can now handle table lookup curves + TableLookup tbl1(m); + EXPECT_TRUE(cc.setTotalCoolingCapacityCurve(tbl1)); + ASSERT_TRUE(cc.totalCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(tbl1, cc.totalCoolingCapacityCurve()); + + TableLookup tbl2(m); + EXPECT_TRUE(cc.setSensibleCoolingCapacityCurve(tbl2)); + ASSERT_TRUE(cc.sensibleCoolingCapacityCurve().optionalCast()); + EXPECT_EQ(tbl2, cc.sensibleCoolingCapacityCurve()); + + TableLookup tbl3(m); + EXPECT_TRUE(cc.setCoolingPowerConsumptionCurve(tbl3)); + ASSERT_TRUE(cc.coolingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(tbl3, cc.coolingPowerConsumptionCurve()); + + TableLookup tbl4(m); + EXPECT_TRUE(ch.setHeatingCapacityCurve(tbl4)); + ASSERT_TRUE(ch.heatingCapacityCurve().optionalCast()); + EXPECT_EQ(tbl4, ch.heatingCapacityCurve()); + + TableLookup tbl5(m); + EXPECT_TRUE(ch.setHeatingPowerConsumptionCurve(tbl5)); + ASSERT_TRUE(ch.heatingPowerConsumptionCurve().optionalCast()); + EXPECT_EQ(tbl5, ch.heatingPowerConsumptionCurve()); + } +} diff --git a/src/osversion/VersionTranslator.cpp b/src/osversion/VersionTranslator.cpp index ae2b3511347..efe2b917952 100644 --- a/src/osversion/VersionTranslator.cpp +++ b/src/osversion/VersionTranslator.cpp @@ -33,6 +33,7 @@ #include "../utilities/units/QuantityConverter.hpp" #include "../utilities/math/FloatCompare.hpp" #include "../utilities/idf/IdfObject_Impl.hpp" +#include "../utilities/core/ASCIIStrings.hpp" #include "../utilities/core/UUID.hpp" #include "../utilities/data/DataEnums.hpp" @@ -8173,8 +8174,226 @@ namespace osversion { } } - m_refactored.push_back(RefactoredObjectData(object, newObject)); + // * 11 - Heating Coil Name + constexpr unsigned heatingCoilNameIndex = 11; + const bool hasHeatingCoil = !object.isEmpty(heatingCoilNameIndex); + + // * 13 - Cooling Coil Name + constexpr unsigned coolingCoilNameIndex = 13; + const bool hasCoolingCoil = !object.isEmpty(coolingCoilNameIndex); + + // We use getString(idx, false, true) to not get default, returned unitialized empty + + // * 18 - Supply Air Flow Rate Method During Cooling Operation + constexpr unsigned coolingSAFMethodIndex = 18; + boost::optional coolingSAFMethod = object.getString(coolingSAFMethodIndex, false, true); + + // * 23 - Supply Air Flow Rate Method During Heating Operation + constexpr unsigned heatingSAFMethodIndex = 23; + boost::optional heatingSAFMethod = object.getString(heatingSAFMethodIndex, false, true); + + // * 28 - Supply Air Flow Rate Method When No Cooling or Heating is Required + constexpr unsigned noCoolHeatSAFMethodIndex = 28; + boost::optional noCoolHeatSAFMethod = object.getString(noCoolHeatSAFMethodIndex, false, true); + + constexpr std::array coolingSAFMethodChoices{"SupplyAirFlowRate", "FlowPerFloorArea", "FractionOfAutosizedCoolingValue", + "FlowPerCoolingCapacity"}; + + constexpr std::array coolingSAFMethodChoicesUC{"SUPPLYAIRFLOWRATE", "FLOWPERFLOORAREA", + "FRACTIONOFAUTOSIZEDCOOLINGVALUE", "FLOWPERCOOLINGCAPACITY"}; + + constexpr std::array heatingSAFMethodChoices{"SupplyAirFlowRate", "FlowPerFloorArea", "FractionOfAutosizedHeatingValue", + "FlowPerHeatingCapacity"}; + constexpr std::array heatingSAFMethodChoicesUC{"SUPPLYAIRFLOWRATE", "FLOWPERFLOORAREA", + "FRACTIONOFAUTOSIZEDHEATINGVALUE", "FLOWPERHEATINGCAPACITY"}; + + constexpr std::array noCoolHeatSAFMethodChoices{ + "SupplyAirFlowRate", "FlowPerFloorArea", "FractionOfAutosizedCoolingValue", "FractionOfAutosizedHeatingValue", + "FlowPerCoolingCapacity", "FlowPerHeatingCapacity"}; + + constexpr std::array noCoolHeatSAFMethodChoicesUC{ + "SUPPLYAIRFLOWRATE", "FLOWPERFLOORAREA", "FRACTIONOFAUTOSIZEDCOOLINGVALUE", "FRACTIONOFAUTOSIZEDHEATINGVALUE", + "FLOWPERCOOLINGCAPACITY", "FLOWPERHEATINGCAPACITY"}; + + // Reset all flow fields, we want only one at best to be set + for (size_t i = 0; i < coolingSAFMethodChoices.size(); ++i) { + const size_t fieldIndex = coolingSAFMethodIndex + 1 + i; + newObject.setString(fieldIndex, ""); + } + for (size_t i = 0; i < heatingSAFMethodChoices.size(); ++i) { + const size_t fieldIndex = heatingSAFMethodIndex + 1 + i; + newObject.setString(fieldIndex, ""); + } + for (size_t i = 0; i < noCoolHeatSAFMethodChoices.size(); ++i) { + const size_t fieldIndex = noCoolHeatSAFMethodIndex + 1 + i; + newObject.setString(fieldIndex, ""); + } + + if (!hasCoolingCoil) { + newObject.setString(coolingSAFMethodIndex, "None"); + } else if (!coolingSAFMethod) { + // Technically here E+ checks if the cooling coil rated air flow rate is autosized or not + // Also could get overriden by the DesignSpecification:ZoneHVAC:Sizing + // Finally it lets it slide as long as one of the other SupplyAirFlowRateXXX is not empty + // Here I guess we'll scan the fields in order, and pick the first we find + // * 19 - Supply Air Flow Rate During Cooling Operation + // * 20 - Supply Air Flow Rate Per Floor Area During Cooling Operation + // * 21 - Fraction of Autosized Design Cooling Supply Air Flow Rate + // * 22 - Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation + bool found = false; + for (size_t i = 0; i < coolingSAFMethodChoices.size(); ++i) { + const size_t fieldIndex = coolingSAFMethodIndex + 1 + i; + if ((value = object.getString(fieldIndex, false, true))) { + newObject.setString(coolingSAFMethodIndex, std::string{coolingSAFMethodChoices[i]}); + newObject.setString(fieldIndex, *value); + found = true; + break; + } + } + if (!found) { + LOG(Warn, "For AirLoopHVACUnitarySystem '" + << object.nameString() + << "', there is a cooling coil, but no Supply Air Flow Rate Method During Cooling Operation and no flow rate fields set. " + "Defaulting to SupplyAirFlowRate with Autosize"); + newObject.setString(coolingSAFMethodIndex, "SupplyAirFlowRate"); + newObject.setString(coolingSAFMethodIndex + 1, "Autosize"); + } + } else { + std::string coolingSAFMethodUC = ascii_to_upper_copy(*coolingSAFMethod); + if (coolingSAFMethodUC == "NONE") { + LOG(Warn, "For AirLoopHVACUnitarySystem '" + << object.nameString() + << "', Supply Air Flow Method Rate During Cooling Operation is 'None' but you have a Cooling Coil, consider changing it"); + } else { + auto it = std::find_if(coolingSAFMethodChoicesUC.cbegin(), coolingSAFMethodChoicesUC.cend(), + [&coolingSAFMethodUC](auto& s) { return s == coolingSAFMethodUC; }); + if (it == coolingSAFMethodChoicesUC.cend()) { + LOG(Error, "For AirLoopHVACUnitarySystem '" + << object.nameString() << "', Unrecognized Supply Air Flow Method Rate During Cooling Operation=" << *coolingSAFMethod); + } else { + const auto dist = std::distance(coolingSAFMethodChoicesUC.cbegin(), it); + const size_t index = coolingSAFMethodIndex + 1 + dist; + if ((value = object.getString(index, false, true))) { + newObject.setString(index, *value); + } else { + LOG(Error, "For AirLoopHVACUnitarySystem '" << object.nameString() << "', Supply Air Flow Method Rate During Cooling Operation is '" + << *coolingSAFMethod << "' but associated field is empty. Setting it to zero."); + newObject.setDouble(index, 0.0); + } + } + } + } + + if (!hasHeatingCoil) { + newObject.setString(heatingSAFMethodIndex, "None"); + } else if (!heatingSAFMethod) { + + // * 23 - Supply Air Flow Rate Method During Heating Operation + // * 24 - Supply Air Flow Rate During Heating Operation + // * 25 - Supply Air Flow Rate Per Floor Area during Heating Operation + // * 26 - Fraction of Autosized Design Heating Supply Air Flow Rate + // * 27 - Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation + bool found = false; + for (size_t i = 0; i < heatingSAFMethodChoices.size(); ++i) { + const size_t fieldIndex = heatingSAFMethodIndex + 1 + i; + if ((value = object.getString(fieldIndex, false, true))) { + newObject.setString(heatingSAFMethodIndex, std::string{heatingSAFMethodChoices[i]}); + newObject.setString(fieldIndex, *value); + found = true; + break; + } + } + if (!found) { + LOG(Warn, "For AirLoopHVACUnitarySystem '" + << object.nameString() + << "', there is a heating coil, but no Supply Air Flow Rate Method During Heating Operation and no flow rate fields set. " + "Defaulting to SupplyAirFlowRate with Autosize"); + newObject.setString(heatingSAFMethodIndex, "SupplyAirFlowRate"); + newObject.setString(heatingSAFMethodIndex + 1, "Autosize"); + } + } else { + std::string heatingSAFMethodUC = ascii_to_upper_copy(*heatingSAFMethod); + if (heatingSAFMethodUC == "NONE") { + LOG(Warn, "For AirLoopHVACUnitarySystem '" + << object.nameString() + << "', Supply Air Flow Method Rate During Heating Operation is 'None' but you have a Heating coil, consider changing it"); + } else { + auto it = std::find_if(heatingSAFMethodChoicesUC.cbegin(), heatingSAFMethodChoicesUC.cend(), + [&heatingSAFMethodUC](auto& s) { return s == heatingSAFMethodUC; }); + if (it == heatingSAFMethodChoicesUC.cend()) { + LOG(Error, "For AirLoopHVACUnitarySystem '" + << object.nameString() << "', Unrecognized Supply Air Flow Method Rate During Heating Operation=" << *heatingSAFMethod); + } else { + auto dist = std::distance(heatingSAFMethodChoicesUC.cbegin(), it); + const size_t index = heatingSAFMethodIndex + 1 + dist; + if ((value = object.getString(index, false, true))) { + newObject.setString(index, *value); + } else { + LOG(Error, "For AirLoopHVACUnitarySystem '" << object.nameString() << "', Supply Air Flow Method Rate During Heating Operation is '" + << *heatingSAFMethod << "' but associated field is empty. Setting it to zero."); + newObject.setDouble(index, 0.0); + } + } + } + } + + if (!hasHeatingCoil && !hasCoolingCoil) { + // TODO: not sure here + newObject.setString(noCoolHeatSAFMethodIndex, "None"); + } else if (!noCoolHeatSAFMethod) { + + // Blank is equivalent to None here, no question + newObject.setString(noCoolHeatSAFMethodIndex, "None"); +#if 0 + // * 29 - Supply Air Flow Rate When No Cooling or Heating is Required + // * 30 - Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required + // * 31 - Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + // * 32 - Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + // * 33 - Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required + // * 34 - Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required + bool found = false; + for (size_t i = 0; i < noCoolHeatSAFMethodChoices.size(); ++i) { + const size_t fieldIndex = noCoolHeatSAFMethodIndex + 1 + i; + if ((value = object.getString(fieldIndex, false, true))) { + newObject.setString(noCoolHeatSAFMethodIndex, std::string{noCoolHeatSAFMethodChoices[i]}); + newObject.setString(fieldIndex, *value); + found = true; + break; + } + } + if (!found) { + LOG(Warn, "For AirLoopHVACUnitarySystem '" << object.nameString() + << ", there is no Supply Air Flow Rate Method When No Cooling or Heating is Required and no flow rate fields set. " + "Defaulting to None"); + newObject.setString(noCoolHeatSAFMethodIndex, "None"); + } +#endif + } else { + std::string noCoolHeatSAFMethodUC = ascii_to_upper_copy(*noCoolHeatSAFMethod); + if (noCoolHeatSAFMethodUC != "NONE") { + auto it = std::find_if(noCoolHeatSAFMethodChoicesUC.cbegin(), noCoolHeatSAFMethodChoicesUC.cend(), + [&noCoolHeatSAFMethodUC](auto& s) { return s == noCoolHeatSAFMethodUC; }); + if (it == noCoolHeatSAFMethodChoicesUC.cend()) { + LOG(Error, "For AirLoopHVACUnitarySystem '" + << object.nameString() + << "', Unrecognized Supply Air Flow Rate Method When No Cooling or Heating is Required=" << *noCoolHeatSAFMethod); + } else { + auto dist = std::distance(noCoolHeatSAFMethodChoicesUC.cbegin(), it); + const size_t index = noCoolHeatSAFMethodIndex + 1 + dist; + if ((value = object.getString(index, false, true))) { + newObject.setString(index, *value); + } else { + LOG(Error, "For AirLoopHVACUnitarySystem '" << object.nameString() + << "', Supply Air Flow Rate Method When No Cooling or Heating is Required is '" + << *noCoolHeatSAFMethod << "' but associated field is empty"); + newObject.setDouble(index, 0.0); + } + } + } + } + ss << newObject; + m_refactored.push_back(RefactoredObjectData(object, std::move(newObject))); auto it = CoilLatentTransitionInfo::findFromParent(coilTransitionInfos, object); if (it != coilTransitionInfos.end()) { diff --git a/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods.py b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods.py new file mode 100644 index 00000000000..3c9aa44887a --- /dev/null +++ b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods.py @@ -0,0 +1,177 @@ +import openstudio + +assert openstudio.openStudioVersion() == "3.6.1" + +FIELD_IDENTIFIERS = [ + "CoolingSAFMethod", + "CoolingSAFMethod_SAFlow", + "CoolingSAFMethod_SAFlowPerFloorArea", + "CoolingSAFMethod_FracOfAutosizedCoolingSAFlow", + "CoolingSAFMethod_FlowPerCoolingCapacity", + "HeatingSAFMethod", + "HeatingSAFMethod_SAFlow", + "HeatingSAFMethod_SAFlowPerFloorArea", + "HeatingSAFMethod_FracOfAutosizedHeatingSAFlow", + "HeatingSAFMethod_FlowPerHeatingCapacity", + "NoCoolHeatSAFMethod", + "NoCoolHeatSAFMethod_SAFlow", + "NoCoolHeatSAFMethod_SAFlowPerFloorArea", + "NoCoolHeatSAFMethod_FracOfAutosizedCoolingSAFlow", + "NoCoolHeatSAFMethod_FracOfAutosizedHeatingSAFlow", + "NoCoolHeatSAFMethod_FlowPerCoolingCapacity", + "NoCoolHeatSAFMethod_FlowPerHeatingCapacity", +] + +COOLINGSAFMETHODINDEX = 18 + + +def get_info(unitary): + return { + field_identifier: unitary.getString(i + COOLINGSAFMETHODINDEX, False, False).get() + for i, field_identifier in enumerate(FIELD_IDENTIFIERS) + } + + +def add_cooling_coil(unitary: openstudio.model.AirLoopHVACUnitarySystem, model: openstudio.model.Model): + cc = openstudio.model.CoilCoolingDXSingleSpeed(model) + assert unitary.setCoolingCoil(cc) + + +def add_heating_coil(unitary: openstudio.model.AirLoopHVACUnitarySystem, model: openstudio.model.Model): + hc = openstudio.model.CoilHeatingDXSingleSpeed(model) + assert unitary.setHeatingCoil(hc) + + +def apply_coils_or_not(m: openstudio.model.Model, prefix: str): + coil_methods = [None, add_cooling_coil, add_heating_coil] + + unitarys = m.getAirLoopHVACUnitarySystems() + assert len(unitarys) == 3 + + test_infos = [] + + for coil_method, u in zip(coil_methods, unitarys): + coil_method_name = "None" + has_cc = False + has_hc = False + if coil_method is not None: + coil_method(unitary=u, model=m) + coil_method_name = coil_method.__name__ + if coil_method_name == "add_cooling_coil": + has_cc = True + else: + has_hc = True + + test_case = f"{prefix} - {coil_method_name}" + u.setName(test_case) + print(test_case) + coolingSAFMethod = "" + heatingSAFMethod = "" + noCoolHeatSAFMethod = "" + if (coolingSAFMethod_ := u.supplyAirFlowRateMethodDuringCoolingOperation()).is_initialized(): + coolingSAFMethod = coolingSAFMethod_.get() + + if (heatingSAFMethod_ := u.supplyAirFlowRateMethodDuringHeatingOperation()).is_initialized(): + heatingSAFMethod = heatingSAFMethod_.get() + + if (noCoolHeatSAFMethod_ := u.supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired()).is_initialized(): + noCoolHeatSAFMethod = noCoolHeatSAFMethod_.get() + + test_infos.append( + dict( + { + "test_case": test_case, + "CC": has_cc, + "HC": has_hc, + "coolingSAFMethod": coolingSAFMethod, + "heatingSAFMethod": heatingSAFMethod, + "noCoolHeatSAFMethod": noCoolHeatSAFMethod, + }, + **get_info(unitary=u), + ) + ) + + return test_infos + + +def model_default(): + """In this test, this is the Default constructed Unitary System, just adding coils (or not). + + The Supply Air Flow During XXX field is set to Autosize, yet the Method field isn't "SupplyAirFlowRate" but blank. + """ + + m = openstudio.model.Model() + for i in range(3): + openstudio.model.AirLoopHVACUnitarySystem(m) + test_infos = apply_coils_or_not(m, prefix="Default") + return m, test_infos + + +def test_SAF_not_null_but_correct_combos(): + """In this test, the SAF method is filled out, and ALL flow fields are set. + + We respect the SAF method choice, we keep the corresponding flow field, and clear out all the others + """ + m = openstudio.model.Model() + for i in range(3): + u = openstudio.model.AirLoopHVACUnitarySystem(m) + + # Supply Air Flow Rate Method During Cooling Operation + assert u.setSupplyAirFlowRateMethodDuringCoolingOperation("FlowPerFloorArea") + assert u.setSupplyAirFlowRateDuringCoolingOperation(1.0) + assert u.setSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(1.1) + assert u.setFractionofAutosizedDesignCoolingSupplyAirFlowRate(1.2) + assert u.setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation(1.3) + + # Supply Air Flow Rate Method During Heating Operation + assert u.setSupplyAirFlowRateMethodDuringHeatingOperation("FlowPerHeatingCapacity") + assert u.setSupplyAirFlowRateDuringHeatingOperation(2.0) + assert u.setSupplyAirFlowRatePerFloorAreaduringHeatingOperation(2.1) + assert u.setFractionofAutosizedDesignHeatingSupplyAirFlowRate(2.2) + assert u.setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation(2.3) + + # Supply Air Flow Rate Method When No Cooling or Heating is Required + assert u.setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FractionOfAutosizedHeatingValue") + assert u.setSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(0.1) + assert u.setSupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired(0.2) + assert u.setFractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(0.3) + assert u.setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(0.4) + assert u.setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired(0.5) + assert u.setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired(0.6) + + test_infos = apply_coils_or_not(m, prefix="SAF_correct") + return m, test_infos + + +def test_SAF_not_null_and_incorrect_combos(): + """In this test, the SAF method is filled out, but the corresponding flow field isn't. + + We respect the SAF method choice, and we set the corresponding flow field field to zero + """ + m = openstudio.model.Model() + for i in range(3): + u = openstudio.model.AirLoopHVACUnitarySystem(m) + assert u.setSupplyAirFlowRateMethodDuringCoolingOperation("FractionOfAutosizedCoolingValue") + assert u.setSupplyAirFlowRatePerFloorAreaDuringCoolingOperation(1.0) + + assert u.setSupplyAirFlowRateMethodDuringHeatingOperation("FlowPerFloorArea") + assert u.setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation(3.0) + + assert u.setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("FlowPerCoolingCapacity") + assert u.setFractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(0.4) + test_infos = apply_coils_or_not(m, prefix="SAF_incorrect") + return m, test_infos + + +if __name__ == "__main__": + m1, test_infos = model_default() + m1.save("test_vt_UnitarySystem_SAFMethods_default.osm", True) + + m2, test_infos2 = test_SAF_not_null_but_correct_combos() + m2.save("test_vt_UnitarySystem_SAFMethods_CorrectCombos.osm", True) + test_infos += test_infos2 + + m3, test_infos3 = test_SAF_not_null_and_incorrect_combos() + m3.save("test_vt_UnitarySystem_SAFMethods_IncorrectCombos.osm", True) + test_infos += test_infos3 + print(test_infos) diff --git a/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_CorrectCombos.osm b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_CorrectCombos.osm new file mode 100644 index 00000000000..78c73954cb4 --- /dev/null +++ b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_CorrectCombos.osm @@ -0,0 +1,320 @@ + +OS:Version, + {826bc855-f2b0-4d21-a4e0-7feb01bf135a}, !- Handle + 3.6.1; !- Version Identifier + +OS:AirLoopHVAC:UnitarySystem, + {58e19f48-4089-4b57-9e5e-18ea9c483ad2}, !- Handle + SAF_correct - add_heating_coil, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + {a3fd1a80-687a-4e6c-8552-0a37f52978de}, !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + , !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + FlowPerFloorArea, !- Supply Air Flow Rate Method During Cooling Operation + 1, !- Supply Air Flow Rate During Cooling Operation {m3/s} + 1.1, !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + 1.2, !- Fraction of Autosized Design Cooling Supply Air Flow Rate + 1.3, !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + FlowPerHeatingCapacity, !- Supply Air Flow Rate Method During Heating Operation + 2, !- Supply Air Flow Rate During Heating Operation {m3/s} + 2.1, !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + 2.2, !- Fraction of Autosized Design Heating Supply Air Flow Rate + 2.3, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + FractionOfAutosizedHeatingValue, !- Supply Air Flow Rate Method When No Cooling or Heating is Required + 0.1, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + 0.2, !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + 0.3, !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + 0.4, !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + 0.5, !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + 0.6, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:AirLoopHVAC:UnitarySystem, + {18f22c23-ad26-44ba-bc05-c08bcd95c845}, !- Handle + SAF_correct - add_cooling_coil, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + , !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + {cb92d862-d9a0-4e5f-85e6-18684de45d25}, !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + FlowPerFloorArea, !- Supply Air Flow Rate Method During Cooling Operation + 1, !- Supply Air Flow Rate During Cooling Operation {m3/s} + 1.1, !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + 1.2, !- Fraction of Autosized Design Cooling Supply Air Flow Rate + 1.3, !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + FlowPerHeatingCapacity, !- Supply Air Flow Rate Method During Heating Operation + 2, !- Supply Air Flow Rate During Heating Operation {m3/s} + 2.1, !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + 2.2, !- Fraction of Autosized Design Heating Supply Air Flow Rate + 2.3, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + FractionOfAutosizedHeatingValue, !- Supply Air Flow Rate Method When No Cooling or Heating is Required + 0.1, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + 0.2, !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + 0.3, !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + 0.4, !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + 0.5, !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + 0.6, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:AirLoopHVAC:UnitarySystem, + {891b942e-5509-4dc2-b924-1576b2326fc4}, !- Handle + SAF_correct - None, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + , !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + , !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + FlowPerFloorArea, !- Supply Air Flow Rate Method During Cooling Operation + 1, !- Supply Air Flow Rate During Cooling Operation {m3/s} + 1.1, !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + 1.2, !- Fraction of Autosized Design Cooling Supply Air Flow Rate + 1.3, !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + FlowPerHeatingCapacity, !- Supply Air Flow Rate Method During Heating Operation + 2, !- Supply Air Flow Rate During Heating Operation {m3/s} + 2.1, !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + 2.2, !- Fraction of Autosized Design Heating Supply Air Flow Rate + 2.3, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + FractionOfAutosizedHeatingValue, !- Supply Air Flow Rate Method When No Cooling or Heating is Required + 0.1, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + 0.2, !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + 0.3, !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + 0.4, !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + 0.5, !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + 0.6, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:Coil:Cooling:DX:SingleSpeed, + {cb92d862-d9a0-4e5f-85e6-18684de45d25}, !- Handle + Coil Cooling DX Single Speed 1, !- Name + {3d5fe8ea-ba4b-40b5-a714-5b9ccef5eef0}, !- Availability Schedule Name + autosize, !- Rated Total Cooling Capacity {W} + autosize, !- Rated Sensible Heat Ratio + 3, !- Rated COP {W/W} + autosize, !- Rated Air Flow Rate {m3/s} + 773.3, !- Rated Evaporator Fan Power Per Volume Flow Rate 2017 {W/(m3/s)} + 934.4, !- Rated Evaporator Fan Power Per Volume Flow Rate 2023 {W/(m3/s)} + , !- Air Inlet Node Name + , !- Air Outlet Node Name + {3e685313-d3b8-4f51-81ec-faa748cb0ccf}, !- Total Cooling Capacity Function of Temperature Curve Name + {9442da5a-0cd8-4014-ae12-784c9021760c}, !- Total Cooling Capacity Function of Flow Fraction Curve Name + {d14f84e0-acc8-4d8c-acff-529a16de7ce1}, !- Energy Input Ratio Function of Temperature Curve Name + {8e6cd4dd-3705-4541-8afe-9bfe326baf9f}, !- Energy Input Ratio Function of Flow Fraction Curve Name + {a4ec44c3-6139-4982-a95c-a8a3807b2205}, !- Part Load Fraction Correlation Curve Name + -25, !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C} + 0, !- Nominal Time for Condensate Removal to Begin {s} + 0, !- Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity {dimensionless} + 0, !- Maximum Cycling Rate {cycles/hr} + 0, !- Latent Capacity Time Constant {s} + , !- Condenser Air Inlet Node Name + AirCooled, !- Condenser Type + 0.9, !- Evaporative Condenser Effectiveness {dimensionless} + autosize, !- Evaporative Condenser Air Flow Rate {m3/s} + autosize, !- Evaporative Condenser Pump Rated Power Consumption {W} + 0, !- Crankcase Heater Capacity {W} + 10, !- Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation {C} + , !- Supply Water Storage Tank Name + , !- Condensate Collection Water Storage Tank Name + 0, !- Basin Heater Capacity {W/K} + 2; !- Basin Heater Setpoint Temperature {C} + +OS:Curve:Biquadratic, + {3e685313-d3b8-4f51-81ec-faa748cb0ccf}, !- Handle + Curve Biquadratic 1, !- Name + 0.942587793, !- Coefficient1 Constant + 0.009543347, !- Coefficient2 x + 0.00068377, !- Coefficient3 x**2 + -0.011042676, !- Coefficient4 y + 5.249e-06, !- Coefficient5 y**2 + -9.72e-06, !- Coefficient6 x*y + 17, !- Minimum Value of x + 22, !- Maximum Value of x + 13, !- Minimum Value of y + 46; !- Maximum Value of y + +OS:Curve:Quadratic, + {9442da5a-0cd8-4014-ae12-784c9021760c}, !- Handle + Curve Quadratic 1, !- Name + 0.8, !- Coefficient1 Constant + 0.2, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Biquadratic, + {d14f84e0-acc8-4d8c-acff-529a16de7ce1}, !- Handle + Curve Biquadratic 2, !- Name + 0.342414409, !- Coefficient1 Constant + 0.034885008, !- Coefficient2 x + -0.0006237, !- Coefficient3 x**2 + 0.004977216, !- Coefficient4 y + 0.000437951, !- Coefficient5 y**2 + -0.000728028, !- Coefficient6 x*y + 17, !- Minimum Value of x + 22, !- Maximum Value of x + 13, !- Minimum Value of y + 46; !- Maximum Value of y + +OS:Curve:Quadratic, + {8e6cd4dd-3705-4541-8afe-9bfe326baf9f}, !- Handle + Curve Quadratic 2, !- Name + 1.1552, !- Coefficient1 Constant + -0.1808, !- Coefficient2 x + 0.0256, !- Coefficient3 x**2 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Quadratic, + {a4ec44c3-6139-4982-a95c-a8a3807b2205}, !- Handle + Curve Quadratic 3, !- Name + 0.85, !- Coefficient1 Constant + 0.15, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + +OS:Schedule:Constant, + {3d5fe8ea-ba4b-40b5-a714-5b9ccef5eef0}, !- Handle + Always On Discrete, !- Name + {6848911b-d942-4905-a3d7-a0994b4241f0}, !- Schedule Type Limits Name + 1; !- Value + +OS:ScheduleTypeLimits, + {6848911b-d942-4905-a3d7-a0994b4241f0}, !- Handle + OnOff, !- Name + 0, !- Lower Limit Value + 1, !- Upper Limit Value + Discrete, !- Numeric Type + Availability; !- Unit Type + +OS:Coil:Heating:DX:SingleSpeed, + {a3fd1a80-687a-4e6c-8552-0a37f52978de}, !- Handle + Coil Heating DX Single Speed 1, !- Name + {3d5fe8ea-ba4b-40b5-a714-5b9ccef5eef0}, !- Availability Schedule Name + Autosize, !- Rated Total Heating Capacity {W} + 5, !- Rated COP {W/W} + Autosize, !- Rated Air Flow Rate {m3/s} + 773.3, !- Rated Supply Fan Power Per Volume Flow Rate 2017 {W/(m3/s)} + 934.4, !- Rated Supply Fan Power Per Volume Flow Rate 2023 {W/(m3/s)} + , !- Air Inlet Node Name + , !- Air Outlet Node Name + {4929c2de-327f-4aef-9148-88958a4ea035}, !- Total Heating Capacity Function of Temperature Curve Name + {c16602e7-747a-45d2-b5e3-61006c406dac}, !- Total Heating Capacity Function of Flow Fraction Curve Name + {60d95f6b-2975-4bc2-a419-c058bd09a09b}, !- Energy Input Ratio Function of Temperature Curve Name + {c84710ff-52d9-4e54-a8d8-9548057e0b9e}, !- Energy Input Ratio Function of Flow Fraction Curve Name + {5f186b70-8f3e-4d94-b6c4-714b123581f0}, !- Part Load Fraction Correlation Curve Name + , !- Defrost Energy Input Ratio Function of Temperature Curve Name + , !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C} + , !- Maximum Outdoor Dry-Bulb Temperature for Defrost Operation {C} + , !- Crankcase Heater Capacity {W} + , !- Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation {C} + Resistive, !- Defrost Strategy + Timed, !- Defrost Control + 0.166667, !- Defrost Time Period Fraction + 2000; !- Resistive Defrost Heater Capacity {W} + +OS:Curve:Cubic, + {4929c2de-327f-4aef-9148-88958a4ea035}, !- Handle + Curve Cubic 1, !- Name + 0.758746, !- Coefficient1 Constant + 0.027626, !- Coefficient2 x + 0.000148716, !- Coefficient3 x**2 + 3.4992e-06, !- Coefficient4 x**3 + -20, !- Minimum Value of x + 20; !- Maximum Value of x + +OS:Curve:Cubic, + {c16602e7-747a-45d2-b5e3-61006c406dac}, !- Handle + Curve Cubic 2, !- Name + 0.84, !- Coefficient1 Constant + 0.16, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Coefficient4 x**3 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Cubic, + {60d95f6b-2975-4bc2-a419-c058bd09a09b}, !- Handle + Curve Cubic 3, !- Name + 1.19248, !- Coefficient1 Constant + -0.0300438, !- Coefficient2 x + 0.00103745, !- Coefficient3 x**2 + -2.3328e-05, !- Coefficient4 x**3 + -20, !- Minimum Value of x + 20; !- Maximum Value of x + +OS:Curve:Quadratic, + {c84710ff-52d9-4e54-a8d8-9548057e0b9e}, !- Handle + Curve Quadratic 4, !- Name + 1.3824, !- Coefficient1 Constant + -0.4336, !- Coefficient2 x + 0.0512, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + +OS:Curve:Quadratic, + {5f186b70-8f3e-4d94-b6c4-714b123581f0}, !- Handle + Curve Quadratic 5, !- Name + 0.75, !- Coefficient1 Constant + 0.25, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + diff --git a/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_IncorrectCombos.osm b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_IncorrectCombos.osm new file mode 100644 index 00000000000..27dce70c039 --- /dev/null +++ b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_IncorrectCombos.osm @@ -0,0 +1,320 @@ + +OS:Version, + {f480fe7b-4869-4f4c-a40f-a36ca5fe0ee2}, !- Handle + 3.6.1; !- Version Identifier + +OS:AirLoopHVAC:UnitarySystem, + {afe538ed-29a5-4bb6-bc93-33362e70a083}, !- Handle + SAF_incorrect - add_heating_coil, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + {c25703b5-59b9-472e-957e-c5e14975ec12}, !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + , !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + FractionOfAutosizedCoolingValue, !- Supply Air Flow Rate Method During Cooling Operation + Autosize, !- Supply Air Flow Rate During Cooling Operation {m3/s} + 1, !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + FlowPerFloorArea, !- Supply Air Flow Rate Method During Heating Operation + Autosize, !- Supply Air Flow Rate During Heating Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + , !- Fraction of Autosized Design Heating Supply Air Flow Rate + 3, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + FlowPerCoolingCapacity, !- Supply Air Flow Rate Method When No Cooling or Heating is Required + Autosize, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + , !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + 0.4, !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:AirLoopHVAC:UnitarySystem, + {89776c9d-4cc0-43db-b97e-2dcd9395a38d}, !- Handle + SAF_incorrect - add_cooling_coil, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + , !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + {7f0c5ec2-2082-4707-b28b-3afdef680ec7}, !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + FractionOfAutosizedCoolingValue, !- Supply Air Flow Rate Method During Cooling Operation + Autosize, !- Supply Air Flow Rate During Cooling Operation {m3/s} + 1, !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + FlowPerFloorArea, !- Supply Air Flow Rate Method During Heating Operation + Autosize, !- Supply Air Flow Rate During Heating Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + , !- Fraction of Autosized Design Heating Supply Air Flow Rate + 3, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + FlowPerCoolingCapacity, !- Supply Air Flow Rate Method When No Cooling or Heating is Required + Autosize, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + , !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + 0.4, !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:AirLoopHVAC:UnitarySystem, + {fd298370-9752-4469-868b-df4e69ca764d}, !- Handle + SAF_incorrect - None, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + , !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + , !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + FractionOfAutosizedCoolingValue, !- Supply Air Flow Rate Method During Cooling Operation + Autosize, !- Supply Air Flow Rate During Cooling Operation {m3/s} + 1, !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + FlowPerFloorArea, !- Supply Air Flow Rate Method During Heating Operation + Autosize, !- Supply Air Flow Rate During Heating Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + , !- Fraction of Autosized Design Heating Supply Air Flow Rate + 3, !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + FlowPerCoolingCapacity, !- Supply Air Flow Rate Method When No Cooling or Heating is Required + Autosize, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + , !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + 0.4, !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:Coil:Cooling:DX:SingleSpeed, + {7f0c5ec2-2082-4707-b28b-3afdef680ec7}, !- Handle + Coil Cooling DX Single Speed 1, !- Name + {d4d7ab0f-8358-4a08-a897-12fcfc3fb6cc}, !- Availability Schedule Name + autosize, !- Rated Total Cooling Capacity {W} + autosize, !- Rated Sensible Heat Ratio + 3, !- Rated COP {W/W} + autosize, !- Rated Air Flow Rate {m3/s} + 773.3, !- Rated Evaporator Fan Power Per Volume Flow Rate 2017 {W/(m3/s)} + 934.4, !- Rated Evaporator Fan Power Per Volume Flow Rate 2023 {W/(m3/s)} + , !- Air Inlet Node Name + , !- Air Outlet Node Name + {d9bb06f0-03a7-423d-a0c9-abc11ac7e876}, !- Total Cooling Capacity Function of Temperature Curve Name + {be1b33e8-727c-49d3-8daa-8b4a79d6bc94}, !- Total Cooling Capacity Function of Flow Fraction Curve Name + {3ee6c8ce-6f40-4c36-8413-03d331783b42}, !- Energy Input Ratio Function of Temperature Curve Name + {29b0e682-aa96-475d-a269-2a6ac9934604}, !- Energy Input Ratio Function of Flow Fraction Curve Name + {c846593d-7f90-48e2-a049-515c0f2f2f8f}, !- Part Load Fraction Correlation Curve Name + -25, !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C} + 0, !- Nominal Time for Condensate Removal to Begin {s} + 0, !- Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity {dimensionless} + 0, !- Maximum Cycling Rate {cycles/hr} + 0, !- Latent Capacity Time Constant {s} + , !- Condenser Air Inlet Node Name + AirCooled, !- Condenser Type + 0.9, !- Evaporative Condenser Effectiveness {dimensionless} + autosize, !- Evaporative Condenser Air Flow Rate {m3/s} + autosize, !- Evaporative Condenser Pump Rated Power Consumption {W} + 0, !- Crankcase Heater Capacity {W} + 10, !- Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation {C} + , !- Supply Water Storage Tank Name + , !- Condensate Collection Water Storage Tank Name + 0, !- Basin Heater Capacity {W/K} + 2; !- Basin Heater Setpoint Temperature {C} + +OS:Curve:Biquadratic, + {d9bb06f0-03a7-423d-a0c9-abc11ac7e876}, !- Handle + Curve Biquadratic 1, !- Name + 0.942587793, !- Coefficient1 Constant + 0.009543347, !- Coefficient2 x + 0.00068377, !- Coefficient3 x**2 + -0.011042676, !- Coefficient4 y + 5.249e-06, !- Coefficient5 y**2 + -9.72e-06, !- Coefficient6 x*y + 17, !- Minimum Value of x + 22, !- Maximum Value of x + 13, !- Minimum Value of y + 46; !- Maximum Value of y + +OS:Curve:Quadratic, + {be1b33e8-727c-49d3-8daa-8b4a79d6bc94}, !- Handle + Curve Quadratic 1, !- Name + 0.8, !- Coefficient1 Constant + 0.2, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Biquadratic, + {3ee6c8ce-6f40-4c36-8413-03d331783b42}, !- Handle + Curve Biquadratic 2, !- Name + 0.342414409, !- Coefficient1 Constant + 0.034885008, !- Coefficient2 x + -0.0006237, !- Coefficient3 x**2 + 0.004977216, !- Coefficient4 y + 0.000437951, !- Coefficient5 y**2 + -0.000728028, !- Coefficient6 x*y + 17, !- Minimum Value of x + 22, !- Maximum Value of x + 13, !- Minimum Value of y + 46; !- Maximum Value of y + +OS:Curve:Quadratic, + {29b0e682-aa96-475d-a269-2a6ac9934604}, !- Handle + Curve Quadratic 2, !- Name + 1.1552, !- Coefficient1 Constant + -0.1808, !- Coefficient2 x + 0.0256, !- Coefficient3 x**2 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Quadratic, + {c846593d-7f90-48e2-a049-515c0f2f2f8f}, !- Handle + Curve Quadratic 3, !- Name + 0.85, !- Coefficient1 Constant + 0.15, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + +OS:Schedule:Constant, + {d4d7ab0f-8358-4a08-a897-12fcfc3fb6cc}, !- Handle + Always On Discrete, !- Name + {1cf9fda4-9d4f-4c4c-97c8-1dfef16a2192}, !- Schedule Type Limits Name + 1; !- Value + +OS:ScheduleTypeLimits, + {1cf9fda4-9d4f-4c4c-97c8-1dfef16a2192}, !- Handle + OnOff, !- Name + 0, !- Lower Limit Value + 1, !- Upper Limit Value + Discrete, !- Numeric Type + Availability; !- Unit Type + +OS:Coil:Heating:DX:SingleSpeed, + {c25703b5-59b9-472e-957e-c5e14975ec12}, !- Handle + Coil Heating DX Single Speed 1, !- Name + {d4d7ab0f-8358-4a08-a897-12fcfc3fb6cc}, !- Availability Schedule Name + Autosize, !- Rated Total Heating Capacity {W} + 5, !- Rated COP {W/W} + Autosize, !- Rated Air Flow Rate {m3/s} + 773.3, !- Rated Supply Fan Power Per Volume Flow Rate 2017 {W/(m3/s)} + 934.4, !- Rated Supply Fan Power Per Volume Flow Rate 2023 {W/(m3/s)} + , !- Air Inlet Node Name + , !- Air Outlet Node Name + {794e6866-0c6f-49b9-b8d8-7d2d21937227}, !- Total Heating Capacity Function of Temperature Curve Name + {d4dde2dc-0a92-48b5-9eb4-26e608493c7f}, !- Total Heating Capacity Function of Flow Fraction Curve Name + {52593531-43ad-4c0b-a851-42015604ab16}, !- Energy Input Ratio Function of Temperature Curve Name + {f91e3329-e69a-4d66-909c-88617b95f34e}, !- Energy Input Ratio Function of Flow Fraction Curve Name + {ccf71900-0aa5-4c50-a615-bbd07a61a263}, !- Part Load Fraction Correlation Curve Name + , !- Defrost Energy Input Ratio Function of Temperature Curve Name + , !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C} + , !- Maximum Outdoor Dry-Bulb Temperature for Defrost Operation {C} + , !- Crankcase Heater Capacity {W} + , !- Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation {C} + Resistive, !- Defrost Strategy + Timed, !- Defrost Control + 0.166667, !- Defrost Time Period Fraction + 2000; !- Resistive Defrost Heater Capacity {W} + +OS:Curve:Cubic, + {794e6866-0c6f-49b9-b8d8-7d2d21937227}, !- Handle + Curve Cubic 1, !- Name + 0.758746, !- Coefficient1 Constant + 0.027626, !- Coefficient2 x + 0.000148716, !- Coefficient3 x**2 + 3.4992e-06, !- Coefficient4 x**3 + -20, !- Minimum Value of x + 20; !- Maximum Value of x + +OS:Curve:Cubic, + {d4dde2dc-0a92-48b5-9eb4-26e608493c7f}, !- Handle + Curve Cubic 2, !- Name + 0.84, !- Coefficient1 Constant + 0.16, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Coefficient4 x**3 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Cubic, + {52593531-43ad-4c0b-a851-42015604ab16}, !- Handle + Curve Cubic 3, !- Name + 1.19248, !- Coefficient1 Constant + -0.0300438, !- Coefficient2 x + 0.00103745, !- Coefficient3 x**2 + -2.3328e-05, !- Coefficient4 x**3 + -20, !- Minimum Value of x + 20; !- Maximum Value of x + +OS:Curve:Quadratic, + {f91e3329-e69a-4d66-909c-88617b95f34e}, !- Handle + Curve Quadratic 4, !- Name + 1.3824, !- Coefficient1 Constant + -0.4336, !- Coefficient2 x + 0.0512, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + +OS:Curve:Quadratic, + {ccf71900-0aa5-4c50-a615-bbd07a61a263}, !- Handle + Curve Quadratic 5, !- Name + 0.75, !- Coefficient1 Constant + 0.25, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + diff --git a/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_default.osm b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_default.osm new file mode 100644 index 00000000000..aad97c86fa8 --- /dev/null +++ b/src/osversion/test/3_7_0/test_vt_UnitarySystem_SAFMethods_default.osm @@ -0,0 +1,320 @@ + +OS:Version, + {6f99e915-0dea-4dbe-96bd-3b7234a03c18}, !- Handle + 3.6.1; !- Version Identifier + +OS:AirLoopHVAC:UnitarySystem, + {f3f3c3bf-3329-40f8-9123-5215c701ef2b}, !- Handle + Default - add_heating_coil, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + {d6a209af-209d-471c-a4ea-71ab99d79d3f}, !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + , !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + , !- Supply Air Flow Rate Method During Cooling Operation + Autosize, !- Supply Air Flow Rate During Cooling Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + , !- Supply Air Flow Rate Method During Heating Operation + Autosize, !- Supply Air Flow Rate During Heating Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + , !- Fraction of Autosized Design Heating Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + , !- Supply Air Flow Rate Method When No Cooling or Heating is Required + Autosize, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + , !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + , !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:AirLoopHVAC:UnitarySystem, + {be0b4235-62b4-4df8-a51b-e1d49176e17d}, !- Handle + Default - add_cooling_coil, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + , !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + {bb05defc-c2ad-4aad-b7fb-93b0fa1b50ce}, !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + , !- Supply Air Flow Rate Method During Cooling Operation + Autosize, !- Supply Air Flow Rate During Cooling Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + , !- Supply Air Flow Rate Method During Heating Operation + Autosize, !- Supply Air Flow Rate During Heating Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + , !- Fraction of Autosized Design Heating Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + , !- Supply Air Flow Rate Method When No Cooling or Heating is Required + Autosize, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + , !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + , !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:AirLoopHVAC:UnitarySystem, + {72536bc6-9c33-45c4-9648-14117e0d545a}, !- Handle + Default - None, !- Name + Load, !- Control Type + , !- Controlling Zone or Thermostat Location + None, !- Dehumidification Control Type + , !- Availability Schedule Name + , !- Air Inlet Node Name + , !- Air Outlet Node Name + , !- Supply Fan Name + , !- Fan Placement + , !- Supply Air Fan Operating Mode Schedule Name + , !- Heating Coil Name + 1, !- DX Heating Coil Sizing Ratio + , !- Cooling Coil Name + No, !- Use DOAS DX Cooling Coil + 2, !- DOAS DX Cooling Coil Leaving Minimum Air Temperature {C} + SensibleOnlyLoadControl, !- Latent Load Control + , !- Supplemental Heating Coil Name + , !- Supply Air Flow Rate Method During Cooling Operation + Autosize, !- Supply Air Flow Rate During Cooling Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area During Cooling Operation {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation {m3/s-W} + , !- Supply Air Flow Rate Method During Heating Operation + Autosize, !- Supply Air Flow Rate During Heating Operation {m3/s} + , !- Supply Air Flow Rate Per Floor Area during Heating Operation {m3/s-m2} + , !- Fraction of Autosized Design Heating Supply Air Flow Rate + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation {m3/s-W} + , !- Supply Air Flow Rate Method When No Cooling or Heating is Required + Autosize, !- Supply Air Flow Rate When No Cooling or Heating is Required {m3/s} + , !- Supply Air Flow Rate Per Floor Area When No Cooling or Heating is Required {m3/s-m2} + , !- Fraction of Autosized Design Cooling Supply Air Flow Rate When No Cooling or Heating is Required + , !- Fraction of Autosized Design Heating Supply Air Flow Rate When No Cooling or Heating is Required + , !- Design Supply Air Flow Rate Per Unit of Capacity During Cooling Operation When No Cooling or Heating is Required {m3/s-W} + , !- Design Supply Air Flow Rate Per Unit of Capacity During Heating Operation When No Cooling or Heating is Required {m3/s-W} + 80, !- Maximum Supply Air Temperature {C} + 21, !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + , !- Outdoor Dry-Bulb Temperature Sensor Node Name + 2.5, !- Maximum Cycling Rate {cycles/hr} + 60, !- Heat Pump Time Constant {s} + 0.01, !- Fraction of On-Cycle Power Use + 60, !- Heat Pump Fan Delay Time {s} + 0, !- Ancilliary On-Cycle Electric Power {W} + 0; !- Ancilliary Off-Cycle Electric Power {W} + +OS:Coil:Cooling:DX:SingleSpeed, + {bb05defc-c2ad-4aad-b7fb-93b0fa1b50ce}, !- Handle + Coil Cooling DX Single Speed 1, !- Name + {d9b16da6-9221-4d9e-8d71-0f29546866be}, !- Availability Schedule Name + autosize, !- Rated Total Cooling Capacity {W} + autosize, !- Rated Sensible Heat Ratio + 3, !- Rated COP {W/W} + autosize, !- Rated Air Flow Rate {m3/s} + 773.3, !- Rated Evaporator Fan Power Per Volume Flow Rate 2017 {W/(m3/s)} + 934.4, !- Rated Evaporator Fan Power Per Volume Flow Rate 2023 {W/(m3/s)} + , !- Air Inlet Node Name + , !- Air Outlet Node Name + {de8d266b-78ba-4848-a454-b96278b6c40d}, !- Total Cooling Capacity Function of Temperature Curve Name + {057a4af8-88a6-42e9-86e1-0f819a786b0b}, !- Total Cooling Capacity Function of Flow Fraction Curve Name + {0f22f79d-d2ce-4c53-a45c-3cbcca8fe6e4}, !- Energy Input Ratio Function of Temperature Curve Name + {1cb80fcb-2950-4157-9d46-4ea1fc8e7f2b}, !- Energy Input Ratio Function of Flow Fraction Curve Name + {43556f19-7e35-4287-90a7-2bf9054f0a46}, !- Part Load Fraction Correlation Curve Name + -25, !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C} + 0, !- Nominal Time for Condensate Removal to Begin {s} + 0, !- Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity {dimensionless} + 0, !- Maximum Cycling Rate {cycles/hr} + 0, !- Latent Capacity Time Constant {s} + , !- Condenser Air Inlet Node Name + AirCooled, !- Condenser Type + 0.9, !- Evaporative Condenser Effectiveness {dimensionless} + autosize, !- Evaporative Condenser Air Flow Rate {m3/s} + autosize, !- Evaporative Condenser Pump Rated Power Consumption {W} + 0, !- Crankcase Heater Capacity {W} + 10, !- Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation {C} + , !- Supply Water Storage Tank Name + , !- Condensate Collection Water Storage Tank Name + 0, !- Basin Heater Capacity {W/K} + 2; !- Basin Heater Setpoint Temperature {C} + +OS:Curve:Biquadratic, + {de8d266b-78ba-4848-a454-b96278b6c40d}, !- Handle + Curve Biquadratic 1, !- Name + 0.942587793, !- Coefficient1 Constant + 0.009543347, !- Coefficient2 x + 0.00068377, !- Coefficient3 x**2 + -0.011042676, !- Coefficient4 y + 5.249e-06, !- Coefficient5 y**2 + -9.72e-06, !- Coefficient6 x*y + 17, !- Minimum Value of x + 22, !- Maximum Value of x + 13, !- Minimum Value of y + 46; !- Maximum Value of y + +OS:Curve:Quadratic, + {057a4af8-88a6-42e9-86e1-0f819a786b0b}, !- Handle + Curve Quadratic 1, !- Name + 0.8, !- Coefficient1 Constant + 0.2, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Biquadratic, + {0f22f79d-d2ce-4c53-a45c-3cbcca8fe6e4}, !- Handle + Curve Biquadratic 2, !- Name + 0.342414409, !- Coefficient1 Constant + 0.034885008, !- Coefficient2 x + -0.0006237, !- Coefficient3 x**2 + 0.004977216, !- Coefficient4 y + 0.000437951, !- Coefficient5 y**2 + -0.000728028, !- Coefficient6 x*y + 17, !- Minimum Value of x + 22, !- Maximum Value of x + 13, !- Minimum Value of y + 46; !- Maximum Value of y + +OS:Curve:Quadratic, + {1cb80fcb-2950-4157-9d46-4ea1fc8e7f2b}, !- Handle + Curve Quadratic 2, !- Name + 1.1552, !- Coefficient1 Constant + -0.1808, !- Coefficient2 x + 0.0256, !- Coefficient3 x**2 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Quadratic, + {43556f19-7e35-4287-90a7-2bf9054f0a46}, !- Handle + Curve Quadratic 3, !- Name + 0.85, !- Coefficient1 Constant + 0.15, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + +OS:Schedule:Constant, + {d9b16da6-9221-4d9e-8d71-0f29546866be}, !- Handle + Always On Discrete, !- Name + {f5380b2f-2236-4498-afe8-a744f74e129b}, !- Schedule Type Limits Name + 1; !- Value + +OS:ScheduleTypeLimits, + {f5380b2f-2236-4498-afe8-a744f74e129b}, !- Handle + OnOff, !- Name + 0, !- Lower Limit Value + 1, !- Upper Limit Value + Discrete, !- Numeric Type + Availability; !- Unit Type + +OS:Coil:Heating:DX:SingleSpeed, + {d6a209af-209d-471c-a4ea-71ab99d79d3f}, !- Handle + Coil Heating DX Single Speed 1, !- Name + {d9b16da6-9221-4d9e-8d71-0f29546866be}, !- Availability Schedule Name + Autosize, !- Rated Total Heating Capacity {W} + 5, !- Rated COP {W/W} + Autosize, !- Rated Air Flow Rate {m3/s} + 773.3, !- Rated Supply Fan Power Per Volume Flow Rate 2017 {W/(m3/s)} + 934.4, !- Rated Supply Fan Power Per Volume Flow Rate 2023 {W/(m3/s)} + , !- Air Inlet Node Name + , !- Air Outlet Node Name + {8ab033a4-9daf-49b6-aa94-c35f67f0104d}, !- Total Heating Capacity Function of Temperature Curve Name + {5ba05bcf-e2e8-4a39-9c2b-549daed55da8}, !- Total Heating Capacity Function of Flow Fraction Curve Name + {6e54493e-45e7-41db-a31e-7a10dc13a23e}, !- Energy Input Ratio Function of Temperature Curve Name + {188e8017-d722-4d68-be85-dcc41e11b0ef}, !- Energy Input Ratio Function of Flow Fraction Curve Name + {9870c076-04bc-4c08-aec7-6bd71f17a9cf}, !- Part Load Fraction Correlation Curve Name + , !- Defrost Energy Input Ratio Function of Temperature Curve Name + , !- Minimum Outdoor Dry-Bulb Temperature for Compressor Operation {C} + , !- Maximum Outdoor Dry-Bulb Temperature for Defrost Operation {C} + , !- Crankcase Heater Capacity {W} + , !- Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation {C} + Resistive, !- Defrost Strategy + Timed, !- Defrost Control + 0.166667, !- Defrost Time Period Fraction + 2000; !- Resistive Defrost Heater Capacity {W} + +OS:Curve:Cubic, + {8ab033a4-9daf-49b6-aa94-c35f67f0104d}, !- Handle + Curve Cubic 1, !- Name + 0.758746, !- Coefficient1 Constant + 0.027626, !- Coefficient2 x + 0.000148716, !- Coefficient3 x**2 + 3.4992e-06, !- Coefficient4 x**3 + -20, !- Minimum Value of x + 20; !- Maximum Value of x + +OS:Curve:Cubic, + {5ba05bcf-e2e8-4a39-9c2b-549daed55da8}, !- Handle + Curve Cubic 2, !- Name + 0.84, !- Coefficient1 Constant + 0.16, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Coefficient4 x**3 + 0.5, !- Minimum Value of x + 1.5; !- Maximum Value of x + +OS:Curve:Cubic, + {6e54493e-45e7-41db-a31e-7a10dc13a23e}, !- Handle + Curve Cubic 3, !- Name + 1.19248, !- Coefficient1 Constant + -0.0300438, !- Coefficient2 x + 0.00103745, !- Coefficient3 x**2 + -2.3328e-05, !- Coefficient4 x**3 + -20, !- Minimum Value of x + 20; !- Maximum Value of x + +OS:Curve:Quadratic, + {188e8017-d722-4d68-be85-dcc41e11b0ef}, !- Handle + Curve Quadratic 4, !- Name + 1.3824, !- Coefficient1 Constant + -0.4336, !- Coefficient2 x + 0.0512, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + +OS:Curve:Quadratic, + {9870c076-04bc-4c08-aec7-6bd71f17a9cf}, !- Handle + Curve Quadratic 5, !- Name + 0.75, !- Coefficient1 Constant + 0.25, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + diff --git a/src/osversion/test/VersionTranslator_GTest.cpp b/src/osversion/test/VersionTranslator_GTest.cpp index 7ef14564a39..6c7d1d84d5b 100644 --- a/src/osversion/test/VersionTranslator_GTest.cpp +++ b/src/osversion/test/VersionTranslator_GTest.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include "../../utilities/core/Compare.hpp" @@ -2552,6 +2553,205 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_GroundHeatExchangerVertical) { EXPECT_EQ(8.0, uka.getDouble(7).get()); // Phase Shift of Minimum Surface Temperature } +TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_default) { + openstudio::path osmPath = resourcesPath() / toPath("osversion/3_7_0/test_vt_UnitarySystem_SAFMethods_default.osm"); + osversion::VersionTranslator vt; + boost::optional model_ = vt.loadModel(osmPath); + ASSERT_TRUE(model_) << "Failed to load " << osmPath; + + openstudio::path outPath = osmPath.parent_path() / toPath(osmPath.stem().string() + "_updated" + osmPath.extension().string()); + model_->save(outPath, true); + + // ===================================================================================================== + // In this test, this is the Default constructed Unitary System, just adding coils (or not). + // The Supply Air Flow During XXX field is set to Autosize, + // yet the Method field isn't "SupplyAirFlowRate" but blank. + // ===================================================================================================== + + std::vector unitarys = model_->getObjectsByType("OS:AirLoopHVAC:UnitarySystem"); + ASSERT_EQ(3u, unitarys.size()); + for (const auto& unitary : unitarys) { + + const bool hasHeatingCoil = !unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::HeatingCoilName); + const bool hasCoolingCoil = !unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::CoolingCoilName); + + if (hasCoolingCoil) { + EXPECT_EQ("SupplyAirFlowRate", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); + EXPECT_EQ("Autosize", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringCoolingOperation).get()); + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringCoolingOperation)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaDuringCoolingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation)); + + if (hasHeatingCoil) { + EXPECT_EQ("SupplyAirFlowRate", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); + EXPECT_EQ("Autosize", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringHeatingOperation).get()); + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringHeatingOperation)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRate)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation)); + + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE( + unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE( + unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired)); + } +} + +TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_CorrectCombos) { + openstudio::path osmPath = resourcesPath() / toPath("osversion/3_7_0/test_vt_UnitarySystem_SAFMethods_CorrectCombos.osm"); + osversion::VersionTranslator vt; + boost::optional model_ = vt.loadModel(osmPath); + ASSERT_TRUE(model_) << "Failed to load " << osmPath; + + openstudio::path outPath = osmPath.parent_path() / toPath(osmPath.stem().string() + "_updated" + osmPath.extension().string()); + model_->save(outPath, true); + + // ===================================================================================================== + // In this test, the SAF method is filled out, and ALL flow fields are set. + // We respect the SAF method choice, we keep the corresponding flow field, and clear out all the others + // ===================================================================================================== + + std::vector unitarys = model_->getObjectsByType("OS:AirLoopHVAC:UnitarySystem"); + ASSERT_EQ(3u, unitarys.size()); + for (const auto& unitary : unitarys) { + + const bool hasHeatingCoil = !unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::HeatingCoilName); + const bool hasCoolingCoil = !unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::CoolingCoilName); + + if (hasCoolingCoil) { + EXPECT_EQ("FlowPerFloorArea", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); + EXPECT_EQ(1.1, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaDuringCoolingOperation).get()); + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaDuringCoolingOperation)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringCoolingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation)); + + if (hasHeatingCoil) { + EXPECT_EQ("FlowPerHeatingCapacity", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); + EXPECT_EQ(2.3, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation).get()); + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringHeatingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRate)); + + if (hasCoolingCoil || hasHeatingCoil) { + EXPECT_EQ("FractionOfAutosizedHeatingValue", + unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); + EXPECT_EQ( + 0.4, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired) + .get()); + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); + EXPECT_TRUE( + unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE( + unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired)); + } +} + +TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_IncorrectCombos) { + openstudio::path osmPath = resourcesPath() / toPath("osversion/3_7_0/test_vt_UnitarySystem_SAFMethods_IncorrectCombos.osm"); + osversion::VersionTranslator vt; + boost::optional model_ = vt.loadModel(osmPath); + ASSERT_TRUE(model_) << "Failed to load " << osmPath; + + openstudio::path outPath = osmPath.parent_path() / toPath(osmPath.stem().string() + "_updated" + osmPath.extension().string()); + model_->save(outPath, true); + + std::vector unitarys = model_->getObjectsByType("OS:AirLoopHVAC:UnitarySystem"); + ASSERT_EQ(3u, unitarys.size()); + + // ===================================================================================================== + // In this test, the SAF method is filled out, but the corresponding flow field isn't. + // We respect the SAF method choice, and we set the corresponding flow field field to zero + // ===================================================================================================== + + for (const auto& unitary : unitarys) { + + const bool hasHeatingCoil = !unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::HeatingCoilName); + const bool hasCoolingCoil = !unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::CoolingCoilName); + + if (hasCoolingCoil) { + EXPECT_EQ("FractionOfAutosizedCoolingValue", + unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); + EXPECT_DOUBLE_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate).get()) + << unitary; + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringCoolingOperation).get()); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringCoolingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaDuringCoolingOperation)); + // EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation)); + + if (hasHeatingCoil) { + EXPECT_EQ("FlowPerFloorArea", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); + EXPECT_DOUBLE_EQ(0.0, unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation).get()) + << unitary; + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodDuringHeatingOperation).get()); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateDuringHeatingOperation)); + // EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaduringHeatingOperation)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRate)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation)); + + if (hasCoolingCoil || hasHeatingCoil) { + EXPECT_EQ("FlowPerCoolingCapacity", + unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); + EXPECT_DOUBLE_EQ( + 0.0, unitary + .getDouble( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired) + .get()) + << unitary; + } else { + EXPECT_EQ("None", unitary.getString(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired).get()); + EXPECT_TRUE(unitary.isEmpty( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired)); + } + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::SupplyAirFlowRatePerFloorAreaWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE( + unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE( + unitary.isEmpty(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignHeatingSupplyAirFlowRateWhenNoCoolingorHeatingisRequired)); + // EXPECT_TRUE(unitary.isEmpty( + // OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperationWhenNoCoolingorHeatingisRequired)); + EXPECT_TRUE(unitary.isEmpty( + OS_AirLoopHVAC_UnitarySystemFields::DesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperationWhenNoCoolingorHeatingisRequired)); + } +} + TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_Coils_RatedFanPowerPerVolumeFlowRate) { openstudio::path osmPath = resourcesPath() / toPath("osversion/3_7_0/test_vt_Coils_RatedFanPowerPerVolumeFlowRate.osm"); osversion::VersionTranslator vt; diff --git a/src/sdd/MapHVAC.cpp b/src/sdd/MapHVAC.cpp index f5fd5c54320..35aaf39767e 100644 --- a/src/sdd/MapHVAC.cpp +++ b/src/sdd/MapHVAC.cpp @@ -2220,14 +2220,16 @@ namespace sdd { coil.setRatedHeatingCoefficientofPerformance(1.0 / _htPumpEIR.get()); } - model::CurveQuadLinear heatingCapacityCurve = coil.heatingCapacityCurve(); + model::Curve _heatingCapacityCurve = coil.heatingCapacityCurve(); + model::CurveQuadLinear heatingCapacityCurve = _heatingCapacityCurve.cast(); heatingCapacityCurve.setCoefficient1Constant(-1.361311959); heatingCapacityCurve.setCoefficient2w(-2.471798046); heatingCapacityCurve.setCoefficient3x(4.173164514); heatingCapacityCurve.setCoefficient4y(0.640757401); heatingCapacityCurve.setCoefficient5z(0.0); - model::CurveQuadLinear heatingPowerConsumptionCurve = coil.heatingPowerConsumptionCurve(); + model::Curve _heatingPowerConsumptionCurve = coil.heatingPowerConsumptionCurve(); + model::CurveQuadLinear heatingPowerConsumptionCurve = _heatingPowerConsumptionCurve.cast(); heatingPowerConsumptionCurve.setCoefficient1Constant(-2.176941116); heatingPowerConsumptionCurve.setCoefficient2w(0.832114286); heatingPowerConsumptionCurve.setCoefficient3x(1.570743399); @@ -3022,14 +3024,16 @@ namespace sdd { coil.setRatedCoolingCoefficientofPerformance(1.0 / _dxEIR.get()); } - model::CurveQuadLinear totalCoolingCapacityCurve = coil.totalCoolingCapacityCurve(); + model::Curve _totalCoolingCapacityCurve = coil.totalCoolingCapacityCurve(); + model::CurveQuadLinear totalCoolingCapacityCurve = _totalCoolingCapacityCurve.cast(); totalCoolingCapacityCurve.setCoefficient1Constant(-9.149069561); totalCoolingCapacityCurve.setCoefficient2w(10.87814026); totalCoolingCapacityCurve.setCoefficient3x(-1.718780157); totalCoolingCapacityCurve.setCoefficient4y(0.746414818); totalCoolingCapacityCurve.setCoefficient5z(0.0); - model::CurveQuintLinear sensibleCoolingCapacityCurve = coil.sensibleCoolingCapacityCurve(); + model::Curve _sensibleCoolingCapacityCurve = coil.sensibleCoolingCapacityCurve(); + model::CurveQuintLinear sensibleCoolingCapacityCurve = _sensibleCoolingCapacityCurve.cast(); sensibleCoolingCapacityCurve.setCoefficient1Constant(-5.462690012); sensibleCoolingCapacityCurve.setCoefficient2v(17.95968138); sensibleCoolingCapacityCurve.setCoefficient3w(-11.87818402); @@ -3037,7 +3041,8 @@ namespace sdd { sensibleCoolingCapacityCurve.setCoefficient5y(0.767285761); sensibleCoolingCapacityCurve.setCoefficient6z(0.0); - model::CurveQuadLinear coolingPowerConsumptionCurve = coil.coolingPowerConsumptionCurve(); + model::Curve _coolingPowerConsumptionCurve = coil.coolingPowerConsumptionCurve(); + model::CurveQuadLinear coolingPowerConsumptionCurve = _coolingPowerConsumptionCurve.cast(); coolingPowerConsumptionCurve.setCoefficient1Constant(-3.20456384); coolingPowerConsumptionCurve.setCoefficient2w(-0.976409399); coolingPowerConsumptionCurve.setCoefficient3x(3.97892546); diff --git a/src/utilities/core/ASCIIStrings.hpp b/src/utilities/core/ASCIIStrings.hpp index 9d7a48f27a3..3cc0a0ef602 100644 --- a/src/utilities/core/ASCIIStrings.hpp +++ b/src/utilities/core/ASCIIStrings.hpp @@ -22,6 +22,17 @@ inline std::string ascii_to_lower_copy(std::string_view input) { return result; } +inline std::string ascii_to_upper_copy(std::string_view input) { + std::string result{input}; + constexpr auto to_upper_diff = 'A' - 'a'; + for (auto& c : result) { + if (c >= 'a' && c <= 'z') { + c += to_upper_diff; + } + } + return result; +} + inline std::string_view ascii_trim_left(std::string_view s) { return s.substr(std::min(s.find_first_not_of(" \f\n\r\t\v"), s.size())); }