src/model/HeatPumpAirToWaterCooling.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 "HeatPumpAirToWaterCooling.hpp" | ||
| 7 | #include "HeatPumpAirToWaterCooling_Impl.hpp" | ||
| 8 | |||
| 9 | #include "HeatPumpAirToWater.hpp" | ||
| 10 | #include "HeatPumpAirToWater_Impl.hpp" | ||
| 11 | #include "HeatPumpAirToWaterCoolingSpeedData.hpp" | ||
| 12 | #include "HeatPumpAirToWaterCoolingSpeedData_Impl.hpp" | ||
| 13 | |||
| 14 | #include "Schedule.hpp" | ||
| 15 | #include "Schedule_Impl.hpp" | ||
| 16 | #include "Curve.hpp" | ||
| 17 | #include "Curve_Impl.hpp" | ||
| 18 | #include "ModelObjectList.hpp" | ||
| 19 | #include "ModelObjectList_Impl.hpp" | ||
| 20 | |||
| 21 | #include "ScheduleTypeLimits.hpp" | ||
| 22 | #include "ScheduleTypeRegistry.hpp" | ||
| 23 | |||
| 24 | #include "PlantLoop.hpp" | ||
| 25 | #include "PlantLoop_Impl.hpp" | ||
| 26 | #include "Node.hpp" | ||
| 27 | |||
| 28 | // Need for clone override | ||
| 29 | #include "Model.hpp" | ||
| 30 | #include "Model_Impl.hpp" | ||
| 31 | |||
| 32 | #include "../utilities/core/Assert.hpp" | ||
| 33 | #include "../utilities/core/ContainersMove.hpp" | ||
| 34 | #include "../utilities/data/DataEnums.hpp" | ||
| 35 | |||
| 36 | #include <utilities/idd/IddEnums.hxx> | ||
| 37 | #include <utilities/idd/OS_HeatPump_AirToWater_Cooling_FieldEnums.hxx> | ||
| 38 | |||
| 39 | namespace openstudio { | ||
| 40 | namespace model { | ||
| 41 | |||
| 42 | namespace detail { | ||
| 43 | |||
| 44 | 15 | HeatPumpAirToWaterCooling_Impl::HeatPumpAirToWaterCooling_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 45 | 15 | : StraightComponent_Impl(idfObject, model, keepHandle) { | |
| 46 |
4/6✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 15 times.
✗ Branch 13 not taken.
|
15 | OS_ASSERT(idfObject.iddObject().type() == HeatPumpAirToWaterCooling::iddObjectType()); |
| 47 | 15 | } | |
| 48 | |||
| 49 | ✗ | HeatPumpAirToWaterCooling_Impl::HeatPumpAirToWaterCooling_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, | |
| 50 | ✗ | bool keepHandle) | |
| 51 | ✗ | : StraightComponent_Impl(other, model, keepHandle) { | |
| 52 | ✗ | OS_ASSERT(other.iddObject().type() == HeatPumpAirToWaterCooling::iddObjectType()); | |
| 53 | ✗ | } | |
| 54 | |||
| 55 | 12 | HeatPumpAirToWaterCooling_Impl::HeatPumpAirToWaterCooling_Impl(const HeatPumpAirToWaterCooling_Impl& other, Model_Impl* model, bool keepHandle) | |
| 56 | 12 | : StraightComponent_Impl(other, model, keepHandle) {} | |
| 57 | |||
| 58 | ✗ | const std::vector<std::string>& HeatPumpAirToWaterCooling_Impl::outputVariableNames() const { | |
| 59 | ✗ | static std::vector<std::string> result; | |
| 60 | ✗ | if (result.empty()) { | |
| 61 | } | ||
| 62 | ✗ | return result; | |
| 63 | } | ||
| 64 | |||
| 65 | ✗ | std::vector<ScheduleTypeKey> HeatPumpAirToWaterCooling_Impl::getScheduleTypeKeys(const Schedule& schedule) const { | |
| 66 | ✗ | std::vector<ScheduleTypeKey> result; | |
| 67 | ✗ | const UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); | |
| 68 | ✗ | if (std::find(fieldIndices.cbegin(), fieldIndices.cend(), OS_HeatPump_AirToWater_CoolingFields::AvailabilityScheduleName) | |
| 69 | ✗ | != fieldIndices.cend()) { | |
| 70 | ✗ | result.emplace_back("HeatPumpAirToWaterCooling", "Availability"); | |
| 71 | } | ||
| 72 | ✗ | return result; | |
| 73 | ✗ | } | |
| 74 | |||
| 75 | ✗ | IddObjectType HeatPumpAirToWaterCooling_Impl::iddObjectType() const { | |
| 76 | ✗ | return HeatPumpAirToWaterCooling::iddObjectType(); | |
| 77 | } | ||
| 78 | |||
| 79 | 23 | unsigned HeatPumpAirToWaterCooling_Impl::inletPort() const { | |
| 80 | 23 | return OS_HeatPump_AirToWater_CoolingFields::ChilledWaterInletNodeName; | |
| 81 | } | ||
| 82 | |||
| 83 | 51 | unsigned HeatPumpAirToWaterCooling_Impl::outletPort() const { | |
| 84 | 51 | return OS_HeatPump_AirToWater_CoolingFields::ChilledWaterOutletNodeName; | |
| 85 | } | ||
| 86 | |||
| 87 | 9 | bool HeatPumpAirToWaterCooling_Impl::addToNode(Node& node) { | |
| 88 |
3/3✓ Branch 1 taken 9 times.
✓ Branch 3 taken 7 times.
✓ Branch 4 taken 2 times.
|
18 | if (boost::optional<PlantLoop> plant = node.plantLoop()) { |
| 89 |
5/5✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 7 times.
✓ Branch 10 taken 5 times.
✓ Branch 11 taken 2 times.
|
14 | if (plant->supplyComponent(node.handle())) { |
| 90 |
1/1✓ Branch 1 taken 5 times.
|
5 | return StraightComponent_Impl::addToNode(node); |
| 91 | } | ||
| 92 | 9 | } | |
| 93 | |||
| 94 | 4 | return false; | |
| 95 | } | ||
| 96 | |||
| 97 | 19 | boost::optional<HVACComponent> HeatPumpAirToWaterCooling_Impl::containingHVACComponent() const { | |
| 98 |
1/1✓ Branch 1 taken 19 times.
|
19 | auto awhp_ = heatPumpAirToWater(); |
| 99 |
2/2✓ Branch 0 taken 13 times.
✓ Branch 1 taken 6 times.
|
19 | if (awhp_) { |
| 100 |
2/2✓ Branch 1 taken 13 times.
✓ Branch 5 taken 13 times.
|
13 | return std::move(*awhp_); |
| 101 | } | ||
| 102 | 6 | return boost::none; | |
| 103 | 19 | } | |
| 104 | |||
| 105 | 36 | boost::optional<HeatPumpAirToWater> HeatPumpAirToWaterCooling_Impl::heatPumpAirToWater() const { | |
| 106 |
3/3✓ Branch 1 taken 36 times.
✓ Branch 4 taken 36 times.
✓ Branch 7 taken 36 times.
|
36 | auto awhps = getObject<ModelObject>().getModelObjectSources<HeatPumpAirToWater>(HeatPumpAirToWater::iddObjectType()); |
| 107 |
2/2✓ Branch 1 taken 17 times.
✓ Branch 2 taken 19 times.
|
36 | if (awhps.empty()) { |
| 108 | 17 | return boost::none; | |
| 109 | } | ||
| 110 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 19 times.
|
19 | if (awhps.size() > 1) { |
| 111 | ✗ | LOG(Error, briefDescription() << " is referenced by more than one HeatPumpAirToWater, returning the first"); | |
| 112 | } | ||
| 113 |
1/1✓ Branch 2 taken 19 times.
|
19 | return awhps[0]; |
| 114 | 36 | } | |
| 115 | |||
| 116 | 4 | ModelObject HeatPumpAirToWaterCooling_Impl::clone(Model model) const { | |
| 117 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | const bool same_model = this->model() == model; |
| 118 | // This handles resetting the ports, and bypassing ParentObject::clone so it doesn't clone children | ||
| 119 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
|
4 | auto t_clone = StraightComponent_Impl::clone(model).cast<HeatPumpAirToWaterCooling>(); |
| 120 | |||
| 121 | // Make a clean list and repopulate it, without cloning the SpeedData objects | ||
| 122 |
1/1✓ Branch 1 taken 4 times.
|
4 | auto newSpeedList = ModelObjectList(model); |
| 123 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
|
4 | newSpeedList.setName(t_clone.nameString() + " Speed Data List"); |
| 124 |
1/1✓ Branch 3 taken 4 times.
|
4 | bool ok = t_clone.getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setSpeedDataList(newSpeedList); |
| 125 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
|
4 | OS_ASSERT(ok); |
| 126 | |||
| 127 |
3/3✓ Branch 1 taken 4 times.
✓ Branch 8 taken 15 times.
✓ Branch 9 taken 4 times.
|
19 | for (const auto& speed : speeds()) { |
| 128 |
2/2✓ Branch 0 taken 10 times.
✓ Branch 1 taken 5 times.
|
15 | if (same_model) { |
| 129 |
1/1✓ Branch 1 taken 10 times.
|
10 | ok = t_clone.addSpeed(speed); |
| 130 | } else { | ||
| 131 |
3/3✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
|
5 | auto speedClone = speed.clone(model).cast<HeatPumpAirToWaterCoolingSpeedData>(); |
| 132 |
1/1✓ Branch 1 taken 5 times.
|
5 | ok = t_clone.addSpeed(speedClone); |
| 133 | 5 | } | |
| 134 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
✗ Branch 3 not taken.
|
15 | OS_ASSERT(ok); |
| 135 | 4 | } | |
| 136 | |||
| 137 | 8 | return std::move(t_clone); | |
| 138 | 4 | } | |
| 139 | |||
| 140 | 7 | std::vector<ModelObject> HeatPumpAirToWaterCooling_Impl::children() const { | |
| 141 | 7 | std::vector<ModelObject> children; | |
| 142 |
3/3✓ Branch 1 taken 7 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 5 times.
|
14 | if (auto c_ = minimumLeavingWaterTemperatureCurve()) { |
| 143 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 5 taken 2 times.
|
2 | children.emplace_back(std::move(*c_)); |
| 144 | 7 | } | |
| 145 |
3/3✓ Branch 1 taken 7 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 5 times.
|
14 | if (auto c_ = maximumLeavingWaterTemperatureCurve()) { |
| 146 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 5 taken 2 times.
|
2 | children.emplace_back(std::move(*c_)); |
| 147 | 7 | } | |
| 148 |
2/3✓ Branch 1 taken 7 times.
✓ Branch 3 taken 7 times.
✗ Branch 4 not taken.
|
14 | if (auto const speedDataList_ = optionalSpeedDataList()) { |
| 149 |
4/4✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 11 taken 26 times.
✓ Branch 12 taken 7 times.
|
33 | for (const auto& mo : speedDataList_->modelObjects()) { |
| 150 |
1/1✓ Branch 1 taken 26 times.
|
26 | children.push_back(mo); |
| 151 | 7 | } | |
| 152 | 7 | } | |
| 153 | 7 | return children; | |
| 154 | ✗ | } | |
| 155 | |||
| 156 | // std::vector<IddObjectType> allowableChildTypes() const override; | ||
| 157 | |||
| 158 | 7 | std::vector<IdfObject> HeatPumpAirToWaterCooling_Impl::remove() { | |
| 159 | // ModelObjectList is kinda dumb, it removes all the modelObjects it has, which we don't want | ||
| 160 | // We listed the SpeedData (ResourceObjects) in children, so it should be handled by ParentObject::remove | ||
| 161 |
1/1✓ Branch 1 taken 7 times.
|
7 | auto speedList_ = optionalSpeedDataList(); |
| 162 |
1/1✓ Branch 1 taken 7 times.
|
7 | std::vector<IdfObject> result = StraightComponent_Impl::remove(); |
| 163 |
5/6✓ Branch 1 taken 5 times.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 5 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 5 times.
✓ Branch 6 taken 2 times.
|
12 | if (!result.empty() && speedList_) { |
| 164 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
|
5 | speedList_->clearExtensibleGroups(); // Clearer than removeAllModelObjects (which does the same thing, but could mean delete all objects) |
| 165 |
3/3✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
|
5 | openstudio::detail::concat_helper(result, speedList_->remove()); |
| 166 | } | ||
| 167 | |||
| 168 | 14 | return result; | |
| 169 | 7 | } | |
| 170 | |||
| 171 | 4 | Schedule HeatPumpAirToWaterCooling_Impl::availabilitySchedule() const { | |
| 172 |
1/1✓ Branch 1 taken 4 times.
|
4 | boost::optional<Schedule> value = optionalAvailabilitySchedule(); |
| 173 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
|
4 | if (!value) { |
| 174 | ✗ | LOG_AND_THROW(briefDescription() << " does not have an Availability Schedule attached."); | |
| 175 | } | ||
| 176 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
8 | return value.get(); |
| 177 | 4 | } | |
| 178 | |||
| 179 | 4 | double HeatPumpAirToWaterCooling_Impl::ratedInletAirTemperature() const { | |
| 180 |
1/1✓ Branch 1 taken 4 times.
|
4 | boost::optional<double> value = getDouble(OS_HeatPump_AirToWater_CoolingFields::RatedInletAirTemperature, true); |
| 181 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
|
4 | OS_ASSERT(value); |
| 182 |
1/1✓ Branch 1 taken 4 times.
|
8 | return value.get(); |
| 183 | } | ||
| 184 | |||
| 185 | 6 | boost::optional<double> HeatPumpAirToWaterCooling_Impl::ratedAirFlowRate() const { | |
| 186 | 6 | return getDouble(OS_HeatPump_AirToWater_CoolingFields::RatedAirFlowRate, true); | |
| 187 | } | ||
| 188 | |||
| 189 | 5 | bool HeatPumpAirToWaterCooling_Impl::isRatedAirFlowRateAutosized() const { | |
| 190 | 5 | bool result = false; | |
| 191 |
1/1✓ Branch 1 taken 5 times.
|
5 | boost::optional<std::string> value = getString(OS_HeatPump_AirToWater_CoolingFields::RatedAirFlowRate, true); |
| 192 |
1/2✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
|
5 | if (value) { |
| 193 |
3/3✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
|
10 | result = openstudio::istringEqual(value.get(), "autosize"); |
| 194 | } | ||
| 195 | 5 | return result; | |
| 196 | 5 | } | |
| 197 | |||
| 198 | 4 | double HeatPumpAirToWaterCooling_Impl::ratedLeavingWaterTemperature() const { | |
| 199 |
1/1✓ Branch 1 taken 4 times.
|
4 | boost::optional<double> value = getDouble(OS_HeatPump_AirToWater_CoolingFields::RatedLeavingWaterTemperature, true); |
| 200 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
|
4 | OS_ASSERT(value); |
| 201 |
1/1✓ Branch 1 taken 4 times.
|
8 | return value.get(); |
| 202 | } | ||
| 203 | |||
| 204 | 6 | boost::optional<double> HeatPumpAirToWaterCooling_Impl::ratedWaterFlowRate() const { | |
| 205 | 6 | return getDouble(OS_HeatPump_AirToWater_CoolingFields::RatedWaterFlowRate, true); | |
| 206 | } | ||
| 207 | |||
| 208 | 5 | bool HeatPumpAirToWaterCooling_Impl::isRatedWaterFlowRateAutosized() const { | |
| 209 | 5 | bool result = false; | |
| 210 |
1/1✓ Branch 1 taken 5 times.
|
5 | boost::optional<std::string> value = getString(OS_HeatPump_AirToWater_CoolingFields::RatedWaterFlowRate, true); |
| 211 |
1/2✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
|
5 | if (value) { |
| 212 |
3/3✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
|
10 | result = openstudio::istringEqual(value.get(), "autosize"); |
| 213 | } | ||
| 214 | 5 | return result; | |
| 215 | 5 | } | |
| 216 | |||
| 217 | 4 | double HeatPumpAirToWaterCooling_Impl::minimumOutdoorAirTemperature() const { | |
| 218 |
1/1✓ Branch 1 taken 4 times.
|
4 | boost::optional<double> value = getDouble(OS_HeatPump_AirToWater_CoolingFields::MinimumOutdoorAirTemperature, true); |
| 219 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
|
4 | OS_ASSERT(value); |
| 220 |
1/1✓ Branch 1 taken 4 times.
|
8 | return value.get(); |
| 221 | } | ||
| 222 | |||
| 223 | 4 | double HeatPumpAirToWaterCooling_Impl::maximumOutdoorAirTemperature() const { | |
| 224 |
1/1✓ Branch 1 taken 4 times.
|
4 | boost::optional<double> value = getDouble(OS_HeatPump_AirToWater_CoolingFields::MaximumOutdoorAirTemperature, true); |
| 225 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
|
4 | OS_ASSERT(value); |
| 226 |
1/1✓ Branch 1 taken 4 times.
|
8 | return value.get(); |
| 227 | } | ||
| 228 | |||
| 229 | 12 | boost::optional<Curve> HeatPumpAirToWaterCooling_Impl::minimumLeavingWaterTemperatureCurve() const { | |
| 230 |
2/2✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
|
12 | return getObject<ModelObject>().getModelObjectTarget<Curve>(OS_HeatPump_AirToWater_CoolingFields::MinimumLeavingWaterTemperatureCurveName); |
| 231 | } | ||
| 232 | |||
| 233 | 11 | boost::optional<Curve> HeatPumpAirToWaterCooling_Impl::maximumLeavingWaterTemperatureCurve() const { | |
| 234 |
2/2✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
|
11 | return getObject<ModelObject>().getModelObjectTarget<Curve>(OS_HeatPump_AirToWater_CoolingFields::MaximumLeavingWaterTemperatureCurveName); |
| 235 | } | ||
| 236 | |||
| 237 | 5 | double HeatPumpAirToWaterCooling_Impl::sizingFactor() const { | |
| 238 |
1/1✓ Branch 1 taken 5 times.
|
5 | boost::optional<double> value = getDouble(OS_HeatPump_AirToWater_CoolingFields::SizingFactor, true); |
| 239 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
|
5 | OS_ASSERT(value); |
| 240 |
1/1✓ Branch 1 taken 5 times.
|
10 | return value.get(); |
| 241 | } | ||
| 242 | |||
| 243 | 27 | boost::optional<HeatPumpAirToWaterCoolingSpeedData> HeatPumpAirToWaterCooling_Impl::boosterModeOnSpeed() const { | |
| 244 |
1/1✓ Branch 1 taken 27 times.
|
54 | return getObject<ModelObject>().getModelObjectTarget<HeatPumpAirToWaterCoolingSpeedData>( |
| 245 |
1/1✓ Branch 1 taken 27 times.
|
54 | OS_HeatPump_AirToWater_CoolingFields::BoosterModeOnSpeed); |
| 246 | } | ||
| 247 | |||
| 248 | 19 | bool HeatPumpAirToWaterCooling_Impl::setAvailabilitySchedule(Schedule& availabilitySchedule) { | |
| 249 |
3/3✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
✓ Branch 7 taken 19 times.
|
76 | const bool result = setSchedule(OS_HeatPump_AirToWater_CoolingFields::AvailabilityScheduleName, "HeatPumpAirToWaterCooling", "Availability", |
| 250 | availabilitySchedule); | ||
| 251 | 19 | return result; | |
| 252 | } | ||
| 253 | |||
| 254 | 19 | bool HeatPumpAirToWaterCooling_Impl::setRatedInletAirTemperature(double ratedInletAirTemperature) { | |
| 255 | 19 | const bool result = setDouble(OS_HeatPump_AirToWater_CoolingFields::RatedInletAirTemperature, ratedInletAirTemperature); | |
| 256 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 19 times.
|
19 | OS_ASSERT(result); |
| 257 | 19 | return result; | |
| 258 | } | ||
| 259 | |||
| 260 | 5 | bool HeatPumpAirToWaterCooling_Impl::setRatedAirFlowRate(double ratedAirFlowRate) { | |
| 261 | 5 | const bool result = setDouble(OS_HeatPump_AirToWater_CoolingFields::RatedAirFlowRate, ratedAirFlowRate); | |
| 262 | 5 | return result; | |
| 263 | } | ||
| 264 | |||
| 265 | 16 | void HeatPumpAirToWaterCooling_Impl::autosizeRatedAirFlowRate() { | |
| 266 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
32 | const bool result = setString(OS_HeatPump_AirToWater_CoolingFields::RatedAirFlowRate, "autosize"); |
| 267 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
|
16 | OS_ASSERT(result); |
| 268 | 16 | } | |
| 269 | |||
| 270 | 19 | bool HeatPumpAirToWaterCooling_Impl::setRatedLeavingWaterTemperature(double ratedLeavingWaterTemperature) { | |
| 271 | 19 | const bool result = setDouble(OS_HeatPump_AirToWater_CoolingFields::RatedLeavingWaterTemperature, ratedLeavingWaterTemperature); | |
| 272 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 19 times.
|
19 | OS_ASSERT(result); |
| 273 | 19 | return result; | |
| 274 | } | ||
| 275 | |||
| 276 | 5 | bool HeatPumpAirToWaterCooling_Impl::setRatedWaterFlowRate(double ratedWaterFlowRate) { | |
| 277 | 5 | const bool result = setDouble(OS_HeatPump_AirToWater_CoolingFields::RatedWaterFlowRate, ratedWaterFlowRate); | |
| 278 | 5 | return result; | |
| 279 | } | ||
| 280 | |||
| 281 | 16 | void HeatPumpAirToWaterCooling_Impl::autosizeRatedWaterFlowRate() { | |
| 282 |
2/2✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
|
32 | const bool result = setString(OS_HeatPump_AirToWater_CoolingFields::RatedWaterFlowRate, "autosize"); |
| 283 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 16 times.
|
16 | OS_ASSERT(result); |
| 284 | 16 | } | |
| 285 | |||
| 286 | 19 | bool HeatPumpAirToWaterCooling_Impl::setMinimumOutdoorAirTemperature(double minimumOutdoorAirTemperature) { | |
| 287 | 19 | const bool result = setDouble(OS_HeatPump_AirToWater_CoolingFields::MinimumOutdoorAirTemperature, minimumOutdoorAirTemperature); | |
| 288 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 19 times.
|
19 | OS_ASSERT(result); |
| 289 | 19 | return result; | |
| 290 | } | ||
| 291 | |||
| 292 | 19 | bool HeatPumpAirToWaterCooling_Impl::setMaximumOutdoorAirTemperature(double maximumOutdoorAirTemperature) { | |
| 293 | 19 | const bool result = setDouble(OS_HeatPump_AirToWater_CoolingFields::MaximumOutdoorAirTemperature, maximumOutdoorAirTemperature); | |
| 294 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 19 times.
|
19 | OS_ASSERT(result); |
| 295 | 19 | return result; | |
| 296 | } | ||
| 297 | |||
| 298 | 4 | bool HeatPumpAirToWaterCooling_Impl::setMinimumLeavingWaterTemperatureCurve(const Curve& minimumLeavingWaterTemperatureCurve) { | |
| 299 | const bool result = | ||
| 300 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | setPointer(OS_HeatPump_AirToWater_CoolingFields::MinimumLeavingWaterTemperatureCurveName, minimumLeavingWaterTemperatureCurve.handle()); |
| 301 | 4 | return result; | |
| 302 | } | ||
| 303 | |||
| 304 | 1 | void HeatPumpAirToWaterCooling_Impl::resetMinimumLeavingWaterTemperatureCurve() { | |
| 305 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | const bool result = setString(OS_HeatPump_AirToWater_CoolingFields::MinimumLeavingWaterTemperatureCurveName, ""); |
| 306 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 307 | 1 | } | |
| 308 | |||
| 309 | 4 | bool HeatPumpAirToWaterCooling_Impl::setMaximumLeavingWaterTemperatureCurve(const Curve& maximumLeavingWaterTemperatureCurve) { | |
| 310 | const bool result = | ||
| 311 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | setPointer(OS_HeatPump_AirToWater_CoolingFields::MaximumLeavingWaterTemperatureCurveName, maximumLeavingWaterTemperatureCurve.handle()); |
| 312 | 4 | return result; | |
| 313 | } | ||
| 314 | |||
| 315 | ✗ | void HeatPumpAirToWaterCooling_Impl::resetMaximumLeavingWaterTemperatureCurve() { | |
| 316 | ✗ | const bool result = setString(OS_HeatPump_AirToWater_CoolingFields::MaximumLeavingWaterTemperatureCurveName, ""); | |
| 317 | ✗ | OS_ASSERT(result); | |
| 318 | ✗ | } | |
| 319 | |||
| 320 | 20 | bool HeatPumpAirToWaterCooling_Impl::setSizingFactor(double sizingFactor) { | |
| 321 | 20 | const bool result = setDouble(OS_HeatPump_AirToWater_CoolingFields::SizingFactor, sizingFactor); | |
| 322 | 20 | return result; | |
| 323 | } | ||
| 324 | |||
| 325 | 4 | bool HeatPumpAirToWaterCooling_Impl::setBoosterModeOnSpeed(const HeatPumpAirToWaterCoolingSpeedData& boosterModeOnSpeed) { | |
| 326 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | const bool result = setPointer(OS_HeatPump_AirToWater_CoolingFields::BoosterModeOnSpeed, boosterModeOnSpeed.handle()); |
| 327 | 4 | return result; | |
| 328 | } | ||
| 329 | |||
| 330 | 1 | void HeatPumpAirToWaterCooling_Impl::resetBoosterModeOnSpeed() { | |
| 331 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | const bool result = setString(OS_HeatPump_AirToWater_CoolingFields::BoosterModeOnSpeed, ""); |
| 332 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 333 | 1 | } | |
| 334 | |||
| 335 | ✗ | boost::optional<double> HeatPumpAirToWaterCooling_Impl::autosizedRatedAirFlowRate() const { | |
| 336 | ✗ | boost::optional<double> result; | |
| 337 | ✗ | if (auto awhp_ = heatPumpAirToWater()) { | |
| 338 | ✗ | result = awhp_->autosizedRatedAirFlowRateinCoolingMode(); | |
| 339 | ✗ | } | |
| 340 | ✗ | return result; | |
| 341 | } | ||
| 342 | |||
| 343 | ✗ | boost::optional<double> HeatPumpAirToWaterCooling_Impl::autosizedRatedWaterFlowRate() const { | |
| 344 | ✗ | boost::optional<double> result; | |
| 345 | ✗ | if (auto awhp_ = heatPumpAirToWater()) { | |
| 346 | ✗ | result = awhp_->autosizedRatedWaterFlowRateinCoolingMode(); | |
| 347 | ✗ | } | |
| 348 | ✗ | return result; | |
| 349 | } | ||
| 350 | |||
| 351 | ✗ | boost::optional<double> HeatPumpAirToWaterCooling_Impl::autosizedRatedCoolingCapacity() const { | |
| 352 | ✗ | boost::optional<double> result; | |
| 353 | ✗ | if (auto awhp_ = heatPumpAirToWater()) { | |
| 354 | ✗ | result = awhp_->autosizedRatedCoolingCapacity(); | |
| 355 | ✗ | } | |
| 356 | ✗ | return result; | |
| 357 | } | ||
| 358 | |||
| 359 | ✗ | void HeatPumpAirToWaterCooling_Impl::autosize() { | |
| 360 | ✗ | autosizeRatedAirFlowRate(); | |
| 361 | ✗ | autosizeRatedWaterFlowRate(); | |
| 362 | ✗ | auto speeds = this->speeds(); | |
| 363 | ✗ | if (!speeds.empty()) { | |
| 364 | ✗ | speeds.back().autosize(); // Only need/can autosize the last (highest) speed | |
| 365 | } | ||
| 366 | ✗ | } | |
| 367 | |||
| 368 | ✗ | void HeatPumpAirToWaterCooling_Impl::applySizingValues() { | |
| 369 | ✗ | if (boost::optional<double> val_ = autosizedRatedAirFlowRate()) { | |
| 370 | ✗ | setRatedAirFlowRate(*val_); | |
| 371 | } | ||
| 372 | |||
| 373 | ✗ | if (boost::optional<double> val_ = autosizedRatedWaterFlowRate()) { | |
| 374 | ✗ | setRatedWaterFlowRate(*val_); | |
| 375 | } | ||
| 376 | |||
| 377 | ✗ | if (boost::optional<double> val_ = autosizedRatedCoolingCapacity()) { | |
| 378 | ✗ | auto speeds = this->speeds(); | |
| 379 | ✗ | if (!speeds.empty()) { | |
| 380 | ✗ | speeds.back().setRatedCoolingCapacity(*val_); // Only need/can autosize the last (highest) speed | |
| 381 | } | ||
| 382 | ✗ | } | |
| 383 | ✗ | } | |
| 384 | |||
| 385 | 7 | ComponentType HeatPumpAirToWaterCooling_Impl::componentType() const { | |
| 386 |
1/1✓ Branch 1 taken 7 times.
|
7 | return ComponentType::Cooling; |
| 387 | } | ||
| 388 | |||
| 389 | 3 | std::vector<FuelType> HeatPumpAirToWaterCooling_Impl::coolingFuelTypes() const { | |
| 390 |
1/1✓ Branch 1 taken 3 times.
|
9 | return {FuelType::Electricity}; |
| 391 | } | ||
| 392 | |||
| 393 | 1 | std::vector<FuelType> HeatPumpAirToWaterCooling_Impl::heatingFuelTypes() const { | |
| 394 | 1 | return {}; | |
| 395 | } | ||
| 396 | |||
| 397 | 1 | std::vector<AppGFuelType> HeatPumpAirToWaterCooling_Impl::appGHeatingFuelTypes() const { | |
| 398 | 1 | return {}; | |
| 399 | } | ||
| 400 | |||
| 401 | 4 | boost::optional<Schedule> HeatPumpAirToWaterCooling_Impl::optionalAvailabilitySchedule() const { | |
| 402 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_HeatPump_AirToWater_CoolingFields::AvailabilityScheduleName); |
| 403 | } | ||
| 404 | |||
| 405 | // Speed API | ||
| 406 | 315 | boost::optional<ModelObjectList> HeatPumpAirToWaterCooling_Impl::optionalSpeedDataList() const { | |
| 407 |
2/2✓ Branch 1 taken 315 times.
✓ Branch 4 taken 315 times.
|
315 | return getObject<ModelObject>().getModelObjectTarget<ModelObjectList>(OS_HeatPump_AirToWater_CoolingFields::SpeedDataList); |
| 408 | } | ||
| 409 | |||
| 410 | 301 | ModelObjectList HeatPumpAirToWaterCooling_Impl::speedDataList() const { | |
| 411 |
1/1✓ Branch 1 taken 301 times.
|
301 | boost::optional<ModelObjectList> value = optionalSpeedDataList(); |
| 412 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 301 times.
|
301 | if (!value) { |
| 413 | ✗ | LOG_AND_THROW(briefDescription() << " does not have a Speed Data List attached."); | |
| 414 | } | ||
| 415 |
2/2✓ Branch 1 taken 301 times.
✓ Branch 4 taken 301 times.
|
602 | return value.get(); |
| 416 | 301 | } | |
| 417 | |||
| 418 | 19 | bool HeatPumpAirToWaterCooling_Impl::setSpeedDataList(const ModelObjectList& speedDataList) { | |
| 419 |
2/2✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
|
19 | const bool result = setPointer(OS_HeatPump_AirToWater_CoolingFields::SpeedDataList, speedDataList.handle()); |
| 420 | 19 | return result; | |
| 421 | } | ||
| 422 | |||
| 423 | ✗ | void HeatPumpAirToWaterCooling_Impl::resetSpeedDataList() { | |
| 424 | ✗ | bool result = setString(OS_HeatPump_AirToWater_CoolingFields::SpeedDataList, ""); | |
| 425 | ✗ | OS_ASSERT(result); | |
| 426 | ✗ | } | |
| 427 | |||
| 428 | 225 | std::vector<HeatPumpAirToWaterCoolingSpeedData> HeatPumpAirToWaterCooling_Impl::speeds() const { | |
| 429 | 225 | std::vector<HeatPumpAirToWaterCoolingSpeedData> result; | |
| 430 |
2/2✓ Branch 1 taken 225 times.
✓ Branch 4 taken 225 times.
|
225 | auto const modelObjects = speedDataList().modelObjects(); |
| 431 | |||
| 432 |
2/2✓ Branch 5 taken 502 times.
✓ Branch 6 taken 225 times.
|
727 | for (auto&& elem : modelObjects) { |
| 433 |
1/1✓ Branch 1 taken 502 times.
|
502 | auto modelObject = elem.optionalCast<HeatPumpAirToWaterCoolingSpeedData>(); |
| 434 |
1/2✓ Branch 0 taken 502 times.
✗ Branch 1 not taken.
|
502 | if (modelObject) { |
| 435 |
2/2✓ Branch 1 taken 502 times.
✓ Branch 5 taken 502 times.
|
502 | result.push_back(std::move(*modelObject)); |
| 436 | } | ||
| 437 | 502 | } | |
| 438 | 450 | return result; | |
| 439 | 225 | } | |
| 440 | |||
| 441 | 96 | unsigned HeatPumpAirToWaterCooling_Impl::numberOfSpeeds() const { | |
| 442 |
1/1✓ Branch 1 taken 96 times.
|
96 | return speeds().size(); // This is right in all cases, but this is slow |
| 443 | // return speedDataList().size(); // This is fast, but could be wrong if the user put non-SpeedData objects in the list or if there are blanks | ||
| 444 | } | ||
| 445 | |||
| 446 | 72 | boost::optional<unsigned> HeatPumpAirToWaterCooling_Impl::speedIndex(const HeatPumpAirToWaterCoolingSpeedData& speed) const { | |
| 447 |
1/1✓ Branch 1 taken 72 times.
|
72 | const auto speedVector = speeds(); |
| 448 |
1/1✓ Branch 3 taken 72 times.
|
203 | auto it = std::find_if(speedVector.cbegin(), speedVector.cend(), [&](const HeatPumpAirToWaterCoolingSpeedData& s) { return s == speed; }); |
| 449 |
2/2✓ Branch 2 taken 5 times.
✓ Branch 3 taken 67 times.
|
72 | if (it != speedVector.cend()) { |
| 450 |
1/1✓ Branch 2 taken 5 times.
|
10 | return static_cast<unsigned>(std::distance(speedVector.cbegin(), it)) + 1; // 1-indexed |
| 451 | } | ||
| 452 | 67 | return boost::none; | |
| 453 | 72 | } | |
| 454 | |||
| 455 | 69 | bool HeatPumpAirToWaterCooling_Impl::addSpeed(const HeatPumpAirToWaterCoolingSpeedData& speed) { | |
| 456 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 2 taken 67 times.
|
69 | if (numberOfSpeeds() >= HeatPumpAirToWaterCooling::maximum_number_of_speeds) { |
| 457 |
10/10✓ 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 16 taken 2 times.
✓ Branch 19 taken 2 times.
✓ Branch 23 taken 2 times.
✓ Branch 26 taken 2 times.
✓ Branch 29 taken 2 times.
|
2 | LOG(Error, "You have reached the maximum number of speeds (=" << HeatPumpAirToWaterCooling::maximum_number_of_speeds << "), occurred for " |
| 458 | << briefDescription() << "."); | ||
| 459 | 2 | return false; // too many speeds | |
| 460 | } | ||
| 461 |
2/3✓ Branch 1 taken 67 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 67 times.
|
134 | if (speedIndex(speed)) { |
| 462 | ✗ | return false; // already in the list | |
| 463 | } | ||
| 464 | |||
| 465 |
2/2✓ Branch 1 taken 67 times.
✓ Branch 4 taken 67 times.
|
67 | return speedDataList().addModelObject(speed); |
| 466 | } | ||
| 467 | |||
| 468 | 1 | bool HeatPumpAirToWaterCooling_Impl::setSpeedIndex(const HeatPumpAirToWaterCoolingSpeedData& speed, unsigned index) { | |
| 469 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto cur_idx_ = speedIndex(speed); |
| 470 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | if (!cur_idx_) { |
| 471 | ✗ | LOG(Warn, "For " << briefDescription() << " cannot set the index of speed " << speed.briefDescription() << " since it is not part of it."); | |
| 472 | ✗ | return false; | |
| 473 | } | ||
| 474 | |||
| 475 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto speedVector = speeds(); |
| 476 | |||
| 477 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (index < 1) { |
| 478 | ✗ | LOG(Debug, "Requested a speed index of " << index << " < 1 to be assigned to " << speed.briefDescription() << ", resetting to 1"); | |
| 479 | ✗ | index = 1; | |
| 480 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 1 time.
|
1 | } else if (index > speedVector.size()) { |
| 481 | ✗ | LOG(Debug, "Requested a speed index of " << index << " > number of speeds (" << speedVector.size() << ") to be assigned to " | |
| 482 | << speed.briefDescription() << ", resetting to " << speedVector.size()); | ||
| 483 | ✗ | index = speedVector.size(); | |
| 484 | } | ||
| 485 | |||
| 486 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | speedVector.erase(speedVector.begin() + (*cur_idx_ - 1)); // stageIndex is 1-indexed, and vector is 0-indexed |
| 487 |
1/1✓ Branch 4 taken 1 time.
|
1 | speedVector.insert(speedVector.begin() + (index - 1), speed); // index is 1-indexed, and vector is 0-indexed |
| 488 | |||
| 489 |
1/1✓ Branch 1 taken 1 time.
|
1 | return setSpeeds(speedVector); |
| 490 | 1 | } | |
| 491 | |||
| 492 | ✗ | bool HeatPumpAirToWaterCooling_Impl::addSpeed(const HeatPumpAirToWaterCoolingSpeedData& speed, unsigned index) { | |
| 493 | ✗ | bool ok = addSpeed(speed); | |
| 494 | ✗ | if (!ok) { | |
| 495 | ✗ | return false; | |
| 496 | } | ||
| 497 | ✗ | ok = setSpeedIndex(speed, index); | |
| 498 | ✗ | return ok; | |
| 499 | } | ||
| 500 | |||
| 501 | 3 | bool HeatPumpAirToWaterCooling_Impl::setSpeeds(const std::vector<HeatPumpAirToWaterCoolingSpeedData>& speeds) { | |
| 502 | // Clear the extensible groups, and redo them | ||
| 503 | 3 | bool ok = true; | |
| 504 | 3 | removeAllSpeeds(); | |
| 505 |
2/2✓ Branch 4 taken 12 times.
✓ Branch 5 taken 3 times.
|
15 | for (const auto& s : speeds) { |
| 506 |
1/1✓ Branch 1 taken 12 times.
|
12 | ok &= addSpeed(s); |
| 507 | } | ||
| 508 | 3 | return ok; | |
| 509 | } | ||
| 510 | |||
| 511 | 3 | bool HeatPumpAirToWaterCooling_Impl::removeSpeed(const HeatPumpAirToWaterCoolingSpeedData& speed) { // NOLINT(readability-*) | |
| 512 |
1/1✓ Branch 1 taken 3 times.
|
3 | auto speedList = speedDataList(); |
| 513 |
3/3✓ Branch 1 taken 3 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 2 times.
|
3 | if (!speedList.hasModelObject(speed)) { |
| 514 |
11/11✓ 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.
✓ Branch 16 taken 1 time.
✓ Branch 19 taken 1 time.
✓ Branch 22 taken 1 time.
✓ Branch 27 taken 1 time.
✓ Branch 30 taken 1 time.
✓ Branch 33 taken 1 time.
|
1 | LOG(Warn, "For " << briefDescription() << " cannot remove speed " << speed.briefDescription() << " since it is not part of it."); |
| 515 | 1 | return false; | |
| 516 | } | ||
| 517 |
1/1✓ Branch 1 taken 2 times.
|
2 | speedList.removeModelObject(speed); |
| 518 | 2 | return true; | |
| 519 | 3 | } | |
| 520 | |||
| 521 | 1 | bool HeatPumpAirToWaterCooling_Impl::removeSpeed(unsigned index) { | |
| 522 | 1 | bool result = false; | |
| 523 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (index < 1) { |
| 524 | ✗ | return false; | |
| 525 | } | ||
| 526 |
1/1✓ Branch 1 taken 1 time.
|
1 | auto speedVector = speeds(); |
| 527 |
1/2✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
|
1 | if (index <= speedVector.size()) { |
| 528 |
1/1✓ Branch 2 taken 1 time.
|
1 | result = removeSpeed(speedVector[index - 1]); // index is 1-indexed |
| 529 | } | ||
| 530 | 1 | return result; | |
| 531 | 1 | } | |
| 532 | |||
| 533 | 6 | void HeatPumpAirToWaterCooling_Impl::removeAllSpeeds() { // NOLINT(readability-make-member-function-const) | |
| 534 |
2/2✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
|
6 | speedDataList().removeAllModelObjects(); // This just clears the list, does not delete the underlying objects |
| 535 | 6 | } | |
| 536 | |||
| 537 | } // namespace detail | ||
| 538 | |||
| 539 | 15 | HeatPumpAirToWaterCooling::HeatPumpAirToWaterCooling(const Model& model) : StraightComponent(HeatPumpAirToWaterCooling::iddObjectType(), model) { | |
| 540 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 15 times.
✗ Branch 5 not taken.
|
15 | OS_ASSERT(getImpl<detail::HeatPumpAirToWaterCooling_Impl>()); |
| 541 | |||
| 542 | 15 | bool ok = true; | |
| 543 | |||
| 544 |
1/1✓ Branch 1 taken 15 times.
|
15 | auto speedList = ModelObjectList(model); |
| 545 |
3/3✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
|
15 | speedList.setName(this->nameString() + " Speed Data List"); |
| 546 |
1/1✓ Branch 3 taken 15 times.
|
15 | ok = getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setSpeedDataList(speedList); |
| 547 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
✗ Branch 3 not taken.
|
15 | OS_ASSERT(ok); |
| 548 | |||
| 549 |
1/1✓ Branch 1 taken 15 times.
|
15 | auto availabilitySchedule = model.alwaysOnDiscreteSchedule(); |
| 550 |
1/1✓ Branch 1 taken 15 times.
|
15 | ok = setAvailabilitySchedule(availabilitySchedule); |
| 551 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 15 times.
✗ Branch 3 not taken.
|
15 | OS_ASSERT(ok); |
| 552 | |||
| 553 | // IDD Defaults | ||
| 554 |
1/1✓ Branch 1 taken 15 times.
|
15 | setRatedInletAirTemperature(8.0); |
| 555 |
1/1✓ Branch 1 taken 15 times.
|
15 | autosizeRatedAirFlowRate(); |
| 556 |
1/1✓ Branch 1 taken 15 times.
|
15 | setRatedLeavingWaterTemperature(40.0); |
| 557 |
1/1✓ Branch 1 taken 15 times.
|
15 | autosizeRatedWaterFlowRate(); |
| 558 |
1/1✓ Branch 1 taken 15 times.
|
15 | setMinimumOutdoorAirTemperature(-30.0); |
| 559 |
1/1✓ Branch 1 taken 15 times.
|
15 | setMaximumOutdoorAirTemperature(100.0); |
| 560 |
1/1✓ Branch 1 taken 15 times.
|
15 | setSizingFactor(1.0); |
| 561 | 15 | } | |
| 562 | |||
| 563 | 7787 | IddObjectType HeatPumpAirToWaterCooling::iddObjectType() { | |
| 564 |
1/1✓ Branch 1 taken 7787 times.
|
7787 | return {IddObjectType::OS_HeatPump_AirToWater_Cooling}; |
| 565 | } | ||
| 566 | |||
| 567 | 4 | Schedule HeatPumpAirToWaterCooling::availabilitySchedule() const { | |
| 568 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->availabilitySchedule(); |
| 569 | } | ||
| 570 | |||
| 571 | 4 | double HeatPumpAirToWaterCooling::ratedInletAirTemperature() const { | |
| 572 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->ratedInletAirTemperature(); |
| 573 | } | ||
| 574 | |||
| 575 | 6 | boost::optional<double> HeatPumpAirToWaterCooling::ratedAirFlowRate() const { | |
| 576 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->ratedAirFlowRate(); |
| 577 | } | ||
| 578 | |||
| 579 | 5 | bool HeatPumpAirToWaterCooling::isRatedAirFlowRateAutosized() const { | |
| 580 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->isRatedAirFlowRateAutosized(); |
| 581 | } | ||
| 582 | |||
| 583 | ✗ | boost::optional<double> HeatPumpAirToWaterCooling::autosizedRatedAirFlowRate() const { | |
| 584 | ✗ | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->autosizedRatedAirFlowRate(); | |
| 585 | } | ||
| 586 | |||
| 587 | 4 | double HeatPumpAirToWaterCooling::ratedLeavingWaterTemperature() const { | |
| 588 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->ratedLeavingWaterTemperature(); |
| 589 | } | ||
| 590 | |||
| 591 | 6 | boost::optional<double> HeatPumpAirToWaterCooling::ratedWaterFlowRate() const { | |
| 592 |
1/1✓ Branch 3 taken 6 times.
|
6 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->ratedWaterFlowRate(); |
| 593 | } | ||
| 594 | |||
| 595 | 5 | bool HeatPumpAirToWaterCooling::isRatedWaterFlowRateAutosized() const { | |
| 596 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->isRatedWaterFlowRateAutosized(); |
| 597 | } | ||
| 598 | |||
| 599 | ✗ | boost::optional<double> HeatPumpAirToWaterCooling::autosizedRatedWaterFlowRate() const { | |
| 600 | ✗ | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->autosizedRatedWaterFlowRate(); | |
| 601 | } | ||
| 602 | |||
| 603 | 4 | double HeatPumpAirToWaterCooling::minimumOutdoorAirTemperature() const { | |
| 604 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->minimumOutdoorAirTemperature(); |
| 605 | } | ||
| 606 | |||
| 607 | 4 | double HeatPumpAirToWaterCooling::maximumOutdoorAirTemperature() const { | |
| 608 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->maximumOutdoorAirTemperature(); |
| 609 | } | ||
| 610 | |||
| 611 | 5 | boost::optional<Curve> HeatPumpAirToWaterCooling::minimumLeavingWaterTemperatureCurve() const { | |
| 612 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->minimumLeavingWaterTemperatureCurve(); |
| 613 | } | ||
| 614 | |||
| 615 | 4 | boost::optional<Curve> HeatPumpAirToWaterCooling::maximumLeavingWaterTemperatureCurve() const { | |
| 616 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->maximumLeavingWaterTemperatureCurve(); |
| 617 | } | ||
| 618 | |||
| 619 | 5 | double HeatPumpAirToWaterCooling::sizingFactor() const { | |
| 620 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->sizingFactor(); |
| 621 | } | ||
| 622 | |||
| 623 | 27 | boost::optional<HeatPumpAirToWaterCoolingSpeedData> HeatPumpAirToWaterCooling::boosterModeOnSpeed() const { | |
| 624 |
1/1✓ Branch 3 taken 27 times.
|
27 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->boosterModeOnSpeed(); |
| 625 | } | ||
| 626 | |||
| 627 | 19 | bool HeatPumpAirToWaterCooling::setAvailabilitySchedule(Schedule& availabilitySchedule) { | |
| 628 |
1/1✓ Branch 3 taken 19 times.
|
19 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setAvailabilitySchedule(availabilitySchedule); |
| 629 | } | ||
| 630 | |||
| 631 | 19 | bool HeatPumpAirToWaterCooling::setRatedInletAirTemperature(double ratedInletAirTemperature) { | |
| 632 |
1/1✓ Branch 3 taken 19 times.
|
19 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setRatedInletAirTemperature(ratedInletAirTemperature); |
| 633 | } | ||
| 634 | |||
| 635 | 5 | bool HeatPumpAirToWaterCooling::setRatedAirFlowRate(double ratedAirFlowRate) { | |
| 636 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setRatedAirFlowRate(ratedAirFlowRate); |
| 637 | } | ||
| 638 | |||
| 639 | 16 | void HeatPumpAirToWaterCooling::autosizeRatedAirFlowRate() { | |
| 640 |
1/1✓ Branch 3 taken 16 times.
|
16 | getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->autosizeRatedAirFlowRate(); |
| 641 | 16 | } | |
| 642 | |||
| 643 | 19 | bool HeatPumpAirToWaterCooling::setRatedLeavingWaterTemperature(double ratedLeavingWaterTemperature) { | |
| 644 |
1/1✓ Branch 3 taken 19 times.
|
19 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setRatedLeavingWaterTemperature(ratedLeavingWaterTemperature); |
| 645 | } | ||
| 646 | |||
| 647 | 5 | bool HeatPumpAirToWaterCooling::setRatedWaterFlowRate(double ratedWaterFlowRate) { | |
| 648 |
1/1✓ Branch 3 taken 5 times.
|
5 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setRatedWaterFlowRate(ratedWaterFlowRate); |
| 649 | } | ||
| 650 | |||
| 651 | 16 | void HeatPumpAirToWaterCooling::autosizeRatedWaterFlowRate() { | |
| 652 |
1/1✓ Branch 3 taken 16 times.
|
16 | getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->autosizeRatedWaterFlowRate(); |
| 653 | 16 | } | |
| 654 | |||
| 655 | 19 | bool HeatPumpAirToWaterCooling::setMinimumOutdoorAirTemperature(double minimumOutdoorAirTemperature) { | |
| 656 |
1/1✓ Branch 3 taken 19 times.
|
19 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setMinimumOutdoorAirTemperature(minimumOutdoorAirTemperature); |
| 657 | } | ||
| 658 | |||
| 659 | 19 | bool HeatPumpAirToWaterCooling::setMaximumOutdoorAirTemperature(double maximumOutdoorAirTemperature) { | |
| 660 |
1/1✓ Branch 3 taken 19 times.
|
19 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setMaximumOutdoorAirTemperature(maximumOutdoorAirTemperature); |
| 661 | } | ||
| 662 | |||
| 663 | 4 | bool HeatPumpAirToWaterCooling::setMinimumLeavingWaterTemperatureCurve(const Curve& minimumLeavingWaterTemperatureCurve) { | |
| 664 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setMinimumLeavingWaterTemperatureCurve(minimumLeavingWaterTemperatureCurve); |
| 665 | } | ||
| 666 | |||
| 667 | 1 | void HeatPumpAirToWaterCooling::resetMinimumLeavingWaterTemperatureCurve() { | |
| 668 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->resetMinimumLeavingWaterTemperatureCurve(); |
| 669 | 1 | } | |
| 670 | |||
| 671 | 4 | bool HeatPumpAirToWaterCooling::setMaximumLeavingWaterTemperatureCurve(const Curve& maximumLeavingWaterTemperatureCurve) { | |
| 672 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setMaximumLeavingWaterTemperatureCurve(maximumLeavingWaterTemperatureCurve); |
| 673 | } | ||
| 674 | |||
| 675 | ✗ | void HeatPumpAirToWaterCooling::resetMaximumLeavingWaterTemperatureCurve() { | |
| 676 | ✗ | getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->resetMaximumLeavingWaterTemperatureCurve(); | |
| 677 | ✗ | } | |
| 678 | |||
| 679 | 20 | bool HeatPumpAirToWaterCooling::setSizingFactor(double sizingFactor) { | |
| 680 |
1/1✓ Branch 3 taken 20 times.
|
20 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setSizingFactor(sizingFactor); |
| 681 | } | ||
| 682 | |||
| 683 | 4 | bool HeatPumpAirToWaterCooling::setBoosterModeOnSpeed(const HeatPumpAirToWaterCoolingSpeedData& boosterModeOnSpeed) { | |
| 684 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setBoosterModeOnSpeed(boosterModeOnSpeed); |
| 685 | } | ||
| 686 | |||
| 687 | 1 | void HeatPumpAirToWaterCooling::resetBoosterModeOnSpeed() { | |
| 688 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->resetBoosterModeOnSpeed(); |
| 689 | 1 | } | |
| 690 | |||
| 691 | // Speed Data API | ||
| 692 | 27 | unsigned HeatPumpAirToWaterCooling::numberOfSpeeds() const { | |
| 693 |
1/1✓ Branch 3 taken 27 times.
|
27 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->numberOfSpeeds(); |
| 694 | } | ||
| 695 | |||
| 696 | 4 | boost::optional<unsigned> HeatPumpAirToWaterCooling::speedIndex(const HeatPumpAirToWaterCoolingSpeedData& speed) const { | |
| 697 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->speedIndex(speed); |
| 698 | } | ||
| 699 | |||
| 700 | 51 | std::vector<HeatPumpAirToWaterCoolingSpeedData> HeatPumpAirToWaterCooling::speeds() const { | |
| 701 |
1/1✓ Branch 3 taken 51 times.
|
51 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->speeds(); |
| 702 | } | ||
| 703 | |||
| 704 | 57 | bool HeatPumpAirToWaterCooling::addSpeed(const HeatPumpAirToWaterCoolingSpeedData& speed) { | |
| 705 |
1/1✓ Branch 3 taken 57 times.
|
57 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->addSpeed(speed); |
| 706 | } | ||
| 707 | |||
| 708 | ✗ | bool HeatPumpAirToWaterCooling::addSpeed(const HeatPumpAirToWaterCoolingSpeedData& speed, unsigned index) { | |
| 709 | ✗ | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->addSpeed(speed, index); | |
| 710 | } | ||
| 711 | |||
| 712 | 1 | bool HeatPumpAirToWaterCooling::setSpeedIndex(const HeatPumpAirToWaterCoolingSpeedData& speed, unsigned index) { | |
| 713 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setSpeedIndex(speed, index); |
| 714 | } | ||
| 715 | |||
| 716 | 2 | bool HeatPumpAirToWaterCooling::setSpeeds(const std::vector<HeatPumpAirToWaterCoolingSpeedData>& speeds) { | |
| 717 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->setSpeeds(speeds); |
| 718 | } | ||
| 719 | |||
| 720 | 3 | void HeatPumpAirToWaterCooling::removeAllSpeeds() { | |
| 721 |
1/1✓ Branch 3 taken 3 times.
|
3 | getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->removeAllSpeeds(); |
| 722 | 3 | } | |
| 723 | |||
| 724 | 2 | bool HeatPumpAirToWaterCooling::removeSpeed(const HeatPumpAirToWaterCoolingSpeedData& speed) { | |
| 725 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->removeSpeed(speed); |
| 726 | } | ||
| 727 | |||
| 728 | 1 | bool HeatPumpAirToWaterCooling::removeSpeed(unsigned index) { | |
| 729 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->removeSpeed(index); |
| 730 | } | ||
| 731 | |||
| 732 | 17 | boost::optional<HeatPumpAirToWater> HeatPumpAirToWaterCooling::heatPumpAirToWater() const { | |
| 733 |
1/1✓ Branch 3 taken 17 times.
|
17 | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->heatPumpAirToWater(); |
| 734 | } | ||
| 735 | |||
| 736 | ✗ | boost::optional<double> HeatPumpAirToWaterCooling::autosizedRatedCoolingCapacity() const { | |
| 737 | ✗ | return getImpl<detail::HeatPumpAirToWaterCooling_Impl>()->autosizedRatedCoolingCapacity(); | |
| 738 | } | ||
| 739 | |||
| 740 | /// @cond | ||
| 741 | 74 | HeatPumpAirToWaterCooling::HeatPumpAirToWaterCooling(std::shared_ptr<detail::HeatPumpAirToWaterCooling_Impl> impl) | |
| 742 |
1/1✓ Branch 3 taken 74 times.
|
74 | : StraightComponent(std::move(impl)) {} |
| 743 | /// @endcond | ||
| 744 | |||
| 745 | } // namespace model | ||
| 746 | } // namespace openstudio | ||
| 747 |