src/model/HeatPumpAirToWater.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "HeatPumpAirToWater.hpp" | ||
| 7 | #include "HeatPumpAirToWater_Impl.hpp" | ||
| 8 | |||
| 9 | #include "Model.hpp" | ||
| 10 | #include "Curve.hpp" | ||
| 11 | #include "Curve_Impl.hpp" | ||
| 12 | #include "HeatPumpAirToWaterHeating.hpp" | ||
| 13 | #include "HeatPumpAirToWaterHeating_Impl.hpp" | ||
| 14 | #include "HeatPumpAirToWaterCooling.hpp" | ||
| 15 | #include "HeatPumpAirToWaterCooling_Impl.hpp" | ||
| 16 | #include "PlantLoop.hpp" | ||
| 17 | #include "Schedule.hpp" | ||
| 18 | #include "Schedule_Impl.hpp" | ||
| 19 | #include "ScheduleTypeLimits.hpp" | ||
| 20 | #include "ScheduleTypeRegistry.hpp" | ||
| 21 | |||
| 22 | #include "../utilities/core/Assert.hpp" | ||
| 23 | #include "../utilities/core/ContainersMove.hpp" | ||
| 24 | #include "../utilities/data/DataEnums.hpp" | ||
| 25 | |||
| 26 | #include <utilities/idd/IddFactory.hxx> | ||
| 27 | #include <utilities/idd/IddEnums.hxx> | ||
| 28 | #include <utilities/idd/OS_HeatPump_AirToWater_FieldEnums.hxx> | ||
| 29 | |||
| 30 | namespace openstudio { | ||
| 31 | namespace model { | ||
| 32 | |||
| 33 | namespace detail { | ||
| 34 | |||
| 35 | 11 | HeatPumpAirToWater_Impl::HeatPumpAirToWater_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 36 | 11 | : StraightComponent_Impl(idfObject, model, keepHandle) { | |
| 37 |
4/6✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
✓ Branch 7 taken 11 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 11 times.
✗ Branch 13 not taken.
|
11 | OS_ASSERT(idfObject.iddObject().type() == HeatPumpAirToWater::iddObjectType()); |
| 38 | 11 | } | |
| 39 | |||
| 40 | ✗ | HeatPumpAirToWater_Impl::HeatPumpAirToWater_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 41 | ✗ | : StraightComponent_Impl(other, model, keepHandle) { | |
| 42 | ✗ | OS_ASSERT(other.iddObject().type() == HeatPumpAirToWater::iddObjectType()); | |
| 43 | ✗ | } | |
| 44 | |||
| 45 | 8 | HeatPumpAirToWater_Impl::HeatPumpAirToWater_Impl(const HeatPumpAirToWater_Impl& other, Model_Impl* model, bool keepHandle) | |
| 46 | 8 | : StraightComponent_Impl(other, model, keepHandle) {} | |
| 47 | |||
| 48 | ✗ | const std::vector<std::string>& HeatPumpAirToWater_Impl::outputVariableNames() const { | |
| 49 | static const std::vector<std::string> result{ | ||
| 50 | "Heat Pump Part Load Ratio in Heating Mode", | ||
| 51 | "Heat Pump Cycling Ratio in Heating Mode", | ||
| 52 | "Heat Pump Load Side Heat Transfer Rate in Heating Mode", | ||
| 53 | "Heat Pump Load Side Heat Transfer Energy in Heating Mode", | ||
| 54 | "Heat Pump Source Side Heat Transfer Rate in Heating Mode", | ||
| 55 | "Heat Pump Source Side Heat Transfer Energy in Heating Mode", | ||
| 56 | "Heat Pump Load Side Inlet Temperature in Heating Mode", | ||
| 57 | "Heat Pump Load Side Outlet Temperature in Heating Mode", | ||
| 58 | "Heat Pump Source Side Inlet Temperature in Heating Mode", | ||
| 59 | "Heat Pump Source Side Outlet Temperature in Heating Mode", | ||
| 60 | "Heat Pump Electricity Rate in Heating Mode", | ||
| 61 | "Heat Pump Electricity Energy in Heating Mode", | ||
| 62 | "Heat Pump Load Due To Defrost", | ||
| 63 | "Heat Pump Fractional Defrost Time", | ||
| 64 | "Heat Pump Defrost Electricity Rate", | ||
| 65 | "Heat Pump Defrost Electricity Energy", | ||
| 66 | "Heat Pump Load Side Mass Flow Rate in Heating Mode", | ||
| 67 | "Heat Pump Source Side Mass Flow Rate in Heating Mode", | ||
| 68 | "Heat Pump Total Heating Rate", | ||
| 69 | "Heat Pump Number Of Heating Unit On", | ||
| 70 | "Heat Pump Speed Level in Heating Mode", | ||
| 71 | "Heat Pump Speed Ratio in Heating Mode", | ||
| 72 | "Heat Pump Air Flow Rate in Heating Mode", | ||
| 73 | "Heat Pump Inlet Air Temperature in Heating Mode", | ||
| 74 | "Heat Pump Outlet Air Temperature in Heating Mode", | ||
| 75 | "Heat Pump Capacity Temperature Modifier in Heating Mode", | ||
| 76 | "Heat Pump EIR Temperature Modifier in Heating Mode", | ||
| 77 | "Heat Pump EIR PLR Modifier in Heating Mode", | ||
| 78 | "Heat Pump Crankcase Heater Electricity Rate", | ||
| 79 | "Heat Pump Crankcase Heater Electricity Energy", | ||
| 80 | "Heat Pump Heating COP", | ||
| 81 | "Heat Pump Part Load Ratio in Cooling Mode", | ||
| 82 | "Heat Pump Cycling Ratio in Cooling Mode", | ||
| 83 | "Heat Pump Load Side Heat Transfer Rate in Cooling Mode", | ||
| 84 | "Heat Pump Load Side Heat Transfer Energy in Cooling Mode", | ||
| 85 | "Heat Pump Source Side Heat Transfer Rate in Cooling Mode", | ||
| 86 | "Heat Pump Source Side Heat Transfer Energy in Cooling Mode", | ||
| 87 | "Heat Pump Load Side Inlet Temperature in Cooling Mode", | ||
| 88 | "Heat Pump Load Side Outlet Temperature in Cooling Mode", | ||
| 89 | "Heat Pump Source Side Inlet Temperature in Cooling Mode", | ||
| 90 | "Heat Pump Source Side Outlet Temperature in Cooling Mode", | ||
| 91 | "Heat Pump Electricity Rate in Cooling Mode", | ||
| 92 | "Heat Pump Electricity Energy in Cooling Mode", | ||
| 93 | "Heat Pump Load Side Mass Flow Rate in Cooling Mode", | ||
| 94 | "Heat Pump Source Side Mass Flow Rate in Cooling Mode", | ||
| 95 | "Heat Pump Total Cooling Rate", | ||
| 96 | "Heat Pump Number Of Cooling Unit On", | ||
| 97 | "Heat Pump Speed Level in Cooling Mode", | ||
| 98 | "Heat Pump Speed Ratio in Cooling Mode", | ||
| 99 | "Heat Pump Air Flow Rate in Cooling Mode", | ||
| 100 | "Heat Pump Inlet Air Temperature in Cooling Mode", | ||
| 101 | "Heat Pump Outlet Air Temperature in Cooling Mode", | ||
| 102 | "Heat Pump Capacity Temperature Modifier in Cooling Mode", | ||
| 103 | "Heat Pump EIR Temperature Modifier in Cooling Mode", | ||
| 104 | "Heat Pump EIR PLR Modifier in Cooling Mode", | ||
| 105 | "Heat Pump Cooling COP", | ||
| 106 | ✗ | }; | |
| 107 | ✗ | return result; | |
| 108 | ✗ | } | |
| 109 | |||
| 110 | ✗ | IddObjectType HeatPumpAirToWater_Impl::iddObjectType() const { | |
| 111 | ✗ | return HeatPumpAirToWater::iddObjectType(); | |
| 112 | } | ||
| 113 | |||
| 114 | ✗ | std::vector<ScheduleTypeKey> HeatPumpAirToWater_Impl::getScheduleTypeKeys(const Schedule& schedule) const { | |
| 115 | ✗ | std::vector<ScheduleTypeKey> result; | |
| 116 | ✗ | const UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); | |
| 117 | ✗ | if (std::find(fieldIndices.cbegin(), fieldIndices.cend(), OS_HeatPump_AirToWaterFields::OperatingModeControlScheduleName) | |
| 118 | ✗ | != fieldIndices.cend()) { | |
| 119 | ✗ | result.emplace_back("HeatPumpAirToWater", "Operating Mode Control"); | |
| 120 | } | ||
| 121 | ✗ | return result; | |
| 122 | ✗ | } | |
| 123 | |||
| 124 | 2 | unsigned HeatPumpAirToWater_Impl::inletPort() const { | |
| 125 | 2 | return OS_HeatPump_AirToWaterFields::AirInletNodeName; | |
| 126 | } | ||
| 127 | |||
| 128 | 2 | unsigned HeatPumpAirToWater_Impl::outletPort() const { | |
| 129 | 2 | return OS_HeatPump_AirToWaterFields::AirOutletNodeName; | |
| 130 | } | ||
| 131 | |||
| 132 | 6 | bool HeatPumpAirToWater_Impl::addToNode(Node& /*node*/) { | |
| 133 |
5/5✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
✓ Branch 10 taken 6 times.
✓ Branch 13 taken 6 times.
|
6 | LOG(Info, "Use the underlying HeatPumpAirToWaterCooling / HeatPumpAirToWaterHeating objects to add to a plant loop."); |
| 134 | 6 | return false; | |
| 135 | } | ||
| 136 | |||
| 137 | 7 | std::vector<ModelObject> HeatPumpAirToWater_Impl::children() const { | |
| 138 | 7 | std::vector<ModelObject> children; | |
| 139 |
3/3✓ Branch 1 taken 7 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 4 times.
|
14 | if (auto c_ = defrostEnergyInputRatioFunctionofTemperatureCurve()) { |
| 140 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 5 taken 3 times.
|
3 | children.emplace_back(std::move(*c_)); |
| 141 | 7 | } | |
| 142 |
3/3✓ Branch 1 taken 7 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 4 times.
|
14 | if (auto c_ = crankcaseHeaterCapacityFunctionofTemperatureCurve()) { |
| 143 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 5 taken 3 times.
|
3 | children.emplace_back(std::move(*c_)); |
| 144 | 7 | } | |
| 145 |
3/3✓ Branch 1 taken 7 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 4 times.
|
14 | if (auto c_ = coolingOperationMode()) { |
| 146 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 5 taken 3 times.
|
3 | children.emplace_back(std::move(*c_)); |
| 147 | 7 | } | |
| 148 |
3/3✓ Branch 1 taken 7 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 4 times.
|
14 | if (auto c_ = heatingOperationMode()) { |
| 149 |
2/2✓ Branch 1 taken 3 times.
✓ Branch 5 taken 3 times.
|
3 | children.emplace_back(std::move(*c_)); |
| 150 | 7 | } | |
| 151 | 7 | return children; | |
| 152 | ✗ | } | |
| 153 | |||
| 154 | 2 | ModelObject HeatPumpAirToWater_Impl::clone(Model model) const { | |
| 155 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | auto t_clone = StraightComponent_Impl::clone(model).cast<HeatPumpAirToWater>(); |
| 156 | // We clone the operation modes, because the autosizing is reported at the wrapper level | ||
| 157 | // AND more importantly in OS, the modes are the the PlantLoops and that's what triggers the translation of the first wrapper (this object) it | ||
| 158 | // finds attached to it, so we must ensure they are unique | ||
| 159 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (auto coolingOpMode_ = coolingOperationMode()) { |
| 160 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | auto coolingOpModeClone = coolingOpMode_->clone(model).cast<HeatPumpAirToWaterCooling>(); |
| 161 |
1/1✓ Branch 1 taken 2 times.
|
2 | bool ok = t_clone.setCoolingOperationMode(coolingOpModeClone); |
| 162 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
|
2 | OS_ASSERT(ok); |
| 163 | 4 | } | |
| 164 |
2/3✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
|
4 | if (auto heatingOpMode_ = heatingOperationMode()) { |
| 165 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | auto heatingOpModeClone = heatingOpMode_->clone(model).cast<HeatPumpAirToWaterHeating>(); |
| 166 |
1/1✓ Branch 1 taken 2 times.
|
2 | bool ok = t_clone.setHeatingOperationMode(heatingOpModeClone); |
| 167 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
|
2 | OS_ASSERT(ok); |
| 168 | 4 | } | |
| 169 | |||
| 170 | 4 | return std::move(t_clone); | |
| 171 | 2 | } | |
| 172 | |||
| 173 | 4 | std::vector<IdfObject> HeatPumpAirToWater_Impl::remove() { | |
| 174 | 4 | std::vector<IdfObject> result; | |
| 175 | |||
| 176 | // We are the only one using these cooling/heating operation modes but design, remove it (it will remove the children too) | ||
| 177 | // But first reset so it's marked as removable | ||
| 178 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 3 times.
|
8 | if (auto coolingOpMode_ = coolingOperationMode()) { |
| 179 |
1/1✓ Branch 1 taken 1 time.
|
1 | resetCoolingOperationMode(); |
| 180 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | result = coolingOpMode_->remove(); |
| 181 | 4 | } | |
| 182 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 3 times.
|
8 | if (auto heatingOpMode_ = heatingOperationMode()) { |
| 183 |
1/1✓ Branch 1 taken 1 time.
|
1 | resetHeatingOperationMode(); |
| 184 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | openstudio::detail::concat_helper(result, heatingOpMode_->remove()); |
| 185 | 4 | } | |
| 186 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | openstudio::detail::concat_helper(result, StraightComponent_Impl::remove()); |
| 187 | 4 | return result; | |
| 188 | ✗ | } | |
| 189 | |||
| 190 | 4 | ComponentType HeatPumpAirToWater_Impl::componentType() const { | |
| 191 |
1/1✓ Branch 1 taken 4 times.
|
4 | bool has_cooling = coolingOperationMode().is_initialized(); |
| 192 |
1/1✓ Branch 1 taken 4 times.
|
4 | bool has_heating = heatingOperationMode().is_initialized(); |
| 193 |
4/4✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 1 time.
✓ Branch 3 taken 1 time.
|
4 | if (has_cooling && has_heating) { |
| 194 |
1/1✓ Branch 1 taken 1 time.
|
1 | return ComponentType::Both; |
| 195 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 2 times.
|
3 | } else if (has_cooling) { |
| 196 |
1/1✓ Branch 1 taken 1 time.
|
1 | return ComponentType::Cooling; |
| 197 |
2/2✓ Branch 0 taken 1 time.
✓ Branch 1 taken 1 time.
|
2 | } else if (has_heating) { |
| 198 |
1/1✓ Branch 1 taken 1 time.
|
1 | return ComponentType::Heating; |
| 199 | } | ||
| 200 |
1/1✓ Branch 1 taken 1 time.
|
1 | return ComponentType::None; |
| 201 | } | ||
| 202 | |||
| 203 | 4 | std::vector<FuelType> HeatPumpAirToWater_Impl::coolingFuelTypes() const { | |
| 204 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
|
8 | if (auto cc_ = coolingOperationMode()) { |
| 205 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | return cc_->coolingFuelTypes(); |
| 206 | 4 | } | |
| 207 | 2 | return {}; | |
| 208 | } | ||
| 209 | |||
| 210 | 4 | std::vector<FuelType> HeatPumpAirToWater_Impl::heatingFuelTypes() const { | |
| 211 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
|
8 | if (auto hc_ = heatingOperationMode()) { |
| 212 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | return hc_->heatingFuelTypes(); |
| 213 | 4 | } | |
| 214 | 2 | return {}; | |
| 215 | } | ||
| 216 | |||
| 217 | 4 | std::vector<AppGFuelType> HeatPumpAirToWater_Impl::appGHeatingFuelTypes() const { | |
| 218 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
|
8 | if (auto hc_ = heatingOperationMode()) { |
| 219 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | return hc_->appGHeatingFuelTypes(); |
| 220 | 4 | } | |
| 221 | 2 | return {}; | |
| 222 | } | ||
| 223 | |||
| 224 | 11 | std::string HeatPumpAirToWater_Impl::operatingModeControlMethod() const { | |
| 225 |
1/1✓ Branch 1 taken 11 times.
|
11 | boost::optional<std::string> value = getString(OS_HeatPump_AirToWaterFields::OperatingModeControlMethod, true); |
| 226 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 11 times.
✗ Branch 4 not taken.
|
11 | OS_ASSERT(value); |
| 227 |
2/2✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
|
22 | return value.get(); |
| 228 | 11 | } | |
| 229 | |||
| 230 | 6 | std::string HeatPumpAirToWater_Impl::operatingModeControlOptionforMultipleUnit() const { | |
| 231 |
1/1✓ Branch 1 taken 6 times.
|
6 | boost::optional<std::string> value = getString(OS_HeatPump_AirToWaterFields::OperatingModeControlOptionforMultipleUnit, true); |
| 232 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
|
6 | OS_ASSERT(value); |
| 233 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
12 | return value.get(); |
| 234 | 6 | } | |
| 235 | |||
| 236 | 9 | boost::optional<Schedule> HeatPumpAirToWater_Impl::operatingModeControlSchedule() const { | |
| 237 |
2/2✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
|
9 | return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_HeatPump_AirToWaterFields::OperatingModeControlScheduleName); |
| 238 | } | ||
| 239 | |||
| 240 | 6 | double HeatPumpAirToWater_Impl::minimumPartLoadRatio() const { | |
| 241 |
1/1✓ Branch 1 taken 6 times.
|
6 | boost::optional<double> value = getDouble(OS_HeatPump_AirToWaterFields::MinimumPartLoadRatio, true); |
| 242 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
|
6 | OS_ASSERT(value); |
| 243 |
1/1✓ Branch 1 taken 6 times.
|
12 | return value.get(); |
| 244 | } | ||
| 245 | |||
| 246 | 6 | boost::optional<std::string> HeatPumpAirToWater_Impl::airInletNodeName() const { | |
| 247 | 6 | return getString(OS_HeatPump_AirToWaterFields::AirInletNodeName, false, true); // Return empty if not initialized | |
| 248 | } | ||
| 249 | |||
| 250 | 6 | boost::optional<std::string> HeatPumpAirToWater_Impl::airOutletNodeName() const { | |
| 251 | 6 | return getString(OS_HeatPump_AirToWaterFields::AirOutletNodeName, false, true); // Return empty if not initialized | |
| 252 | } | ||
| 253 | |||
| 254 | 5 | double HeatPumpAirToWater_Impl::maximumOutdoorDryBulbTemperatureForDefrostOperation() const { | |
| 255 |
1/1✓ Branch 1 taken 5 times.
|
5 | boost::optional<double> value = getDouble(OS_HeatPump_AirToWaterFields::MaximumOutdoorDryBulbTemperatureForDefrostOperation, true); |
| 256 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
|
5 | OS_ASSERT(value); |
| 257 |
1/1✓ Branch 1 taken 5 times.
|
10 | return value.get(); |
| 258 | } | ||
| 259 | |||
| 260 | 6 | std::string HeatPumpAirToWater_Impl::heatPumpDefrostControl() const { | |
| 261 |
1/1✓ Branch 1 taken 6 times.
|
6 | boost::optional<std::string> value = getString(OS_HeatPump_AirToWaterFields::HeatPumpDefrostControl, true); |
| 262 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
|
6 | OS_ASSERT(value); |
| 263 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
12 | return value.get(); |
| 264 | 6 | } | |
| 265 | |||
| 266 | 6 | double HeatPumpAirToWater_Impl::heatPumpDefrostTimePeriodFraction() const { | |
| 267 |
1/1✓ Branch 1 taken 6 times.
|
6 | boost::optional<double> value = getDouble(OS_HeatPump_AirToWaterFields::HeatPumpDefrostTimePeriodFraction, true); |
| 268 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
|
6 | OS_ASSERT(value); |
| 269 |
1/1✓ Branch 1 taken 6 times.
|
12 | return value.get(); |
| 270 | } | ||
| 271 | |||
| 272 | 6 | double HeatPumpAirToWater_Impl::resistiveDefrostHeaterCapacity() const { | |
| 273 |
1/1✓ Branch 1 taken 6 times.
|
6 | boost::optional<double> value = getDouble(OS_HeatPump_AirToWaterFields::ResistiveDefrostHeaterCapacity, true); |
| 274 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
|
6 | OS_ASSERT(value); |
| 275 |
1/1✓ Branch 1 taken 6 times.
|
12 | return value.get(); |
| 276 | } | ||
| 277 | |||
| 278 | 14 | boost::optional<Curve> HeatPumpAirToWater_Impl::defrostEnergyInputRatioFunctionofTemperatureCurve() const { | |
| 279 |
1/1✓ Branch 1 taken 14 times.
|
28 | return getObject<ModelObject>().getModelObjectTarget<Curve>( |
| 280 |
1/1✓ Branch 1 taken 14 times.
|
28 | OS_HeatPump_AirToWaterFields::DefrostEnergyInputRatioFunctionofTemperatureCurveName); |
| 281 | } | ||
| 282 | |||
| 283 | 5 | int HeatPumpAirToWater_Impl::heatPumpMultiplier() const { | |
| 284 |
1/1✓ Branch 1 taken 5 times.
|
5 | boost::optional<int> value = getInt(OS_HeatPump_AirToWaterFields::HeatPumpMultiplier, true); |
| 285 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
|
5 | OS_ASSERT(value); |
| 286 |
1/1✓ Branch 1 taken 5 times.
|
10 | return value.get(); |
| 287 | } | ||
| 288 | |||
| 289 | 6 | std::string HeatPumpAirToWater_Impl::controlType() const { | |
| 290 |
1/1✓ Branch 1 taken 6 times.
|
6 | boost::optional<std::string> value = getString(OS_HeatPump_AirToWaterFields::ControlType, true); |
| 291 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
|
6 | OS_ASSERT(value); |
| 292 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
12 | return value.get(); |
| 293 | 6 | } | |
| 294 | |||
| 295 | 6 | double HeatPumpAirToWater_Impl::crankcaseHeaterCapacity() const { | |
| 296 |
1/1✓ Branch 1 taken 6 times.
|
6 | boost::optional<double> value = getDouble(OS_HeatPump_AirToWaterFields::CrankcaseHeaterCapacity, true); |
| 297 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
|
6 | OS_ASSERT(value); |
| 298 |
1/1✓ Branch 1 taken 6 times.
|
12 | return value.get(); |
| 299 | } | ||
| 300 | |||
| 301 | 15 | boost::optional<Curve> HeatPumpAirToWater_Impl::crankcaseHeaterCapacityFunctionofTemperatureCurve() const { | |
| 302 |
1/1✓ Branch 1 taken 15 times.
|
30 | return getObject<ModelObject>().getModelObjectTarget<Curve>( |
| 303 |
1/1✓ Branch 1 taken 15 times.
|
30 | OS_HeatPump_AirToWaterFields::CrankcaseHeaterCapacityFunctionofTemperatureCurveName); |
| 304 | } | ||
| 305 | |||
| 306 | 6 | double HeatPumpAirToWater_Impl::maximumAmbientTemperatureforCrankcaseHeaterOperation() const { | |
| 307 |
1/1✓ Branch 1 taken 6 times.
|
6 | boost::optional<double> value = getDouble(OS_HeatPump_AirToWaterFields::MaximumAmbientTemperatureforCrankcaseHeaterOperation, true); |
| 308 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
|
6 | OS_ASSERT(value); |
| 309 |
1/1✓ Branch 1 taken 6 times.
|
12 | return value.get(); |
| 310 | } | ||
| 311 | |||
| 312 | 38 | boost::optional<HeatPumpAirToWaterHeating> HeatPumpAirToWater_Impl::heatingOperationMode() const { | |
| 313 |
2/2✓ Branch 1 taken 38 times.
✓ Branch 4 taken 38 times.
|
38 | return getObject<ModelObject>().getModelObjectTarget<HeatPumpAirToWaterHeating>(OS_HeatPump_AirToWaterFields::HeatingOperationMode); |
| 314 | } | ||
| 315 | |||
| 316 | 34 | boost::optional<HeatPumpAirToWaterCooling> HeatPumpAirToWater_Impl::coolingOperationMode() const { | |
| 317 |
2/2✓ Branch 1 taken 34 times.
✓ Branch 4 taken 34 times.
|
34 | return getObject<ModelObject>().getModelObjectTarget<HeatPumpAirToWaterCooling>(OS_HeatPump_AirToWaterFields::CoolingOperationMode); |
| 318 | } | ||
| 319 | |||
| 320 | 15 | bool HeatPumpAirToWater_Impl::setOperatingModeControlMethod(const std::string& operatingModeControlMethod) { | |
| 321 |
9/12✓ Branch 1 taken 15 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 13 times.
✓ Branch 6 taken 2 times.
✓ Branch 9 taken 2 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
✓ Branch 12 taken 13 times.
✓ Branch 14 taken 2 times.
✓ Branch 15 taken 13 times.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
|
15 | if (operatingModeControlMethod == "ScheduledModes" && !operatingModeControlSchedule()) { |
| 322 |
8/8✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 13 taken 2 times.
✓ Branch 17 taken 2 times.
✓ Branch 20 taken 2 times.
✓ Branch 23 taken 2 times.
|
2 | LOG(Warn, "For " << briefDescription() << ", to use 'ScheduledModes' use setOperatingModeControlSchedule"); |
| 323 | 2 | return false; | |
| 324 | } | ||
| 325 | 13 | const bool result = setString(OS_HeatPump_AirToWaterFields::OperatingModeControlMethod, operatingModeControlMethod); | |
| 326 | 13 | return result; | |
| 327 | } | ||
| 328 | |||
| 329 | 16 | bool HeatPumpAirToWater_Impl::setOperatingModeControlOptionforMultipleUnit(const std::string& operatingModeControlOptionforMultipleUnit) { | |
| 330 | const bool result = | ||
| 331 | 16 | setString(OS_HeatPump_AirToWaterFields::OperatingModeControlOptionforMultipleUnit, operatingModeControlOptionforMultipleUnit); | |
| 332 | 16 | return result; | |
| 333 | } | ||
| 334 | |||
| 335 | 4 | bool HeatPumpAirToWater_Impl::setOperatingModeControlSchedule(Schedule& operatingModeControlSchedule) { | |
| 336 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
|
16 | bool result = setSchedule(OS_HeatPump_AirToWaterFields::OperatingModeControlScheduleName, "HeatPumpAirToWater", "Operating Mode Control", |
| 337 | operatingModeControlSchedule); | ||
| 338 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
8 | result &= setString(OS_HeatPump_AirToWaterFields::OperatingModeControlMethod, "ScheduledModes"); |
| 339 | 4 | return result; | |
| 340 | } | ||
| 341 | |||
| 342 | 1 | void HeatPumpAirToWater_Impl::resetOperatingModeControlSchedule() { | |
| 343 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | const bool result = setString(OS_HeatPump_AirToWaterFields::OperatingModeControlScheduleName, ""); |
| 344 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 345 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | setString(OS_HeatPump_AirToWaterFields::OperatingModeControlMethod, "Load"); // Reset to default |
| 346 | 1 | } | |
| 347 | |||
| 348 | 16 | bool HeatPumpAirToWater_Impl::setMinimumPartLoadRatio(double minimumPartLoadRatio) { | |
| 349 | 16 | const bool result = setDouble(OS_HeatPump_AirToWaterFields::MinimumPartLoadRatio, minimumPartLoadRatio); | |
| 350 | 16 | return result; | |
| 351 | } | ||
| 352 | |||
| 353 | 4 | bool HeatPumpAirToWater_Impl::setAirInletNodeName(const std::string& airInletNodeName) { | |
| 354 | 4 | const bool result = setString(OS_HeatPump_AirToWaterFields::AirInletNodeName, airInletNodeName); | |
| 355 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
4 | OS_ASSERT(result); |
| 356 | 4 | return result; | |
| 357 | } | ||
| 358 | |||
| 359 | ✗ | void HeatPumpAirToWater_Impl::resetAirInletNodeName() { | |
| 360 | ✗ | const bool result = setString(OS_HeatPump_AirToWaterFields::AirInletNodeName, ""); | |
| 361 | ✗ | OS_ASSERT(result); | |
| 362 | ✗ | } | |
| 363 | |||
| 364 | 4 | bool HeatPumpAirToWater_Impl::setAirOutletNodeName(const std::string& airOutletNodeName) { | |
| 365 | 4 | const bool result = setString(OS_HeatPump_AirToWaterFields::AirOutletNodeName, airOutletNodeName); | |
| 366 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
4 | OS_ASSERT(result); |
| 367 | 4 | return result; | |
| 368 | } | ||
| 369 | |||
| 370 | ✗ | void HeatPumpAirToWater_Impl::resetAirOutletNodeName() { | |
| 371 | ✗ | const bool result = setString(OS_HeatPump_AirToWaterFields::AirOutletNodeName, ""); | |
| 372 | ✗ | OS_ASSERT(result); | |
| 373 | ✗ | } | |
| 374 | |||
| 375 | 15 | bool HeatPumpAirToWater_Impl::setMaximumOutdoorDryBulbTemperatureForDefrostOperation(double maximumOutdoorDryBulbTemperatureForDefrostOperation) { | |
| 376 | 15 | const bool result = setDouble(OS_HeatPump_AirToWaterFields::MaximumOutdoorDryBulbTemperatureForDefrostOperation, | |
| 377 | maximumOutdoorDryBulbTemperatureForDefrostOperation); | ||
| 378 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
|
15 | OS_ASSERT(result); |
| 379 | 15 | return result; | |
| 380 | } | ||
| 381 | |||
| 382 | 16 | bool HeatPumpAirToWater_Impl::setHeatPumpDefrostControl(const std::string& heatPumpDefrostControl) { | |
| 383 | 16 | const bool result = setString(OS_HeatPump_AirToWaterFields::HeatPumpDefrostControl, heatPumpDefrostControl); | |
| 384 | 16 | return result; | |
| 385 | } | ||
| 386 | |||
| 387 | 16 | bool HeatPumpAirToWater_Impl::setHeatPumpDefrostTimePeriodFraction(double heatPumpDefrostTimePeriodFraction) { | |
| 388 | 16 | const bool result = setDouble(OS_HeatPump_AirToWaterFields::HeatPumpDefrostTimePeriodFraction, heatPumpDefrostTimePeriodFraction); | |
| 389 | 16 | return result; | |
| 390 | } | ||
| 391 | |||
| 392 | 16 | bool HeatPumpAirToWater_Impl::setResistiveDefrostHeaterCapacity(double resistiveDefrostHeaterCapacity) { | |
| 393 | 16 | const bool result = setDouble(OS_HeatPump_AirToWaterFields::ResistiveDefrostHeaterCapacity, resistiveDefrostHeaterCapacity); | |
| 394 | 16 | return result; | |
| 395 | } | ||
| 396 | |||
| 397 | bool | ||
| 398 | 5 | HeatPumpAirToWater_Impl::setDefrostEnergyInputRatioFunctionofTemperatureCurve(const Curve& defrostEnergyInputRatioFunctionofTemperatureCurve) { | |
| 399 |
1/1✓ Branch 1 taken 5 times.
|
5 | const bool result = setPointer(OS_HeatPump_AirToWaterFields::DefrostEnergyInputRatioFunctionofTemperatureCurveName, |
| 400 |
1/1✓ Branch 1 taken 5 times.
|
5 | defrostEnergyInputRatioFunctionofTemperatureCurve.handle()); |
| 401 | 5 | return result; | |
| 402 | } | ||
| 403 | |||
| 404 | ✗ | void HeatPumpAirToWater_Impl::resetDefrostEnergyInputRatioFunctionofTemperatureCurve() { | |
| 405 | ✗ | const bool result = setString(OS_HeatPump_AirToWaterFields::DefrostEnergyInputRatioFunctionofTemperatureCurveName, ""); | |
| 406 | ✗ | OS_ASSERT(result); | |
| 407 | ✗ | } | |
| 408 | |||
| 409 | 15 | bool HeatPumpAirToWater_Impl::setHeatPumpMultiplier(int heatPumpMultiplier) { | |
| 410 | 15 | const bool result = setInt(OS_HeatPump_AirToWaterFields::HeatPumpMultiplier, heatPumpMultiplier); | |
| 411 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
|
15 | OS_ASSERT(result); |
| 412 | 15 | return result; | |
| 413 | } | ||
| 414 | |||
| 415 | 16 | bool HeatPumpAirToWater_Impl::setControlType(const std::string& controlType) { | |
| 416 | 16 | const bool result = setString(OS_HeatPump_AirToWaterFields::ControlType, controlType); | |
| 417 | 16 | return result; | |
| 418 | } | ||
| 419 | |||
| 420 | 16 | bool HeatPumpAirToWater_Impl::setCrankcaseHeaterCapacity(double crankcaseHeaterCapacity) { | |
| 421 | 16 | const bool result = setDouble(OS_HeatPump_AirToWaterFields::CrankcaseHeaterCapacity, crankcaseHeaterCapacity); | |
| 422 | 16 | return result; | |
| 423 | } | ||
| 424 | |||
| 425 | bool | ||
| 426 | 5 | HeatPumpAirToWater_Impl::setCrankcaseHeaterCapacityFunctionofTemperatureCurve(const Curve& crankcaseHeaterCapacityFunctionofTemperatureCurve) { | |
| 427 |
1/1✓ Branch 1 taken 5 times.
|
5 | const bool result = setPointer(OS_HeatPump_AirToWaterFields::CrankcaseHeaterCapacityFunctionofTemperatureCurveName, |
| 428 |
1/1✓ Branch 1 taken 5 times.
|
5 | crankcaseHeaterCapacityFunctionofTemperatureCurve.handle()); |
| 429 | 5 | return result; | |
| 430 | } | ||
| 431 | |||
| 432 | ✗ | void HeatPumpAirToWater_Impl::resetCrankcaseHeaterCapacityFunctionofTemperatureCurve() { | |
| 433 | ✗ | const bool result = setString(OS_HeatPump_AirToWaterFields::CrankcaseHeaterCapacityFunctionofTemperatureCurveName, ""); | |
| 434 | ✗ | OS_ASSERT(result); | |
| 435 | ✗ | } | |
| 436 | |||
| 437 | bool | ||
| 438 | 16 | HeatPumpAirToWater_Impl::setMaximumAmbientTemperatureforCrankcaseHeaterOperation(double maximumAmbientTemperatureforCrankcaseHeaterOperation) { | |
| 439 | 16 | const bool result = setDouble(OS_HeatPump_AirToWaterFields::MaximumAmbientTemperatureforCrankcaseHeaterOperation, | |
| 440 | maximumAmbientTemperatureforCrankcaseHeaterOperation); | ||
| 441 | 16 | return result; | |
| 442 | } | ||
| 443 | |||
| 444 | 11 | bool HeatPumpAirToWater_Impl::setHeatingOperationMode(const HeatPumpAirToWaterHeating& heatingOperationMode) { | |
| 445 |
10/11✓ Branch 1 taken 11 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 10 times.
✓ Branch 6 taken 1 time.
✓ Branch 9 taken 1 time.
✓ Branch 12 taken 1 time.
✓ Branch 15 taken 1 time.
✓ Branch 17 taken 1 time.
✗ Branch 18 not taken.
✓ Branch 19 taken 1 time.
✓ Branch 20 taken 10 times.
|
22 | if (auto awhp_ = heatingOperationMode.heatPumpAirToWater(); awhp_ && awhp_->handle() != this->handle()) { |
| 446 |
5/5✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
|
1 | LOG(Warn, "This HeatPumpAirToWaterCooling object is already assigned to a HeatPumpAirToWater object. Cannot assign it again."); |
| 447 | 1 | return false; | |
| 448 | 11 | } | |
| 449 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | const bool result = setPointer(OS_HeatPump_AirToWaterFields::HeatingOperationMode, heatingOperationMode.handle()); |
| 450 | 10 | return result; | |
| 451 | } | ||
| 452 | |||
| 453 | 1 | void HeatPumpAirToWater_Impl::resetHeatingOperationMode() { | |
| 454 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | const bool result = setString(OS_HeatPump_AirToWaterFields::HeatingOperationMode, ""); |
| 455 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 456 | 1 | } | |
| 457 | |||
| 458 | 11 | bool HeatPumpAirToWater_Impl::setCoolingOperationMode(const HeatPumpAirToWaterCooling& coolingOperationMode) { | |
| 459 |
10/11✓ Branch 1 taken 11 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 10 times.
✓ Branch 6 taken 1 time.
✓ Branch 9 taken 1 time.
✓ Branch 12 taken 1 time.
✓ Branch 15 taken 1 time.
✓ Branch 17 taken 1 time.
✗ Branch 18 not taken.
✓ Branch 19 taken 1 time.
✓ Branch 20 taken 10 times.
|
22 | if (auto awhp_ = coolingOperationMode.heatPumpAirToWater(); awhp_ && awhp_->handle() != this->handle()) { |
| 460 |
5/5✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
|
1 | LOG(Warn, "This HeatPumpAirToWaterCooling object is already assigned to a HeatPumpAirToWater object. Cannot assign it again."); |
| 461 | 1 | return false; | |
| 462 | 11 | } | |
| 463 |
2/2✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
|
10 | const bool result = setPointer(OS_HeatPump_AirToWaterFields::CoolingOperationMode, coolingOperationMode.handle()); |
| 464 | 10 | return result; | |
| 465 | } | ||
| 466 | |||
| 467 | 2 | void HeatPumpAirToWater_Impl::resetCoolingOperationMode() { | |
| 468 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | const bool result = setString(OS_HeatPump_AirToWaterFields::CoolingOperationMode, ""); |
| 469 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | OS_ASSERT(result); |
| 470 | 2 | } | |
| 471 | |||
| 472 | ✗ | boost::optional<double> HeatPumpAirToWater_Impl::autosizedRatedAirFlowRateinHeatingMode() const { | |
| 473 | ✗ | return getAutosizedValue("Design Size Rated Air Volume Flow Rate in Heating Mode", "m3/s"); | |
| 474 | } | ||
| 475 | |||
| 476 | ✗ | boost::optional<double> HeatPumpAirToWater_Impl::autosizedRatedWaterFlowRateinHeatingMode() const { | |
| 477 | ✗ | return getAutosizedValue("Design Size Rated Water Volume Flow Rate in Heating Mode", "m3/s"); | |
| 478 | } | ||
| 479 | |||
| 480 | ✗ | boost::optional<double> HeatPumpAirToWater_Impl::autosizedRatedAirFlowRateinCoolingMode() const { | |
| 481 | ✗ | return getAutosizedValue("Design Size Rated Air Volume Flow Rate in Cooling Mode", "m3/s"); | |
| 482 | } | ||
| 483 | |||
| 484 | ✗ | boost::optional<double> HeatPumpAirToWater_Impl::autosizedRatedWaterFlowRateinCoolingMode() const { | |
| 485 | ✗ | return getAutosizedValue("Design Size Rated Water Volume Flow Rate in Cooling Mode", "m3/s"); | |
| 486 | } | ||
| 487 | |||
| 488 | ✗ | boost::optional<double> HeatPumpAirToWater_Impl::autosizedRatedHeatingCapacity() const { | |
| 489 | ✗ | return getAutosizedValue("Design Size Rated Heating Capacity", "W"); | |
| 490 | } | ||
| 491 | |||
| 492 | ✗ | boost::optional<double> HeatPumpAirToWater_Impl::autosizedRatedCoolingCapacity() const { | |
| 493 | ✗ | return getAutosizedValue("Design Size Rated Cooling Capacity", "W"); | |
| 494 | } | ||
| 495 | |||
| 496 | ✗ | void HeatPumpAirToWater_Impl::autosize() {} | |
| 497 | |||
| 498 | ✗ | void HeatPumpAirToWater_Impl::applySizingValues() {} | |
| 499 | |||
| 500 | 5 | boost::optional<PlantLoop> HeatPumpAirToWater_Impl::coolingLoop() const { | |
| 501 |
2/3✓ Branch 1 taken 5 times.
✓ Branch 3 taken 5 times.
✗ Branch 4 not taken.
|
10 | if (auto mode_ = coolingOperationMode()) { |
| 502 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | return mode_->plantLoop(); |
| 503 | 5 | } | |
| 504 | ✗ | return boost::none; | |
| 505 | } | ||
| 506 | |||
| 507 | 4 | boost::optional<PlantLoop> HeatPumpAirToWater_Impl::heatingLoop() const { | |
| 508 |
2/3✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
|
8 | if (auto mode_ = heatingOperationMode()) { |
| 509 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | return mode_->plantLoop(); |
| 510 | 4 | } | |
| 511 | ✗ | return boost::none; | |
| 512 | } | ||
| 513 | |||
| 514 | ✗ | std::vector<EMSActuatorNames> HeatPumpAirToWater_Impl::emsActuatorNames() const { | |
| 515 | ✗ | std::vector<EMSActuatorNames> actuators{{"HeatPump:AirToWater", "Operating Mode"}}; | |
| 516 | ✗ | if (auto mode_ = heatingOperationMode()) { | |
| 517 | ✗ | actuators.emplace_back("HeatPump:AirToWater", "Defrost Flag"); | |
| 518 | ✗ | actuators.emplace_back("HeatPump:AirToWater", "Entering Water Temperature"); | |
| 519 | ✗ | actuators.emplace_back("HeatPump:AirToWater", "Leaving Water Temperature"); | |
| 520 | ✗ | } | |
| 521 | ✗ | return actuators; | |
| 522 | ✗ | } | |
| 523 | |||
| 524 | ✗ | std::vector<std::string> HeatPumpAirToWater_Impl::emsInternalVariableNames() const { | |
| 525 | ✗ | std::vector<std::string> types; | |
| 526 | ✗ | return types; | |
| 527 | } | ||
| 528 | |||
| 529 | } // namespace detail | ||
| 530 | |||
| 531 | 11 | HeatPumpAirToWater::HeatPumpAirToWater(const Model& model) : StraightComponent(HeatPumpAirToWater::iddObjectType(), model) { | |
| 532 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 11 times.
✗ Branch 5 not taken.
|
11 | OS_ASSERT(getImpl<detail::HeatPumpAirToWater_Impl>()); |
| 533 | |||
| 534 | // IDD defaults | ||
| 535 | 11 | bool ok = true; | |
| 536 |
2/2✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
|
22 | ok &= setOperatingModeControlMethod("Load"); |
| 537 |
2/2✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
|
11 | ok &= setOperatingModeControlOptionforMultipleUnit("SingleMode"); |
| 538 |
1/1✓ Branch 1 taken 11 times.
|
11 | ok &= setMinimumPartLoadRatio(0.0); |
| 539 |
1/1✓ Branch 1 taken 11 times.
|
11 | ok &= setMaximumOutdoorDryBulbTemperatureForDefrostOperation(10.0); |
| 540 |
2/2✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
|
11 | ok &= setHeatPumpDefrostControl("None"); |
| 541 |
1/1✓ Branch 1 taken 11 times.
|
11 | ok &= setHeatPumpDefrostTimePeriodFraction(0.058333); |
| 542 |
1/1✓ Branch 1 taken 11 times.
|
11 | ok &= setResistiveDefrostHeaterCapacity(0.0); |
| 543 |
1/1✓ Branch 1 taken 11 times.
|
11 | ok &= setHeatPumpMultiplier(1); |
| 544 |
2/2✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
|
11 | ok &= setControlType("VariableSpeed"); |
| 545 |
1/1✓ Branch 1 taken 11 times.
|
11 | ok &= setCrankcaseHeaterCapacity(0.0); |
| 546 |
1/1✓ Branch 1 taken 11 times.
|
11 | ok &= setMaximumAmbientTemperatureforCrankcaseHeaterOperation(10.0); |
| 547 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 11 times.
✗ Branch 3 not taken.
|
11 | OS_ASSERT(ok); |
| 548 | 11 | } | |
| 549 | |||
| 550 | 7708 | IddObjectType HeatPumpAirToWater::iddObjectType() { | |
| 551 |
1/1✓ Branch 1 taken 7708 times.
|
7708 | return {IddObjectType::OS_HeatPump_AirToWater}; |
| 552 | } | ||
| 553 | |||
| 554 | ✗ | std::vector<std::string> HeatPumpAirToWater::operatingModeControlMethodValues() { | |
| 555 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_HeatPump_AirToWaterFields::OperatingModeControlMethod); | |
| 556 | } | ||
| 557 | |||
| 558 | ✗ | std::vector<std::string> HeatPumpAirToWater::operatingModeControlOptionforMultipleUnitValues() { | |
| 559 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), | |
| 560 | ✗ | OS_HeatPump_AirToWaterFields::OperatingModeControlOptionforMultipleUnit); | |
| 561 | } | ||
| 562 | |||
| 563 | ✗ | std::vector<std::string> HeatPumpAirToWater::heatPumpDefrostControlValues() { | |
| 564 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_HeatPump_AirToWaterFields::HeatPumpDefrostControl); | |
| 565 | } | ||
| 566 | |||
| 567 | ✗ | std::vector<std::string> HeatPumpAirToWater::controlTypeValues() { | |
| 568 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_HeatPump_AirToWaterFields::ControlType); | |
| 569 | } | ||
| 570 | |||
| 571 | 11 | std::string HeatPumpAirToWater::operatingModeControlMethod() const { | |
| 572 |
1/1✓ Branch 3 taken 11 times.
|
11 | return getImpl<detail::HeatPumpAirToWater_Impl>()->operatingModeControlMethod(); |
| 573 | } | ||
| 574 | |||
| 575 | 6 | std::string HeatPumpAirToWater::operatingModeControlOptionforMultipleUnit() const { | |
| 576 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::HeatPumpAirToWater_Impl>()->operatingModeControlOptionforMultipleUnit(); |
| 577 | } | ||
| 578 | |||
| 579 | 7 | boost::optional<Schedule> HeatPumpAirToWater::operatingModeControlSchedule() const { | |
| 580 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::HeatPumpAirToWater_Impl>()->operatingModeControlSchedule(); |
| 581 | } | ||
| 582 | |||
| 583 | 6 | double HeatPumpAirToWater::minimumPartLoadRatio() const { | |
| 584 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::HeatPumpAirToWater_Impl>()->minimumPartLoadRatio(); |
| 585 | } | ||
| 586 | |||
| 587 | 6 | boost::optional<std::string> HeatPumpAirToWater::airInletNodeName() const { | |
| 588 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::HeatPumpAirToWater_Impl>()->airInletNodeName(); |
| 589 | } | ||
| 590 | |||
| 591 | 6 | boost::optional<std::string> HeatPumpAirToWater::airOutletNodeName() const { | |
| 592 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::HeatPumpAirToWater_Impl>()->airOutletNodeName(); |
| 593 | } | ||
| 594 | |||
| 595 | 5 | double HeatPumpAirToWater::maximumOutdoorDryBulbTemperatureForDefrostOperation() const { | |
| 596 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::HeatPumpAirToWater_Impl>()->maximumOutdoorDryBulbTemperatureForDefrostOperation(); |
| 597 | } | ||
| 598 | |||
| 599 | 6 | std::string HeatPumpAirToWater::heatPumpDefrostControl() const { | |
| 600 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::HeatPumpAirToWater_Impl>()->heatPumpDefrostControl(); |
| 601 | } | ||
| 602 | |||
| 603 | 6 | double HeatPumpAirToWater::heatPumpDefrostTimePeriodFraction() const { | |
| 604 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::HeatPumpAirToWater_Impl>()->heatPumpDefrostTimePeriodFraction(); |
| 605 | } | ||
| 606 | |||
| 607 | 6 | double HeatPumpAirToWater::resistiveDefrostHeaterCapacity() const { | |
| 608 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::HeatPumpAirToWater_Impl>()->resistiveDefrostHeaterCapacity(); |
| 609 | } | ||
| 610 | |||
| 611 | 7 | boost::optional<Curve> HeatPumpAirToWater::defrostEnergyInputRatioFunctionofTemperatureCurve() const { | |
| 612 |
1/1✓ Branch 3 taken 7 times.
|
7 | return getImpl<detail::HeatPumpAirToWater_Impl>()->defrostEnergyInputRatioFunctionofTemperatureCurve(); |
| 613 | } | ||
| 614 | |||
| 615 | 5 | int HeatPumpAirToWater::heatPumpMultiplier() const { | |
| 616 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::HeatPumpAirToWater_Impl>()->heatPumpMultiplier(); |
| 617 | } | ||
| 618 | |||
| 619 | 6 | std::string HeatPumpAirToWater::controlType() const { | |
| 620 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::HeatPumpAirToWater_Impl>()->controlType(); |
| 621 | } | ||
| 622 | |||
| 623 | 6 | double HeatPumpAirToWater::crankcaseHeaterCapacity() const { | |
| 624 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::HeatPumpAirToWater_Impl>()->crankcaseHeaterCapacity(); |
| 625 | } | ||
| 626 | |||
| 627 | 8 | boost::optional<Curve> HeatPumpAirToWater::crankcaseHeaterCapacityFunctionofTemperatureCurve() const { | |
| 628 |
1/1✓ Branch 3 taken 8 times.
|
8 | return getImpl<detail::HeatPumpAirToWater_Impl>()->crankcaseHeaterCapacityFunctionofTemperatureCurve(); |
| 629 | } | ||
| 630 | |||
| 631 | 6 | double HeatPumpAirToWater::maximumAmbientTemperatureforCrankcaseHeaterOperation() const { | |
| 632 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::HeatPumpAirToWater_Impl>()->maximumAmbientTemperatureforCrankcaseHeaterOperation(); |
| 633 | } | ||
| 634 | |||
| 635 | 9 | boost::optional<HeatPumpAirToWaterHeating> HeatPumpAirToWater::heatingOperationMode() const { | |
| 636 |
1/1✓ Branch 3 taken 9 times.
|
9 | return getImpl<detail::HeatPumpAirToWater_Impl>()->heatingOperationMode(); |
| 637 | } | ||
| 638 | |||
| 639 | 8 | boost::optional<HeatPumpAirToWaterCooling> HeatPumpAirToWater::coolingOperationMode() const { | |
| 640 |
1/1✓ Branch 3 taken 8 times.
|
8 | return getImpl<detail::HeatPumpAirToWater_Impl>()->coolingOperationMode(); |
| 641 | } | ||
| 642 | |||
| 643 | 15 | bool HeatPumpAirToWater::setOperatingModeControlMethod(const std::string& operatingModeControlMethod) { | |
| 644 |
1/1✓ Branch 3 taken 15 times.
|
15 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setOperatingModeControlMethod(operatingModeControlMethod); |
| 645 | } | ||
| 646 | |||
| 647 | 16 | bool HeatPumpAirToWater::setOperatingModeControlOptionforMultipleUnit(const std::string& operatingModeControlOptionforMultipleUnit) { | |
| 648 |
1/1✓ Branch 3 taken 16 times.
|
16 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setOperatingModeControlOptionforMultipleUnit(operatingModeControlOptionforMultipleUnit); |
| 649 | } | ||
| 650 | |||
| 651 | 4 | bool HeatPumpAirToWater::setOperatingModeControlSchedule(Schedule& operatingModeControlSchedule) { | |
| 652 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setOperatingModeControlSchedule(operatingModeControlSchedule); |
| 653 | } | ||
| 654 | |||
| 655 | 1 | void HeatPumpAirToWater::resetOperatingModeControlSchedule() { | |
| 656 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::HeatPumpAirToWater_Impl>()->resetOperatingModeControlSchedule(); |
| 657 | 1 | } | |
| 658 | |||
| 659 | 16 | bool HeatPumpAirToWater::setMinimumPartLoadRatio(double minimumPartLoadRatio) { | |
| 660 |
1/1✓ Branch 3 taken 16 times.
|
16 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setMinimumPartLoadRatio(minimumPartLoadRatio); |
| 661 | } | ||
| 662 | |||
| 663 | 4 | bool HeatPumpAirToWater::setAirInletNodeName(const std::string& airInletNodeName) { | |
| 664 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setAirInletNodeName(airInletNodeName); |
| 665 | } | ||
| 666 | |||
| 667 | ✗ | void HeatPumpAirToWater::resetAirInletNodeName() { | |
| 668 | ✗ | getImpl<detail::HeatPumpAirToWater_Impl>()->resetAirInletNodeName(); | |
| 669 | ✗ | } | |
| 670 | |||
| 671 | 4 | bool HeatPumpAirToWater::setAirOutletNodeName(const std::string& airOutletNodeName) { | |
| 672 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setAirOutletNodeName(airOutletNodeName); |
| 673 | } | ||
| 674 | |||
| 675 | ✗ | void HeatPumpAirToWater::resetAirOutletNodeName() { | |
| 676 | ✗ | getImpl<detail::HeatPumpAirToWater_Impl>()->resetAirOutletNodeName(); | |
| 677 | ✗ | } | |
| 678 | |||
| 679 | 15 | bool HeatPumpAirToWater::setMaximumOutdoorDryBulbTemperatureForDefrostOperation(double maximumOutdoorDryBulbTemperatureForDefrostOperation) { | |
| 680 |
1/1✓ Branch 3 taken 15 times.
|
30 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setMaximumOutdoorDryBulbTemperatureForDefrostOperation( |
| 681 | 30 | maximumOutdoorDryBulbTemperatureForDefrostOperation); | |
| 682 | } | ||
| 683 | |||
| 684 | 16 | bool HeatPumpAirToWater::setHeatPumpDefrostControl(const std::string& heatPumpDefrostControl) { | |
| 685 |
1/1✓ Branch 3 taken 16 times.
|
16 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setHeatPumpDefrostControl(heatPumpDefrostControl); |
| 686 | } | ||
| 687 | |||
| 688 | 16 | bool HeatPumpAirToWater::setHeatPumpDefrostTimePeriodFraction(double heatPumpDefrostTimePeriodFraction) { | |
| 689 |
1/1✓ Branch 3 taken 16 times.
|
16 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setHeatPumpDefrostTimePeriodFraction(heatPumpDefrostTimePeriodFraction); |
| 690 | } | ||
| 691 | |||
| 692 | 16 | bool HeatPumpAirToWater::setResistiveDefrostHeaterCapacity(double resistiveDefrostHeaterCapacity) { | |
| 693 |
1/1✓ Branch 3 taken 16 times.
|
16 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setResistiveDefrostHeaterCapacity(resistiveDefrostHeaterCapacity); |
| 694 | } | ||
| 695 | |||
| 696 | 5 | bool HeatPumpAirToWater::setDefrostEnergyInputRatioFunctionofTemperatureCurve(const Curve& defrostEnergyInputRatioFunctionofTemperatureCurve) { | |
| 697 |
1/1✓ Branch 3 taken 5 times.
|
10 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setDefrostEnergyInputRatioFunctionofTemperatureCurve( |
| 698 | 10 | defrostEnergyInputRatioFunctionofTemperatureCurve); | |
| 699 | } | ||
| 700 | |||
| 701 | ✗ | void HeatPumpAirToWater::resetDefrostEnergyInputRatioFunctionofTemperatureCurve() { | |
| 702 | ✗ | getImpl<detail::HeatPumpAirToWater_Impl>()->resetDefrostEnergyInputRatioFunctionofTemperatureCurve(); | |
| 703 | ✗ | } | |
| 704 | |||
| 705 | 15 | bool HeatPumpAirToWater::setHeatPumpMultiplier(int heatPumpMultiplier) { | |
| 706 |
1/1✓ Branch 3 taken 15 times.
|
15 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setHeatPumpMultiplier(heatPumpMultiplier); |
| 707 | } | ||
| 708 | |||
| 709 | 16 | bool HeatPumpAirToWater::setControlType(const std::string& controlType) { | |
| 710 |
1/1✓ Branch 3 taken 16 times.
|
16 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setControlType(controlType); |
| 711 | } | ||
| 712 | |||
| 713 | 16 | bool HeatPumpAirToWater::setCrankcaseHeaterCapacity(double crankcaseHeaterCapacity) { | |
| 714 |
1/1✓ Branch 3 taken 16 times.
|
16 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setCrankcaseHeaterCapacity(crankcaseHeaterCapacity); |
| 715 | } | ||
| 716 | |||
| 717 | 5 | bool HeatPumpAirToWater::setCrankcaseHeaterCapacityFunctionofTemperatureCurve(const Curve& crankcaseHeaterCapacityFunctionofTemperatureCurve) { | |
| 718 |
1/1✓ Branch 3 taken 5 times.
|
10 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setCrankcaseHeaterCapacityFunctionofTemperatureCurve( |
| 719 | 10 | crankcaseHeaterCapacityFunctionofTemperatureCurve); | |
| 720 | } | ||
| 721 | |||
| 722 | ✗ | void HeatPumpAirToWater::resetCrankcaseHeaterCapacityFunctionofTemperatureCurve() { | |
| 723 | ✗ | getImpl<detail::HeatPumpAirToWater_Impl>()->resetCrankcaseHeaterCapacityFunctionofTemperatureCurve(); | |
| 724 | ✗ | } | |
| 725 | |||
| 726 | 16 | bool HeatPumpAirToWater::setMaximumAmbientTemperatureforCrankcaseHeaterOperation(double maximumAmbientTemperatureforCrankcaseHeaterOperation) { | |
| 727 |
1/1✓ Branch 3 taken 16 times.
|
32 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setMaximumAmbientTemperatureforCrankcaseHeaterOperation( |
| 728 | 32 | maximumAmbientTemperatureforCrankcaseHeaterOperation); | |
| 729 | } | ||
| 730 | |||
| 731 | 11 | bool HeatPumpAirToWater::setHeatingOperationMode(const HeatPumpAirToWaterHeating& heatingOperationMode) { | |
| 732 |
1/1✓ Branch 3 taken 11 times.
|
11 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setHeatingOperationMode(heatingOperationMode); |
| 733 | } | ||
| 734 | |||
| 735 | ✗ | void HeatPumpAirToWater::resetHeatingOperationMode() { | |
| 736 | ✗ | getImpl<detail::HeatPumpAirToWater_Impl>()->resetHeatingOperationMode(); | |
| 737 | ✗ | } | |
| 738 | |||
| 739 | 11 | bool HeatPumpAirToWater::setCoolingOperationMode(const HeatPumpAirToWaterCooling& coolingOperationMode) { | |
| 740 |
1/1✓ Branch 3 taken 11 times.
|
11 | return getImpl<detail::HeatPumpAirToWater_Impl>()->setCoolingOperationMode(coolingOperationMode); |
| 741 | } | ||
| 742 | |||
| 743 | 1 | void HeatPumpAirToWater::resetCoolingOperationMode() { | |
| 744 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::HeatPumpAirToWater_Impl>()->resetCoolingOperationMode(); |
| 745 | 1 | } | |
| 746 | |||
| 747 | 5 | boost::optional<PlantLoop> HeatPumpAirToWater::coolingLoop() const { | |
| 748 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::HeatPumpAirToWater_Impl>()->coolingLoop(); |
| 749 | } | ||
| 750 | |||
| 751 | 4 | boost::optional<PlantLoop> HeatPumpAirToWater::heatingLoop() const { | |
| 752 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::HeatPumpAirToWater_Impl>()->heatingLoop(); |
| 753 | } | ||
| 754 | |||
| 755 | ✗ | boost::optional<double> HeatPumpAirToWater::autosizedRatedAirFlowRateinCoolingMode() const { | |
| 756 | ✗ | return getImpl<detail::HeatPumpAirToWater_Impl>()->autosizedRatedAirFlowRateinCoolingMode(); | |
| 757 | } | ||
| 758 | |||
| 759 | ✗ | boost::optional<double> HeatPumpAirToWater::autosizedRatedWaterFlowRateinCoolingMode() const { | |
| 760 | ✗ | return getImpl<detail::HeatPumpAirToWater_Impl>()->autosizedRatedWaterFlowRateinCoolingMode(); | |
| 761 | } | ||
| 762 | |||
| 763 | ✗ | boost::optional<double> HeatPumpAirToWater::autosizedRatedAirFlowRateinHeatingMode() const { | |
| 764 | ✗ | return getImpl<detail::HeatPumpAirToWater_Impl>()->autosizedRatedAirFlowRateinHeatingMode(); | |
| 765 | } | ||
| 766 | |||
| 767 | ✗ | boost::optional<double> HeatPumpAirToWater::autosizedRatedWaterFlowRateinHeatingMode() const { | |
| 768 | ✗ | return getImpl<detail::HeatPumpAirToWater_Impl>()->autosizedRatedWaterFlowRateinHeatingMode(); | |
| 769 | } | ||
| 770 | |||
| 771 | ✗ | boost::optional<double> HeatPumpAirToWater::autosizedRatedHeatingCapacity() const { | |
| 772 | ✗ | return getImpl<detail::HeatPumpAirToWater_Impl>()->autosizedRatedHeatingCapacity(); | |
| 773 | } | ||
| 774 | |||
| 775 | ✗ | boost::optional<double> HeatPumpAirToWater::autosizedRatedCoolingCapacity() const { | |
| 776 | ✗ | return getImpl<detail::HeatPumpAirToWater_Impl>()->autosizedRatedCoolingCapacity(); | |
| 777 | } | ||
| 778 | |||
| 779 | /// @cond | ||
| 780 |
1/1✓ Branch 3 taken 64 times.
|
64 | HeatPumpAirToWater::HeatPumpAirToWater(std::shared_ptr<detail::HeatPumpAirToWater_Impl> impl) : StraightComponent(std::move(impl)) {} |
| 781 | /// @endcond | ||
| 782 | |||
| 783 | } // namespace model | ||
| 784 | } // namespace openstudio | ||
| 785 |