src/model/CoilCoolingDX.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 "CoilCoolingDX.hpp" | ||
| 7 | #include "CoilCoolingDX_Impl.hpp" | ||
| 8 | |||
| 9 | #include "Model.hpp" | ||
| 10 | #include "Model_Impl.hpp" | ||
| 11 | #include "Schedule.hpp" | ||
| 12 | #include "Schedule_Impl.hpp" | ||
| 13 | #include "ThermalZone.hpp" | ||
| 14 | #include "ThermalZone_Impl.hpp" | ||
| 15 | #include "ScheduleTypeLimits.hpp" | ||
| 16 | #include "ScheduleTypeRegistry.hpp" | ||
| 17 | #include "CoilCoolingDXCurveFitPerformance.hpp" | ||
| 18 | #include "CoilCoolingDXCurveFitPerformance_Impl.hpp" | ||
| 19 | #include "Node.hpp" | ||
| 20 | #include "Node_Impl.hpp" | ||
| 21 | #include "AirLoopHVACUnitarySystem.hpp" | ||
| 22 | #include "AirLoopHVACUnitarySystem_Impl.hpp" | ||
| 23 | #include "AirLoopHVACOutdoorAirSystem.hpp" | ||
| 24 | #include "AirLoopHVACOutdoorAirSystem_Impl.hpp" | ||
| 25 | #include "AirLoopHVACDedicatedOutdoorAirSystem.hpp" | ||
| 26 | #include "AirLoopHVACDedicatedOutdoorAirSystem_Impl.hpp" | ||
| 27 | #include "AirflowNetworkEquivalentDuct.hpp" | ||
| 28 | #include "AirflowNetworkEquivalentDuct_Impl.hpp" | ||
| 29 | #include "CoilSystemCoolingDXHeatExchangerAssisted.hpp" | ||
| 30 | #include "CoilSystemCoolingDXHeatExchangerAssisted_Impl.hpp" | ||
| 31 | #include "ZoneHVACPackagedTerminalAirConditioner.hpp" | ||
| 32 | #include "ZoneHVACPackagedTerminalAirConditioner_Impl.hpp" | ||
| 33 | #include "ZoneHVACPackagedTerminalHeatPump.hpp" | ||
| 34 | #include "ZoneHVACPackagedTerminalHeatPump_Impl.hpp" | ||
| 35 | |||
| 36 | #include <utilities/idd/IddFactory.hxx> | ||
| 37 | #include <utilities/idd/IddEnums.hxx> | ||
| 38 | #include <utilities/idd/OS_Coil_Cooling_DX_FieldEnums.hxx> | ||
| 39 | #include "../utilities/core/Assert.hpp" | ||
| 40 | #include "../utilities/data/DataEnums.hpp" | ||
| 41 | |||
| 42 | namespace openstudio { | ||
| 43 | namespace model { | ||
| 44 | |||
| 45 | namespace detail { | ||
| 46 | |||
| 47 | 24 | CoilCoolingDX_Impl::CoilCoolingDX_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 48 | 24 | : StraightComponent_Impl(idfObject, model, keepHandle) { | |
| 49 |
4/6✓ Branch 1 taken 24 times.
✓ Branch 4 taken 24 times.
✓ Branch 7 taken 24 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 24 times.
✗ Branch 13 not taken.
|
24 | OS_ASSERT(idfObject.iddObject().type() == CoilCoolingDX::iddObjectType()); |
| 50 | 24 | } | |
| 51 | |||
| 52 | ✗ | CoilCoolingDX_Impl::CoilCoolingDX_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 53 | ✗ | : StraightComponent_Impl(other, model, keepHandle) { | |
| 54 | ✗ | OS_ASSERT(other.iddObject().type() == CoilCoolingDX::iddObjectType()); | |
| 55 | ✗ | } | |
| 56 | |||
| 57 | 25 | CoilCoolingDX_Impl::CoilCoolingDX_Impl(const CoilCoolingDX_Impl& other, Model_Impl* model, bool keepHandle) | |
| 58 | 25 | : StraightComponent_Impl(other, model, keepHandle) {} | |
| 59 | |||
| 60 | ✗ | const std::vector<std::string>& CoilCoolingDX_Impl::outputVariableNames() const { | |
| 61 | static const std::vector<std::string> result{"Cooling Coil Total Cooling Rate", | ||
| 62 | "Cooling Coil Total Cooling Energy", | ||
| 63 | "Cooling Coil Sensible Cooling Rate", | ||
| 64 | "Cooling Coil Sensible Cooling Energy", | ||
| 65 | "Cooling Coil Latent Cooling Rate", | ||
| 66 | "Cooling Coil Latent Cooling Energy", | ||
| 67 | "Cooling Coil Electricity Rate", | ||
| 68 | "Cooling Coil Electricity Energy", | ||
| 69 | "Cooling Coil Runtime Fraction", | ||
| 70 | "SubcoolReheat Cooling Coil Operation Mode", | ||
| 71 | "SubcoolReheat Cooling Coil Operation Mode Ratio", | ||
| 72 | "SubcoolReheat Cooling Coil Recovered Heat Energy Rate", | ||
| 73 | ✗ | "SubcoolReheat Cooling Coil Recovered Heat Energy"}; | |
| 74 | ✗ | return result; | |
| 75 | ✗ | } | |
| 76 | |||
| 77 | 47 | IddObjectType CoilCoolingDX_Impl::iddObjectType() const { | |
| 78 | 47 | return CoilCoolingDX::iddObjectType(); | |
| 79 | } | ||
| 80 | |||
| 81 | ✗ | std::vector<ScheduleTypeKey> CoilCoolingDX_Impl::getScheduleTypeKeys(const Schedule& schedule) const { | |
| 82 | ✗ | std::vector<ScheduleTypeKey> result; | |
| 83 | ✗ | UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); | |
| 84 | ✗ | UnsignedVector::const_iterator b(fieldIndices.begin()); | |
| 85 | ✗ | UnsignedVector::const_iterator e(fieldIndices.end()); | |
| 86 | ✗ | if (std::find(b, e, OS_Coil_Cooling_DXFields::AvailabilitySchedule) != e) { | |
| 87 | ✗ | result.push_back(ScheduleTypeKey("CoilCoolingDX", "Availability Schedule")); | |
| 88 | } | ||
| 89 | ✗ | return result; | |
| 90 | ✗ | } | |
| 91 | |||
| 92 | 27 | unsigned CoilCoolingDX_Impl::inletPort() const { | |
| 93 | 27 | return OS_Coil_Cooling_DXFields::EvaporatorInletNode; | |
| 94 | } | ||
| 95 | |||
| 96 | 37 | unsigned CoilCoolingDX_Impl::outletPort() const { | |
| 97 | 37 | return OS_Coil_Cooling_DXFields::EvaporatorOutletNode; | |
| 98 | } | ||
| 99 | |||
| 100 | 2 | ModelObject CoilCoolingDX_Impl::clone(Model model) const { | |
| 101 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | return StraightComponent_Impl::clone(model); |
| 102 | |||
| 103 | // The CoilCoolingDXCurveFitPerformance is a ResourceObject so it'll be handled by the ModelObject::clone | ||
| 104 | // (StraightComponent_Impl::clone calls HVACComponent_Impl::clone, which skips ParentObject_Impl::clone and goes directly to ModelObject::clone) | ||
| 105 | // auto performanceClone = performanceObject().clone(model).cast<CoilCoolingDXCurveFitPerformance>(); | ||
| 106 | // t_clone.setPerformanceObject(performanceClone); | ||
| 107 | } | ||
| 108 | |||
| 109 | 17 | std::vector<ModelObject> CoilCoolingDX_Impl::children() const { | |
| 110 | 17 | std::vector<ModelObject> result; | |
| 111 | |||
| 112 | // This is a ResourceObject, so it shouldn't really be a child except for OS App / IG | ||
| 113 |
2/2✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
|
17 | result.push_back(performanceObject()); |
| 114 | |||
| 115 | std::vector<AirflowNetworkEquivalentDuct> myAFNItems = | ||
| 116 |
3/3✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
✓ Branch 7 taken 17 times.
|
17 | getObject<ModelObject>().getModelObjectSources<AirflowNetworkEquivalentDuct>(AirflowNetworkEquivalentDuct::iddObjectType()); |
| 117 |
1/1✓ Branch 5 taken 17 times.
|
17 | result.insert(result.end(), myAFNItems.begin(), myAFNItems.end()); |
| 118 | |||
| 119 | 34 | return result; | |
| 120 | 17 | } | |
| 121 | |||
| 122 | ✗ | AirflowNetworkEquivalentDuct CoilCoolingDX_Impl::getAirflowNetworkEquivalentDuct(double length, double diameter) { | |
| 123 | ✗ | boost::optional<AirflowNetworkEquivalentDuct> opt = airflowNetworkEquivalentDuct(); | |
| 124 | ✗ | if (opt) { | |
| 125 | ✗ | if (opt->airPathLength() != length) { | |
| 126 | ✗ | opt->setAirPathLength(length); | |
| 127 | } | ||
| 128 | ✗ | if (opt->airPathHydraulicDiameter() != diameter) { | |
| 129 | ✗ | opt->setAirPathHydraulicDiameter(diameter); | |
| 130 | } | ||
| 131 | } | ||
| 132 | ✗ | return AirflowNetworkEquivalentDuct(model(), length, diameter, handle()); | |
| 133 | ✗ | } | |
| 134 | |||
| 135 | ✗ | boost::optional<AirflowNetworkEquivalentDuct> CoilCoolingDX_Impl::airflowNetworkEquivalentDuct() const { | |
| 136 | std::vector<AirflowNetworkEquivalentDuct> myAFN = | ||
| 137 | ✗ | getObject<ModelObject>().getModelObjectSources<AirflowNetworkEquivalentDuct>(AirflowNetworkEquivalentDuct::iddObjectType()); | |
| 138 | ✗ | auto count = myAFN.size(); | |
| 139 | ✗ | if (count == 1) { | |
| 140 | ✗ | return myAFN[0]; | |
| 141 | ✗ | } else if (count > 1) { | |
| 142 | ✗ | LOG(Warn, briefDescription() << " has more than one AirflowNetwork EquivalentDuct attached, returning first."); | |
| 143 | ✗ | return myAFN[0]; | |
| 144 | } | ||
| 145 | ✗ | return boost::none; | |
| 146 | ✗ | } | |
| 147 | |||
| 148 | 37 | boost::optional<HVACComponent> CoilCoolingDX_Impl::containingHVACComponent() const { | |
| 149 | // AirLoopHVACUnitarySystem | ||
| 150 | { | ||
| 151 |
2/2✓ Branch 1 taken 37 times.
✓ Branch 4 taken 37 times.
|
37 | auto systems = this->model().getConcreteModelObjects<AirLoopHVACUnitarySystem>(); |
| 152 | |||
| 153 |
2/2✓ Branch 5 taken 18 times.
✓ Branch 6 taken 19 times.
|
37 | for (auto const& system : systems) { |
| 154 |
2/3✓ Branch 1 taken 18 times.
✓ Branch 3 taken 18 times.
✗ Branch 4 not taken.
|
36 | if (auto coolingCoil = system.coolingCoil()) { |
| 155 |
5/6✓ Branch 1 taken 18 times.
✓ Branch 4 taken 18 times.
✓ Branch 7 taken 18 times.
✓ Branch 10 taken 18 times.
✓ Branch 12 taken 18 times.
✗ Branch 13 not taken.
|
18 | if (coolingCoil->handle() == this->handle()) { |
| 156 |
1/1✓ Branch 1 taken 18 times.
|
18 | return system; |
| 157 | } | ||
| 158 | 18 | } | |
| 159 | } | ||
| 160 | 37 | } | |
| 161 | |||
| 162 | // CoilSystemCoolingDXHeatExchangerAssisted | ||
| 163 | { | ||
| 164 |
2/2✓ Branch 1 taken 19 times.
✓ Branch 4 taken 19 times.
|
19 | auto coilSystems = this->model().getConcreteModelObjects<CoilSystemCoolingDXHeatExchangerAssisted>(); |
| 165 |
2/2✓ Branch 5 taken 4 times.
✓ Branch 6 taken 15 times.
|
19 | for (const auto& coilSystem : coilSystems) { |
| 166 |
5/6✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
✗ Branch 14 not taken.
|
4 | if (coilSystem.coolingCoil().handle() == this->handle()) { |
| 167 |
1/1✓ Branch 1 taken 4 times.
|
4 | return coilSystem; |
| 168 | } | ||
| 169 | } | ||
| 170 | 19 | } | |
| 171 | |||
| 172 | 15 | return boost::none; | |
| 173 | } | ||
| 174 | |||
| 175 | 17 | boost::optional<ZoneHVACComponent> CoilCoolingDX_Impl::containingZoneHVACComponent() const { | |
| 176 | // ZoneHVACPackagedTerminalAirConditioner | ||
| 177 | |||
| 178 | std::vector<ZoneHVACPackagedTerminalAirConditioner> zoneHVACPackagedTerminalAirConditioners = | ||
| 179 |
2/2✓ Branch 1 taken 17 times.
✓ Branch 4 taken 17 times.
|
17 | this->model().getConcreteModelObjects<ZoneHVACPackagedTerminalAirConditioner>(); |
| 180 | |||
| 181 |
2/2✓ Branch 5 taken 5 times.
✓ Branch 6 taken 12 times.
|
17 | for (const auto& zoneHVACPackagedTerminalAirConditioner : zoneHVACPackagedTerminalAirConditioners) { |
| 182 |
3/4✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 8 taken 5 times.
✗ Branch 9 not taken.
|
10 | if (boost::optional<HVACComponent> coil = zoneHVACPackagedTerminalAirConditioner.coolingCoil()) { |
| 183 |
5/6✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✓ Branch 10 taken 5 times.
✓ Branch 12 taken 5 times.
✗ Branch 13 not taken.
|
5 | if (coil->handle() == this->handle()) { |
| 184 |
1/1✓ Branch 1 taken 5 times.
|
5 | return zoneHVACPackagedTerminalAirConditioner; |
| 185 | } | ||
| 186 | 5 | } | |
| 187 | } | ||
| 188 | |||
| 189 | // ZoneHVACPackagedTerminalHeatPump | ||
| 190 | |||
| 191 | std::vector<ZoneHVACPackagedTerminalHeatPump> zoneHVACPackagedTerminalHeatPumps = | ||
| 192 |
2/2✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
|
12 | this->model().getConcreteModelObjects<ZoneHVACPackagedTerminalHeatPump>(); |
| 193 | |||
| 194 |
2/2✓ Branch 5 taken 4 times.
✓ Branch 6 taken 8 times.
|
12 | for (const auto& zoneHVACPackagedTerminalHeatPump : zoneHVACPackagedTerminalHeatPumps) { |
| 195 |
3/4✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 8 taken 4 times.
✗ Branch 9 not taken.
|
8 | if (boost::optional<HVACComponent> coil = zoneHVACPackagedTerminalHeatPump.coolingCoil()) { |
| 196 |
5/6✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 12 taken 4 times.
✗ Branch 13 not taken.
|
4 | if (coil->handle() == this->handle()) { |
| 197 |
1/1✓ Branch 1 taken 4 times.
|
4 | return zoneHVACPackagedTerminalHeatPump; |
| 198 | } | ||
| 199 | 4 | } | |
| 200 | } | ||
| 201 | |||
| 202 | 8 | return boost::none; | |
| 203 | 17 | } | |
| 204 | |||
| 205 | 5 | bool CoilCoolingDX_Impl::addToNode(Node& node) { | |
| 206 |
3/3✓ Branch 1 taken 5 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 2 times.
|
10 | if (boost::optional<AirLoopHVAC> airLoop = node.airLoopHVAC()) { |
| 207 |
5/5✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 11 taken 2 times.
✓ Branch 12 taken 1 time.
|
3 | if (!airLoop->demandComponent(node.handle())) { |
| 208 | // TODO: JM 2019-03-12 I'm not sure we shouldn't just restrict to ANY containingHVACComponent (disallow if part of a UnitarySystem) | ||
| 209 |
1/1✓ Branch 1 taken 2 times.
|
2 | auto t_containingHVACComponent = containingHVACComponent(); |
| 210 |
3/12✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
✗ Branch 7 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 16 taken 2 times.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
|
4 | if (t_containingHVACComponent && t_containingHVACComponent->optionalCast<CoilSystemCoolingDXHeatExchangerAssisted>()) { |
| 211 | ✗ | LOG(Warn, | |
| 212 | this->briefDescription() << " cannot be connected directly when it's part of a parent CoilSystemCoolingDXHeatExchangerAssisted. " | ||
| 213 | "Please call CoilSystemCoolingDXHeatExchangerAssisted::addToNode instead"); | ||
| 214 | } else { | ||
| 215 |
1/1✓ Branch 1 taken 2 times.
|
2 | return StraightComponent_Impl::addToNode(node); |
| 216 | } | ||
| 217 | 2 | } | |
| 218 |
2/3✓ Branch 1 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
|
4 | } else if (boost::optional<AirLoopHVACOutdoorAirSystem> oas = node.airLoopHVACOutdoorAirSystem()) { |
| 219 | ✗ | if (oas->airLoopHVACDedicatedOutdoorAirSystem()) { | |
| 220 | ✗ | return StraightComponent_Impl::addToNode(node); | |
| 221 | } | ||
| 222 | 7 | } | |
| 223 | |||
| 224 | 3 | return false; | |
| 225 | } | ||
| 226 | |||
| 227 | 21 | boost::optional<Schedule> CoilCoolingDX_Impl::optionalAvailabilitySchedule() const { | |
| 228 |
2/2✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
|
21 | return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_Coil_Cooling_DXFields::AvailabilitySchedule); |
| 229 | } | ||
| 230 | |||
| 231 | 21 | Schedule CoilCoolingDX_Impl::availabilitySchedule() const { | |
| 232 |
1/1✓ Branch 1 taken 21 times.
|
21 | boost::optional<Schedule> value = optionalAvailabilitySchedule(); |
| 233 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 21 times.
|
21 | if (!value) { |
| 234 | // it is an error if we get here, however we don't want to crash | ||
| 235 | // so we hook up to global always on schedule | ||
| 236 | ✗ | LOG(Error, "Required availability schedule not set, using 'Always On' schedule"); | |
| 237 | ✗ | value = this->model().alwaysOnDiscreteSchedule(); | |
| 238 | ✗ | OS_ASSERT(value); | |
| 239 | ✗ | const_cast<CoilCoolingDX_Impl*>(this)->setAvailabilitySchedule(*value); | |
| 240 | ✗ | value = optionalAvailabilitySchedule(); | |
| 241 | } | ||
| 242 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 21 times.
✗ Branch 4 not taken.
|
21 | OS_ASSERT(value); |
| 243 |
2/2✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
|
42 | return value.get(); |
| 244 | 21 | } | |
| 245 | |||
| 246 | 21 | boost::optional<ThermalZone> CoilCoolingDX_Impl::condenserZone() const { | |
| 247 |
2/2✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
|
21 | return getObject<ModelObject>().getModelObjectTarget<ThermalZone>(OS_Coil_Cooling_DXFields::CondenserZone); |
| 248 | } | ||
| 249 | |||
| 250 | 48 | boost::optional<CoilCoolingDXCurveFitPerformance> CoilCoolingDX_Impl::optionalPerformanceObject() const { | |
| 251 |
2/2✓ Branch 1 taken 48 times.
✓ Branch 4 taken 48 times.
|
48 | return getObject<ModelObject>().getModelObjectTarget<CoilCoolingDXCurveFitPerformance>(OS_Coil_Cooling_DXFields::PerformanceObject); |
| 252 | } | ||
| 253 | |||
| 254 | 48 | CoilCoolingDXCurveFitPerformance CoilCoolingDX_Impl::performanceObject() const { | |
| 255 |
1/1✓ Branch 1 taken 48 times.
|
48 | boost::optional<CoilCoolingDXCurveFitPerformance> value = optionalPerformanceObject(); |
| 256 |
1/2✗ Branch 1 not taken.
✓ Branch 2 taken 48 times.
|
48 | if (!value) { |
| 257 | ✗ | LOG_AND_THROW(briefDescription() << " does not have an Performance Object attached."); | |
| 258 | } | ||
| 259 |
2/2✓ Branch 1 taken 48 times.
✓ Branch 4 taken 48 times.
|
96 | return value.get(); |
| 260 | 48 | } | |
| 261 | |||
| 262 | // boost::optional<std::string> CoilCoolingDX_Impl::condensateCollectionWaterStorageTankName() const { | ||
| 263 | // return getString(OS_Coil_Cooling_DXFields::CondensateCollectionWaterStorageTankName,true); | ||
| 264 | // } | ||
| 265 | |||
| 266 | // boost::optional<std::string> CoilCoolingDX_Impl::evaporativeCondenserSupplyWaterStorageTankName() const { | ||
| 267 | // return getString(OS_Coil_Cooling_DXFields::EvaporativeCondenserSupplyWaterStorageTankName,true); | ||
| 268 | // } | ||
| 269 | |||
| 270 | 25 | bool CoilCoolingDX_Impl::setAvailabilitySchedule(Schedule& schedule) { | |
| 271 |
3/3✓ Branch 1 taken 25 times.
✓ Branch 4 taken 25 times.
✓ Branch 7 taken 25 times.
|
100 | bool result = setSchedule(OS_Coil_Cooling_DXFields::AvailabilitySchedule, "CoilCoolingDX", "Availability Schedule", schedule); |
| 272 | 25 | return result; | |
| 273 | } | ||
| 274 | |||
| 275 | 1 | bool CoilCoolingDX_Impl::setCondenserZone(const ThermalZone& thermalZone) { | |
| 276 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
1 | bool result = setPointer(OS_Coil_Cooling_DXFields::CondenserZone, thermalZone.handle()); |
| 277 | 1 | return result; | |
| 278 | } | ||
| 279 | |||
| 280 | 1 | void CoilCoolingDX_Impl::resetCondenserZone() { | |
| 281 |
2/2✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
|
2 | bool result = setString(OS_Coil_Cooling_DXFields::CondenserZone, ""); |
| 282 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | OS_ASSERT(result); |
| 283 | 1 | } | |
| 284 | |||
| 285 | //boost::optional<std::string> CoilCoolingDX_Impl::condenserInletNodeName() const { | ||
| 286 | //return getString(OS_Coil_Cooling_DXFields::CondenserInletNodeName, false, true); | ||
| 287 | //} | ||
| 288 | |||
| 289 | //bool CoilCoolingDX_Impl::setCondenserInletNodeName(const std::string& condenserInletNodeName) { | ||
| 290 | //bool result = setString(OS_Coil_Cooling_DXFields::CondenserInletNodeName, condenserInletNodeName); | ||
| 291 | //return result; | ||
| 292 | //} | ||
| 293 | |||
| 294 | //void CoilCoolingDX_Impl::resetCondenserInletNodeName() { | ||
| 295 | //bool result = setString(OS_Coil_Cooling_DXFields::CondenserInletNodeName, ""); | ||
| 296 | //OS_ASSERT(result); | ||
| 297 | //} | ||
| 298 | |||
| 299 | //boost::optional<std::string> CoilCoolingDX_Impl::condenserOutletNodeName() const { | ||
| 300 | //return getString(OS_Coil_Cooling_DXFields::CondenserOutletNodeName, false, true); | ||
| 301 | //} | ||
| 302 | |||
| 303 | //bool CoilCoolingDX_Impl::setCondenserOutletNodeName(const std::string& condenserOutletNodeName) { | ||
| 304 | //bool result = setString(OS_Coil_Cooling_DXFields::CondenserOutletNodeName, condenserOutletNodeName); | ||
| 305 | //return result; | ||
| 306 | //} | ||
| 307 | |||
| 308 | //void CoilCoolingDX_Impl::resetCondenserOutletNodeName() { | ||
| 309 | //bool result = setString(OS_Coil_Cooling_DXFields::CondenserOutletNodeName, ""); | ||
| 310 | //OS_ASSERT(result); | ||
| 311 | //} | ||
| 312 | |||
| 313 | 28 | bool CoilCoolingDX_Impl::setPerformanceObject(const CoilCoolingDXCurveFitPerformance& coilCoolingDXCurveFitPerformance) { | |
| 314 |
2/2✓ Branch 1 taken 28 times.
✓ Branch 4 taken 28 times.
|
28 | bool result = setPointer(OS_Coil_Cooling_DXFields::PerformanceObject, coilCoolingDXCurveFitPerformance.handle()); |
| 315 | 28 | return result; | |
| 316 | } | ||
| 317 | |||
| 318 | // bool CoilCoolingDX_Impl::setCondensateCollectionWaterStorageTankName(const std::string& condensateCollectionWaterStorageTankName) { | ||
| 319 | // bool result = setString(OS_Coil_Cooling_DXFields::CondensateCollectionWaterStorageTankName, condensateCollectionWaterStorageTankName); | ||
| 320 | // return result; | ||
| 321 | // } | ||
| 322 | |||
| 323 | // void CoilCoolingDX_Impl::resetCondensateCollectionWaterStorageTankName() { | ||
| 324 | // bool result = setString(OS_Coil_Cooling_DXFields::CondensateCollectionWaterStorageTankName, ""); | ||
| 325 | // OS_ASSERT(result); | ||
| 326 | // } | ||
| 327 | |||
| 328 | // bool CoilCoolingDX_Impl::setEvaporativeCondenserSupplyWaterStorageTankName(const std::string& evaporativeCondenserSupplyWaterStorageTankName) { | ||
| 329 | // bool result = setString(OS_Coil_Cooling_DXFields::EvaporativeCondenserSupplyWaterStorageTankName, evaporativeCondenserSupplyWaterStorageTankName); | ||
| 330 | // return result; | ||
| 331 | // } | ||
| 332 | |||
| 333 | // void CoilCoolingDX_Impl::resetEvaporativeCondenserSupplyWaterStorageTankName() { | ||
| 334 | // bool result = setString(OS_Coil_Cooling_DXFields::EvaporativeCondenserSupplyWaterStorageTankName, ""); | ||
| 335 | // OS_ASSERT(result); | ||
| 336 | // } | ||
| 337 | |||
| 338 | ✗ | ComponentType CoilCoolingDX_Impl::componentType() const { | |
| 339 | ✗ | return ComponentType::Cooling; | |
| 340 | } | ||
| 341 | |||
| 342 | ✗ | std::vector<FuelType> CoilCoolingDX_Impl::coolingFuelTypes() const { | |
| 343 | ✗ | return {FuelType::Electricity}; | |
| 344 | } | ||
| 345 | |||
| 346 | ✗ | std::vector<FuelType> CoilCoolingDX_Impl::heatingFuelTypes() const { | |
| 347 | ✗ | return {}; | |
| 348 | } | ||
| 349 | |||
| 350 | ✗ | std::vector<AppGFuelType> CoilCoolingDX_Impl::appGHeatingFuelTypes() const { | |
| 351 | ✗ | return {}; | |
| 352 | } | ||
| 353 | |||
| 354 | } // namespace detail | ||
| 355 | |||
| 356 | 24 | CoilCoolingDX::CoilCoolingDX(const Model& model, const CoilCoolingDXCurveFitPerformance& coilCoolingDXCurveFitPerformance) | |
| 357 | 24 | : StraightComponent(CoilCoolingDX::iddObjectType(), model) { | |
| 358 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 24 times.
✗ Branch 5 not taken.
|
24 | OS_ASSERT(getImpl<detail::CoilCoolingDX_Impl>()); |
| 359 | |||
| 360 |
1/1✓ Branch 1 taken 24 times.
|
24 | auto always_on = model.alwaysOnDiscreteSchedule(); |
| 361 |
1/1✓ Branch 1 taken 24 times.
|
24 | bool ok = setAvailabilitySchedule(always_on); |
| 362 |
1/3✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
✗ Branch 3 not taken.
|
24 | OS_ASSERT(ok); |
| 363 |
1/1✓ Branch 1 taken 24 times.
|
24 | ok = setPerformanceObject(coilCoolingDXCurveFitPerformance); |
| 364 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 24 times.
|
24 | if (!ok) { |
| 365 | ✗ | remove(); | |
| 366 | ✗ | LOG_AND_THROW("Unable to set " << briefDescription() << "'s coilCoolingDXCurveFitPerformance to " | |
| 367 | << coilCoolingDXCurveFitPerformance.briefDescription() << "."); | ||
| 368 | } | ||
| 369 | 24 | } | |
| 370 | |||
| 371 | 7715 | IddObjectType CoilCoolingDX::iddObjectType() { | |
| 372 |
1/1✓ Branch 1 taken 7715 times.
|
7715 | return {IddObjectType::OS_Coil_Cooling_DX}; |
| 373 | } | ||
| 374 | |||
| 375 | 21 | Schedule CoilCoolingDX::availabilitySchedule() const { | |
| 376 |
1/1✓ Branch 3 taken 21 times.
|
21 | return getImpl<detail::CoilCoolingDX_Impl>()->availabilitySchedule(); |
| 377 | } | ||
| 378 | |||
| 379 | 21 | boost::optional<ThermalZone> CoilCoolingDX::condenserZone() const { | |
| 380 |
1/1✓ Branch 3 taken 21 times.
|
21 | return getImpl<detail::CoilCoolingDX_Impl>()->condenserZone(); |
| 381 | } | ||
| 382 | |||
| 383 | 31 | CoilCoolingDXCurveFitPerformance CoilCoolingDX::performanceObject() const { | |
| 384 |
1/1✓ Branch 3 taken 31 times.
|
31 | return getImpl<detail::CoilCoolingDX_Impl>()->performanceObject(); |
| 385 | } | ||
| 386 | |||
| 387 | 25 | bool CoilCoolingDX::setAvailabilitySchedule(Schedule& schedule) { | |
| 388 |
1/1✓ Branch 3 taken 25 times.
|
25 | return getImpl<detail::CoilCoolingDX_Impl>()->setAvailabilitySchedule(schedule); |
| 389 | } | ||
| 390 | |||
| 391 | 1 | bool CoilCoolingDX::setCondenserZone(const ThermalZone& thermalZone) { | |
| 392 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::CoilCoolingDX_Impl>()->setCondenserZone(thermalZone); |
| 393 | } | ||
| 394 | |||
| 395 | 1 | void CoilCoolingDX::resetCondenserZone() { | |
| 396 |
1/1✓ Branch 3 taken 1 time.
|
1 | getImpl<detail::CoilCoolingDX_Impl>()->resetCondenserZone(); |
| 397 | 1 | } | |
| 398 | |||
| 399 | 28 | bool CoilCoolingDX::setPerformanceObject(const CoilCoolingDXCurveFitPerformance& coilCoolingDXCurveFitPerformance) { | |
| 400 |
1/1✓ Branch 3 taken 28 times.
|
28 | return getImpl<detail::CoilCoolingDX_Impl>()->setPerformanceObject(coilCoolingDXCurveFitPerformance); |
| 401 | } | ||
| 402 | |||
| 403 | ✗ | AirflowNetworkEquivalentDuct CoilCoolingDX::getAirflowNetworkEquivalentDuct(double length, double diameter) { | |
| 404 | ✗ | return getImpl<detail::CoilCoolingDX_Impl>()->getAirflowNetworkEquivalentDuct(length, diameter); | |
| 405 | } | ||
| 406 | |||
| 407 | ✗ | boost::optional<AirflowNetworkEquivalentDuct> CoilCoolingDX::airflowNetworkEquivalentDuct() const { | |
| 408 | ✗ | return getImpl<detail::CoilCoolingDX_Impl>()->airflowNetworkEquivalentDuct(); | |
| 409 | } | ||
| 410 | |||
| 411 | //boost::optional<std::string> CoilCoolingDX::condenserInletNodeName() const { | ||
| 412 | //return getImpl<detail::CoilCoolingDX_Impl>()->condenserInletNodeName(); | ||
| 413 | //} | ||
| 414 | |||
| 415 | //bool CoilCoolingDX::setCondenserInletNodeName(const std::string& condenserInletNodeName) { | ||
| 416 | //return getImpl<detail::CoilCoolingDX_Impl>()->setCondenserInletNodeName(condenserInletNodeName); | ||
| 417 | //} | ||
| 418 | |||
| 419 | //void CoilCoolingDX::resetCondenserInletNodeName() { | ||
| 420 | //getImpl<detail::CoilCoolingDX_Impl>()->resetCondenserInletNodeName(); | ||
| 421 | //} | ||
| 422 | |||
| 423 | //bool CoilCoolingDX::setCondenserOutletNodeName(const std::string& condenserOutletNodeName) { | ||
| 424 | //return getImpl<detail::CoilCoolingDX_Impl>()->setCondenserOutletNodeName(condenserOutletNodeName); | ||
| 425 | //} | ||
| 426 | |||
| 427 | //boost::optional<std::string> CoilCoolingDX::condenserOutletNodeName() const { | ||
| 428 | //return getImpl<detail::CoilCoolingDX_Impl>()->condenserOutletNodeName(); | ||
| 429 | //} | ||
| 430 | |||
| 431 | //void CoilCoolingDX::resetCondenserOutletNodeName() { | ||
| 432 | //getImpl<detail::CoilCoolingDX_Impl>()->resetCondenserOutletNodeName(); | ||
| 433 | //} | ||
| 434 | |||
| 435 | // boost::optional<std::string> CoilCoolingDX::condensateCollectionWaterStorageTankName() const { | ||
| 436 | // return getImpl<detail::CoilCoolingDX_Impl>()->condensateCollectionWaterStorageTankName(); | ||
| 437 | // } | ||
| 438 | // | ||
| 439 | // bool CoilCoolingDX::setCondensateCollectionWaterStorageTankName(const std::string& condensateCollectionWaterStorageTankName) { | ||
| 440 | // return getImpl<detail::CoilCoolingDX_Impl>()->setCondensateCollectionWaterStorageTankName(condensateCollectionWaterStorageTankName); | ||
| 441 | // } | ||
| 442 | // | ||
| 443 | // void CoilCoolingDX::resetCondensateCollectionWaterStorageTankName() { | ||
| 444 | // getImpl<detail::CoilCoolingDX_Impl>()->resetCondensateCollectionWaterStorageTankName(); | ||
| 445 | // } | ||
| 446 | // | ||
| 447 | // boost::optional<std::string> CoilCoolingDX::evaporativeCondenserSupplyWaterStorageTankName() const { | ||
| 448 | // return getImpl<detail::CoilCoolingDX_Impl>()->evaporativeCondenserSupplyWaterStorageTankName(); | ||
| 449 | // } | ||
| 450 | // | ||
| 451 | // bool CoilCoolingDX::setEvaporativeCondenserSupplyWaterStorageTankName(const std::string& evaporativeCondenserSupplyWaterStorageTankName) { | ||
| 452 | // return getImpl<detail::CoilCoolingDX_Impl>()->setEvaporativeCondenserSupplyWaterStorageTankName(evaporativeCondenserSupplyWaterStorageTankName); | ||
| 453 | // } | ||
| 454 | // | ||
| 455 | // void CoilCoolingDX::resetEvaporativeCondenserSupplyWaterStorageTankName() { | ||
| 456 | // getImpl<detail::CoilCoolingDX_Impl>()->resetEvaporativeCondenserSupplyWaterStorageTankName(); | ||
| 457 | // } | ||
| 458 | |||
| 459 | /// @cond | ||
| 460 |
1/1✓ Branch 2 taken 37 times.
|
37 | CoilCoolingDX::CoilCoolingDX(std::shared_ptr<detail::CoilCoolingDX_Impl> impl) : StraightComponent(impl) {} |
| 461 | /// @endcond | ||
| 462 | |||
| 463 | } // namespace model | ||
| 464 | } // namespace openstudio | ||
| 465 |