GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 85.2% 304 / 0 / 357
Functions: 89.7% 96 / 0 / 107
Branches: 62.0% 183 / 0 / 295

src/model/ZoneVentilationWindandStackOpenArea.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 "ZoneVentilationWindandStackOpenArea.hpp"
7 #include "ZoneVentilationWindandStackOpenArea_Impl.hpp"
8
9 #include "Schedule.hpp"
10 #include "Schedule_Impl.hpp"
11 #include "ThermalZone.hpp"
12 #include "ThermalZone_Impl.hpp"
13 #include "Model.hpp"
14 #include "ZoneHVACEquipmentList.hpp"
15 #include "ZoneHVACEquipmentList_Impl.hpp"
16 #include "ScheduleTypeLimits.hpp"
17 #include "ScheduleTypeRegistry.hpp"
18
19 #include "../utilities/core/Assert.hpp"
20 #include "../utilities/data/DataEnums.hpp"
21
22 #include <utilities/idd/IddFactory.hxx>
23 #include <utilities/idd/IddEnums.hxx>
24 #include <utilities/idd/OS_ZoneVentilation_WindandStackOpenArea_FieldEnums.hxx>
25
26 namespace openstudio {
27 namespace model {
28
29 namespace detail {
30
31 6 ZoneVentilationWindandStackOpenArea_Impl::ZoneVentilationWindandStackOpenArea_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
32 6 : ZoneHVACComponent_Impl(idfObject, model, keepHandle) {
33
4/6
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 6 times.
✗ Branch 13 not taken.
6 OS_ASSERT(idfObject.iddObject().type() == ZoneVentilationWindandStackOpenArea::iddObjectType());
34 6 }
35
36 ✗ ZoneVentilationWindandStackOpenArea_Impl::ZoneVentilationWindandStackOpenArea_Impl(const openstudio::detail::WorkspaceObject_Impl& other,
37 ✗ Model_Impl* model, bool keepHandle)
38 ✗ : ZoneHVACComponent_Impl(other, model, keepHandle) {
39 ✗ OS_ASSERT(other.iddObject().type() == ZoneVentilationWindandStackOpenArea::iddObjectType());
40 ✗ }
41
42 4 ZoneVentilationWindandStackOpenArea_Impl::ZoneVentilationWindandStackOpenArea_Impl(const ZoneVentilationWindandStackOpenArea_Impl& other,
43 4 Model_Impl* model, bool keepHandle)
44 4 : ZoneHVACComponent_Impl(other, model, keepHandle) {}
45
46 ✗ const std::vector<std::string>& ZoneVentilationWindandStackOpenArea_Impl::outputVariableNames() const {
47 ✗ static const std::vector<std::string> result;
48 // Not appropriate: all variables reported at the zone level
49 //result.push_back("Zone Ventilation Sensible Heat Loss Energy");
50 //result.push_back("Zone Ventilation Sensible Heat Gain Energy");
51 //result.push_back("Zone Ventilation Latent Heat Loss Energy");
52 //result.push_back("Zone Ventilation Latent Heat Gain Energy");
53 //result.push_back("Zone Ventilation Total Heat Loss Energy");
54 //result.push_back("Zone Ventilation Total Heat Gain Energy");
55 //result.push_back("Zone Ventilation Current Density Volume Flow Rate");
56 //result.push_back("Zone Ventilation Standard Density Volume Flow Rate");
57 //result.push_back("Zone Ventilation Current Density Volume");
58 //result.push_back("Zone Ventilation Standard Density Volume");
59 //result.push_back("Zone Ventilation Mass");
60 //result.push_back("Zone Ventilation Mass Flow Rate");
61 //result.push_back("Zone Ventilation Current Density Air Change Rate");
62 //result.push_back("Zone Ventilation Fan Electricity Energy");
63 //result.push_back("Zone Ventilation Air Inlet Temperature");
64 ✗ return result;
65 }
66
67 12 IddObjectType ZoneVentilationWindandStackOpenArea_Impl::iddObjectType() const {
68 12 return ZoneVentilationWindandStackOpenArea::iddObjectType();
69 }
70
71 ✗ std::vector<ScheduleTypeKey> ZoneVentilationWindandStackOpenArea_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_ZoneVentilation_WindandStackOpenAreaFields::OpeningAreaFractionScheduleName) != e) {
77 ✗ result.push_back(ScheduleTypeKey("ZoneVentilationWindandStackOpenArea", "Opening Area Fraction Schedule"));
78 }
79 ✗ if (std::find(b, e, OS_ZoneVentilation_WindandStackOpenAreaFields::MinimumIndoorTemperatureScheduleName) != e) {
80 ✗ result.push_back(ScheduleTypeKey("ZoneVentilationWindandStackOpenArea", "Minimum Indoor Temperature"));
81 }
82 ✗ if (std::find(b, e, OS_ZoneVentilation_WindandStackOpenAreaFields::MaximumIndoorTemperatureScheduleName) != e) {
83 ✗ result.push_back(ScheduleTypeKey("ZoneVentilationWindandStackOpenArea", "Maximum Indoor Temperature"));
84 }
85 ✗ if (std::find(b, e, OS_ZoneVentilation_WindandStackOpenAreaFields::DeltaTemperatureScheduleName) != e) {
86 ✗ result.push_back(ScheduleTypeKey("ZoneVentilationWindandStackOpenArea", "Delta Temperature"));
87 }
88 ✗ if (std::find(b, e, OS_ZoneVentilation_WindandStackOpenAreaFields::MinimumOutdoorTemperatureScheduleName) != e) {
89 ✗ result.push_back(ScheduleTypeKey("ZoneVentilationWindandStackOpenArea", "Minimum Outdoor Temperature"));
90 }
91 ✗ if (std::find(b, e, OS_ZoneVentilation_WindandStackOpenAreaFields::MaximumOutdoorTemperatureScheduleName) != e) {
92 ✗ result.push_back(ScheduleTypeKey("ZoneVentilationWindandStackOpenArea", "Maximum Outdoor Temperature"));
93 }
94 ✗ return result;
95 ✗ }
96
97 5 boost::optional<Schedule> ZoneVentilationWindandStackOpenArea_Impl::optionalOpeningAreaFractionSchedule() const {
98
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_ZoneVentilation_WindandStackOpenAreaFields::OpeningAreaFractionScheduleName);
99 }
100
101 5 Schedule ZoneVentilationWindandStackOpenArea_Impl::openingAreaFractionSchedule() const {
102
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<Schedule> value = optionalOpeningAreaFractionSchedule();
103
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
5 if (!value) {
104 // it is an error if we get here, however we don't want to crash
105 // so we hook up to global always on schedule
106 ✗ LOG(Error, "Required availability schedule not set, using 'Always On' schedule");
107 ✗ value = this->model().alwaysOnDiscreteSchedule();
108 ✗ OS_ASSERT(value);
109 ✗ const_cast<ZoneVentilationWindandStackOpenArea_Impl*>(this)->setOpeningAreaFractionSchedule(*value);
110 ✗ value = optionalOpeningAreaFractionSchedule();
111 }
112
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
5 OS_ASSERT(value);
113
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
10 return value.get();
114 5 }
115
116 8 bool ZoneVentilationWindandStackOpenArea_Impl::setOpeningAreaFractionSchedule(Schedule& schedule) {
117
3/3
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
32 bool result = ModelObject_Impl::setSchedule(OS_ZoneVentilation_WindandStackOpenAreaFields::OpeningAreaFractionScheduleName,
118 "ZoneVentilationWindandStackOpenArea", "Opening Area Fraction Schedule", schedule);
119 8 return result;
120 }
121
122 7 double ZoneVentilationWindandStackOpenArea_Impl::openingArea() const {
123
1/1
✓ Branch 1 taken 7 times.
7 boost::optional<double> value = getDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::OpeningArea, true);
124
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
7 OS_ASSERT(value);
125
1/1
✓ Branch 1 taken 7 times.
14 return value.get();
126 }
127
128 10 bool ZoneVentilationWindandStackOpenArea_Impl::setOpeningArea(double openingArea) {
129 10 bool result = setDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::OpeningArea, openingArea);
130 // OS_ASSERT(result);
131 10 return result;
132 }
133
134 9 boost::optional<double> ZoneVentilationWindandStackOpenArea_Impl::openingEffectiveness() const {
135
1/1
✓ Branch 1 taken 9 times.
9 boost::optional<double> value = getDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::OpeningEffectiveness, false);
136 9 return value;
137 }
138
139 6 bool ZoneVentilationWindandStackOpenArea_Impl::isOpeningEffectivenessAutocalculated() const {
140 6 bool result = false;
141
1/1
✓ Branch 1 taken 6 times.
6 boost::optional<std::string> value = getString(OS_ZoneVentilation_WindandStackOpenAreaFields::OpeningEffectiveness, true);
142
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
6 if (value) {
143
3/3
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
12 result = openstudio::istringEqual(value.get(), "Autocalculate");
144 }
145 6 return result;
146 6 }
147
148 6 bool ZoneVentilationWindandStackOpenArea_Impl::setOpeningEffectiveness(double openingEffectiveness) {
149 6 bool result = setDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::OpeningEffectiveness, openingEffectiveness);
150 6 return result;
151 }
152
153 8 void ZoneVentilationWindandStackOpenArea_Impl::autocalculateOpeningEffectiveness() {
154
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 bool result = setString(OS_ZoneVentilation_WindandStackOpenAreaFields::OpeningEffectiveness, "autocalculate");
155
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
8 OS_ASSERT(result);
156 8 }
157
158 7 double ZoneVentilationWindandStackOpenArea_Impl::effectiveAngle() const {
159
1/1
✓ Branch 1 taken 7 times.
7 boost::optional<double> value = getDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::EffectiveAngle, true);
160
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
7 OS_ASSERT(value);
161
1/1
✓ Branch 1 taken 7 times.
14 return value.get();
162 }
163
164 10 bool ZoneVentilationWindandStackOpenArea_Impl::setEffectiveAngle(double effectiveAngle) {
165 10 bool result = setDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::EffectiveAngle, effectiveAngle);
166 // OS_ASSERT(result);
167 10 return result;
168 }
169
170 7 double ZoneVentilationWindandStackOpenArea_Impl::heightDifference() const {
171
1/1
✓ Branch 1 taken 7 times.
7 boost::optional<double> value = getDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::HeightDifference, true);
172
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
7 OS_ASSERT(value);
173
1/1
✓ Branch 1 taken 7 times.
14 return value.get();
174 }
175
176 9 bool ZoneVentilationWindandStackOpenArea_Impl::setHeightDifference(double heightDifference) {
177 9 bool result = setDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::HeightDifference, heightDifference);
178 // OS_ASSERT(result);
179 9 return result;
180 }
181
182 7 boost::optional<double> ZoneVentilationWindandStackOpenArea_Impl::dischargeCoefficientforOpening() const {
183
1/1
✓ Branch 1 taken 7 times.
7 boost::optional<double> value = getDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::DischargeCoefficientforOpening, false);
184 7 return value;
185 }
186
187 6 bool ZoneVentilationWindandStackOpenArea_Impl::isDischargeCoefficientforOpeningAutocalculated() const {
188 6 bool result = false;
189
1/1
✓ Branch 1 taken 6 times.
6 boost::optional<std::string> value = getString(OS_ZoneVentilation_WindandStackOpenAreaFields::DischargeCoefficientforOpening, true);
190
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
6 if (value) {
191
3/3
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 7 taken 6 times.
12 result = openstudio::istringEqual(value.get(), "Autocalculate");
192 }
193 6 return result;
194 6 }
195
196 4 bool ZoneVentilationWindandStackOpenArea_Impl::setDischargeCoefficientforOpening(double dischargeCoefficientforOpening) {
197 4 bool result = setDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::DischargeCoefficientforOpening, dischargeCoefficientforOpening);
198 // OS_ASSERT(result);
199 4 return result;
200 }
201
202 9 void ZoneVentilationWindandStackOpenArea_Impl::autocalculateDischargeCoefficientforOpening() {
203
2/2
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
18 bool result = setString(OS_ZoneVentilation_WindandStackOpenAreaFields::DischargeCoefficientforOpening, "autocalculate");
204
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
9 OS_ASSERT(result);
205 9 }
206
207 7 double ZoneVentilationWindandStackOpenArea_Impl::minimumIndoorTemperature() const {
208
1/1
✓ Branch 1 taken 7 times.
7 boost::optional<double> value = getDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::MinimumIndoorTemperature, true);
209
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
7 OS_ASSERT(value);
210
1/1
✓ Branch 1 taken 7 times.
14 return value.get();
211 }
212
213 9 boost::optional<Schedule> ZoneVentilationWindandStackOpenArea_Impl::minimumIndoorTemperatureSchedule() const {
214
1/1
✓ Branch 1 taken 9 times.
18 return getObject<ModelObject>().getModelObjectTarget<Schedule>(
215
1/1
✓ Branch 1 taken 9 times.
18 OS_ZoneVentilation_WindandStackOpenAreaFields::MinimumIndoorTemperatureScheduleName);
216 }
217
218 6 double ZoneVentilationWindandStackOpenArea_Impl::maximumIndoorTemperature() const {
219
1/1
✓ Branch 1 taken 6 times.
6 boost::optional<double> value = getDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::MaximumIndoorTemperature, true);
220
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
6 OS_ASSERT(value);
221
1/1
✓ Branch 1 taken 6 times.
12 return value.get();
222 }
223
224 7 boost::optional<Schedule> ZoneVentilationWindandStackOpenArea_Impl::maximumIndoorTemperatureSchedule() const {
225
1/1
✓ Branch 1 taken 7 times.
14 return getObject<ModelObject>().getModelObjectTarget<Schedule>(
226
1/1
✓ Branch 1 taken 7 times.
14 OS_ZoneVentilation_WindandStackOpenAreaFields::MaximumIndoorTemperatureScheduleName);
227 }
228
229 5 double ZoneVentilationWindandStackOpenArea_Impl::deltaTemperature() const {
230
1/1
✓ Branch 1 taken 5 times.
5 boost::optional<double> value = getDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::DeltaTemperature, true);
231
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 4 not taken.
5 OS_ASSERT(value);
232
1/1
✓ Branch 1 taken 5 times.
10 return value.get();
233 }
234
235 7 boost::optional<Schedule> ZoneVentilationWindandStackOpenArea_Impl::deltaTemperatureSchedule() const {
236
2/2
✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
7 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_ZoneVentilation_WindandStackOpenAreaFields::DeltaTemperatureScheduleName);
237 }
238
239 6 double ZoneVentilationWindandStackOpenArea_Impl::minimumOutdoorTemperature() const {
240
1/1
✓ Branch 1 taken 6 times.
6 boost::optional<double> value = getDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::MinimumOutdoorTemperature, true);
241
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
6 OS_ASSERT(value);
242
1/1
✓ Branch 1 taken 6 times.
12 return value.get();
243 }
244
245 7 boost::optional<Schedule> ZoneVentilationWindandStackOpenArea_Impl::minimumOutdoorTemperatureSchedule() const {
246
1/1
✓ Branch 1 taken 7 times.
14 return getObject<ModelObject>().getModelObjectTarget<Schedule>(
247
1/1
✓ Branch 1 taken 7 times.
14 OS_ZoneVentilation_WindandStackOpenAreaFields::MinimumOutdoorTemperatureScheduleName);
248 }
249
250 6 double ZoneVentilationWindandStackOpenArea_Impl::maximumOutdoorTemperature() const {
251
1/1
✓ Branch 1 taken 6 times.
6 boost::optional<double> value = getDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::MaximumOutdoorTemperature, true);
252
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
6 OS_ASSERT(value);
253
1/1
✓ Branch 1 taken 6 times.
12 return value.get();
254 }
255
256 7 boost::optional<Schedule> ZoneVentilationWindandStackOpenArea_Impl::maximumOutdoorTemperatureSchedule() const {
257
1/1
✓ Branch 1 taken 7 times.
14 return getObject<ModelObject>().getModelObjectTarget<Schedule>(
258
1/1
✓ Branch 1 taken 7 times.
14 OS_ZoneVentilation_WindandStackOpenAreaFields::MaximumOutdoorTemperatureScheduleName);
259 }
260
261 6 double ZoneVentilationWindandStackOpenArea_Impl::maximumWindSpeed() const {
262
1/1
✓ Branch 1 taken 6 times.
6 boost::optional<double> value = getDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::MaximumWindSpeed, true);
263
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
6 OS_ASSERT(value);
264
1/1
✓ Branch 1 taken 6 times.
12 return value.get();
265 }
266
267 11 bool ZoneVentilationWindandStackOpenArea_Impl::setMinimumIndoorTemperature(double minimumIndoorTemperature) {
268 11 bool result = setDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::MinimumIndoorTemperature, minimumIndoorTemperature);
269 11 return result;
270 }
271
272 3 bool ZoneVentilationWindandStackOpenArea_Impl::setMinimumIndoorTemperatureSchedule(Schedule& schedule) {
273
3/3
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
12 bool result = ModelObject_Impl::setSchedule(OS_ZoneVentilation_WindandStackOpenAreaFields::MinimumIndoorTemperatureScheduleName,
274 "ZoneVentilationWindandStackOpenArea", "Minimum Indoor Temperature", schedule);
275 3 return result;
276 }
277
278 1 void ZoneVentilationWindandStackOpenArea_Impl::resetMinimumIndoorTemperatureSchedule() {
279
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_ZoneVentilation_WindandStackOpenAreaFields::MinimumIndoorTemperatureScheduleName, "");
280
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
281 1 }
282
283 10 bool ZoneVentilationWindandStackOpenArea_Impl::setMaximumIndoorTemperature(double maximumIndoorTemperature) {
284 10 bool result = setDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::MaximumIndoorTemperature, maximumIndoorTemperature);
285 10 return result;
286 }
287
288 2 bool ZoneVentilationWindandStackOpenArea_Impl::setMaximumIndoorTemperatureSchedule(Schedule& schedule) {
289
3/3
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
8 bool result = ModelObject_Impl::setSchedule(OS_ZoneVentilation_WindandStackOpenAreaFields::MaximumIndoorTemperatureScheduleName,
290 "ZoneVentilationWindandStackOpenArea", "Maximum Indoor Temperature", schedule);
291 2 return result;
292 }
293
294 1 void ZoneVentilationWindandStackOpenArea_Impl::resetMaximumIndoorTemperatureSchedule() {
295
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_ZoneVentilation_WindandStackOpenAreaFields::MaximumIndoorTemperatureScheduleName, "");
296
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
297 1 }
298
299 9 bool ZoneVentilationWindandStackOpenArea_Impl::setDeltaTemperature(double deltaTemperature) {
300 9 bool result = setDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::DeltaTemperature, deltaTemperature);
301 9 return result;
302 }
303
304 2 bool ZoneVentilationWindandStackOpenArea_Impl::setDeltaTemperatureSchedule(Schedule& schedule) {
305
3/3
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
8 bool result = ModelObject_Impl::setSchedule(OS_ZoneVentilation_WindandStackOpenAreaFields::DeltaTemperatureScheduleName,
306 "ZoneVentilationWindandStackOpenArea", "Delta Temperature", schedule);
307 2 return result;
308 }
309
310 1 void ZoneVentilationWindandStackOpenArea_Impl::resetDeltaTemperatureSchedule() {
311
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_ZoneVentilation_WindandStackOpenAreaFields::DeltaTemperatureScheduleName, "");
312
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
313 1 }
314
315 10 bool ZoneVentilationWindandStackOpenArea_Impl::setMinimumOutdoorTemperature(double minimumOutdoorTemperature) {
316 10 bool result = setDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::MinimumOutdoorTemperature, minimumOutdoorTemperature);
317 10 return result;
318 }
319
320 2 bool ZoneVentilationWindandStackOpenArea_Impl::setMinimumOutdoorTemperatureSchedule(Schedule& schedule) {
321
3/3
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
8 bool result = ModelObject_Impl::setSchedule(OS_ZoneVentilation_WindandStackOpenAreaFields::MinimumOutdoorTemperatureScheduleName,
322 "ZoneVentilationWindandStackOpenArea", "Minimum Outdoor Temperature", schedule);
323 2 return result;
324 }
325
326 1 void ZoneVentilationWindandStackOpenArea_Impl::resetMinimumOutdoorTemperatureSchedule() {
327
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_ZoneVentilation_WindandStackOpenAreaFields::MinimumOutdoorTemperatureScheduleName, "");
328
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
329 1 }
330
331 10 bool ZoneVentilationWindandStackOpenArea_Impl::setMaximumOutdoorTemperature(double maximumOutdoorTemperature) {
332 10 bool result = setDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::MaximumOutdoorTemperature, maximumOutdoorTemperature);
333 10 return result;
334 }
335
336 2 bool ZoneVentilationWindandStackOpenArea_Impl::setMaximumOutdoorTemperatureSchedule(Schedule& schedule) {
337
3/3
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
8 bool result = ModelObject_Impl::setSchedule(OS_ZoneVentilation_WindandStackOpenAreaFields::MaximumOutdoorTemperatureScheduleName,
338 "ZoneVentilationWindandStackOpenArea", "Maximum Outdoor Temperature", schedule);
339 2 return result;
340 }
341
342 1 void ZoneVentilationWindandStackOpenArea_Impl::resetMaximumOutdoorTemperatureSchedule() {
343
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_ZoneVentilation_WindandStackOpenAreaFields::MaximumOutdoorTemperatureScheduleName, "");
344
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
345 1 }
346
347 10 bool ZoneVentilationWindandStackOpenArea_Impl::setMaximumWindSpeed(double maximumWindSpeed) {
348 10 bool result = setDouble(OS_ZoneVentilation_WindandStackOpenAreaFields::MaximumWindSpeed, maximumWindSpeed);
349 10 return result;
350 }
351
352 ✗ unsigned ZoneVentilationWindandStackOpenArea_Impl::inletPort() const {
353 ✗ return 0; // this object has no inlet or outlet node
354 }
355
356 ✗ unsigned ZoneVentilationWindandStackOpenArea_Impl::outletPort() const {
357 ✗ return 0; // this object has no inlet or outlet node
358 }
359
360 10 boost::optional<ThermalZone> ZoneVentilationWindandStackOpenArea_Impl::thermalZone() const {
361
1/1
✓ Branch 1 taken 10 times.
10 auto thisObject = this->getObject<ModelObject>();
362
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 std::vector<ThermalZone> thermalZones = this->model().getConcreteModelObjects<ThermalZone>();
363
2/2
✓ Branch 5 taken 10 times.
✓ Branch 6 taken 4 times.
14 for (const auto& thermalZone : thermalZones) {
364
1/1
✓ Branch 1 taken 10 times.
10 std::vector<ModelObject> equipment = thermalZone.equipment();
365
366
3/3
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 6 times.
✓ Branch 8 taken 4 times.
10 if (std::find(equipment.begin(), equipment.end(), thisObject) != equipment.end()) {
367
1/1
✓ Branch 1 taken 6 times.
6 return thermalZone;
368 }
369 10 }
370 4 return boost::none;
371 10 }
372
373 3 bool ZoneVentilationWindandStackOpenArea_Impl::addToThermalZone(ThermalZone& thermalZone) {
374
1/1
✓ Branch 1 taken 3 times.
3 Model m = this->model();
375
376
3/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 3 times.
3 if (thermalZone.model() != m) {
377 ✗ return false;
378 }
379
380
2/3
✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
3 if (thermalZone.isPlenum()) {
381 ✗ return false;
382 }
383
384
1/1
✓ Branch 1 taken 3 times.
3 removeFromThermalZone();
385
386
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 thermalZone.addEquipment(this->getObject<ZoneHVACComponent>());
387
388 3 return true;
389 3 }
390
391 4 void ZoneVentilationWindandStackOpenArea_Impl::removeFromThermalZone() {
392
3/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 3 times.
8 if (boost::optional<ThermalZone> thermalZone = this->thermalZone()) {
393
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 thermalZone->removeEquipment(this->getObject<ZoneHVACComponent>());
394 4 }
395 4 }
396
397 ✗ std::vector<EMSActuatorNames> ZoneVentilationWindandStackOpenArea_Impl::emsActuatorNames() const {
398 ✗ std::vector<EMSActuatorNames> actuators{{"Zone Ventilation", "Air Exchange Flow Rate"}};
399 ✗ return actuators;
400 ✗ }
401
402 ✗ std::vector<std::string> ZoneVentilationWindandStackOpenArea_Impl::emsInternalVariableNames() const {
403 ✗ std::vector<std::string> types;
404 ✗ return types;
405 }
406
407 ✗ ComponentType ZoneVentilationWindandStackOpenArea_Impl::componentType() const {
408 ✗ return ComponentType::None;
409 }
410
411 ✗ std::vector<FuelType> ZoneVentilationWindandStackOpenArea_Impl::coolingFuelTypes() const {
412 ✗ return {};
413 }
414
415 ✗ std::vector<FuelType> ZoneVentilationWindandStackOpenArea_Impl::heatingFuelTypes() const {
416 ✗ return {};
417 }
418
419 ✗ std::vector<AppGFuelType> ZoneVentilationWindandStackOpenArea_Impl::appGHeatingFuelTypes() const {
420 ✗ return {};
421 }
422
423 } // namespace detail
424
425 6 ZoneVentilationWindandStackOpenArea::ZoneVentilationWindandStackOpenArea(const Model& model)
426 6 : ZoneHVACComponent(ZoneVentilationWindandStackOpenArea::iddObjectType(), model) {
427
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 6 times.
✗ Branch 5 not taken.
6 OS_ASSERT(getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>());
428
429 {
430
1/1
✓ Branch 1 taken 6 times.
6 auto schedule = model.alwaysOnDiscreteSchedule();
431
1/1
✓ Branch 1 taken 6 times.
6 setOpeningAreaFractionSchedule(schedule);
432 6 }
433
434
1/1
✓ Branch 1 taken 6 times.
6 setOpeningArea(0.0);
435
1/1
✓ Branch 1 taken 6 times.
6 autocalculateOpeningEffectiveness();
436
1/1
✓ Branch 1 taken 6 times.
6 setEffectiveAngle(0.0);
437
1/1
✓ Branch 1 taken 6 times.
6 setHeightDifference(0.0);
438
1/1
✓ Branch 1 taken 6 times.
6 autocalculateDischargeCoefficientforOpening();
439
1/1
✓ Branch 1 taken 6 times.
6 setMinimumIndoorTemperature(-100.0);
440
1/1
✓ Branch 1 taken 6 times.
6 setMaximumIndoorTemperature(100.0);
441
1/1
✓ Branch 1 taken 6 times.
6 setDeltaTemperature(-100.0);
442
1/1
✓ Branch 1 taken 6 times.
6 setMinimumOutdoorTemperature(-100.0);
443
1/1
✓ Branch 1 taken 6 times.
6 setMaximumOutdoorTemperature(100.0);
444
1/1
✓ Branch 1 taken 6 times.
6 setMaximumWindSpeed(40.0);
445 6 }
446
447 7916 IddObjectType ZoneVentilationWindandStackOpenArea::iddObjectType() {
448
1/1
✓ Branch 1 taken 7916 times.
7916 return {IddObjectType::OS_ZoneVentilation_WindandStackOpenArea};
449 }
450
451 7 double ZoneVentilationWindandStackOpenArea::openingArea() const {
452
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->openingArea();
453 }
454
455 10 bool ZoneVentilationWindandStackOpenArea::setOpeningArea(double openingArea) {
456
1/1
✓ Branch 3 taken 10 times.
10 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setOpeningArea(openingArea);
457 }
458
459 5 Schedule ZoneVentilationWindandStackOpenArea::openingAreaFractionSchedule() const {
460
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->openingAreaFractionSchedule();
461 }
462
463 8 bool ZoneVentilationWindandStackOpenArea::setOpeningAreaFractionSchedule(Schedule& schedule) {
464
1/1
✓ Branch 3 taken 8 times.
8 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setOpeningAreaFractionSchedule(schedule);
465 }
466 9 boost::optional<double> ZoneVentilationWindandStackOpenArea::openingEffectiveness() const {
467
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->openingEffectiveness();
468 }
469
470 6 bool ZoneVentilationWindandStackOpenArea::isOpeningEffectivenessAutocalculated() const {
471
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->isOpeningEffectivenessAutocalculated();
472 }
473
474 6 bool ZoneVentilationWindandStackOpenArea::setOpeningEffectiveness(double openingEffectiveness) {
475
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setOpeningEffectiveness(openingEffectiveness);
476 }
477
478 8 void ZoneVentilationWindandStackOpenArea::autocalculateOpeningEffectiveness() {
479
1/1
✓ Branch 3 taken 8 times.
8 getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->autocalculateOpeningEffectiveness();
480 8 }
481
482 7 double ZoneVentilationWindandStackOpenArea::effectiveAngle() const {
483
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->effectiveAngle();
484 }
485
486 10 bool ZoneVentilationWindandStackOpenArea::setEffectiveAngle(double effectiveAngle) {
487
1/1
✓ Branch 3 taken 10 times.
10 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setEffectiveAngle(effectiveAngle);
488 }
489
490 7 double ZoneVentilationWindandStackOpenArea::heightDifference() const {
491
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->heightDifference();
492 }
493
494 9 bool ZoneVentilationWindandStackOpenArea::setHeightDifference(double heightDifference) {
495
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setHeightDifference(heightDifference);
496 }
497
498 7 boost::optional<double> ZoneVentilationWindandStackOpenArea::dischargeCoefficientforOpening() const {
499
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->dischargeCoefficientforOpening();
500 }
501
502 6 bool ZoneVentilationWindandStackOpenArea::isDischargeCoefficientforOpeningAutocalculated() const {
503
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->isDischargeCoefficientforOpeningAutocalculated();
504 }
505
506 4 bool ZoneVentilationWindandStackOpenArea::setDischargeCoefficientforOpening(double dischargeCoefficientforOpening) {
507
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setDischargeCoefficientforOpening(dischargeCoefficientforOpening);
508 }
509
510 9 void ZoneVentilationWindandStackOpenArea::autocalculateDischargeCoefficientforOpening() {
511
1/1
✓ Branch 3 taken 9 times.
9 getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->autocalculateDischargeCoefficientforOpening();
512 9 }
513
514 7 double ZoneVentilationWindandStackOpenArea::minimumIndoorTemperature() const {
515
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->minimumIndoorTemperature();
516 }
517
518 9 boost::optional<Schedule> ZoneVentilationWindandStackOpenArea::minimumIndoorTemperatureSchedule() const {
519
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->minimumIndoorTemperatureSchedule();
520 }
521
522 6 double ZoneVentilationWindandStackOpenArea::maximumIndoorTemperature() const {
523
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->maximumIndoorTemperature();
524 }
525
526 7 boost::optional<Schedule> ZoneVentilationWindandStackOpenArea::maximumIndoorTemperatureSchedule() const {
527
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->maximumIndoorTemperatureSchedule();
528 }
529
530 5 double ZoneVentilationWindandStackOpenArea::deltaTemperature() const {
531
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->deltaTemperature();
532 }
533
534 7 boost::optional<Schedule> ZoneVentilationWindandStackOpenArea::deltaTemperatureSchedule() const {
535
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->deltaTemperatureSchedule();
536 }
537
538 6 double ZoneVentilationWindandStackOpenArea::minimumOutdoorTemperature() const {
539
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->minimumOutdoorTemperature();
540 }
541
542 7 boost::optional<Schedule> ZoneVentilationWindandStackOpenArea::minimumOutdoorTemperatureSchedule() const {
543
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->minimumOutdoorTemperatureSchedule();
544 }
545
546 6 double ZoneVentilationWindandStackOpenArea::maximumOutdoorTemperature() const {
547
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->maximumOutdoorTemperature();
548 }
549
550 7 boost::optional<Schedule> ZoneVentilationWindandStackOpenArea::maximumOutdoorTemperatureSchedule() const {
551
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->maximumOutdoorTemperatureSchedule();
552 }
553
554 6 double ZoneVentilationWindandStackOpenArea::maximumWindSpeed() const {
555
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->maximumWindSpeed();
556 }
557
558 11 bool ZoneVentilationWindandStackOpenArea::setMinimumIndoorTemperature(double minimumIndoorTemperature) {
559
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setMinimumIndoorTemperature(minimumIndoorTemperature);
560 }
561
562 3 bool ZoneVentilationWindandStackOpenArea::setMinimumIndoorTemperatureSchedule(Schedule& schedule) {
563
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setMinimumIndoorTemperatureSchedule(schedule);
564 }
565
566 1 void ZoneVentilationWindandStackOpenArea::resetMinimumIndoorTemperatureSchedule() {
567
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->resetMinimumIndoorTemperatureSchedule();
568 1 }
569
570 10 bool ZoneVentilationWindandStackOpenArea::setMaximumIndoorTemperature(double maximumIndoorTemperature) {
571
1/1
✓ Branch 3 taken 10 times.
10 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setMaximumIndoorTemperature(maximumIndoorTemperature);
572 }
573
574 2 bool ZoneVentilationWindandStackOpenArea::setMaximumIndoorTemperatureSchedule(Schedule& schedule) {
575
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setMaximumIndoorTemperatureSchedule(schedule);
576 }
577
578 1 void ZoneVentilationWindandStackOpenArea::resetMaximumIndoorTemperatureSchedule() {
579
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->resetMaximumIndoorTemperatureSchedule();
580 1 }
581
582 9 bool ZoneVentilationWindandStackOpenArea::setDeltaTemperature(double deltaTemperature) {
583
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setDeltaTemperature(deltaTemperature);
584 }
585
586 2 bool ZoneVentilationWindandStackOpenArea::setDeltaTemperatureSchedule(Schedule& schedule) {
587
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setDeltaTemperatureSchedule(schedule);
588 }
589
590 1 void ZoneVentilationWindandStackOpenArea::resetDeltaTemperatureSchedule() {
591
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->resetDeltaTemperatureSchedule();
592 1 }
593
594 10 bool ZoneVentilationWindandStackOpenArea::setMinimumOutdoorTemperature(double minimumOutdoorTemperature) {
595
1/1
✓ Branch 3 taken 10 times.
10 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setMinimumOutdoorTemperature(minimumOutdoorTemperature);
596 }
597
598 2 bool ZoneVentilationWindandStackOpenArea::setMinimumOutdoorTemperatureSchedule(Schedule& schedule) {
599
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setMinimumOutdoorTemperatureSchedule(schedule);
600 }
601
602 1 void ZoneVentilationWindandStackOpenArea::resetMinimumOutdoorTemperatureSchedule() {
603
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->resetMinimumOutdoorTemperatureSchedule();
604 1 }
605
606 10 bool ZoneVentilationWindandStackOpenArea::setMaximumOutdoorTemperature(double maximumOutdoorTemperature) {
607
1/1
✓ Branch 3 taken 10 times.
10 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setMaximumOutdoorTemperature(maximumOutdoorTemperature);
608 }
609
610 2 bool ZoneVentilationWindandStackOpenArea::setMaximumOutdoorTemperatureSchedule(Schedule& schedule) {
611
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setMaximumOutdoorTemperatureSchedule(schedule);
612 }
613
614 1 void ZoneVentilationWindandStackOpenArea::resetMaximumOutdoorTemperatureSchedule() {
615
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->resetMaximumOutdoorTemperatureSchedule();
616 1 }
617
618 10 bool ZoneVentilationWindandStackOpenArea::setMaximumWindSpeed(double maximumWindSpeed) {
619
1/1
✓ Branch 3 taken 10 times.
10 return getImpl<detail::ZoneVentilationWindandStackOpenArea_Impl>()->setMaximumWindSpeed(maximumWindSpeed);
620 }
621
622 /// @cond
623 5 ZoneVentilationWindandStackOpenArea::ZoneVentilationWindandStackOpenArea(std::shared_ptr<detail::ZoneVentilationWindandStackOpenArea_Impl> impl)
624
1/1
✓ Branch 3 taken 5 times.
5 : ZoneHVACComponent(std::move(impl)) {}
625 /// @endcond
626
627 } // namespace model
628 } // namespace openstudio
629