src/model/FanZoneExhaust.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 "FanZoneExhaust.hpp" | ||
| 7 | #include "FanZoneExhaust_Impl.hpp" | ||
| 8 | |||
| 9 | #include "ThermalZone.hpp" | ||
| 10 | #include "ThermalZone_Impl.hpp" | ||
| 11 | #include "Node.hpp" | ||
| 12 | #include "Node_Impl.hpp" | ||
| 13 | #include "PortList.hpp" | ||
| 14 | #include "PortList_Impl.hpp" | ||
| 15 | #include "AirflowNetworkZoneExhaustFan.hpp" | ||
| 16 | #include "AirflowNetworkZoneExhaustFan_Impl.hpp" | ||
| 17 | #include "AirflowNetworkCrack.hpp" | ||
| 18 | #include "AirflowNetworkCrack_Impl.hpp" | ||
| 19 | |||
| 20 | #include "Model.hpp" | ||
| 21 | #include "Model_Impl.hpp" | ||
| 22 | |||
| 23 | #include "Schedule.hpp" | ||
| 24 | #include "Schedule_Impl.hpp" | ||
| 25 | |||
| 26 | #include <utilities/idd/IddFactory.hxx> | ||
| 27 | |||
| 28 | #include <utilities/idd/OS_Fan_ZoneExhaust_FieldEnums.hxx> | ||
| 29 | #include <utilities/idd/IddEnums.hxx> | ||
| 30 | |||
| 31 | #include "../utilities/core/Assert.hpp" | ||
| 32 | #include "../utilities/data/DataEnums.hpp" | ||
| 33 | |||
| 34 | namespace openstudio { | ||
| 35 | namespace model { | ||
| 36 | |||
| 37 | namespace detail { | ||
| 38 | |||
| 39 | 4 | FanZoneExhaust_Impl::FanZoneExhaust_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 40 | 4 | : ZoneHVACComponent_Impl(idfObject, model, keepHandle) { | |
| 41 |
4/6✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 4 times.
✗ Branch 13 not taken.
|
4 | OS_ASSERT(idfObject.iddObject().type() == FanZoneExhaust::iddObjectType()); |
| 42 | 4 | } | |
| 43 | |||
| 44 | ✗ | FanZoneExhaust_Impl::FanZoneExhaust_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 45 | ✗ | : ZoneHVACComponent_Impl(other, model, keepHandle) { | |
| 46 | ✗ | OS_ASSERT(other.iddObject().type() == FanZoneExhaust::iddObjectType()); | |
| 47 | ✗ | } | |
| 48 | |||
| 49 | 2 | FanZoneExhaust_Impl::FanZoneExhaust_Impl(const FanZoneExhaust_Impl& other, Model_Impl* model, bool keepHandle) | |
| 50 | 2 | : ZoneHVACComponent_Impl(other, model, keepHandle) {} | |
| 51 | |||
| 52 | ✗ | const std::vector<std::string>& FanZoneExhaust_Impl::outputVariableNames() const { | |
| 53 | static const std::vector<std::string> results{ | ||
| 54 | "Fan Electricity Rate", "Fan Rise in Air Temperature", "Fan Heat Gain to Air", "Fan Electricity Energy", | ||
| 55 | ✗ | "Fan Air Mass Flow Rate", "Fan Unbalanced Air Mass Flow Rate", "Fan Balanced Air Mass Flow Rate"}; | |
| 56 | ✗ | return results; | |
| 57 | ✗ | } | |
| 58 | |||
| 59 | 8 | IddObjectType FanZoneExhaust_Impl::iddObjectType() const { | |
| 60 | 8 | return FanZoneExhaust::iddObjectType(); | |
| 61 | } | ||
| 62 | |||
| 63 | 2 | std::vector<ModelObject> FanZoneExhaust_Impl::children() const { | |
| 64 | 2 | std::vector<ModelObject> result; | |
| 65 | std::vector<AirflowNetworkZoneExhaustFan> myAFNItems = | ||
| 66 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | getObject<ModelObject>().getModelObjectSources<AirflowNetworkZoneExhaustFan>(AirflowNetworkZoneExhaustFan::iddObjectType()); |
| 67 |
1/1✓ Branch 5 taken 2 times.
|
2 | result.insert(result.end(), myAFNItems.begin(), myAFNItems.end()); |
| 68 | 4 | return result; | |
| 69 | 2 | } | |
| 70 | |||
| 71 | ✗ | std::vector<ScheduleTypeKey> FanZoneExhaust_Impl::getScheduleTypeKeys(const Schedule& schedule) const { | |
| 72 | ✗ | std::vector<ScheduleTypeKey> result; | |
| 73 | ✗ | UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); | |
| 74 | ✗ | UnsignedVector::const_iterator b(fieldIndices.begin()); | |
| 75 | ✗ | UnsignedVector::const_iterator e(fieldIndices.end()); | |
| 76 | ✗ | if (std::find(b, e, OS_Fan_ZoneExhaustFields::AvailabilityScheduleName) != e) { | |
| 77 | ✗ | result.push_back(ScheduleTypeKey("FanZoneExhaust", "Availability")); | |
| 78 | } | ||
| 79 | ✗ | if (std::find(b, e, OS_Fan_ZoneExhaustFields::FlowFractionScheduleName) != e) { | |
| 80 | ✗ | result.push_back(ScheduleTypeKey("FanZoneExhaust", "Flow Fraction")); | |
| 81 | } | ||
| 82 | ✗ | if (std::find(b, e, OS_Fan_ZoneExhaustFields::MinimumZoneTemperatureLimitScheduleName) != e) { | |
| 83 | ✗ | result.push_back(ScheduleTypeKey("FanZoneExhaust", "Minimum Zone Temperature Limit")); | |
| 84 | } | ||
| 85 | ✗ | if (std::find(b, e, OS_Fan_ZoneExhaustFields::BalancedExhaustFractionScheduleName) != e) { | |
| 86 | ✗ | result.push_back(ScheduleTypeKey("FanZoneExhaust", "Balanced Exhaust Fraction")); | |
| 87 | } | ||
| 88 | ✗ | return result; | |
| 89 | ✗ | } | |
| 90 | |||
| 91 | 6 | boost::optional<ThermalZone> FanZoneExhaust_Impl::thermalZone() const { | |
| 92 | 6 | boost::optional<ThermalZone> result; | |
| 93 | |||
| 94 |
4/4✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 6 taken 3 times.
✓ Branch 7 taken 3 times.
|
12 | if (boost::optional<ModelObject> mo1 = connectedObject(inletPort())) { |
| 95 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 3 times.
✗ Branch 7 not taken.
|
6 | if (boost::optional<Node> node = mo1->optionalCast<Node>()) { |
| 96 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 3 times.
✗ Branch 7 not taken.
|
6 | if (boost::optional<ModelObject> mo2 = node->inletModelObject()) { |
| 97 |
3/4✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 6 taken 3 times.
✗ Branch 7 not taken.
|
6 | if (boost::optional<PortList> pl = mo2->optionalCast<PortList>()) { |
| 98 |
4/5✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 11 taken 3 times.
✗ Branch 12 not taken.
|
6 | if (boost::optional<ThermalZone> tz = pl->thermalZone()) { |
| 99 |
1/1✓ Branch 1 taken 3 times.
|
3 | result = tz; |
| 100 | 3 | } | |
| 101 | 3 | } | |
| 102 | 3 | } | |
| 103 | 3 | } | |
| 104 | 6 | } | |
| 105 | |||
| 106 | 6 | return result; | |
| 107 | ✗ | } | |
| 108 | |||
| 109 | 2 | bool FanZoneExhaust_Impl::addToThermalZone(ThermalZone& thermalZone) { | |
| 110 |
1/1✓ Branch 1 taken 2 times.
|
2 | Model m = this->model(); |
| 111 | |||
| 112 |
3/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
|
2 | if (thermalZone.model() != m) { |
| 113 | ✗ | return false; | |
| 114 | } | ||
| 115 | |||
| 116 |
1/1✓ Branch 1 taken 2 times.
|
2 | removeFromThermalZone(); |
| 117 | |||
| 118 |
1/1✓ Branch 1 taken 2 times.
|
2 | thermalZone.setUseIdealAirLoads(false); |
| 119 | |||
| 120 | // Zone Exhaust Node (Exhaust Fan Inlet node) | ||
| 121 | |||
| 122 |
1/1✓ Branch 1 taken 2 times.
|
2 | Node exhaustNode(m); |
| 123 | |||
| 124 |
1/1✓ Branch 1 taken 2 times.
|
2 | PortList exhaustPortList = thermalZone.exhaustPortList(); |
| 125 | |||
| 126 |
1/1✓ Branch 1 taken 2 times.
|
2 | unsigned nextPort = exhaustPortList.nextPort(); |
| 127 | |||
| 128 |
4/4✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
|
2 | m.connect(exhaustPortList, nextPort, exhaustNode, exhaustNode.inletPort()); |
| 129 | |||
| 130 |
1/1✓ Branch 1 taken 2 times.
|
2 | auto mo = this->getObject<ModelObject>(); |
| 131 | |||
| 132 |
5/5✓ 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.
|
2 | m.connect(exhaustNode, exhaustNode.outletPort(), mo, this->inletPort()); |
| 133 | |||
| 134 | // Node (Exhaust Fan Outlet Node) | ||
| 135 | |||
| 136 |
1/1✓ Branch 1 taken 2 times.
|
2 | Node exhaustFanOutletNode(m); |
| 137 | |||
| 138 |
5/5✓ 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.
|
2 | m.connect(mo, this->outletPort(), exhaustFanOutletNode, exhaustFanOutletNode.inletPort()); |
| 139 | |||
| 140 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | thermalZone.addEquipment(this->getObject<ZoneHVACComponent>()); |
| 141 | |||
| 142 | 2 | return true; | |
| 143 | 2 | } | |
| 144 | |||
| 145 | 2 | boost::optional<Schedule> FanZoneExhaust_Impl::availabilitySchedule() const { | |
| 146 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_Fan_ZoneExhaustFields::AvailabilityScheduleName); |
| 147 | } | ||
| 148 | |||
| 149 | 2 | double FanZoneExhaust_Impl::fanTotalEfficiency() const { | |
| 150 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<double> value = getDouble(OS_Fan_ZoneExhaustFields::FanTotalEfficiency, true); |
| 151 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
|
2 | OS_ASSERT(value); |
| 152 |
1/1✓ Branch 1 taken 2 times.
|
4 | return value.get(); |
| 153 | } | ||
| 154 | |||
| 155 | 2 | double FanZoneExhaust_Impl::pressureRise() const { | |
| 156 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<double> value = getDouble(OS_Fan_ZoneExhaustFields::PressureRise, true); |
| 157 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
|
2 | OS_ASSERT(value); |
| 158 |
1/1✓ Branch 1 taken 2 times.
|
4 | return value.get(); |
| 159 | } | ||
| 160 | |||
| 161 | 2 | boost::optional<double> FanZoneExhaust_Impl::maximumFlowRate() const { | |
| 162 | 2 | return getDouble(OS_Fan_ZoneExhaustFields::MaximumFlowRate, true); | |
| 163 | } | ||
| 164 | |||
| 165 | 19 | unsigned FanZoneExhaust_Impl::inletPort() const { | |
| 166 | 19 | return OS_Fan_ZoneExhaustFields::AirInletNodeName; | |
| 167 | } | ||
| 168 | |||
| 169 | 8 | unsigned FanZoneExhaust_Impl::outletPort() const { | |
| 170 | 8 | return OS_Fan_ZoneExhaustFields::AirOutletNodeName; | |
| 171 | } | ||
| 172 | |||
| 173 | 2 | std::string FanZoneExhaust_Impl::endUseSubcategory() const { | |
| 174 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<std::string> value = getString(OS_Fan_ZoneExhaustFields::EndUseSubcategory, true); |
| 175 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
|
2 | OS_ASSERT(value); |
| 176 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | return value.get(); |
| 177 | 2 | } | |
| 178 | |||
| 179 | 2 | boost::optional<Schedule> FanZoneExhaust_Impl::flowFractionSchedule() const { | |
| 180 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_Fan_ZoneExhaustFields::FlowFractionScheduleName); |
| 181 | } | ||
| 182 | |||
| 183 | 2 | std::string FanZoneExhaust_Impl::systemAvailabilityManagerCouplingMode() const { | |
| 184 |
1/1✓ Branch 1 taken 2 times.
|
2 | boost::optional<std::string> value = getString(OS_Fan_ZoneExhaustFields::SystemAvailabilityManagerCouplingMode, true); |
| 185 |
1/3✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
|
2 | OS_ASSERT(value); |
| 186 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
4 | return value.get(); |
| 187 | 2 | } | |
| 188 | |||
| 189 | 2 | boost::optional<Schedule> FanZoneExhaust_Impl::minimumZoneTemperatureLimitSchedule() const { | |
| 190 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_Fan_ZoneExhaustFields::MinimumZoneTemperatureLimitScheduleName); |
| 191 | } | ||
| 192 | |||
| 193 | 2 | boost::optional<Schedule> FanZoneExhaust_Impl::balancedExhaustFractionSchedule() const { | |
| 194 |
2/2✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
|
2 | return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_Fan_ZoneExhaustFields::BalancedExhaustFractionScheduleName); |
| 195 | } | ||
| 196 | |||
| 197 | ✗ | bool FanZoneExhaust_Impl::setAvailabilitySchedule(Schedule& schedule) { | |
| 198 | ✗ | bool result = setSchedule(OS_Fan_ZoneExhaustFields::AvailabilityScheduleName, "FanZoneExhaust", "Availability", schedule); | |
| 199 | ✗ | return result; | |
| 200 | } | ||
| 201 | |||
| 202 | ✗ | void FanZoneExhaust_Impl::resetAvailabilitySchedule() { | |
| 203 | ✗ | bool result = setString(OS_Fan_ZoneExhaustFields::AvailabilityScheduleName, ""); | |
| 204 | ✗ | OS_ASSERT(result); | |
| 205 | ✗ | } | |
| 206 | |||
| 207 | 4 | bool FanZoneExhaust_Impl::setFanTotalEfficiency(double fanTotalEfficiency) { | |
| 208 | 4 | bool result = setDouble(OS_Fan_ZoneExhaustFields::FanTotalEfficiency, fanTotalEfficiency); | |
| 209 | 4 | return result; | |
| 210 | } | ||
| 211 | |||
| 212 | 4 | bool FanZoneExhaust_Impl::setPressureRise(double pressureRise) { | |
| 213 | 4 | bool result = setDouble(OS_Fan_ZoneExhaustFields::PressureRise, pressureRise); | |
| 214 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
4 | OS_ASSERT(result); |
| 215 | 4 | return result; | |
| 216 | } | ||
| 217 | |||
| 218 | ✗ | bool FanZoneExhaust_Impl::setMaximumFlowRate(boost::optional<double> maximumFlowRate) { | |
| 219 | ✗ | bool result(false); | |
| 220 | ✗ | if (maximumFlowRate) { | |
| 221 | ✗ | result = setDouble(OS_Fan_ZoneExhaustFields::MaximumFlowRate, maximumFlowRate.get()); | |
| 222 | } else { | ||
| 223 | ✗ | resetMaximumFlowRate(); | |
| 224 | ✗ | result = true; | |
| 225 | } | ||
| 226 | ✗ | return result; | |
| 227 | } | ||
| 228 | |||
| 229 | ✗ | void FanZoneExhaust_Impl::resetMaximumFlowRate() { | |
| 230 | ✗ | bool result = setString(OS_Fan_ZoneExhaustFields::MaximumFlowRate, ""); | |
| 231 | ✗ | OS_ASSERT(result); | |
| 232 | ✗ | } | |
| 233 | |||
| 234 | 4 | bool FanZoneExhaust_Impl::setEndUseSubcategory(const std::string& endUseSubcategory) { | |
| 235 | 4 | bool result = setString(OS_Fan_ZoneExhaustFields::EndUseSubcategory, endUseSubcategory); | |
| 236 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
4 | OS_ASSERT(result); |
| 237 | 4 | return result; | |
| 238 | } | ||
| 239 | |||
| 240 | ✗ | bool FanZoneExhaust_Impl::setFlowFractionSchedule(Schedule& schedule) { | |
| 241 | ✗ | bool result = setSchedule(OS_Fan_ZoneExhaustFields::FlowFractionScheduleName, "FanZoneExhaust", "Flow Fraction", schedule); | |
| 242 | ✗ | return result; | |
| 243 | } | ||
| 244 | |||
| 245 | ✗ | void FanZoneExhaust_Impl::resetFlowFractionSchedule() { | |
| 246 | ✗ | bool result = setString(OS_Fan_ZoneExhaustFields::FlowFractionScheduleName, ""); | |
| 247 | ✗ | OS_ASSERT(result); | |
| 248 | ✗ | } | |
| 249 | |||
| 250 | 4 | bool FanZoneExhaust_Impl::setSystemAvailabilityManagerCouplingMode(const std::string& systemAvailabilityManagerCouplingMode) { | |
| 251 | 4 | bool result = setString(OS_Fan_ZoneExhaustFields::SystemAvailabilityManagerCouplingMode, systemAvailabilityManagerCouplingMode); | |
| 252 | 4 | return result; | |
| 253 | } | ||
| 254 | |||
| 255 | ✗ | bool FanZoneExhaust_Impl::setMinimumZoneTemperatureLimitSchedule(Schedule& schedule) { | |
| 256 | bool result = | ||
| 257 | ✗ | setSchedule(OS_Fan_ZoneExhaustFields::MinimumZoneTemperatureLimitScheduleName, "FanZoneExhaust", "Minimum Zone Temperature Limit", schedule); | |
| 258 | ✗ | return result; | |
| 259 | } | ||
| 260 | |||
| 261 | ✗ | void FanZoneExhaust_Impl::resetMinimumZoneTemperatureLimitSchedule() { | |
| 262 | ✗ | bool result = setString(OS_Fan_ZoneExhaustFields::MinimumZoneTemperatureLimitScheduleName, ""); | |
| 263 | ✗ | OS_ASSERT(result); | |
| 264 | ✗ | } | |
| 265 | |||
| 266 | ✗ | bool FanZoneExhaust_Impl::setBalancedExhaustFractionSchedule(Schedule& schedule) { | |
| 267 | bool result = | ||
| 268 | ✗ | setSchedule(OS_Fan_ZoneExhaustFields::BalancedExhaustFractionScheduleName, "FanZoneExhaust", "Balanced Exhaust Fraction", schedule); | |
| 269 | ✗ | return result; | |
| 270 | } | ||
| 271 | |||
| 272 | ✗ | void FanZoneExhaust_Impl::resetBalancedExhaustFractionSchedule() { | |
| 273 | ✗ | bool result = setString(OS_Fan_ZoneExhaustFields::BalancedExhaustFractionScheduleName, ""); | |
| 274 | ✗ | OS_ASSERT(result); | |
| 275 | ✗ | } | |
| 276 | |||
| 277 | ✗ | std::vector<EMSActuatorNames> FanZoneExhaust_Impl::emsActuatorNames() const { | |
| 278 | std::vector<EMSActuatorNames> actuators{ | ||
| 279 | ✗ | {"Fan", "Fan Air Mass Flow Rate"}, {"Fan", "Fan Pressure Rise"}, {"Fan", "Fan Total Efficiency"}, {"Fan", "Fan Autosized Air Flow Rate"}}; | |
| 280 | ✗ | return actuators; | |
| 281 | ✗ | } | |
| 282 | |||
| 283 | ✗ | std::vector<std::string> FanZoneExhaust_Impl::emsInternalVariableNames() const { | |
| 284 | ✗ | std::vector<std::string> types{"Fan Maximum Mass Flow Rate", "Fan Nominal Pressure Rise", "Fan Nominal Total Efficiency"}; | |
| 285 | ✗ | return types; | |
| 286 | ✗ | } | |
| 287 | |||
| 288 | 1 | AirflowNetworkZoneExhaustFan FanZoneExhaust_Impl::getAirflowNetworkZoneExhaustFan(const AirflowNetworkCrack& crack) { | |
| 289 |
1/1✓ Branch 1 taken 1 time.
|
1 | boost::optional<AirflowNetworkZoneExhaustFan> opt = airflowNetworkZoneExhaustFan(); |
| 290 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
|
1 | if (opt) { |
| 291 | ✗ | boost::optional<AirflowNetworkCrack> oldCrack = opt->crack(); | |
| 292 | ✗ | if (oldCrack) { | |
| 293 | ✗ | if (oldCrack->handle() == crack.handle()) { | |
| 294 | ✗ | return opt.get(); | |
| 295 | } | ||
| 296 | } | ||
| 297 | ✗ | opt->remove(); | |
| 298 | ✗ | } | |
| 299 |
3/3✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
|
1 | return AirflowNetworkZoneExhaustFan(model(), crack, handle()); |
| 300 | 1 | } | |
| 301 | |||
| 302 | 2 | boost::optional<AirflowNetworkZoneExhaustFan> FanZoneExhaust_Impl::airflowNetworkZoneExhaustFan() const { | |
| 303 | std::vector<AirflowNetworkZoneExhaustFan> myAFNItems = | ||
| 304 |
3/3✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
|
2 | getObject<ModelObject>().getModelObjectSources<AirflowNetworkZoneExhaustFan>(AirflowNetworkZoneExhaustFan::iddObjectType()); |
| 305 | 2 | auto count = myAFNItems.size(); | |
| 306 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | if (count == 1) { |
| 307 | ✗ | return myAFNItems[0]; | |
| 308 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | } else if (count > 1) { |
| 309 | ✗ | LOG(Warn, briefDescription() << " has more than one AirflowNetwork ZoneExhaustFan attached, returning first."); | |
| 310 | ✗ | return myAFNItems[0]; | |
| 311 | } | ||
| 312 | 2 | return boost::none; | |
| 313 | 2 | } | |
| 314 | |||
| 315 | ✗ | ComponentType FanZoneExhaust_Impl::componentType() const { | |
| 316 | ✗ | return ComponentType::None; | |
| 317 | } | ||
| 318 | |||
| 319 | ✗ | std::vector<FuelType> FanZoneExhaust_Impl::coolingFuelTypes() const { | |
| 320 | ✗ | return {}; | |
| 321 | } | ||
| 322 | |||
| 323 | ✗ | std::vector<FuelType> FanZoneExhaust_Impl::heatingFuelTypes() const { | |
| 324 | ✗ | return {}; | |
| 325 | } | ||
| 326 | |||
| 327 | ✗ | std::vector<AppGFuelType> FanZoneExhaust_Impl::appGHeatingFuelTypes() const { | |
| 328 | ✗ | return {}; | |
| 329 | } | ||
| 330 | |||
| 331 | } // namespace detail | ||
| 332 | |||
| 333 | 4 | FanZoneExhaust::FanZoneExhaust(const Model& model) : ZoneHVACComponent(FanZoneExhaust::iddObjectType(), model) { | |
| 334 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 4 times.
✗ Branch 5 not taken.
|
4 | OS_ASSERT(getImpl<detail::FanZoneExhaust_Impl>()); |
| 335 | |||
| 336 |
1/1✓ Branch 1 taken 4 times.
|
4 | setFanTotalEfficiency(0.60); |
| 337 |
1/1✓ Branch 1 taken 4 times.
|
4 | setPressureRise(0); |
| 338 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
8 | setEndUseSubcategory("General"); |
| 339 |
2/2✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
|
4 | setSystemAvailabilityManagerCouplingMode("Decoupled"); |
| 340 | 4 | } | |
| 341 | |||
| 342 | 7615 | IddObjectType FanZoneExhaust::iddObjectType() { | |
| 343 |
1/1✓ Branch 1 taken 7615 times.
|
7615 | return {IddObjectType::OS_Fan_ZoneExhaust}; |
| 344 | } | ||
| 345 | |||
| 346 | ✗ | std::vector<std::string> FanZoneExhaust::systemAvailabilityManagerCouplingModeValues() { | |
| 347 | ✗ | return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_Fan_ZoneExhaustFields::SystemAvailabilityManagerCouplingMode); | |
| 348 | } | ||
| 349 | |||
| 350 | 2 | boost::optional<Schedule> FanZoneExhaust::availabilitySchedule() const { | |
| 351 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::FanZoneExhaust_Impl>()->availabilitySchedule(); |
| 352 | } | ||
| 353 | |||
| 354 | ✗ | double FanZoneExhaust::fanTotalEfficiency() const { | |
| 355 | ✗ | return getImpl<detail::FanZoneExhaust_Impl>()->fanTotalEfficiency(); | |
| 356 | } | ||
| 357 | |||
| 358 | 2 | double FanZoneExhaust::fanEfficiency() const { | |
| 359 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::FanZoneExhaust_Impl>()->fanTotalEfficiency(); |
| 360 | } | ||
| 361 | |||
| 362 | 2 | double FanZoneExhaust::pressureRise() const { | |
| 363 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::FanZoneExhaust_Impl>()->pressureRise(); |
| 364 | } | ||
| 365 | |||
| 366 | 2 | boost::optional<double> FanZoneExhaust::maximumFlowRate() const { | |
| 367 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::FanZoneExhaust_Impl>()->maximumFlowRate(); |
| 368 | } | ||
| 369 | |||
| 370 | 2 | std::string FanZoneExhaust::endUseSubcategory() const { | |
| 371 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::FanZoneExhaust_Impl>()->endUseSubcategory(); |
| 372 | } | ||
| 373 | |||
| 374 | 2 | boost::optional<Schedule> FanZoneExhaust::flowFractionSchedule() const { | |
| 375 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::FanZoneExhaust_Impl>()->flowFractionSchedule(); |
| 376 | } | ||
| 377 | |||
| 378 | 2 | std::string FanZoneExhaust::systemAvailabilityManagerCouplingMode() const { | |
| 379 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::FanZoneExhaust_Impl>()->systemAvailabilityManagerCouplingMode(); |
| 380 | } | ||
| 381 | |||
| 382 | 2 | boost::optional<Schedule> FanZoneExhaust::minimumZoneTemperatureLimitSchedule() const { | |
| 383 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::FanZoneExhaust_Impl>()->minimumZoneTemperatureLimitSchedule(); |
| 384 | } | ||
| 385 | |||
| 386 | 2 | boost::optional<Schedule> FanZoneExhaust::balancedExhaustFractionSchedule() const { | |
| 387 |
1/1✓ Branch 3 taken 2 times.
|
2 | return getImpl<detail::FanZoneExhaust_Impl>()->balancedExhaustFractionSchedule(); |
| 388 | } | ||
| 389 | |||
| 390 | ✗ | bool FanZoneExhaust::setAvailabilitySchedule(Schedule& schedule) { | |
| 391 | ✗ | return getImpl<detail::FanZoneExhaust_Impl>()->setAvailabilitySchedule(schedule); | |
| 392 | } | ||
| 393 | |||
| 394 | ✗ | void FanZoneExhaust::resetAvailabilitySchedule() { | |
| 395 | ✗ | getImpl<detail::FanZoneExhaust_Impl>()->resetAvailabilitySchedule(); | |
| 396 | ✗ | } | |
| 397 | |||
| 398 | 4 | bool FanZoneExhaust::setFanTotalEfficiency(double fanTotalEfficiency) { | |
| 399 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::FanZoneExhaust_Impl>()->setFanTotalEfficiency(fanTotalEfficiency); |
| 400 | } | ||
| 401 | |||
| 402 | ✗ | bool FanZoneExhaust::setFanEfficiency(double fanTotalEfficiency) { | |
| 403 | ✗ | return getImpl<detail::FanZoneExhaust_Impl>()->setFanTotalEfficiency(fanTotalEfficiency); | |
| 404 | } | ||
| 405 | |||
| 406 | 4 | bool FanZoneExhaust::setPressureRise(double pressureRise) { | |
| 407 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::FanZoneExhaust_Impl>()->setPressureRise(pressureRise); |
| 408 | } | ||
| 409 | |||
| 410 | ✗ | bool FanZoneExhaust::setMaximumFlowRate(double maximumFlowRate) { | |
| 411 | ✗ | return getImpl<detail::FanZoneExhaust_Impl>()->setMaximumFlowRate(maximumFlowRate); | |
| 412 | } | ||
| 413 | |||
| 414 | ✗ | void FanZoneExhaust::resetMaximumFlowRate() { | |
| 415 | ✗ | getImpl<detail::FanZoneExhaust_Impl>()->resetMaximumFlowRate(); | |
| 416 | ✗ | } | |
| 417 | |||
| 418 | 4 | bool FanZoneExhaust::setEndUseSubcategory(const std::string& endUseSubcategory) { | |
| 419 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::FanZoneExhaust_Impl>()->setEndUseSubcategory(endUseSubcategory); |
| 420 | } | ||
| 421 | |||
| 422 | ✗ | bool FanZoneExhaust::setFlowFractionSchedule(Schedule& schedule) { | |
| 423 | ✗ | return getImpl<detail::FanZoneExhaust_Impl>()->setFlowFractionSchedule(schedule); | |
| 424 | } | ||
| 425 | |||
| 426 | ✗ | void FanZoneExhaust::resetFlowFractionSchedule() { | |
| 427 | ✗ | getImpl<detail::FanZoneExhaust_Impl>()->resetFlowFractionSchedule(); | |
| 428 | ✗ | } | |
| 429 | |||
| 430 | 4 | bool FanZoneExhaust::setSystemAvailabilityManagerCouplingMode(const std::string& systemAvailabilityManagerCouplingMode) { | |
| 431 |
1/1✓ Branch 3 taken 4 times.
|
4 | return getImpl<detail::FanZoneExhaust_Impl>()->setSystemAvailabilityManagerCouplingMode(systemAvailabilityManagerCouplingMode); |
| 432 | } | ||
| 433 | |||
| 434 | ✗ | bool FanZoneExhaust::setMinimumZoneTemperatureLimitSchedule(Schedule& schedule) { | |
| 435 | ✗ | return getImpl<detail::FanZoneExhaust_Impl>()->setMinimumZoneTemperatureLimitSchedule(schedule); | |
| 436 | } | ||
| 437 | |||
| 438 | ✗ | void FanZoneExhaust::resetMinimumZoneTemperatureLimitSchedule() { | |
| 439 | ✗ | getImpl<detail::FanZoneExhaust_Impl>()->resetMinimumZoneTemperatureLimitSchedule(); | |
| 440 | ✗ | } | |
| 441 | |||
| 442 | ✗ | bool FanZoneExhaust::setBalancedExhaustFractionSchedule(Schedule& schedule) { | |
| 443 | ✗ | return getImpl<detail::FanZoneExhaust_Impl>()->setBalancedExhaustFractionSchedule(schedule); | |
| 444 | } | ||
| 445 | |||
| 446 | ✗ | void FanZoneExhaust::resetBalancedExhaustFractionSchedule() { | |
| 447 | ✗ | getImpl<detail::FanZoneExhaust_Impl>()->resetBalancedExhaustFractionSchedule(); | |
| 448 | ✗ | } | |
| 449 | |||
| 450 | 1 | AirflowNetworkZoneExhaustFan FanZoneExhaust::getAirflowNetworkZoneExhaustFan(const AirflowNetworkCrack& crack) { | |
| 451 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::FanZoneExhaust_Impl>()->getAirflowNetworkZoneExhaustFan(crack); |
| 452 | } | ||
| 453 | |||
| 454 | 1 | boost::optional<AirflowNetworkZoneExhaustFan> FanZoneExhaust::airflowNetworkZoneExhaustFan() const { | |
| 455 |
1/1✓ Branch 3 taken 1 time.
|
1 | return getImpl<detail::FanZoneExhaust_Impl>()->airflowNetworkZoneExhaustFan(); |
| 456 | } | ||
| 457 | |||
| 458 | /// @cond | ||
| 459 |
1/1✓ Branch 3 taken 2 times.
|
2 | FanZoneExhaust::FanZoneExhaust(std::shared_ptr<detail::FanZoneExhaust_Impl> impl) : ZoneHVACComponent(std::move(impl)) {} |
| 460 | /// @endcond | ||
| 461 | |||
| 462 | } // namespace model | ||
| 463 | } // namespace openstudio | ||
| 464 |