GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 77.3% 348 / 0 / 450
Functions: 82.1% 78 / 0 / 95
Branches: 58.7% 290 / 0 / 494

src/model/FanOnOff.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 "FanOnOff.hpp"
7 #include "FanOnOff_Impl.hpp"
8 #include "WaterHeaterHeatPump.hpp"
9 #include "WaterHeaterHeatPump_Impl.hpp"
10 #include "Node.hpp"
11 #include "Node_Impl.hpp"
12 #include "Schedule.hpp"
13 #include "Schedule_Impl.hpp"
14 #include "Model.hpp"
15 #include "Loop.hpp"
16 #include "StraightComponent.hpp"
17 #include "StraightComponent_Impl.hpp"
18 #include "Curve.hpp"
19 #include "Curve_Impl.hpp"
20 #include "CurveCubic.hpp"
21 #include "CurveCubic_Impl.hpp"
22 #include "CurveExponent.hpp"
23 #include "CurveExponent_Impl.hpp"
24 #include "ZoneHVACComponent.hpp"
25 #include "ZoneHVACComponent_Impl.hpp"
26 #include "ZoneHVACWaterToAirHeatPump.hpp"
27 #include "ZoneHVACWaterToAirHeatPump_Impl.hpp"
28 #include "ZoneHVACPackagedTerminalAirConditioner.hpp"
29 #include "ZoneHVACPackagedTerminalAirConditioner_Impl.hpp"
30 #include "ZoneHVACFourPipeFanCoil.hpp"
31 #include "ZoneHVACFourPipeFanCoil_Impl.hpp"
32 #include "ZoneHVACPackagedTerminalHeatPump.hpp"
33 #include "ZoneHVACPackagedTerminalHeatPump_Impl.hpp"
34 #include "ZoneHVACTerminalUnitVariableRefrigerantFlow.hpp"
35 #include "ZoneHVACTerminalUnitVariableRefrigerantFlow_Impl.hpp"
36 #include "ZoneHVACUnitHeater.hpp"
37 #include "ZoneHVACUnitHeater_Impl.hpp"
38 #include "ZoneHVACUnitVentilator.hpp"
39 #include "ZoneHVACUnitVentilator_Impl.hpp"
40 #include "ZoneHVACEvaporativeCoolerUnit.hpp"
41 #include "ZoneHVACEvaporativeCoolerUnit_Impl.hpp"
42 #include "AirLoopHVACUnitaryHeatPumpAirToAir.hpp"
43 #include "AirLoopHVACUnitaryHeatPumpAirToAir_Impl.hpp"
44 #include "AirLoopHVACUnitarySystem.hpp"
45 #include "AirLoopHVACUnitarySystem_Impl.hpp"
46 #include "AirLoopHVACOutdoorAirSystem.hpp"
47 #include "AirLoopHVACOutdoorAirSystem_Impl.hpp"
48 #include "AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass.hpp"
49 #include "AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass_Impl.hpp"
50 #include "AirflowNetworkFan.hpp"
51 #include "AirflowNetworkFan_Impl.hpp"
52 #include <utilities/idd/OS_Fan_OnOff_FieldEnums.hxx>
53 #include <utilities/idd/IddEnums.hxx>
54 #include "../utilities/core/Assert.hpp"
55 #include "../utilities/data/DataEnums.hpp"
56
57 namespace openstudio {
58 namespace model {
59
60 namespace detail {
61
62 120 FanOnOff_Impl::FanOnOff_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
63 120 : StraightComponent_Impl(idfObject, model, keepHandle) {
64
4/6
✓ Branch 1 taken 120 times.
✓ Branch 4 taken 120 times.
✓ Branch 7 taken 120 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 120 times.
✗ Branch 13 not taken.
120 OS_ASSERT(idfObject.iddObject().type() == FanOnOff::iddObjectType());
65 120 }
66
67 11 FanOnOff_Impl::FanOnOff_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle)
68 11 : StraightComponent_Impl(other, model, keepHandle) {
69
4/6
✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
✓ Branch 7 taken 11 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 11 times.
✗ Branch 13 not taken.
11 OS_ASSERT(other.iddObject().type() == FanOnOff::iddObjectType());
70 11 }
71
72 58 FanOnOff_Impl::FanOnOff_Impl(const FanOnOff_Impl& other, Model_Impl* model, bool keepHandle) : StraightComponent_Impl(other, model, keepHandle) {}
73
74 ✗ const std::vector<std::string>& FanOnOff_Impl::outputVariableNames() const {
75 static const std::vector<std::string> results{"Fan Electricity Rate", "Fan Rise in Air Temperature", "Fan Heat Gain to Air",
76 ✗ "Fan Electricity Energy", "Fan Air Mass Flow Rate", "Fan Runtime Fraction"};
77 ✗ return results;
78 ✗ }
79
80 64 IddObjectType FanOnOff_Impl::iddObjectType() const {
81 64 return FanOnOff::iddObjectType();
82 }
83
84 4 std::vector<openstudio::IdfObject> FanOnOff_Impl::remove() {
85 4 return StraightComponent_Impl::remove();
86 }
87
88 40 std::vector<ModelObject> FanOnOff_Impl::children() const {
89 40 std::vector<ModelObject> result;
90
3/4
✓ Branch 1 taken 40 times.
✓ Branch 4 taken 40 times.
✓ Branch 8 taken 40 times.
✗ Branch 9 not taken.
80 if (boost::optional<Curve> intermediate = fanPowerRatioFunctionofSpeedRatioCurve()) {
91
2/2
✓ Branch 1 taken 40 times.
✓ Branch 4 taken 40 times.
40 result.push_back(*intermediate);
92 40 }
93
3/4
✓ Branch 1 taken 40 times.
✓ Branch 4 taken 40 times.
✓ Branch 8 taken 40 times.
✗ Branch 9 not taken.
80 if (boost::optional<Curve> intermediate = fanEfficiencyRatioFunctionofSpeedRatioCurve()) {
94
2/2
✓ Branch 1 taken 40 times.
✓ Branch 4 taken 40 times.
40 result.push_back(*intermediate);
95 40 }
96 40 return result;
97 ✗ }
98
99 // Inlet and Outlet nodes
100
101 28 unsigned FanOnOff_Impl::inletPort() const {
102 28 return OS_Fan_OnOffFields::AirInletNodeName;
103 }
104
105 28 unsigned FanOnOff_Impl::outletPort() const {
106 28 return OS_Fan_OnOffFields::AirOutletNodeName;
107 }
108
109 ✗ std::vector<ScheduleTypeKey> FanOnOff_Impl::getScheduleTypeKeys(const Schedule& schedule) const {
110 ✗ std::vector<ScheduleTypeKey> result;
111 ✗ UnsignedVector fieldIndices = getSourceIndices(schedule.handle());
112 ✗ UnsignedVector::const_iterator b(fieldIndices.begin());
113 ✗ UnsignedVector::const_iterator e(fieldIndices.end());
114 ✗ if (std::find(b, e, OS_Fan_OnOffFields::AvailabilityScheduleName) != e) {
115 ✗ result.emplace_back("FanOnOff", "Availability");
116 }
117 ✗ return result;
118 ✗ }
119
120 29 Schedule FanOnOff_Impl::availabilitySchedule() const {
121
1/1
✓ Branch 1 taken 29 times.
29 boost::optional<Schedule> value = optionalAvailabilitySchedule();
122
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 29 times.
29 if (!value) {
123 // it is an error if we get here, however we don't want to crash
124 // so we hook up to global always on schedule
125 ✗ LOG(Error, "Required availability schedule not set, using 'Always On' schedule");
126 ✗ value = this->model().alwaysOnDiscreteSchedule();
127 ✗ OS_ASSERT(value);
128 ✗ const_cast<FanOnOff_Impl*>(this)->setAvailabilitySchedule(*value);
129 ✗ value = optionalAvailabilitySchedule();
130 }
131
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 29 times.
✗ Branch 4 not taken.
29 OS_ASSERT(value);
132
2/2
✓ Branch 1 taken 29 times.
✓ Branch 4 taken 29 times.
58 return value.get();
133 29 }
134
135 110 bool FanOnOff_Impl::setAvailabilitySchedule(Schedule& schedule) {
136
3/3
✓ Branch 1 taken 110 times.
✓ Branch 4 taken 110 times.
✓ Branch 7 taken 110 times.
440 bool result = setSchedule(OS_Fan_OnOffFields::AvailabilityScheduleName, "FanOnOff", "Availability", schedule);
137 110 return result;
138 }
139
140 34 double FanOnOff_Impl::fanTotalEfficiency() const {
141
1/1
✓ Branch 1 taken 34 times.
34 boost::optional<double> value = getDouble(OS_Fan_OnOffFields::FanTotalEfficiency, true);
142
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 4 not taken.
34 OS_ASSERT(value);
143
1/1
✓ Branch 1 taken 34 times.
68 return value.get();
144 }
145
146 4 bool FanOnOff_Impl::isFanTotalEfficiencyDefaulted() const {
147 4 return isEmpty(OS_Fan_OnOffFields::FanTotalEfficiency);
148 }
149
150 34 double FanOnOff_Impl::pressureRise() const {
151
1/1
✓ Branch 1 taken 34 times.
34 boost::optional<double> value = getDouble(OS_Fan_OnOffFields::PressureRise, true);
152
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 4 not taken.
34 OS_ASSERT(value);
153
1/1
✓ Branch 1 taken 34 times.
68 return value.get();
154 }
155
156 32 boost::optional<double> FanOnOff_Impl::maximumFlowRate() const {
157 32 return getDouble(OS_Fan_OnOffFields::MaximumFlowRate, true);
158 }
159
160 4 bool FanOnOff_Impl::isMaximumFlowRateAutosized() const {
161 4 bool result = false;
162
1/1
✓ Branch 1 taken 4 times.
4 boost::optional<std::string> value = getString(OS_Fan_OnOffFields::MaximumFlowRate, true);
163
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (value) {
164
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
8 result = openstudio::istringEqual(value.get(), "autosize");
165 }
166 4 return result;
167 4 }
168
169 32 double FanOnOff_Impl::motorEfficiency() const {
170
1/1
✓ Branch 1 taken 32 times.
32 boost::optional<double> value = getDouble(OS_Fan_OnOffFields::MotorEfficiency, true);
171
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 32 times.
✗ Branch 4 not taken.
32 OS_ASSERT(value);
172
1/1
✓ Branch 1 taken 32 times.
64 return value.get();
173 }
174
175 2 bool FanOnOff_Impl::isMotorEfficiencyDefaulted() const {
176 2 return isEmpty(OS_Fan_OnOffFields::MotorEfficiency);
177 }
178
179 32 boost::optional<double> FanOnOff_Impl::motorInAirstreamFraction() const {
180 32 return getDouble(OS_Fan_OnOffFields::MotorInAirstreamFraction, true);
181 }
182
183 29 std::string FanOnOff_Impl::endUseSubcategory() const {
184
1/1
✓ Branch 1 taken 29 times.
29 boost::optional<std::string> value = getString(OS_Fan_OnOffFields::EndUseSubcategory, true);
185
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 29 times.
✗ Branch 4 not taken.
29 OS_ASSERT(value);
186
2/2
✓ Branch 1 taken 29 times.
✓ Branch 4 taken 29 times.
58 return value.get();
187 29 }
188
189 2 bool FanOnOff_Impl::isEndUseSubcategoryDefaulted() const {
190 2 return isEmpty(OS_Fan_OnOffFields::EndUseSubcategory);
191 }
192
193 113 bool FanOnOff_Impl::setFanTotalEfficiency(double fanTotalEfficiency) {
194 113 bool result = setDouble(OS_Fan_OnOffFields::FanTotalEfficiency, fanTotalEfficiency);
195 113 return result;
196 }
197
198 2 void FanOnOff_Impl::resetFanTotalEfficiency() {
199
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
4 bool result = setString(OS_Fan_OnOffFields::FanTotalEfficiency, "");
200
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
201 2 }
202
203 112 bool FanOnOff_Impl::setPressureRise(double pressureRise) {
204 112 bool result = setDouble(OS_Fan_OnOffFields::PressureRise, pressureRise);
205
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 112 times.
112 OS_ASSERT(result);
206 112 return result;
207 }
208
209 3 bool FanOnOff_Impl::setMaximumFlowRate(boost::optional<double> maximumFlowRate) {
210 3 bool result(false);
211
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
3 if (maximumFlowRate) {
212 3 result = setDouble(OS_Fan_OnOffFields::MaximumFlowRate, maximumFlowRate.get());
213 } else {
214 ✗ resetMaximumFlowRate();
215 ✗ result = true;
216 }
217 3 return result;
218 }
219
220 1 void FanOnOff_Impl::resetMaximumFlowRate() {
221
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_Fan_OnOffFields::MaximumFlowRate, "");
222
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
223 1 }
224
225 110 void FanOnOff_Impl::autosizeMaximumFlowRate() {
226
2/2
✓ Branch 1 taken 110 times.
✓ Branch 4 taken 110 times.
220 bool result = setString(OS_Fan_OnOffFields::MaximumFlowRate, "autosize");
227
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 110 times.
110 OS_ASSERT(result);
228 110 }
229
230 110 bool FanOnOff_Impl::setMotorEfficiency(double motorEfficiency) {
231 110 bool result = setDouble(OS_Fan_OnOffFields::MotorEfficiency, motorEfficiency);
232 110 return result;
233 }
234
235 1 void FanOnOff_Impl::resetMotorEfficiency() {
236
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_Fan_OnOffFields::MotorEfficiency, "");
237
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
238 1 }
239
240 110 bool FanOnOff_Impl::setMotorInAirstreamFraction(boost::optional<double> motorInAirstreamFraction) {
241 110 bool result(false);
242
1/2
✓ Branch 0 taken 110 times.
✗ Branch 1 not taken.
110 if (motorInAirstreamFraction) {
243 110 result = setDouble(OS_Fan_OnOffFields::MotorInAirstreamFraction, motorInAirstreamFraction.get());
244 } else {
245 ✗ resetMotorInAirstreamFraction();
246 ✗ result = true;
247 }
248 110 return result;
249 }
250
251 1 void FanOnOff_Impl::resetMotorInAirstreamFraction() {
252
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_Fan_OnOffFields::MotorInAirstreamFraction, "");
253
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
254 1 }
255
256 1 bool FanOnOff_Impl::setEndUseSubcategory(const std::string& endUseSubcategory) {
257 1 bool result = setString(OS_Fan_OnOffFields::EndUseSubcategory, endUseSubcategory);
258
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
259 1 return result;
260 }
261
262 1 void FanOnOff_Impl::resetEndUseSubcategory() {
263
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_Fan_OnOffFields::EndUseSubcategory, "");
264
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
265 1 }
266
267 29 boost::optional<Schedule> FanOnOff_Impl::optionalAvailabilitySchedule() const {
268
2/2
✓ Branch 1 taken 29 times.
✓ Branch 4 taken 29 times.
29 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_Fan_OnOffFields::AvailabilityScheduleName);
269 }
270
271 ✗ boost::optional<ModelObject> FanOnOff_Impl::availabilityScheduleAsModelObject() const {
272 ✗ OptionalModelObject result = availabilitySchedule();
273 ✗ return result;
274 }
275
276 // Curves
277
278 81 Curve FanOnOff_Impl::fanPowerRatioFunctionofSpeedRatioCurve() const {
279 boost::optional<Curve> curve =
280
2/2
✓ Branch 1 taken 81 times.
✓ Branch 4 taken 81 times.
81 getObject<ModelObject>().getModelObjectTarget<Curve>(OS_Fan_OnOffFields::FanPowerRatioFunctionofSpeedRatioCurveName);
281
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 81 times.
✗ Branch 4 not taken.
81 OS_ASSERT(curve);
282
2/2
✓ Branch 1 taken 81 times.
✓ Branch 4 taken 81 times.
162 return curve.get();
283 81 }
284
285 112 bool FanOnOff_Impl::setFanPowerRatioFunctionofSpeedRatioCurve(const Curve& curve) {
286
4/5
✓ Branch 1 taken 112 times.
✓ Branch 4 taken 112 times.
✓ Branch 7 taken 112 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 112 times.
112 if (model() != curve.model()) {
287 ✗ return false;
288 }
289
2/2
✓ Branch 1 taken 112 times.
✓ Branch 4 taken 112 times.
112 return this->setPointer(OS_Fan_OnOffFields::FanPowerRatioFunctionofSpeedRatioCurveName, curve.handle());
290 }
291
292 81 Curve FanOnOff_Impl::fanEfficiencyRatioFunctionofSpeedRatioCurve() const {
293 boost::optional<Curve> curve =
294
2/2
✓ Branch 1 taken 81 times.
✓ Branch 4 taken 81 times.
81 getObject<ModelObject>().getModelObjectTarget<Curve>(OS_Fan_OnOffFields::FanEfficiencyRatioFunctionofSpeedRatioCurveName);
295
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 81 times.
✗ Branch 4 not taken.
81 OS_ASSERT(curve);
296
2/2
✓ Branch 1 taken 81 times.
✓ Branch 4 taken 81 times.
162 return curve.get();
297 81 }
298
299 113 bool FanOnOff_Impl::setFanEfficiencyRatioFunctionofSpeedRatioCurve(const Curve& curve) {
300
4/5
✓ Branch 1 taken 113 times.
✓ Branch 4 taken 113 times.
✓ Branch 7 taken 113 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 113 times.
113 if (model() != curve.model()) {
301 ✗ return false;
302 }
303
2/2
✓ Branch 1 taken 113 times.
✓ Branch 4 taken 113 times.
113 return this->setPointer(OS_Fan_OnOffFields::FanEfficiencyRatioFunctionofSpeedRatioCurveName, curve.handle());
304 }
305
306 10 ModelObject FanOnOff_Impl::clone(Model model) const {
307 // TODO: why is this calling ModelObject_Impl::clone and not StraightComponent_Impl::clone?
308
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 return ModelObject_Impl::clone(model);
309 }
310
311 // Fan:OnOff can not be added to an AirLoopHVAC.
312 // It can only be contained within another HVAC Component, such as Unitary, ZoneHVAC, etc.
313 5 bool FanOnOff_Impl::addToNode(Node& node) {
314
3/3
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 4 times.
✓ Branch 5 taken 1 time.
10 if (node.loop()) {
315 4 return false;
316
2/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✗ Branch 5 not taken.
2 } else if (node.airLoopHVACOutdoorAirSystem()) {
317 1 return false;
318 } else {
319 ✗ return StraightComponent_Impl::addToNode(node);
320 }
321 }
322
323 6 boost::optional<HVACComponent> FanOnOff_Impl::containingHVACComponent() const {
324 // Process all types that might contain a FanOnOff object.
325
326
1/1
✓ Branch 1 taken 6 times.
6 auto t_handle = handle();
327
328 // AirLoopHVACUnitarySystem
329
2/2
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
6 std::vector<AirLoopHVACUnitarySystem> airLoopHVACUnitarySystems = this->model().getConcreteModelObjects<AirLoopHVACUnitarySystem>();
330
331
2/2
✓ Branch 5 taken 3 times.
✓ Branch 6 taken 3 times.
6 for (const auto& airLoopHVACUnitarySystem : airLoopHVACUnitarySystems) {
332
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (boost::optional<HVACComponent> fan = airLoopHVACUnitarySystem.supplyFan()) {
333
5/6
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 12 taken 3 times.
✗ Branch 13 not taken.
3 if (fan->handle() == this->handle()) {
334
1/1
✓ Branch 1 taken 3 times.
3 return airLoopHVACUnitarySystem;
335 }
336 3 }
337 }
338
339 // WaterHeaterHeatPump
340 {
341
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 auto hpwhs = model().getConcreteModelObjects<WaterHeaterHeatPump>();
342
1/2
✗ Branch 5 not taken.
✓ Branch 6 taken 3 times.
3 for (const auto& hpwh : hpwhs) {
343 ✗ if (hpwh.fan().handle() == t_handle) {
344 ✗ return hpwh;
345 }
346 }
347 3 }
348
349 // AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass
350 std::vector<AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass> bypassSystems =
351
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 this->model().getConcreteModelObjects<AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass>();
352
353
1/2
✗ Branch 5 not taken.
✓ Branch 6 taken 3 times.
3 for (const auto& bypassSystem : bypassSystems) {
354 ✗ if (boost::optional<HVACComponent> fan = bypassSystem.supplyAirFan()) {
355 ✗ if (fan->handle() == this->handle()) {
356 ✗ return bypassSystem;
357 }
358 ✗ }
359 }
360
361 // AirLoopHVACUnitaryHeatPumpAirToAir
362 std::vector<AirLoopHVACUnitaryHeatPumpAirToAir> airLoopHVACUnitaryHeatPumpAirToAirs =
363
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 this->model().getConcreteModelObjects<AirLoopHVACUnitaryHeatPumpAirToAir>();
364
365
2/2
✓ Branch 5 taken 1 time.
✓ Branch 6 taken 2 times.
3 for (const auto& airLoopHVACUnitaryHeatPumpAirToAir : airLoopHVACUnitaryHeatPumpAirToAirs) {
366
3/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 8 taken 1 time.
✗ Branch 9 not taken.
2 if (boost::optional<HVACComponent> fan = airLoopHVACUnitaryHeatPumpAirToAir.supplyAirFan()) {
367
5/6
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 12 taken 1 time.
✗ Branch 13 not taken.
1 if (fan->handle() == this->handle()) {
368
1/1
✓ Branch 1 taken 1 time.
1 return airLoopHVACUnitaryHeatPumpAirToAir;
369 }
370 1 }
371 }
372
373 2 return boost::none;
374 6 }
375
376 11 boost::optional<ZoneHVACComponent> FanOnOff_Impl::containingZoneHVACComponent() const {
377
2/2
✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
11 std::vector<ZoneHVACComponent> zoneHVACComponent = this->model().getModelObjects<ZoneHVACComponent>();
378
2/2
✓ Branch 5 taken 9 times.
✓ Branch 6 taken 4 times.
13 for (const auto& elem : zoneHVACComponent) {
379
10/12
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
✓ Branch 10 taken 1 time.
✓ Branch 11 taken 1 time.
✓ Branch 12 taken 1 time.
✓ Branch 13 taken 1 time.
✓ Branch 14 taken 2 times.
✓ Branch 15 taken 1 time.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 2 times.
9 switch (elem.iddObject().type().value()) {
380 1 case openstudio::IddObjectType::OS_ZoneHVAC_FourPipeFanCoil: {
381
1/1
✓ Branch 1 taken 1 time.
1 auto component = elem.cast<ZoneHVACFourPipeFanCoil>();
382
5/6
✓ 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 14 not taken.
1 if (component.supplyAirFan().handle() == this->handle()) {
383
1/1
✓ Branch 1 taken 1 time.
1 return elem;
384 }
385 ✗ break;
386 1 }
387 1 case openstudio::IddObjectType::OS_ZoneHVAC_PackagedTerminalHeatPump: {
388
1/1
✓ Branch 1 taken 1 time.
1 auto component = elem.cast<ZoneHVACPackagedTerminalHeatPump>();
389
5/6
✓ 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 14 not taken.
1 if (component.supplyAirFan().handle() == this->handle()) {
390
1/1
✓ Branch 1 taken 1 time.
1 return elem;
391 }
392 ✗ break;
393 1 }
394 1 case openstudio::IddObjectType::OS_ZoneHVAC_PackagedTerminalAirConditioner: {
395
1/1
✓ Branch 1 taken 1 time.
1 auto component = elem.cast<ZoneHVACPackagedTerminalAirConditioner>();
396
5/6
✓ 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 14 not taken.
1 if (component.supplyAirFan().handle() == this->handle()) {
397
1/1
✓ Branch 1 taken 1 time.
1 return elem;
398 }
399 ✗ break;
400 1 }
401 1 case openstudio::IddObjectType::OS_ZoneHVAC_TerminalUnit_VariableRefrigerantFlow: {
402
1/1
✓ Branch 1 taken 1 time.
1 auto component = elem.cast<ZoneHVACTerminalUnitVariableRefrigerantFlow>();
403
5/6
✓ 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 14 not taken.
1 if (component.supplyAirFan().handle() == this->handle()) {
404
1/1
✓ Branch 1 taken 1 time.
1 return elem;
405 }
406 ✗ break;
407 1 }
408 2 case openstudio::IddObjectType::OS_ZoneHVAC_WaterToAirHeatPump: {
409
1/1
✓ Branch 1 taken 2 times.
2 auto component = elem.cast<ZoneHVACWaterToAirHeatPump>();
410
5/6
✓ 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 14 not taken.
2 if (component.supplyAirFan().handle() == this->handle()) {
411
1/1
✓ Branch 1 taken 2 times.
2 return elem;
412 }
413 ✗ break;
414 2 }
415 1 case openstudio::IddObjectType::OS_ZoneHVAC_UnitHeater: {
416
1/1
✓ Branch 1 taken 1 time.
1 auto component = elem.cast<ZoneHVACUnitHeater>();
417
5/6
✓ 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 14 not taken.
1 if (component.supplyAirFan().handle() == this->handle()) {
418
1/1
✓ Branch 1 taken 1 time.
1 return elem;
419 }
420 ✗ break;
421 1 }
422 ✗ case openstudio::IddObjectType::OS_ZoneHVAC_UnitVentilator: {
423 ✗ auto component = elem.cast<ZoneHVACUnitVentilator>();
424 ✗ if (component.supplyAirFan().handle() == this->handle()) {
425 ✗ return elem;
426 }
427 ✗ break;
428 ✗ }
429 ✗ case openstudio::IddObjectType::OS_ZoneHVAC_EvaporativeCoolerUnit: {
430 ✗ auto component = elem.cast<ZoneHVACEvaporativeCoolerUnit>();
431 ✗ if (component.supplyAirFan().handle() == this->handle()) {
432 ✗ return elem;
433 }
434 ✗ break;
435 ✗ }
436 2 default: {
437 2 break;
438 }
439 }
440 }
441 4 return boost::none;
442 11 }
443
444 ✗ AirflowNetworkFan FanOnOff_Impl::getAirflowNetworkFan() {
445 ✗ auto opt = airflowNetworkFan();
446 ✗ if (opt) {
447 ✗ return opt.get();
448 }
449 ✗ return AirflowNetworkFan(model(), handle());
450 ✗ }
451
452 ✗ boost::optional<AirflowNetworkFan> FanOnOff_Impl::airflowNetworkFan() const {
453 std::vector<AirflowNetworkFan> myAFNitems =
454 ✗ getObject<ModelObject>().getModelObjectSources<AirflowNetworkFan>(AirflowNetworkFan::iddObjectType());
455 ✗ auto count = myAFNitems.size();
456 ✗ if (count == 1) {
457 ✗ return myAFNitems[0];
458 ✗ } else if (count > 1) {
459 ✗ LOG(Warn, briefDescription() << " has more than one AirflowNetwork EquivalentDuct attached, returning first.");
460 ✗ return myAFNitems[0];
461 }
462 ✗ return boost::none;
463 ✗ }
464
465 ✗ boost::optional<double> FanOnOff_Impl::autosizedMaximumFlowRate() const {
466 ✗ return getAutosizedValue("Design Size Maximum Flow Rate", "m3/s");
467 }
468
469 ✗ void FanOnOff_Impl::autosize() {
470 ✗ autosizeMaximumFlowRate();
471 ✗ }
472
473 ✗ void FanOnOff_Impl::applySizingValues() {
474 ✗ boost::optional<double> val;
475 ✗ val = autosizedMaximumFlowRate();
476 ✗ if (val) {
477 ✗ setMaximumFlowRate(val.get());
478 }
479 ✗ }
480
481 ✗ std::vector<EMSActuatorNames> FanOnOff_Impl::emsActuatorNames() const {
482 std::vector<EMSActuatorNames> actuators{
483 ✗ {"Fan", "Fan Air Mass Flow Rate"}, {"Fan", "Fan Pressure Rise"}, {"Fan", "Fan Total Efficiency"}, {"Fan", "Fan Autosized Air Flow Rate"}};
484 ✗ return actuators;
485 ✗ }
486
487 ✗ std::vector<std::string> FanOnOff_Impl::emsInternalVariableNames() const {
488 ✗ std::vector<std::string> types{"Fan Maximum Mass Flow Rate", "Fan Nominal Pressure Rise", "Fan Nominal Total Efficiency"};
489 ✗ return types;
490 ✗ }
491
492 ✗ ComponentType FanOnOff_Impl::componentType() const {
493 ✗ return ComponentType::None;
494 }
495
496 ✗ std::vector<FuelType> FanOnOff_Impl::coolingFuelTypes() const {
497 ✗ return {};
498 }
499
500 ✗ std::vector<FuelType> FanOnOff_Impl::heatingFuelTypes() const {
501 ✗ return {};
502 }
503
504 ✗ std::vector<AppGFuelType> FanOnOff_Impl::appGHeatingFuelTypes() const {
505 ✗ return {};
506 }
507
508 } // namespace detail
509
510 49 FanOnOff::FanOnOff(const Model& model) : StraightComponent(FanOnOff::iddObjectType(), model) {
511
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 49 times.
✗ Branch 5 not taken.
49 OS_ASSERT(getImpl<detail::FanOnOff_Impl>());
512
513
1/1
✓ Branch 1 taken 49 times.
49 auto availabilitySchedule = model.alwaysOnDiscreteSchedule();
514
1/1
✓ Branch 1 taken 49 times.
49 setAvailabilitySchedule(availabilitySchedule);
515
516
1/1
✓ Branch 1 taken 49 times.
49 bool ok = setFanTotalEfficiency(0.6);
517
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 49 times.
✗ Branch 3 not taken.
49 OS_ASSERT(ok);
518
1/1
✓ Branch 1 taken 49 times.
49 setPressureRise(300);
519
1/1
✓ Branch 1 taken 49 times.
49 autosizeMaximumFlowRate();
520
1/1
✓ Branch 1 taken 49 times.
49 ok = setMotorEfficiency(0.8);
521
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 49 times.
✗ Branch 3 not taken.
49 OS_ASSERT(ok);
522
1/1
✓ Branch 1 taken 49 times.
49 ok = setMotorInAirstreamFraction(1.0);
523
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 49 times.
✗ Branch 3 not taken.
49 OS_ASSERT(ok);
524
525
1/1
✓ Branch 1 taken 49 times.
49 CurveExponent fanPowerFtSpeedCurve(model);
526
2/2
✓ Branch 1 taken 49 times.
✓ Branch 4 taken 49 times.
49 fanPowerFtSpeedCurve.setName("Fan On Off Power Curve");
527
1/1
✓ Branch 1 taken 49 times.
49 fanPowerFtSpeedCurve.setCoefficient1Constant(1.0);
528
1/1
✓ Branch 1 taken 49 times.
49 fanPowerFtSpeedCurve.setCoefficient2Constant(0);
529
1/1
✓ Branch 1 taken 49 times.
49 fanPowerFtSpeedCurve.setCoefficient3Constant(0);
530
1/1
✓ Branch 1 taken 49 times.
49 ok = setFanPowerRatioFunctionofSpeedRatioCurve(fanPowerFtSpeedCurve);
531
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 49 times.
✗ Branch 3 not taken.
49 OS_ASSERT(ok);
532
533
1/1
✓ Branch 1 taken 49 times.
49 CurveCubic fanEfficiencyFtSpeedCurve(model);
534
2/2
✓ Branch 1 taken 49 times.
✓ Branch 4 taken 49 times.
49 fanEfficiencyFtSpeedCurve.setName("Fan On Off Efficiency Curve");
535
1/1
✓ Branch 1 taken 49 times.
49 fanEfficiencyFtSpeedCurve.setCoefficient1Constant(1.0);
536
1/1
✓ Branch 1 taken 49 times.
49 fanEfficiencyFtSpeedCurve.setCoefficient2x(0.0);
537
1/1
✓ Branch 1 taken 49 times.
49 fanEfficiencyFtSpeedCurve.setCoefficient3xPOW2(0.0);
538
1/1
✓ Branch 1 taken 49 times.
49 fanEfficiencyFtSpeedCurve.setCoefficient4xPOW3(0.0);
539
1/1
✓ Branch 1 taken 49 times.
49 ok = setFanEfficiencyRatioFunctionofSpeedRatioCurve(fanEfficiencyFtSpeedCurve);
540
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 49 times.
✗ Branch 3 not taken.
49 OS_ASSERT(ok);
541 49 }
542
543 56 FanOnOff::FanOnOff(const Model& model, Schedule& availabilitySchedule) : StraightComponent(FanOnOff::iddObjectType(), model) {
544
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 56 times.
✗ Branch 5 not taken.
56 OS_ASSERT(getImpl<detail::FanOnOff_Impl>());
545
546
1/1
✓ Branch 1 taken 56 times.
56 setAvailabilitySchedule(availabilitySchedule);
547
548
1/1
✓ Branch 1 taken 56 times.
56 bool ok = setFanTotalEfficiency(0.6);
549
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 56 times.
✗ Branch 3 not taken.
56 OS_ASSERT(ok);
550
1/1
✓ Branch 1 taken 56 times.
56 setPressureRise(300);
551
1/1
✓ Branch 1 taken 56 times.
56 autosizeMaximumFlowRate();
552
1/1
✓ Branch 1 taken 56 times.
56 ok = setMotorEfficiency(0.8);
553
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 56 times.
✗ Branch 3 not taken.
56 OS_ASSERT(ok);
554
1/1
✓ Branch 1 taken 56 times.
56 ok = setMotorInAirstreamFraction(1.0);
555
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 56 times.
✗ Branch 3 not taken.
56 OS_ASSERT(ok);
556
557
1/1
✓ Branch 1 taken 56 times.
56 CurveExponent fanPowerFtSpeedCurve(model);
558
2/2
✓ Branch 1 taken 56 times.
✓ Branch 4 taken 56 times.
56 fanPowerFtSpeedCurve.setName("Fan On Off Power Curve");
559
1/1
✓ Branch 1 taken 56 times.
56 fanPowerFtSpeedCurve.setCoefficient1Constant(1.0);
560
1/1
✓ Branch 1 taken 56 times.
56 fanPowerFtSpeedCurve.setCoefficient2Constant(0);
561
1/1
✓ Branch 1 taken 56 times.
56 fanPowerFtSpeedCurve.setCoefficient3Constant(0);
562
1/1
✓ Branch 1 taken 56 times.
56 ok = setFanPowerRatioFunctionofSpeedRatioCurve(fanPowerFtSpeedCurve);
563
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 56 times.
✗ Branch 3 not taken.
56 OS_ASSERT(ok);
564
565
1/1
✓ Branch 1 taken 56 times.
56 CurveCubic fanEfficiencyFtSpeedCurve(model);
566
2/2
✓ Branch 1 taken 56 times.
✓ Branch 4 taken 56 times.
56 fanEfficiencyFtSpeedCurve.setName("Fan On Off Efficiency Curve");
567
1/1
✓ Branch 1 taken 56 times.
56 fanEfficiencyFtSpeedCurve.setCoefficient1Constant(1.0);
568
1/1
✓ Branch 1 taken 56 times.
56 fanEfficiencyFtSpeedCurve.setCoefficient2x(0.0);
569
1/1
✓ Branch 1 taken 56 times.
56 fanEfficiencyFtSpeedCurve.setCoefficient3xPOW2(0.0);
570
1/1
✓ Branch 1 taken 56 times.
56 fanEfficiencyFtSpeedCurve.setCoefficient4xPOW3(0.0);
571
1/1
✓ Branch 1 taken 56 times.
56 ok = setFanEfficiencyRatioFunctionofSpeedRatioCurve(fanEfficiencyFtSpeedCurve);
572
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 56 times.
✗ Branch 3 not taken.
56 OS_ASSERT(ok);
573 56 }
574
575 4 FanOnOff::FanOnOff(const Model& model, Schedule& availabilitySchedule, Curve& fanPowerRatioFunctionofSpeedRatioCurve,
576 4 Curve& fanEfficiencyRatioFunctionofSpeedRatioCurve)
577
578 4 : StraightComponent(FanOnOff::iddObjectType(), model) {
579
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 4 times.
✗ Branch 5 not taken.
4 OS_ASSERT(getImpl<detail::FanOnOff_Impl>());
580
581
1/1
✓ Branch 1 taken 4 times.
4 setAvailabilitySchedule(availabilitySchedule);
582
583
1/1
✓ Branch 1 taken 4 times.
4 bool ok = setFanTotalEfficiency(0.6);
584
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
4 OS_ASSERT(ok);
585
1/1
✓ Branch 1 taken 4 times.
4 setPressureRise(300);
586
1/1
✓ Branch 1 taken 4 times.
4 autosizeMaximumFlowRate();
587
1/1
✓ Branch 1 taken 4 times.
4 ok = setMotorEfficiency(0.8);
588
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
4 OS_ASSERT(ok);
589
1/1
✓ Branch 1 taken 4 times.
4 ok = setMotorInAirstreamFraction(1.0);
590
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
4 OS_ASSERT(ok);
591
592
1/1
✓ Branch 1 taken 4 times.
4 ok = setFanPowerRatioFunctionofSpeedRatioCurve(fanPowerRatioFunctionofSpeedRatioCurve);
593
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
4 OS_ASSERT(ok);
594
595
1/1
✓ Branch 1 taken 4 times.
4 ok = setFanEfficiencyRatioFunctionofSpeedRatioCurve(fanEfficiencyRatioFunctionofSpeedRatioCurve);
596
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
✗ Branch 3 not taken.
4 OS_ASSERT(ok);
597 4 }
598
599 8041 IddObjectType FanOnOff::iddObjectType() {
600
1/1
✓ Branch 1 taken 8041 times.
8041 return {IddObjectType::OS_Fan_OnOff};
601 }
602
603 // Field Availability Schedule Name
604
605 29 Schedule FanOnOff::availabilitySchedule() const {
606
1/1
✓ Branch 3 taken 29 times.
29 return getImpl<detail::FanOnOff_Impl>()->availabilitySchedule();
607 }
608
609 110 bool FanOnOff::setAvailabilitySchedule(Schedule& schedule) {
610
1/1
✓ Branch 3 taken 110 times.
110 return getImpl<detail::FanOnOff_Impl>()->setAvailabilitySchedule(schedule);
611 }
612
613 // Field Fan Efficiency
614
615 5 double FanOnOff::fanTotalEfficiency() const {
616
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::FanOnOff_Impl>()->fanTotalEfficiency();
617 }
618
619 2 bool FanOnOff::isFanTotalEfficiencyDefaulted() const {
620
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::FanOnOff_Impl>()->isFanTotalEfficiencyDefaulted();
621 }
622
623 112 bool FanOnOff::setFanTotalEfficiency(double fanTotalEfficiency) {
624
1/1
✓ Branch 3 taken 112 times.
112 return getImpl<detail::FanOnOff_Impl>()->setFanTotalEfficiency(fanTotalEfficiency);
625 }
626
627 1 void FanOnOff::resetFanTotalEfficiency() {
628
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::FanOnOff_Impl>()->resetFanTotalEfficiency();
629 1 }
630
631 29 double FanOnOff::fanEfficiency() const {
632
1/1
✓ Branch 3 taken 29 times.
29 return getImpl<detail::FanOnOff_Impl>()->fanTotalEfficiency();
633 }
634
635 2 bool FanOnOff::isFanEfficiencyDefaulted() const {
636
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::FanOnOff_Impl>()->isFanTotalEfficiencyDefaulted();
637 }
638
639 1 bool FanOnOff::setFanEfficiency(double fanTotalEfficiency) {
640
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::FanOnOff_Impl>()->setFanTotalEfficiency(fanTotalEfficiency);
641 }
642
643 1 void FanOnOff::resetFanEfficiency() {
644
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::FanOnOff_Impl>()->resetFanTotalEfficiency();
645 1 }
646
647 // Field Pressure Rise
648
649 34 double FanOnOff::pressureRise() const {
650
1/1
✓ Branch 3 taken 34 times.
34 return getImpl<detail::FanOnOff_Impl>()->pressureRise();
651 }
652
653 112 bool FanOnOff::setPressureRise(double pressureRise) {
654
1/1
✓ Branch 3 taken 112 times.
112 return getImpl<detail::FanOnOff_Impl>()->setPressureRise(pressureRise);
655 }
656
657 // Field Maximum Flow Rate
658
659 32 boost::optional<double> FanOnOff::maximumFlowRate() const {
660
1/1
✓ Branch 3 taken 32 times.
32 return getImpl<detail::FanOnOff_Impl>()->maximumFlowRate();
661 }
662
663 4 bool FanOnOff::isMaximumFlowRateAutosized() const {
664
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::FanOnOff_Impl>()->isMaximumFlowRateAutosized();
665 }
666
667 3 bool FanOnOff::setMaximumFlowRate(double maximumFlowRate) {
668
2/2
✓ Branch 3 taken 3 times.
✓ Branch 6 taken 3 times.
3 return getImpl<detail::FanOnOff_Impl>()->setMaximumFlowRate(maximumFlowRate);
669 }
670
671 1 void FanOnOff::resetMaximumFlowRate() {
672
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::FanOnOff_Impl>()->resetMaximumFlowRate();
673 1 }
674
675 110 void FanOnOff::autosizeMaximumFlowRate() {
676
1/1
✓ Branch 3 taken 110 times.
110 getImpl<detail::FanOnOff_Impl>()->autosizeMaximumFlowRate();
677 110 }
678
679 // Field Motor Efficiency
680
681 32 double FanOnOff::motorEfficiency() const {
682
1/1
✓ Branch 3 taken 32 times.
32 return getImpl<detail::FanOnOff_Impl>()->motorEfficiency();
683 }
684
685 2 bool FanOnOff::isMotorEfficiencyDefaulted() const {
686
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::FanOnOff_Impl>()->isMotorEfficiencyDefaulted();
687 }
688
689 110 bool FanOnOff::setMotorEfficiency(double motorEfficiency) {
690
1/1
✓ Branch 3 taken 110 times.
110 return getImpl<detail::FanOnOff_Impl>()->setMotorEfficiency(motorEfficiency);
691 }
692
693 1 void FanOnOff::resetMotorEfficiency() {
694
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::FanOnOff_Impl>()->resetMotorEfficiency();
695 1 }
696
697 // Field Motor In Airstream Fraction
698
699 32 boost::optional<double> FanOnOff::motorInAirstreamFraction() const {
700
1/1
✓ Branch 3 taken 32 times.
32 return getImpl<detail::FanOnOff_Impl>()->motorInAirstreamFraction();
701 }
702
703 110 bool FanOnOff::setMotorInAirstreamFraction(double motorInAirstreamFraction) {
704
2/2
✓ Branch 3 taken 110 times.
✓ Branch 6 taken 110 times.
110 return getImpl<detail::FanOnOff_Impl>()->setMotorInAirstreamFraction(motorInAirstreamFraction);
705 }
706
707 1 void FanOnOff::resetMotorInAirstreamFraction() {
708
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::FanOnOff_Impl>()->resetMotorInAirstreamFraction();
709 1 }
710
711 // Field Fan Power Ratio Function of Speed Ratio Curve
712
713 41 Curve FanOnOff::fanPowerRatioFunctionofSpeedRatioCurve() const {
714
1/1
✓ Branch 3 taken 41 times.
41 return getImpl<detail::FanOnOff_Impl>()->fanPowerRatioFunctionofSpeedRatioCurve();
715 }
716
717 112 bool FanOnOff::setFanPowerRatioFunctionofSpeedRatioCurve(const Curve& curve) {
718
1/1
✓ Branch 3 taken 112 times.
112 return getImpl<detail::FanOnOff_Impl>()->setFanPowerRatioFunctionofSpeedRatioCurve(curve);
719 }
720
721 /* Field Fan Efficiency Ratio Function of Speed Ratio Curve */
722
723 41 Curve FanOnOff::fanEfficiencyRatioFunctionofSpeedRatioCurve() const {
724
1/1
✓ Branch 3 taken 41 times.
41 return getImpl<detail::FanOnOff_Impl>()->fanEfficiencyRatioFunctionofSpeedRatioCurve();
725 }
726
727 113 bool FanOnOff::setFanEfficiencyRatioFunctionofSpeedRatioCurve(const Curve& curve) {
728
1/1
✓ Branch 3 taken 113 times.
113 return getImpl<detail::FanOnOff_Impl>()->setFanEfficiencyRatioFunctionofSpeedRatioCurve(curve);
729 }
730
731 29 std::string FanOnOff::endUseSubcategory() const {
732
1/1
✓ Branch 3 taken 29 times.
29 return getImpl<detail::FanOnOff_Impl>()->endUseSubcategory();
733 }
734
735 2 bool FanOnOff::isEndUseSubcategoryDefaulted() const {
736
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::FanOnOff_Impl>()->isEndUseSubcategoryDefaulted();
737 }
738
739 // Field End-Use Subcategory
740
741 1 bool FanOnOff::setEndUseSubcategory(const std::string& endUseSubcategory) {
742
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::FanOnOff_Impl>()->setEndUseSubcategory(endUseSubcategory);
743 }
744
745 1 void FanOnOff::resetEndUseSubcategory() {
746
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::FanOnOff_Impl>()->resetEndUseSubcategory();
747 1 }
748
749 ✗ AirflowNetworkFan FanOnOff::getAirflowNetworkFan() {
750 ✗ return getImpl<detail::FanOnOff_Impl>()->getAirflowNetworkFan();
751 }
752
753 ✗ boost::optional<AirflowNetworkFan> FanOnOff::airflowNetworkFan() const {
754 ✗ return getImpl<detail::FanOnOff_Impl>()->airflowNetworkFan();
755 }
756
757 /// @cond
758
1/1
✓ Branch 3 taken 47 times.
47 FanOnOff::FanOnOff(std::shared_ptr<detail::FanOnOff_Impl> impl) : StraightComponent(std::move(impl)) {}
759 /// @endcond
760
761 ✗ boost::optional<double> FanOnOff::autosizedMaximumFlowRate() const {
762 ✗ return getImpl<detail::FanOnOff_Impl>()->autosizedMaximumFlowRate();
763 }
764
765 } // namespace model
766 } // namespace openstudio
767