GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 72.1% 426 / 0 / 591
Functions: 78.7% 122 / 0 / 155
Branches: 56.0% 357 / 0 / 637

src/model/SimulationControl.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 "SimulationControl.hpp"
7 #include "SimulationControl_Impl.hpp"
8
9 #include "Model.hpp"
10
11 #include "AirLoopHVAC.hpp"
12 #include "AirLoopHVAC_Impl.hpp"
13 #include "ConvergenceLimits.hpp"
14 #include "ConvergenceLimits_Impl.hpp"
15 #include "HeatBalanceAlgorithm.hpp"
16 #include "HeatBalanceAlgorithm_Impl.hpp"
17 #include "InsideSurfaceConvectionAlgorithm.hpp"
18 #include "InsideSurfaceConvectionAlgorithm_Impl.hpp"
19 #include "PlantLoop.hpp"
20 #include "PlantLoop_Impl.hpp"
21 #include "OutsideSurfaceConvectionAlgorithm.hpp"
22 #include "OutsideSurfaceConvectionAlgorithm_Impl.hpp"
23 #include "RunPeriod.hpp"
24 #include "RunPeriod_Impl.hpp"
25 #include "ShadowCalculation.hpp"
26 #include "ShadowCalculation_Impl.hpp"
27 #include "SizingParameters.hpp"
28 #include "SizingParameters_Impl.hpp"
29 #include "SizingPeriod.hpp"
30 #include "SizingPeriod_Impl.hpp"
31 #include "SizingPlant.hpp"
32 #include "ThermalZone.hpp"
33 #include "ThermalZone_Impl.hpp"
34 #include "Timestep.hpp"
35 #include "Timestep_Impl.hpp"
36 #include "WeatherFile.hpp"
37 #include "WeatherFile_Impl.hpp"
38 #include "ZoneAirContaminantBalance.hpp"
39 #include "ZoneAirContaminantBalance_Impl.hpp"
40 #include "ZoneAirHeatBalanceAlgorithm.hpp"
41 #include "ZoneAirHeatBalanceAlgorithm_Impl.hpp"
42 #include "ZoneAirMassFlowConservation.hpp"
43 #include "ZoneAirMassFlowConservation_Impl.hpp"
44 #include "ZoneCapacitanceMultiplierResearchSpecial.hpp"
45 #include "ZoneCapacitanceMultiplierResearchSpecial_Impl.hpp"
46
47 #include <utilities/idd/IddFactory.hxx>
48
49 #include <utilities/idd/OS_SimulationControl_FieldEnums.hxx>
50 #include <utilities/idd/IddEnums.hxx>
51
52 #include "../utilities/sql/SqlFile.hpp"
53 #include "../utilities/core/Assert.hpp"
54 #include "../utilities/core/Compare.hpp"
55 #include "../utilities/units/Unit.hpp"
56
57 #include <algorithm>
58
59 namespace openstudio {
60 namespace model {
61
62 namespace detail {
63
64 1207 SimulationControl_Impl::SimulationControl_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
65 1207 : ParentObject_Impl(idfObject, model, keepHandle) {
66
4/6
✓ Branch 1 taken 1207 times.
✓ Branch 4 taken 1207 times.
✓ Branch 7 taken 1207 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 1207 times.
✗ Branch 13 not taken.
1207 OS_ASSERT(idfObject.iddObject().type() == SimulationControl::iddObjectType());
67 1207 }
68
69 64 SimulationControl_Impl::SimulationControl_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle)
70 64 : ParentObject_Impl(other, model, keepHandle) {
71
4/6
✓ Branch 1 taken 64 times.
✓ Branch 4 taken 64 times.
✓ Branch 7 taken 64 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 64 times.
✗ Branch 13 not taken.
64 OS_ASSERT(other.iddObject().type() == SimulationControl::iddObjectType());
72 64 }
73
74 134 SimulationControl_Impl::SimulationControl_Impl(const SimulationControl_Impl& other, Model_Impl* model, bool keepHandle)
75 134 : ParentObject_Impl(other, model, keepHandle) {}
76
77 // return the parent object in the hierarchy
78 1 boost::optional<ParentObject> SimulationControl_Impl::parent() const {
79 // Simulation is highest level, there is no parent
80 1 return {};
81 }
82
83 // return any children objects in the hierarchy
84 882 std::vector<ModelObject> SimulationControl_Impl::children() const {
85 882 std::vector<ModelObject> result;
86
87
1/1
✓ Branch 1 taken 882 times.
882 OptionalConvergenceLimits ocl = convergenceLimits();
88
2/2
✓ Branch 0 taken 65 times.
✓ Branch 1 taken 817 times.
882 if (ocl) {
89
2/2
✓ Branch 1 taken 65 times.
✓ Branch 4 taken 65 times.
65 result.push_back(*ocl);
90 }
91
92 //OptionalDaylightSavingsTime odst = daylightSavingsTime();
93 //if (odst) { result.push_back(*odst); }
94
95
1/1
✓ Branch 1 taken 882 times.
882 OptionalHeatBalanceAlgorithm ohba = heatBalanceAlgorithm();
96
2/2
✓ Branch 0 taken 64 times.
✓ Branch 1 taken 818 times.
882 if (ohba) {
97
2/2
✓ Branch 1 taken 64 times.
✓ Branch 4 taken 64 times.
64 result.push_back(*ohba);
98 }
99
100
1/1
✓ Branch 1 taken 882 times.
882 OptionalInsideSurfaceConvectionAlgorithm oisca = insideSurfaceConvectionAlgorithm();
101
2/2
✓ Branch 0 taken 60 times.
✓ Branch 1 taken 822 times.
882 if (oisca) {
102
2/2
✓ Branch 1 taken 60 times.
✓ Branch 4 taken 60 times.
60 result.push_back(*oisca);
103 }
104
105
1/1
✓ Branch 1 taken 882 times.
882 OptionalOutsideSurfaceConvectionAlgorithm oosca = outsideSurfaceConvectionAlgorithm();
106
2/2
✓ Branch 0 taken 58 times.
✓ Branch 1 taken 824 times.
882 if (oosca) {
107
2/2
✓ Branch 1 taken 58 times.
✓ Branch 4 taken 58 times.
58 result.push_back(*oosca);
108 }
109
110
1/1
✓ Branch 1 taken 882 times.
882 RunPeriodVector rps = runPeriods();
111
1/1
✓ Branch 5 taken 882 times.
882 result.insert(result.end(), rps.begin(), rps.end());
112
113
1/1
✓ Branch 1 taken 882 times.
882 OptionalShadowCalculation osc = shadowCalculation();
114
2/2
✓ Branch 0 taken 62 times.
✓ Branch 1 taken 820 times.
882 if (osc) {
115
2/2
✓ Branch 1 taken 62 times.
✓ Branch 4 taken 62 times.
62 result.push_back(*osc);
116 }
117
118 //SpecialDaysVector sds = specialDays();
119 //result.insert(result.end(),sds.begin(),sds.end());
120
121
1/1
✓ Branch 1 taken 882 times.
882 OptionalSizingParameters osp = sizingParameters();
122
2/2
✓ Branch 0 taken 12 times.
✓ Branch 1 taken 870 times.
882 if (osp) {
123
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 result.push_back(*osp);
124 }
125
126
1/1
✓ Branch 1 taken 882 times.
882 OptionalTimestep ot = timestep();
127
2/2
✓ Branch 0 taken 866 times.
✓ Branch 1 taken 16 times.
882 if (ot) {
128
2/2
✓ Branch 1 taken 866 times.
✓ Branch 4 taken 866 times.
866 result.push_back(*ot);
129 }
130
131
1/1
✓ Branch 1 taken 882 times.
882 OptionalZoneAirContaminantBalance ozacb = zoneAirContaminantBalance();
132
2/2
✓ Branch 0 taken 16 times.
✓ Branch 1 taken 866 times.
882 if (ozacb) {
133
2/2
✓ Branch 1 taken 16 times.
✓ Branch 4 taken 16 times.
16 result.push_back(*ozacb);
134 }
135
136
1/1
✓ Branch 1 taken 882 times.
882 OptionalZoneAirHeatBalanceAlgorithm ozahba = zoneAirHeatBalanceAlgorithm();
137
2/2
✓ Branch 0 taken 49 times.
✓ Branch 1 taken 833 times.
882 if (ozahba) {
138
2/2
✓ Branch 1 taken 49 times.
✓ Branch 4 taken 49 times.
49 result.push_back(*ozahba);
139 }
140
141
1/1
✓ Branch 1 taken 882 times.
882 OptionalZoneAirMassFlowConservation ozamfc = zoneAirMassFlowConservation();
142
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 882 times.
882 if (ozamfc) {
143 ✗ result.push_back(*ozamfc);
144 }
145
146 882 OptionalZoneCapacitanceMultiplierResearchSpecial ozcmrs;
147
1/1
✓ Branch 1 taken 882 times.
882 ozcmrs = zoneCapacitanceMultiplierResearchSpecial();
148
2/2
✓ Branch 0 taken 12 times.
✓ Branch 1 taken 870 times.
882 if (ozcmrs) {
149
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 result.push_back(*ozcmrs);
150 }
151
152 1764 return result;
153 882 }
154
155 ✗ std::vector<IddObjectType> SimulationControl_Impl::allowableChildTypes() const {
156 ✗ IddObjectTypeVector result;
157 ✗ result.push_back(ConvergenceLimits::iddObjectType());
158 ✗ result.push_back(HeatBalanceAlgorithm::iddObjectType());
159 ✗ result.push_back(InsideSurfaceConvectionAlgorithm::iddObjectType());
160 ✗ result.push_back(OutsideSurfaceConvectionAlgorithm::iddObjectType());
161 ✗ result.push_back(RunPeriod::iddObjectType());
162 ✗ result.push_back(ShadowCalculation::iddObjectType());
163 ✗ result.push_back(SizingParameters::iddObjectType());
164 ✗ result.push_back(Timestep::iddObjectType());
165 ✗ result.push_back(ZoneAirContaminantBalance::iddObjectType());
166 ✗ result.push_back(ZoneAirHeatBalanceAlgorithm::iddObjectType());
167 ✗ result.push_back(ZoneAirMassFlowConservation::iddObjectType());
168 ✗ result.push_back(ZoneCapacitanceMultiplierResearchSpecial::iddObjectType());
169 ✗ return result;
170 ✗ }
171
172 1 const std::vector<std::string>& SimulationControl_Impl::outputVariableNames() const {
173
2/4
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
1 static const std::vector<std::string> result;
174 1 return result;
175 }
176
177 8 IddObjectType SimulationControl_Impl::iddObjectType() const {
178 8 return SimulationControl::iddObjectType();
179 }
180
181 877 bool SimulationControl_Impl::doZoneSizingCalculation() const {
182
183 838 auto shouldItBeOn = [this]() -> bool {
184
1/1
✓ Branch 1 taken 838 times.
838 const auto m = model();
185
1/1
✓ Branch 1 taken 838 times.
838 const auto hasSizingPeriods = !m.getModelObjects<SizingPeriod>().empty();
186
2/2
✓ Branch 0 taken 803 times.
✓ Branch 1 taken 35 times.
838 if (!hasSizingPeriods) {
187 803 return false;
188 }
189
190
1/1
✓ Branch 1 taken 35 times.
35 const auto zones = m.getConcreteModelObjects<ThermalZone>();
191
2/2
✓ Branch 1 taken 29 times.
✓ Branch 8 taken 35 times.
64 const auto hasZoneEquipment = std::any_of(zones.cbegin(), zones.cend(), [](const auto& z) { return !z.equipment().empty(); });
192
193 35 return hasZoneEquipment;
194 838 };
195
196
3/3
✓ Branch 1 taken 877 times.
✓ Branch 3 taken 52 times.
✓ Branch 4 taken 825 times.
877 if (!isDoZoneSizingCalculationDefaulted()) {
197
1/1
✓ Branch 1 taken 52 times.
52 boost::optional<std::string> value = getString(OS_SimulationControlFields::DoZoneSizingCalculation, true);
198
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 52 times.
✗ Branch 4 not taken.
52 OS_ASSERT(value);
199
3/3
✓ Branch 1 taken 52 times.
✓ Branch 4 taken 52 times.
✓ Branch 7 taken 52 times.
52 const auto result = openstudio::istringEqual(value.get(), "Yes");
200
5/7
✓ Branch 0 taken 13 times.
✓ Branch 1 taken 39 times.
✓ Branch 3 taken 13 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 13 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 52 times.
52 if (!result && shouldItBeOn()) {
201 ✗ LOG(Warn, "You have zonal equipment and design days, it's possible you should enable SimulationControl::DoZoneSizingCalculation");
202 }
203 52 return result;
204 52 }
205
206
1/1
✓ Branch 1 taken 825 times.
825 const auto result = shouldItBeOn();
207
2/2
✓ Branch 0 taken 15 times.
✓ Branch 1 taken 810 times.
825 if (result) {
208
5/5
✓ Branch 1 taken 15 times.
✓ Branch 4 taken 15 times.
✓ Branch 7 taken 15 times.
✓ Branch 10 taken 15 times.
✓ Branch 13 taken 15 times.
15 LOG(Debug, "You have zonal equipment and design days, and SimulationControl::DoZoneSizingCalculation is defaulted: turning on.");
209 }
210
211 825 return result;
212 }
213
214 880 bool SimulationControl_Impl::isDoZoneSizingCalculationDefaulted() const {
215 880 return isEmpty(OS_SimulationControlFields::DoZoneSizingCalculation);
216 }
217
218 877 bool SimulationControl_Impl::doSystemSizingCalculation() const {
219
220 838 auto shouldItBeOn = [this]() -> bool {
221
1/1
✓ Branch 1 taken 838 times.
838 const auto m = model();
222
9/14
✓ Branch 1 taken 838 times.
✓ Branch 4 taken 35 times.
✓ Branch 5 taken 803 times.
✓ Branch 7 taken 35 times.
✓ Branch 10 taken 14 times.
✓ Branch 11 taken 21 times.
✓ Branch 12 taken 35 times.
✓ Branch 13 taken 803 times.
✓ Branch 15 taken 838 times.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
1676 return !m.getModelObjects<SizingPeriod>().empty() && !m.getConcreteModelObjects<AirLoopHVAC>().empty();
223 838 };
224
225
3/3
✓ Branch 1 taken 877 times.
✓ Branch 3 taken 52 times.
✓ Branch 4 taken 825 times.
877 if (!isDoSystemSizingCalculationDefaulted()) {
226
1/1
✓ Branch 1 taken 52 times.
52 boost::optional<std::string> value = getString(OS_SimulationControlFields::DoSystemSizingCalculation, true);
227
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 52 times.
✗ Branch 4 not taken.
52 OS_ASSERT(value);
228
3/3
✓ Branch 1 taken 52 times.
✓ Branch 4 taken 52 times.
✓ Branch 7 taken 52 times.
52 const auto result = openstudio::istringEqual(value.get(), "Yes");
229
5/7
✓ Branch 0 taken 13 times.
✓ Branch 1 taken 39 times.
✓ Branch 3 taken 13 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 13 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 52 times.
52 if (!result && shouldItBeOn()) {
230 ✗ LOG(Warn, "You have AirLoopHVAC(s) and design day(s), it's possible you should enable SimulationControl::DoSystemSizingCalculation");
231 }
232 52 return result;
233 52 }
234
235
1/1
✓ Branch 1 taken 825 times.
825 const auto result = shouldItBeOn();
236
2/2
✓ Branch 0 taken 14 times.
✓ Branch 1 taken 811 times.
825 if (result) {
237
5/5
✓ Branch 1 taken 14 times.
✓ Branch 4 taken 14 times.
✓ Branch 7 taken 14 times.
✓ Branch 10 taken 14 times.
✓ Branch 13 taken 14 times.
14 LOG(Debug, "You have AirLoopHVAC(s) and design day(s), and SimulationControl::DoSystemSizingCalculation is defaulted: assuming on.");
238 }
239
240 825 return result;
241 }
242
243 880 bool SimulationControl_Impl::isDoSystemSizingCalculationDefaulted() const {
244 880 return isEmpty(OS_SimulationControlFields::DoSystemSizingCalculation);
245 }
246
247 877 bool SimulationControl_Impl::doPlantSizingCalculation() const {
248
249 873 auto shouldItBeOn = [this]() -> bool {
250
1/1
✓ Branch 1 taken 873 times.
873 const auto m = model();
251
9/14
✓ Branch 1 taken 873 times.
✓ Branch 4 taken 70 times.
✓ Branch 5 taken 803 times.
✓ Branch 7 taken 70 times.
✓ Branch 10 taken 21 times.
✓ Branch 11 taken 49 times.
✓ Branch 12 taken 70 times.
✓ Branch 13 taken 803 times.
✓ Branch 15 taken 873 times.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
1746 return !m.getModelObjects<SizingPeriod>().empty() && !m.getConcreteModelObjects<PlantLoop>().empty();
252 873 };
253
254
3/3
✓ Branch 1 taken 877 times.
✓ Branch 3 taken 18 times.
✓ Branch 4 taken 859 times.
877 if (!isDoPlantSizingCalculationDefaulted()) {
255
1/1
✓ Branch 1 taken 18 times.
18 boost::optional<std::string> value = getString(OS_SimulationControlFields::DoPlantSizingCalculation, true);
256
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 18 times.
✗ Branch 4 not taken.
18 OS_ASSERT(value);
257
3/3
✓ Branch 1 taken 18 times.
✓ Branch 4 taken 18 times.
✓ Branch 7 taken 18 times.
18 const auto result = openstudio::istringEqual(value.get(), "Yes");
258
5/7
✓ Branch 0 taken 14 times.
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 14 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 14 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 18 times.
18 if (!result && shouldItBeOn()) {
259 ✗ LOG(Warn, "You have PlantLoop(s) and design days, it's possible you should enable SimulationControl::DoPlantSizingCalculation");
260 }
261 18 return result;
262 18 }
263
264
1/1
✓ Branch 1 taken 859 times.
859 const auto result = shouldItBeOn();
265
2/2
✓ Branch 0 taken 21 times.
✓ Branch 1 taken 838 times.
859 if (result) {
266
5/5
✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
✓ Branch 7 taken 21 times.
✓ Branch 10 taken 21 times.
✓ Branch 13 taken 21 times.
21 LOG(Debug, "You have PlantLoop(s) and design days, and SimulationControl::DoPlantSizingCalculation is defaulted: assuming on.");
267 }
268
269 859 return result;
270 }
271
272 880 bool SimulationControl_Impl::isDoPlantSizingCalculationDefaulted() const {
273 880 return isEmpty(OS_SimulationControlFields::DoPlantSizingCalculation);
274 }
275
276 866 bool SimulationControl_Impl::runSimulationforSizingPeriods() const {
277
1/1
✓ Branch 1 taken 866 times.
866 boost::optional<std::string> value = getString(OS_SimulationControlFields::RunSimulationforSizingPeriods, true);
278
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 866 times.
✗ Branch 4 not taken.
866 OS_ASSERT(value);
279
3/3
✓ Branch 1 taken 866 times.
✓ Branch 4 taken 866 times.
✓ Branch 7 taken 866 times.
1732 return openstudio::istringEqual(value.get(), "Yes");
280 866 }
281
282 3 bool SimulationControl_Impl::isRunSimulationforSizingPeriodsDefaulted() const {
283 3 return isEmpty(OS_SimulationControlFields::RunSimulationforSizingPeriods);
284 }
285
286 866 bool SimulationControl_Impl::runSimulationforWeatherFileRunPeriods() const {
287
1/1
✓ Branch 1 taken 866 times.
866 boost::optional<std::string> value = getString(OS_SimulationControlFields::RunSimulationforWeatherFileRunPeriods, true);
288
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 866 times.
✗ Branch 4 not taken.
866 OS_ASSERT(value);
289
3/3
✓ Branch 1 taken 866 times.
✓ Branch 4 taken 866 times.
✓ Branch 7 taken 866 times.
1732 return openstudio::istringEqual(value.get(), "Yes");
290 866 }
291
292 3 bool SimulationControl_Impl::isRunSimulationforWeatherFileRunPeriodsDefaulted() const {
293 3 return isEmpty(OS_SimulationControlFields::RunSimulationforWeatherFileRunPeriods);
294 }
295
296 8 double SimulationControl_Impl::loadsConvergenceToleranceValue() const {
297
1/1
✓ Branch 1 taken 8 times.
8 boost::optional<double> value = getDouble(OS_SimulationControlFields::LoadsConvergenceToleranceValue, true);
298
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 8 times.
✗ Branch 4 not taken.
8 OS_ASSERT(value);
299
1/1
✓ Branch 1 taken 8 times.
16 return value.get();
300 }
301
302 64 bool SimulationControl_Impl::isLoadsConvergenceToleranceValueDefaulted() const {
303 64 return isEmpty(OS_SimulationControlFields::LoadsConvergenceToleranceValue);
304 }
305
306 8 double SimulationControl_Impl::temperatureConvergenceToleranceValue() const {
307
1/1
✓ Branch 1 taken 8 times.
8 boost::optional<double> value = getDouble(OS_SimulationControlFields::TemperatureConvergenceToleranceValue, true);
308
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 8 times.
✗ Branch 4 not taken.
8 OS_ASSERT(value);
309
1/1
✓ Branch 1 taken 8 times.
16 return value.get();
310 }
311
312 64 bool SimulationControl_Impl::isTemperatureConvergenceToleranceValueDefaulted() const {
313 64 return isEmpty(OS_SimulationControlFields::TemperatureConvergenceToleranceValue);
314 }
315
316 8 std::string SimulationControl_Impl::solarDistribution() const {
317
1/1
✓ Branch 1 taken 8 times.
8 boost::optional<std::string> value = getString(OS_SimulationControlFields::SolarDistribution, true);
318
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 8 times.
✗ Branch 4 not taken.
8 OS_ASSERT(value);
319
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 return value.get();
320 8 }
321
322 63 bool SimulationControl_Impl::isSolarDistributionDefaulted() const {
323 63 return isEmpty(OS_SimulationControlFields::SolarDistribution);
324 }
325
326 7 int SimulationControl_Impl::maximumNumberofWarmupDays() const {
327
1/1
✓ Branch 1 taken 7 times.
7 boost::optional<int> value = getInt(OS_SimulationControlFields::MaximumNumberofWarmupDays, true);
328
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
7 OS_ASSERT(value);
329
1/1
✓ Branch 1 taken 7 times.
14 return value.get();
330 }
331
332 64 bool SimulationControl_Impl::isMaximumNumberofWarmupDaysDefaulted() const {
333 64 return isEmpty(OS_SimulationControlFields::MaximumNumberofWarmupDays);
334 }
335
336 7 int SimulationControl_Impl::minimumNumberofWarmupDays() const {
337
1/1
✓ Branch 1 taken 7 times.
7 boost::optional<int> value = getInt(OS_SimulationControlFields::MinimumNumberofWarmupDays, true);
338
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
7 OS_ASSERT(value);
339
1/1
✓ Branch 1 taken 7 times.
14 return value.get();
340 }
341
342 64 bool SimulationControl_Impl::isMinimumNumberofWarmupDaysDefaulted() const {
343 64 return isEmpty(OS_SimulationControlFields::MinimumNumberofWarmupDays);
344 }
345
346 226 bool SimulationControl_Impl::setDoZoneSizingCalculation(bool doZoneSizingCalculation) {
347 226 bool result = false;
348
2/2
✓ Branch 0 taken 181 times.
✓ Branch 1 taken 45 times.
226 if (doZoneSizingCalculation) {
349
2/2
✓ Branch 1 taken 181 times.
✓ Branch 4 taken 181 times.
543 result = setString(OS_SimulationControlFields::DoZoneSizingCalculation, "Yes");
350 } else {
351
2/2
✓ Branch 1 taken 45 times.
✓ Branch 4 taken 45 times.
135 result = setString(OS_SimulationControlFields::DoZoneSizingCalculation, "No");
352 }
353
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 226 times.
226 OS_ASSERT(result);
354 226 return result;
355 }
356
357 2 void SimulationControl_Impl::resetDoZoneSizingCalculation() {
358
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
4 bool result = setString(OS_SimulationControlFields::DoZoneSizingCalculation, "");
359
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
360 2 }
361
362 226 bool SimulationControl_Impl::setDoSystemSizingCalculation(bool doSystemSizingCalculation) {
363 226 bool result = false;
364
2/2
✓ Branch 0 taken 175 times.
✓ Branch 1 taken 51 times.
226 if (doSystemSizingCalculation) {
365
2/2
✓ Branch 1 taken 175 times.
✓ Branch 4 taken 175 times.
525 result = setString(OS_SimulationControlFields::DoSystemSizingCalculation, "Yes");
366 } else {
367
2/2
✓ Branch 1 taken 51 times.
✓ Branch 4 taken 51 times.
153 result = setString(OS_SimulationControlFields::DoSystemSizingCalculation, "No");
368 }
369
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 226 times.
226 OS_ASSERT(result);
370 226 return result;
371 }
372
373 2 void SimulationControl_Impl::resetDoSystemSizingCalculation() {
374
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
4 bool result = setString(OS_SimulationControlFields::DoSystemSizingCalculation, "");
375
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
376 2 }
377
378 58 bool SimulationControl_Impl::setDoPlantSizingCalculation(bool doPlantSizingCalculation) {
379 58 bool result = false;
380
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 52 times.
58 if (doPlantSizingCalculation) {
381
2/2
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
18 result = setString(OS_SimulationControlFields::DoPlantSizingCalculation, "Yes");
382 } else {
383
2/2
✓ Branch 1 taken 52 times.
✓ Branch 4 taken 52 times.
156 result = setString(OS_SimulationControlFields::DoPlantSizingCalculation, "No");
384 }
385
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 58 times.
58 OS_ASSERT(result);
386 58 return result;
387 }
388
389 2 void SimulationControl_Impl::resetDoPlantSizingCalculation() {
390
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
4 bool result = setString(OS_SimulationControlFields::DoPlantSizingCalculation, "");
391
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
392 2 }
393
394 227 bool SimulationControl_Impl::setRunSimulationforSizingPeriods(bool runSimulationforSizingPeriods) {
395 227 bool result = false;
396
2/2
✓ Branch 0 taken 34 times.
✓ Branch 1 taken 193 times.
227 if (runSimulationforSizingPeriods) {
397
2/2
✓ Branch 1 taken 34 times.
✓ Branch 4 taken 34 times.
102 result = setString(OS_SimulationControlFields::RunSimulationforSizingPeriods, "Yes");
398 } else {
399
2/2
✓ Branch 1 taken 193 times.
✓ Branch 4 taken 193 times.
579 result = setString(OS_SimulationControlFields::RunSimulationforSizingPeriods, "No");
400 }
401
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 227 times.
227 OS_ASSERT(result);
402 227 return result;
403 }
404
405 1 void SimulationControl_Impl::resetRunSimulationforSizingPeriods() {
406
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_SimulationControlFields::RunSimulationforSizingPeriods, "");
407
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
408 1 }
409
410 227 bool SimulationControl_Impl::setRunSimulationforWeatherFileRunPeriods(bool runSimulationforWeatherFileRunPeriods) {
411 227 bool result = false;
412
2/2
✓ Branch 0 taken 214 times.
✓ Branch 1 taken 13 times.
227 if (runSimulationforWeatherFileRunPeriods) {
413
2/2
✓ Branch 1 taken 214 times.
✓ Branch 4 taken 214 times.
642 result = setString(OS_SimulationControlFields::RunSimulationforWeatherFileRunPeriods, "Yes");
414 } else {
415
2/2
✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
39 result = setString(OS_SimulationControlFields::RunSimulationforWeatherFileRunPeriods, "No");
416 }
417
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 227 times.
227 OS_ASSERT(result);
418 227 return result;
419 }
420
421 1 void SimulationControl_Impl::resetRunSimulationforWeatherFileRunPeriods() {
422
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_SimulationControlFields::RunSimulationforWeatherFileRunPeriods, "");
423
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
424 1 }
425
426 19 bool SimulationControl_Impl::setLoadsConvergenceToleranceValue(double loadsConvergenceToleranceValue) {
427 19 bool result = setDouble(OS_SimulationControlFields::LoadsConvergenceToleranceValue, loadsConvergenceToleranceValue);
428 19 return result;
429 }
430
431 1 void SimulationControl_Impl::resetLoadsConvergenceToleranceValue() {
432
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_SimulationControlFields::LoadsConvergenceToleranceValue, "");
433
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
434 1 }
435
436 19 bool SimulationControl_Impl::setTemperatureConvergenceToleranceValue(double temperatureConvergenceToleranceValue) {
437 19 bool result = setDouble(OS_SimulationControlFields::TemperatureConvergenceToleranceValue, temperatureConvergenceToleranceValue);
438 19 return result;
439 }
440
441 1 void SimulationControl_Impl::resetTemperatureConvergenceToleranceValue() {
442
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_SimulationControlFields::TemperatureConvergenceToleranceValue, "");
443
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
444 1 }
445
446 77 bool SimulationControl_Impl::setSolarDistribution(const std::string& solarDistribution) {
447 77 bool result = setString(OS_SimulationControlFields::SolarDistribution, solarDistribution);
448 77 return result;
449 }
450
451 ✗ void SimulationControl_Impl::resetSolarDistribution() {
452 ✗ bool result = setString(OS_SimulationControlFields::SolarDistribution, "");
453 ✗ OS_ASSERT(result);
454 ✗ }
455
456 16 bool SimulationControl_Impl::setMaximumNumberofWarmupDays(int maximumNumberofWarmupDays) {
457 16 bool result = setInt(OS_SimulationControlFields::MaximumNumberofWarmupDays, maximumNumberofWarmupDays);
458 16 return result;
459 }
460
461 1 void SimulationControl_Impl::resetMaximumNumberofWarmupDays() {
462
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_SimulationControlFields::MaximumNumberofWarmupDays, "");
463
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
464 1 }
465
466 16 bool SimulationControl_Impl::setMinimumNumberofWarmupDays(int minimumNumberofWarmupDays) {
467 16 bool result = setInt(OS_SimulationControlFields::MinimumNumberofWarmupDays, minimumNumberofWarmupDays);
468 16 return result;
469 }
470
471 1 void SimulationControl_Impl::resetMinimumNumberofWarmupDays() {
472
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_SimulationControlFields::MinimumNumberofWarmupDays, "");
473
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
474 1 }
475
476 ✗ std::vector<std::string> SimulationControl_Impl::solarDistributionValues() const {
477 ✗ return SimulationControl::validSolarDistributionValues();
478 }
479
480 882 boost::optional<ConvergenceLimits> SimulationControl_Impl::convergenceLimits() const {
481
2/2
✓ Branch 1 taken 882 times.
✓ Branch 4 taken 882 times.
882 return model().getOptionalUniqueModelObject<ConvergenceLimits>();
482 }
483
484 882 boost::optional<HeatBalanceAlgorithm> SimulationControl_Impl::heatBalanceAlgorithm() const {
485
2/2
✓ Branch 1 taken 882 times.
✓ Branch 4 taken 882 times.
882 return model().getOptionalUniqueModelObject<HeatBalanceAlgorithm>();
486 }
487
488 882 boost::optional<InsideSurfaceConvectionAlgorithm> SimulationControl_Impl::insideSurfaceConvectionAlgorithm() const {
489
2/2
✓ Branch 1 taken 882 times.
✓ Branch 4 taken 882 times.
882 return model().getOptionalUniqueModelObject<InsideSurfaceConvectionAlgorithm>();
490 }
491
492 882 boost::optional<OutsideSurfaceConvectionAlgorithm> SimulationControl_Impl::outsideSurfaceConvectionAlgorithm() const {
493
2/2
✓ Branch 1 taken 882 times.
✓ Branch 4 taken 882 times.
882 return model().getOptionalUniqueModelObject<OutsideSurfaceConvectionAlgorithm>();
494 }
495
496 882 std::vector<RunPeriod> SimulationControl_Impl::runPeriods() const {
497
2/2
✓ Branch 1 taken 882 times.
✓ Branch 4 taken 882 times.
882 return model().getConcreteModelObjects<RunPeriod>();
498 }
499
500 882 boost::optional<ShadowCalculation> SimulationControl_Impl::shadowCalculation() const {
501
2/2
✓ Branch 1 taken 882 times.
✓ Branch 4 taken 882 times.
882 return model().getOptionalUniqueModelObject<ShadowCalculation>();
502 }
503
504 882 boost::optional<SizingParameters> SimulationControl_Impl::sizingParameters() const {
505
2/2
✓ Branch 1 taken 882 times.
✓ Branch 4 taken 882 times.
882 return model().getOptionalUniqueModelObject<SizingParameters>();
506 }
507
508 882 boost::optional<Timestep> SimulationControl_Impl::timestep() const {
509
2/2
✓ Branch 1 taken 882 times.
✓ Branch 4 taken 882 times.
882 return model().getOptionalUniqueModelObject<Timestep>();
510 }
511
512 882 boost::optional<ZoneAirContaminantBalance> SimulationControl_Impl::zoneAirContaminantBalance() const {
513
2/2
✓ Branch 1 taken 882 times.
✓ Branch 4 taken 882 times.
882 return model().getOptionalUniqueModelObject<ZoneAirContaminantBalance>();
514 }
515
516 882 boost::optional<ZoneAirHeatBalanceAlgorithm> SimulationControl_Impl::zoneAirHeatBalanceAlgorithm() const {
517
2/2
✓ Branch 1 taken 882 times.
✓ Branch 4 taken 882 times.
882 return model().getOptionalUniqueModelObject<ZoneAirHeatBalanceAlgorithm>();
518 }
519
520 882 boost::optional<ZoneAirMassFlowConservation> SimulationControl_Impl::zoneAirMassFlowConservation() const {
521
2/2
✓ Branch 1 taken 882 times.
✓ Branch 4 taken 882 times.
882 return model().getOptionalUniqueModelObject<ZoneAirMassFlowConservation>();
522 }
523
524 882 boost::optional<ZoneCapacitanceMultiplierResearchSpecial> SimulationControl_Impl::zoneCapacitanceMultiplierResearchSpecial() const {
525
2/2
✓ Branch 1 taken 882 times.
✓ Branch 4 taken 882 times.
882 return model().getOptionalUniqueModelObject<ZoneCapacitanceMultiplierResearchSpecial>();
526 }
527
528 ✗ std::vector<std::string> SimulationControl_Impl::sizingEnvironmentPeriods() const {
529 ✗ StringVector result;
530 ✗ OptionalSqlFile oSqlFile = model().sqlFile();
531 ✗ if (oSqlFile && runSimulationforSizingPeriods()) {
532 ✗ SizingPeriodVector sizingPeriods = model().getModelObjects<SizingPeriod>();
533 ✗ StringVector environmentPeriods = oSqlFile->availableEnvPeriods();
534 ✗ for (const SizingPeriod& sp : sizingPeriods) {
535 ✗ std::string spName = sp.name().get();
536 ✗ if (std::find(environmentPeriods.begin(), environmentPeriods.end(), spName) != environmentPeriods.end()) {
537 ✗ result.push_back(spName);
538 } else {
539 ✗ LOG(Warn, "Expected to find environment period '" << spName << "' in SqlFile, but did not.");
540 }
541 ✗ }
542 ✗ }
543 ✗ return result;
544 ✗ }
545
546 ✗ std::vector<std::string> SimulationControl_Impl::annualSimulationEnvironmentPeriods() const {
547 ✗ StringVector result;
548 ✗ OptionalSqlFile oSqlFile = model().sqlFile();
549 ✗ if (oSqlFile && runSimulationforWeatherFileRunPeriods()) {
550 ✗ RunPeriodVector runPeriods = this->runPeriods();
551 ✗ StringVector environmentPeriods = oSqlFile->availableEnvPeriods();
552 ✗ for (const RunPeriod& runPeriod : runPeriods) {
553 ✗ if (runPeriod.isAnnual() && !runPeriod.isRepeated()) {
554 ✗ std::string rpName = runPeriod.name().get();
555 ✗ auto it = std::find_if(environmentPeriods.begin(), environmentPeriods.end(),
556 ✗ [&rpName](const auto& envName) { return istringEqual(rpName, envName); });
557 ✗ if (it != environmentPeriods.end()) {
558 ✗ result.push_back(*it);
559 }
560 ✗ }
561 }
562 ✗ if (result.empty()) {
563 // try environment name from WeatherFile
564 ✗ OptionalWeatherFile oWeatherFile = model().getOptionalUniqueModelObject<WeatherFile>();
565 ✗ if (oWeatherFile) {
566 ✗ OptionalString os = oWeatherFile->environmentName();
567 ✗ if (os) {
568 ✗ std::string candidate = *os;
569 ✗ auto it = std::find_if(environmentPeriods.begin(), environmentPeriods.end(),
570 ✗ [&candidate](const auto& envName) { return istringEqual(candidate, envName); });
571
572 ✗ if (it != environmentPeriods.end()) {
573 ✗ result.push_back(*it);
574 }
575 ✗ }
576 ✗ }
577 ✗ }
578 ✗ }
579 ✗ return result;
580 ✗ }
581
582 ✗ std::vector<std::string> SimulationControl_Impl::partialYearEnvironmentPeriods() const {
583 ✗ StringVector result;
584 ✗ OptionalSqlFile oSqlFile = model().sqlFile();
585 ✗ if (oSqlFile && runSimulationforWeatherFileRunPeriods()) {
586 ✗ RunPeriodVector runPeriods = this->runPeriods();
587 ✗ StringVector environmentPeriods = oSqlFile->availableEnvPeriods();
588 ✗ for (const RunPeriod& runPeriod : runPeriods) {
589 ✗ if (runPeriod.isPartialYear()) {
590 ✗ std::string rpName = runPeriod.name().get();
591 ✗ auto it = std::find(environmentPeriods.begin(), environmentPeriods.end(), rpName);
592 ✗ if (it != environmentPeriods.end()) {
593 ✗ result.push_back(*it);
594 }
595 ✗ }
596 }
597 ✗ }
598 ✗ return result;
599 ✗ }
600
601 ✗ std::vector<std::string> SimulationControl_Impl::repeatedIntervalEnvironmentPeriods() const {
602 ✗ StringVector result;
603 ✗ OptionalSqlFile oSqlFile = model().sqlFile();
604 ✗ if (oSqlFile && runSimulationforWeatherFileRunPeriods()) {
605 ✗ RunPeriodVector runPeriods = this->runPeriods();
606 ✗ StringVector environmentPeriods = oSqlFile->availableEnvPeriods();
607 ✗ for (const RunPeriod& runPeriod : runPeriods) {
608 ✗ if (runPeriod.isRepeated()) {
609 ✗ std::string rpName = runPeriod.name().get();
610 ✗ auto it = std::find(environmentPeriods.begin(), environmentPeriods.end(), rpName);
611 ✗ if (it != environmentPeriods.end()) {
612 ✗ result.push_back(*it);
613 }
614 ✗ }
615 }
616 ✗ }
617 ✗ return result;
618 ✗ }
619
620 877 bool SimulationControl_Impl::doHVACSizingSimulationforSizingPeriods() const {
621
622 874 auto shouldItBeOn = [this]() -> bool {
623
1/1
✓ Branch 1 taken 874 times.
874 const auto m = model();
624
1/1
✓ Branch 1 taken 874 times.
874 const auto hasSizingPeriods = !m.getModelObjects<SizingPeriod>().empty();
625
2/2
✓ Branch 0 taken 803 times.
✓ Branch 1 taken 71 times.
874 if (!hasSizingPeriods) {
626 803 return false;
627 }
628
629 // Sizing:Plant I/O: "The use of 'Coincident' sizing option requires that the object
630 // be set to YES for the input field called Do HVAC Sizing Simulation for Sizing Periods"
631
1/1
✓ Branch 1 taken 71 times.
71 const auto plantLoops = m.getConcreteModelObjects<PlantLoop>();
632
1/1
✓ Branch 3 taken 71 times.
71 const auto hasPlantsWithCoincidentSizingOption = std::any_of(plantLoops.begin(), plantLoops.end(), [](const PlantLoop& p) {
633
4/4
✓ Branch 1 taken 21 times.
✓ Branch 4 taken 21 times.
✓ Branch 7 taken 21 times.
✓ Branch 10 taken 21 times.
63 return openstudio::istringEqual("Coincident", p.sizingPlant().sizingOption());
634 });
635
636 71 return hasPlantsWithCoincidentSizingOption;
637 874 };
638
639
3/3
✓ Branch 1 taken 877 times.
✓ Branch 3 taken 18 times.
✓ Branch 4 taken 859 times.
877 if (!isDoHVACSizingSimulationforSizingPeriodsDefaulted()) {
640
1/1
✓ Branch 1 taken 18 times.
18 boost::optional<std::string> value = getString(OS_SimulationControlFields::DoHVACSizingSimulationforSizingPeriods, true);
641
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 18 times.
✗ Branch 4 not taken.
18 OS_ASSERT(value);
642
3/3
✓ Branch 1 taken 18 times.
✓ Branch 4 taken 18 times.
✓ Branch 7 taken 18 times.
18 const auto result = openstudio::istringEqual(value.get(), "Yes");
643
5/7
✓ Branch 0 taken 15 times.
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 15 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 15 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 18 times.
18 if (!result && shouldItBeOn()) {
644 ✗ LOG(Warn, "You have PlantLoop(s) with 'Coincident' Sizing Option and design day(s), it's possible you should enable "
645 "SimulationControl::DoHVACSizingSimulationforSizingPeriods");
646 }
647 18 return result;
648 18 }
649
650
1/1
✓ Branch 1 taken 859 times.
859 const auto result = shouldItBeOn();
651
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 856 times.
859 if (result) {
652
5/5
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 13 taken 3 times.
3 LOG(Debug, "You have PlantLoop(s) with 'Coincident' Sizing Option and design day(s), and "
653 "SimulationControl::DoHVACSizingSimulationforSizingPeriods is defaulted: assuming on.");
654 }
655
656 859 return result;
657 }
658
659 1736 bool SimulationControl_Impl::isDoHVACSizingSimulationforSizingPeriodsDefaulted() const {
660 1736 return isEmpty(OS_SimulationControlFields::DoHVACSizingSimulationforSizingPeriods);
661 }
662
663 58 bool SimulationControl_Impl::setDoHVACSizingSimulationforSizingPeriods(bool doHVACSizingSimulationforSizingPeriods) {
664 58 bool result = setBooleanFieldValue(OS_SimulationControlFields::DoHVACSizingSimulationforSizingPeriods, doHVACSizingSimulationforSizingPeriods);
665
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 58 times.
58 OS_ASSERT(result);
666 58 return result;
667 }
668
669 2 void SimulationControl_Impl::resetDoHVACSizingSimulationforSizingPeriods() {
670
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
4 bool result = setString(OS_SimulationControlFields::DoHVACSizingSimulationforSizingPeriods, "");
671
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 OS_ASSERT(result);
672 2 }
673
674 14 int SimulationControl_Impl::maximumNumberofHVACSizingSimulationPasses() const {
675
1/1
✓ Branch 1 taken 14 times.
14 boost::optional<int> value = getInt(OS_SimulationControlFields::MaximumNumberofHVACSizingSimulationPasses, true);
676
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 14 times.
✗ Branch 4 not taken.
14 OS_ASSERT(value);
677
1/1
✓ Branch 1 taken 14 times.
28 return value.get();
678 }
679
680 859 bool SimulationControl_Impl::isMaximumNumberofHVACSizingSimulationPassesDefaulted() const {
681 859 return isEmpty(OS_SimulationControlFields::MaximumNumberofHVACSizingSimulationPasses);
682 }
683
684 20 bool SimulationControl_Impl::setMaximumNumberofHVACSizingSimulationPasses(int maximumNumberofHVACSizingSimulationPasses) {
685 20 bool result = setInt(OS_SimulationControlFields::MaximumNumberofHVACSizingSimulationPasses, maximumNumberofHVACSizingSimulationPasses);
686 20 return result;
687 }
688
689 1 void SimulationControl_Impl::resetMaximumNumberofHVACSizingSimulationPasses() {
690
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_SimulationControlFields::MaximumNumberofHVACSizingSimulationPasses, "");
691
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
692 1 }
693
694 } // namespace detail
695
696 1142 SimulationControl::SimulationControl(const Model& model) : ParentObject(iddObjectType(), model) {
697
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 1142 times.
✗ Branch 5 not taken.
1142 OS_ASSERT(getImpl<detail::SimulationControl_Impl>());
698 1142 }
699
700
1/1
✓ Branch 3 taken 1040 times.
1040 SimulationControl::SimulationControl(std::shared_ptr<detail::SimulationControl_Impl> impl) : ParentObject(std::move(impl)) {}
701
702 12937 IddObjectType SimulationControl::iddObjectType() {
703
1/1
✓ Branch 1 taken 12937 times.
12937 return {IddObjectType::OS_SimulationControl};
704 }
705
706 ✗ std::vector<std::string> SimulationControl::validSolarDistributionValues() {
707 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), OS_SimulationControlFields::SolarDistribution);
708 }
709
710 877 bool SimulationControl::doZoneSizingCalculation() const {
711
1/1
✓ Branch 3 taken 877 times.
877 return getImpl<detail::SimulationControl_Impl>()->doZoneSizingCalculation();
712 }
713
714 3 bool SimulationControl::isDoZoneSizingCalculationDefaulted() const {
715
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::SimulationControl_Impl>()->isDoZoneSizingCalculationDefaulted();
716 }
717
718 877 bool SimulationControl::doSystemSizingCalculation() const {
719
1/1
✓ Branch 3 taken 877 times.
877 return getImpl<detail::SimulationControl_Impl>()->doSystemSizingCalculation();
720 }
721
722 3 bool SimulationControl::isDoSystemSizingCalculationDefaulted() const {
723
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::SimulationControl_Impl>()->isDoSystemSizingCalculationDefaulted();
724 }
725
726 877 bool SimulationControl::doPlantSizingCalculation() const {
727
1/1
✓ Branch 3 taken 877 times.
877 return getImpl<detail::SimulationControl_Impl>()->doPlantSizingCalculation();
728 }
729
730 3 bool SimulationControl::isDoPlantSizingCalculationDefaulted() const {
731
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::SimulationControl_Impl>()->isDoPlantSizingCalculationDefaulted();
732 }
733
734 866 bool SimulationControl::runSimulationforSizingPeriods() const {
735
1/1
✓ Branch 3 taken 866 times.
866 return getImpl<detail::SimulationControl_Impl>()->runSimulationforSizingPeriods();
736 }
737
738 3 bool SimulationControl::isRunSimulationforSizingPeriodsDefaulted() const {
739
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::SimulationControl_Impl>()->isRunSimulationforSizingPeriodsDefaulted();
740 }
741
742 866 bool SimulationControl::runSimulationforWeatherFileRunPeriods() const {
743
1/1
✓ Branch 3 taken 866 times.
866 return getImpl<detail::SimulationControl_Impl>()->runSimulationforWeatherFileRunPeriods();
744 }
745
746 3 bool SimulationControl::isRunSimulationforWeatherFileRunPeriodsDefaulted() const {
747
1/1
✓ Branch 3 taken 3 times.
3 return getImpl<detail::SimulationControl_Impl>()->isRunSimulationforWeatherFileRunPeriodsDefaulted();
748 }
749
750 8 double SimulationControl::loadsConvergenceToleranceValue() const {
751
1/1
✓ Branch 3 taken 8 times.
8 return getImpl<detail::SimulationControl_Impl>()->loadsConvergenceToleranceValue();
752 }
753
754 64 bool SimulationControl::isLoadsConvergenceToleranceValueDefaulted() const {
755
1/1
✓ Branch 3 taken 64 times.
64 return getImpl<detail::SimulationControl_Impl>()->isLoadsConvergenceToleranceValueDefaulted();
756 }
757
758 8 double SimulationControl::temperatureConvergenceToleranceValue() const {
759
1/1
✓ Branch 3 taken 8 times.
8 return getImpl<detail::SimulationControl_Impl>()->temperatureConvergenceToleranceValue();
760 }
761
762 64 bool SimulationControl::isTemperatureConvergenceToleranceValueDefaulted() const {
763
1/1
✓ Branch 3 taken 64 times.
64 return getImpl<detail::SimulationControl_Impl>()->isTemperatureConvergenceToleranceValueDefaulted();
764 }
765
766 8 std::string SimulationControl::solarDistribution() const {
767
1/1
✓ Branch 3 taken 8 times.
8 return getImpl<detail::SimulationControl_Impl>()->solarDistribution();
768 }
769
770 63 bool SimulationControl::isSolarDistributionDefaulted() const {
771
1/1
✓ Branch 3 taken 63 times.
63 return getImpl<detail::SimulationControl_Impl>()->isSolarDistributionDefaulted();
772 }
773
774 7 int SimulationControl::maximumNumberofWarmupDays() const {
775
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::SimulationControl_Impl>()->maximumNumberofWarmupDays();
776 }
777
778 64 bool SimulationControl::isMaximumNumberofWarmupDaysDefaulted() const {
779
1/1
✓ Branch 3 taken 64 times.
64 return getImpl<detail::SimulationControl_Impl>()->isMaximumNumberofWarmupDaysDefaulted();
780 }
781
782 7 int SimulationControl::minimumNumberofWarmupDays() const {
783
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::SimulationControl_Impl>()->minimumNumberofWarmupDays();
784 }
785
786 64 bool SimulationControl::isMinimumNumberofWarmupDaysDefaulted() const {
787
1/1
✓ Branch 3 taken 64 times.
64 return getImpl<detail::SimulationControl_Impl>()->isMinimumNumberofWarmupDaysDefaulted();
788 }
789
790 226 bool SimulationControl::setDoZoneSizingCalculation(bool doZoneSizingCalculation) {
791
1/1
✓ Branch 3 taken 226 times.
226 return getImpl<detail::SimulationControl_Impl>()->setDoZoneSizingCalculation(doZoneSizingCalculation);
792 }
793
794 ✗ void SimulationControl::setDoZoneSizingCalculationNoFail(bool doZoneSizingCalculation) {
795 ✗ bool result = getImpl<detail::SimulationControl_Impl>()->setDoZoneSizingCalculation(doZoneSizingCalculation);
796 ✗ OS_ASSERT(result);
797 ✗ }
798
799 2 void SimulationControl::resetDoZoneSizingCalculation() {
800
1/1
✓ Branch 3 taken 2 times.
2 getImpl<detail::SimulationControl_Impl>()->resetDoZoneSizingCalculation();
801 2 }
802
803 226 bool SimulationControl::setDoSystemSizingCalculation(bool doSystemSizingCalculation) {
804
1/1
✓ Branch 3 taken 226 times.
226 return getImpl<detail::SimulationControl_Impl>()->setDoSystemSizingCalculation(doSystemSizingCalculation);
805 }
806
807 ✗ void SimulationControl::setDoSystemSizingCalculationNoFail(bool doSystemSizingCalculation) {
808 ✗ bool result = getImpl<detail::SimulationControl_Impl>()->setDoSystemSizingCalculation(doSystemSizingCalculation);
809 ✗ OS_ASSERT(result);
810 ✗ }
811
812 2 void SimulationControl::resetDoSystemSizingCalculation() {
813
1/1
✓ Branch 3 taken 2 times.
2 getImpl<detail::SimulationControl_Impl>()->resetDoSystemSizingCalculation();
814 2 }
815
816 58 bool SimulationControl::setDoPlantSizingCalculation(bool doPlantSizingCalculation) {
817
1/1
✓ Branch 3 taken 58 times.
58 return getImpl<detail::SimulationControl_Impl>()->setDoPlantSizingCalculation(doPlantSizingCalculation);
818 }
819
820 ✗ void SimulationControl::setDoPlantSizingCalculationNoFail(bool doPlantSizingCalculation) {
821 ✗ bool result = getImpl<detail::SimulationControl_Impl>()->setDoPlantSizingCalculation(doPlantSizingCalculation);
822 ✗ OS_ASSERT(result);
823 ✗ }
824
825 2 void SimulationControl::resetDoPlantSizingCalculation() {
826
1/1
✓ Branch 3 taken 2 times.
2 getImpl<detail::SimulationControl_Impl>()->resetDoPlantSizingCalculation();
827 2 }
828
829 227 bool SimulationControl::setRunSimulationforSizingPeriods(bool runSimulationforSizingPeriods) {
830
1/1
✓ Branch 3 taken 227 times.
227 return getImpl<detail::SimulationControl_Impl>()->setRunSimulationforSizingPeriods(runSimulationforSizingPeriods);
831 }
832
833 ✗ void SimulationControl::setRunSimulationforSizingPeriodsNoFail(bool runSimulationforSizingPeriods) {
834 ✗ bool result = getImpl<detail::SimulationControl_Impl>()->setRunSimulationforSizingPeriods(runSimulationforSizingPeriods);
835 ✗ OS_ASSERT(result);
836 ✗ }
837
838 1 void SimulationControl::resetRunSimulationforSizingPeriods() {
839
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::SimulationControl_Impl>()->resetRunSimulationforSizingPeriods();
840 1 }
841
842 227 bool SimulationControl::setRunSimulationforWeatherFileRunPeriods(bool runSimulationforWeatherFileRunPeriods) {
843
1/1
✓ Branch 3 taken 227 times.
227 return getImpl<detail::SimulationControl_Impl>()->setRunSimulationforWeatherFileRunPeriods(runSimulationforWeatherFileRunPeriods);
844 }
845
846 ✗ void SimulationControl::setRunSimulationforWeatherFileRunPeriodsNoFail(bool runSimulationforWeatherFileRunPeriods) {
847 ✗ bool result = getImpl<detail::SimulationControl_Impl>()->setRunSimulationforWeatherFileRunPeriods(runSimulationforWeatherFileRunPeriods);
848 ✗ OS_ASSERT(result);
849 ✗ }
850
851 1 void SimulationControl::resetRunSimulationforWeatherFileRunPeriods() {
852
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::SimulationControl_Impl>()->resetRunSimulationforWeatherFileRunPeriods();
853 1 }
854
855 19 bool SimulationControl::setLoadsConvergenceToleranceValue(double loadsConvergenceToleranceValue) {
856
1/1
✓ Branch 3 taken 19 times.
19 return getImpl<detail::SimulationControl_Impl>()->setLoadsConvergenceToleranceValue(loadsConvergenceToleranceValue);
857 }
858
859 1 void SimulationControl::resetLoadsConvergenceToleranceValue() {
860
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::SimulationControl_Impl>()->resetLoadsConvergenceToleranceValue();
861 1 }
862
863 19 bool SimulationControl::setTemperatureConvergenceToleranceValue(double temperatureConvergenceToleranceValue) {
864
1/1
✓ Branch 3 taken 19 times.
19 return getImpl<detail::SimulationControl_Impl>()->setTemperatureConvergenceToleranceValue(temperatureConvergenceToleranceValue);
865 }
866
867 1 void SimulationControl::resetTemperatureConvergenceToleranceValue() {
868
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::SimulationControl_Impl>()->resetTemperatureConvergenceToleranceValue();
869 1 }
870
871 77 bool SimulationControl::setSolarDistribution(const std::string& solarDistribution) {
872
1/1
✓ Branch 3 taken 77 times.
77 return getImpl<detail::SimulationControl_Impl>()->setSolarDistribution(solarDistribution);
873 }
874
875 ✗ void SimulationControl::resetSolarDistribution() {
876 ✗ getImpl<detail::SimulationControl_Impl>()->resetSolarDistribution();
877 ✗ }
878
879 16 bool SimulationControl::setMaximumNumberofWarmupDays(int maximumNumberofWarmupDays) {
880
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::SimulationControl_Impl>()->setMaximumNumberofWarmupDays(maximumNumberofWarmupDays);
881 }
882
883 1 void SimulationControl::resetMaximumNumberofWarmupDays() {
884
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::SimulationControl_Impl>()->resetMaximumNumberofWarmupDays();
885 1 }
886
887 16 bool SimulationControl::setMinimumNumberofWarmupDays(int minimumNumberofWarmupDays) {
888
1/1
✓ Branch 3 taken 16 times.
16 return getImpl<detail::SimulationControl_Impl>()->setMinimumNumberofWarmupDays(minimumNumberofWarmupDays);
889 }
890
891 1 void SimulationControl::resetMinimumNumberofWarmupDays() {
892
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::SimulationControl_Impl>()->resetMinimumNumberofWarmupDays();
893 1 }
894
895 ✗ boost::optional<ConvergenceLimits> SimulationControl::convergenceLimits() const {
896 ✗ return getImpl<detail::SimulationControl_Impl>()->convergenceLimits();
897 }
898
899 ✗ boost::optional<HeatBalanceAlgorithm> SimulationControl::heatBalanceAlgorithm() const {
900 ✗ return getImpl<detail::SimulationControl_Impl>()->heatBalanceAlgorithm();
901 }
902
903 ✗ boost::optional<InsideSurfaceConvectionAlgorithm> SimulationControl::insideSurfaceConvectionAlgorithm() const {
904 ✗ return getImpl<detail::SimulationControl_Impl>()->insideSurfaceConvectionAlgorithm();
905 }
906
907 ✗ boost::optional<OutsideSurfaceConvectionAlgorithm> SimulationControl::outsideSurfaceConvectionAlgorithm() const {
908 ✗ return getImpl<detail::SimulationControl_Impl>()->outsideSurfaceConvectionAlgorithm();
909 }
910
911 ✗ std::vector<RunPeriod> SimulationControl::runPeriods() const {
912 ✗ return getImpl<detail::SimulationControl_Impl>()->runPeriods();
913 }
914
915 ✗ boost::optional<ShadowCalculation> SimulationControl::shadowCalculation() const {
916 ✗ return getImpl<detail::SimulationControl_Impl>()->shadowCalculation();
917 }
918
919 ✗ boost::optional<SizingParameters> SimulationControl::sizingParameters() const {
920 ✗ return getImpl<detail::SimulationControl_Impl>()->sizingParameters();
921 }
922
923 ✗ boost::optional<Timestep> SimulationControl::timestep() const {
924 ✗ return getImpl<detail::SimulationControl_Impl>()->timestep();
925 }
926
927 ✗ boost::optional<ZoneAirContaminantBalance> SimulationControl::zoneAirContaminantBalance() const {
928 ✗ return getImpl<detail::SimulationControl_Impl>()->zoneAirContaminantBalance();
929 }
930
931 ✗ boost::optional<ZoneAirHeatBalanceAlgorithm> SimulationControl::zoneAirHeatBalanceAlgorithm() const {
932 ✗ return getImpl<detail::SimulationControl_Impl>()->zoneAirHeatBalanceAlgorithm();
933 }
934
935 ✗ boost::optional<ZoneAirMassFlowConservation> SimulationControl::zoneAirMassFlowConservation() const {
936 ✗ return getImpl<detail::SimulationControl_Impl>()->zoneAirMassFlowConservation();
937 }
938
939 ✗ boost::optional<ZoneCapacitanceMultiplierResearchSpecial> SimulationControl::zoneCapacitanceMultiplierResearchSpecial() const {
940 ✗ return getImpl<detail::SimulationControl_Impl>()->zoneCapacitanceMultiplierResearchSpecial();
941 }
942
943 ✗ std::vector<std::string> SimulationControl::sizingEnvironmentPeriods() const {
944 ✗ return getImpl<detail::SimulationControl_Impl>()->sizingEnvironmentPeriods();
945 }
946
947 ✗ std::vector<std::string> SimulationControl::annualSimulationEnvironmentPeriods() const {
948 ✗ return getImpl<detail::SimulationControl_Impl>()->annualSimulationEnvironmentPeriods();
949 }
950
951 ✗ std::vector<std::string> SimulationControl::partialYearEnvironmentPeriods() const {
952 ✗ return getImpl<detail::SimulationControl_Impl>()->partialYearEnvironmentPeriods();
953 }
954
955 ✗ std::vector<std::string> SimulationControl::repeatedIntervalEnvironmentPeriods() const {
956 ✗ return getImpl<detail::SimulationControl_Impl>()->repeatedIntervalEnvironmentPeriods();
957 }
958
959 877 bool SimulationControl::doHVACSizingSimulationforSizingPeriods() const {
960
1/1
✓ Branch 3 taken 877 times.
877 return getImpl<detail::SimulationControl_Impl>()->doHVACSizingSimulationforSizingPeriods();
961 }
962
963 859 bool SimulationControl::isDoHVACSizingSimulationforSizingPeriodsDefaulted() const {
964
1/1
✓ Branch 3 taken 859 times.
859 return getImpl<detail::SimulationControl_Impl>()->isDoHVACSizingSimulationforSizingPeriodsDefaulted();
965 }
966
967 58 bool SimulationControl::setDoHVACSizingSimulationforSizingPeriods(bool doHVACSizingSimulationforSizingPeriods) {
968
1/1
✓ Branch 3 taken 58 times.
58 return getImpl<detail::SimulationControl_Impl>()->setDoHVACSizingSimulationforSizingPeriods(doHVACSizingSimulationforSizingPeriods);
969 }
970
971 ✗ void SimulationControl::setDoHVACSizingSimulationforSizingPeriodsNoFail(bool doHVACSizingSimulationforSizingPeriods) {
972 ✗ bool result = getImpl<detail::SimulationControl_Impl>()->setDoHVACSizingSimulationforSizingPeriods(doHVACSizingSimulationforSizingPeriods);
973 ✗ OS_ASSERT(result);
974 ✗ }
975
976 2 void SimulationControl::resetDoHVACSizingSimulationforSizingPeriods() {
977
1/1
✓ Branch 3 taken 2 times.
2 getImpl<detail::SimulationControl_Impl>()->resetDoHVACSizingSimulationforSizingPeriods();
978 2 }
979
980 14 int SimulationControl::maximumNumberofHVACSizingSimulationPasses() const {
981
1/1
✓ Branch 3 taken 14 times.
14 return getImpl<detail::SimulationControl_Impl>()->maximumNumberofHVACSizingSimulationPasses();
982 }
983
984 859 bool SimulationControl::isMaximumNumberofHVACSizingSimulationPassesDefaulted() const {
985
1/1
✓ Branch 3 taken 859 times.
859 return getImpl<detail::SimulationControl_Impl>()->isMaximumNumberofHVACSizingSimulationPassesDefaulted();
986 }
987
988 20 bool SimulationControl::setMaximumNumberofHVACSizingSimulationPasses(int maximumNumberofHVACSizingSimulationPasses) {
989
1/1
✓ Branch 3 taken 20 times.
20 return getImpl<detail::SimulationControl_Impl>()->setMaximumNumberofHVACSizingSimulationPasses(maximumNumberofHVACSizingSimulationPasses);
990 }
991
992 1 void SimulationControl::resetMaximumNumberofHVACSizingSimulationPasses() {
993
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::SimulationControl_Impl>()->resetMaximumNumberofHVACSizingSimulationPasses();
994 1 }
995
996 } // namespace model
997 } // namespace openstudio
998