GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 50.2% 323 / 0 / 644
Functions: 55.6% 10 / 0 / 18
Branches: 52.3% 402 / 0 / 768

src/model/HVACTemplates.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 "HVACTemplates.hpp"
7 #include "Model.hpp"
8 #include "PipeAdiabatic.hpp"
9 #include "AirLoopHVAC.hpp"
10 #include "AirLoopHVAC_Impl.hpp"
11 #include "ChillerElectricEIR.hpp"
12 #include "ChillerElectricEIR_Impl.hpp"
13 #include "ThermalZone.hpp"
14 #include "ThermalZone_Impl.hpp"
15 #include "ZoneHVACPackagedTerminalHeatPump.hpp"
16 #include "ZoneHVACPackagedTerminalHeatPump_Impl.hpp"
17 #include "ZoneHVACPackagedTerminalAirConditioner.hpp"
18 #include "ZoneHVACPackagedTerminalAirConditioner_Impl.hpp"
19 #include "BoilerHotWater.hpp"
20 #include "BoilerHotWater_Impl.hpp"
21 #include "WaterHeaterMixed.hpp"
22 #include "WaterHeaterMixed_Impl.hpp"
23 #include "PumpVariableSpeed.hpp"
24 #include "PumpVariableSpeed_Impl.hpp"
25 #include "PlantLoop.hpp"
26 #include "PlantLoop_Impl.hpp"
27 #include "SizingPlant.hpp"
28 #include "SizingPlant_Impl.hpp"
29 #include "CoilCoolingDXSingleSpeed.hpp"
30 #include "CoilCoolingDXSingleSpeed_Impl.hpp"
31 #include "CoilCoolingDXTwoSpeed.hpp"
32 #include "CoilCoolingDXTwoSpeed_Impl.hpp"
33 #include "CurveCubic.hpp"
34 #include "CurveCubic_Impl.hpp"
35 #include "CurveQuadratic.hpp"
36 #include "CurveQuadratic_Impl.hpp"
37 #include "CurveBiquadratic.hpp"
38 #include "CurveBiquadratic_Impl.hpp"
39 #include "CoilHeatingGas.hpp"
40 #include "CoilHeatingGas_Impl.hpp"
41 #include "CoilHeatingElectric.hpp"
42 #include "CoilHeatingElectric_Impl.hpp"
43 #include "CoilHeatingDXSingleSpeed.hpp"
44 #include "CoilHeatingDXSingleSpeed_Impl.hpp"
45 #include "ScheduleRuleset.hpp"
46 #include "ScheduleRuleset_Impl.hpp"
47 #include "ScheduleDay.hpp"
48 #include "ScheduleDay_Impl.hpp"
49 #include "FanConstantVolume.hpp"
50 #include "FanConstantVolume_Impl.hpp"
51 #include "FanVariableVolume.hpp"
52 #include "FanVariableVolume_Impl.hpp"
53 #include "SetpointManagerMixedAir.hpp"
54 #include "SetpointManagerMixedAir_Impl.hpp"
55 #include "SetpointManagerSingleZoneReheat.hpp"
56 #include "SetpointManagerSingleZoneReheat_Impl.hpp"
57 #include "SetpointManagerScheduled.hpp"
58 #include "SetpointManagerScheduled_Impl.hpp"
59 #include "SetpointManagerFollowOutdoorAirTemperature.hpp"
60 #include "SetpointManagerFollowOutdoorAirTemperature_Impl.hpp"
61 #include "SizingSystem.hpp"
62 #include "SizingSystem_Impl.hpp"
63 #include "Node.hpp"
64 #include "Node_Impl.hpp"
65 #include "AirLoopHVACOutdoorAirSystem.hpp"
66 #include "AirLoopHVACOutdoorAirSystem_Impl.hpp"
67 #include "AirLoopHVACUnitaryHeatPumpAirToAir.hpp"
68 #include "AirLoopHVACUnitaryHeatPumpAirToAir_Impl.hpp"
69 #include "AirTerminalSingleDuctParallelPIUReheat.hpp"
70 #include "AirTerminalSingleDuctParallelPIUReheat_Impl.hpp"
71 #include "AirTerminalSingleDuctConstantVolumeNoReheat.hpp"
72 #include "AirTerminalSingleDuctConstantVolumeNoReheat_Impl.hpp"
73 #include "AirTerminalSingleDuctVAVReheat.hpp"
74 #include "AirTerminalSingleDuctVAVReheat_Impl.hpp"
75 #include "ControllerOutdoorAir.hpp"
76 #include "ControllerOutdoorAir_Impl.hpp"
77 #include "CoilCoolingWater.hpp"
78 #include "CoilCoolingWater_Impl.hpp"
79 #include "CoilHeatingWater.hpp"
80 #include "CoilHeatingWater_Impl.hpp"
81 #include "Splitter.hpp"
82 #include "Splitter_Impl.hpp"
83 #include "Mixer.hpp"
84 #include "Mixer_Impl.hpp"
85 #include "CoolingTowerSingleSpeed.hpp"
86 #include "CoolingTowerSingleSpeed_Impl.hpp"
87 #include "PumpConstantSpeed.hpp"
88 #include "WaterUseEquipmentDefinition.hpp"
89 #include "WaterUseEquipment.hpp"
90 #include "WaterUseConnections.hpp"
91
92 #include "../utilities/time/Time.hpp"
93
94 namespace openstudio {
95
96 namespace model {
97
98 13 Schedule makeSchedule(Model& model, const std::string& name = "Hot_Water_Temperature", double targetTemperature = 67.0) {
99 //Make a time stamp to use in multiple places
100
1/1
✓ Branch 1 taken 13 times.
13 Time osTime = Time(0, 24, 0, 0);
101
102 //Schedule Ruleset
103
1/1
✓ Branch 1 taken 13 times.
13 ScheduleRuleset tempSchedule = ScheduleRuleset(model);
104
1/1
✓ Branch 1 taken 13 times.
13 tempSchedule.setName(name);
105
106 //Winter Design Day
107
1/1
✓ Branch 1 taken 13 times.
13 ScheduleDay tempScheduleWinter = ScheduleDay(model);
108
1/1
✓ Branch 1 taken 13 times.
13 tempSchedule.setWinterDesignDaySchedule(tempScheduleWinter);
109
3/3
✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
13 tempSchedule.winterDesignDaySchedule().setName(name + "_Winter_Design_Day");
110
2/2
✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
13 tempSchedule.winterDesignDaySchedule().addValue(osTime, targetTemperature);
111
112 //Summer Design Day
113
1/1
✓ Branch 1 taken 13 times.
13 ScheduleDay tempScheduleSummer = ScheduleDay(model);
114
1/1
✓ Branch 1 taken 13 times.
13 tempSchedule.setSummerDesignDaySchedule(tempScheduleSummer);
115
3/3
✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
13 tempSchedule.summerDesignDaySchedule().setName(name + "_Summer_Design_Day");
116
2/2
✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
13 tempSchedule.summerDesignDaySchedule().addValue(osTime, targetTemperature);
117
118 //All other days
119
3/3
✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
13 tempSchedule.defaultDaySchedule().setName(name + "_Default");
120
2/2
✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
13 tempSchedule.defaultDaySchedule().addValue(osTime, targetTemperature);
121
122 26 return std::move(tempSchedule);
123 13 }
124
125 3 Schedule deckTempSchedule(Model& model) {
126
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
6 return makeSchedule(model, "Deck_Temperature", 12.8);
127 }
128
129 7 Schedule hotWaterTempSchedule(Model& model) {
130
2/2
✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
14 return makeSchedule(model, "Hot_Water_Temperature", 67.0);
131 }
132
133 3 Schedule chilledWaterTempSchedule(Model& model) {
134
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
6 return makeSchedule(model, "Chilled_Water_Temperature", 6.7);
135 }
136
137 4 ZoneHVACPackagedTerminalAirConditioner addSystemType1(Model& model) {
138
1/1
✓ Branch 1 taken 4 times.
4 Model tempModel;
139
1/1
✓ Branch 1 taken 4 times.
4 Schedule availabilitySchedule = model.alwaysOnDiscreteSchedule();
140
141
1/1
✓ Branch 1 taken 4 times.
4 model::FanConstantVolume fan(model, availabilitySchedule);
142
1/1
✓ Branch 1 taken 4 times.
4 fan.setPressureRise(500);
143
144
1/1
✓ Branch 1 taken 4 times.
4 model::CoilHeatingWater heatingCoil(model, availabilitySchedule);
145
146
1/1
✓ Branch 1 taken 4 times.
4 CoilCoolingDXSingleSpeed coolingCoil = CoilCoolingDXSingleSpeed(model);
147
148
1/1
✓ Branch 1 taken 4 times.
4 model::ZoneHVACPackagedTerminalAirConditioner ptac(model, availabilitySchedule, fan, heatingCoil, coolingCoil);
149
150 8 return ptac;
151 4 }
152
153 4 void addSystemType1(Model& model, std::vector<ThermalZone> zones) {
154
155
4/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 13 taken 4 times.
✓ Branch 17 taken 4 times.
8 zones.erase(std::remove_if(zones.begin(), zones.end(), [&](const auto& zone) { return zone.model() != model; }), zones.end());
156
157 // Hot Water Plant
158
159
1/2
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
4 if (!zones.empty()) {
160
1/1
✓ Branch 1 taken 4 times.
4 PlantLoop hotWaterPlant(model);
161
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 hotWaterPlant.setName("Hot Water Loop");
162
1/1
✓ Branch 1 taken 4 times.
4 SizingPlant sizingPlant = hotWaterPlant.sizingPlant();
163
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 sizingPlant.setLoopType("Heating");
164
1/1
✓ Branch 1 taken 4 times.
4 sizingPlant.setDesignLoopExitTemperature(82.0);
165
1/1
✓ Branch 1 taken 4 times.
4 sizingPlant.setLoopDesignTemperatureDifference(11.0);
166
167
1/1
✓ Branch 1 taken 4 times.
4 Node hotWaterOutletNode = hotWaterPlant.supplyOutletNode();
168
1/1
✓ Branch 1 taken 4 times.
4 Node hotWaterInletNode = hotWaterPlant.supplyInletNode();
169
170
1/1
✓ Branch 1 taken 4 times.
4 PumpVariableSpeed pump = PumpVariableSpeed(model);
171
172
1/1
✓ Branch 1 taken 4 times.
4 BoilerHotWater boiler = BoilerHotWater(model);
173
174
1/1
✓ Branch 1 taken 4 times.
4 CurveBiquadratic boilerCurve(model);
175
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 boilerCurve.setName("Boiler Efficiency");
176
1/1
✓ Branch 1 taken 4 times.
4 boilerCurve.setCoefficient1Constant(1.0);
177
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 boilerCurve.setInputUnitTypeforX("Dimensionless");
178
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 boilerCurve.setInputUnitTypeforY("Dimensionless");
179
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 boilerCurve.setOutputUnitType("Dimensionless");
180
181
1/1
✓ Branch 1 taken 4 times.
4 boiler.setNormalizedBoilerEfficiencyCurve(boilerCurve);
182
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 boiler.setEfficiencyCurveTemperatureEvaluationVariable("LeavingBoiler");
183
184
1/1
✓ Branch 1 taken 4 times.
4 pump.addToNode(hotWaterInletNode);
185
186
4/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
4 Node node = hotWaterPlant.supplySplitter().lastOutletModelObject()->cast<Node>();
187
1/1
✓ Branch 1 taken 4 times.
4 boiler.addToNode(node);
188
189
1/1
✓ Branch 1 taken 4 times.
4 PipeAdiabatic pipe(model);
190
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 hotWaterPlant.addSupplyBranchForComponent(pipe);
191
192
1/1
✓ Branch 1 taken 4 times.
4 PipeAdiabatic pipe2(model);
193
1/1
✓ Branch 1 taken 4 times.
4 pipe2.addToNode(hotWaterOutletNode);
194
195
1/1
✓ Branch 1 taken 4 times.
4 Schedule _hotWaterSchedule = hotWaterTempSchedule(model);
196
197
1/1
✓ Branch 1 taken 4 times.
4 SetpointManagerScheduled hotWaterSPM(model, _hotWaterSchedule);
198
199
1/1
✓ Branch 1 taken 4 times.
4 hotWaterSPM.addToNode(hotWaterOutletNode);
200
201
2/2
✓ Branch 5 taken 4 times.
✓ Branch 6 taken 4 times.
8 for (auto& zone : zones) {
202
1/1
✓ Branch 1 taken 4 times.
4 model::ZoneHVACPackagedTerminalAirConditioner ptac = addSystemType1(model);
203
204
1/1
✓ Branch 1 taken 4 times.
4 ptac.addToThermalZone(zone);
205
206
1/1
✓ Branch 1 taken 4 times.
4 HVACComponent comp = ptac.heatingCoil();
207
208
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 hotWaterPlant.addDemandBranchForComponent(comp);
209 4 }
210 4 }
211 4 }
212
213 ✗ ZoneHVACPackagedTerminalHeatPump addSystemType2(Model& model) {
214 ✗ Model tempModel;
215 ✗ Schedule availabilitySchedule = model.alwaysOnDiscreteSchedule();
216
217 ✗ model::FanConstantVolume fan(model, availabilitySchedule);
218 ✗ fan.setPressureRise(300);
219
220 ✗ model::CoilHeatingElectric supplementalHeatingCoil(model);
221
222 ✗ CoilCoolingDXSingleSpeed coolingCoil = CoilCoolingDXSingleSpeed(model);
223
224 ✗ CoilHeatingDXSingleSpeed heatingCoil(model);
225
226 ✗ model::ZoneHVACPackagedTerminalHeatPump pthp(model, availabilitySchedule, fan, heatingCoil, coolingCoil, supplementalHeatingCoil);
227
228 ✗ return pthp;
229 ✗ }
230
231 ✗ void addSystemType2(Model& model, std::vector<ThermalZone> zones) {
232 ✗ for (auto& zone : zones) {
233 ✗ if (zone.model() == model) {
234 ✗ ZoneHVACPackagedTerminalHeatPump pthp = addSystemType2(model);
235
236 ✗ pthp.addToThermalZone(zone);
237 ✗ }
238 }
239 ✗ }
240
241 8 Loop addSystemType3(Model& model) {
242
1/1
✓ Branch 1 taken 8 times.
8 Model tempModel;
243
1/1
✓ Branch 1 taken 8 times.
8 Schedule _alwaysOnSchedule = model.alwaysOnDiscreteSchedule();
244
245
1/1
✓ Branch 1 taken 8 times.
8 AirLoopHVAC airLoopHVAC = AirLoopHVAC(model);
246
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 airLoopHVAC.setName("Packaged Rooftop Air Conditioner");
247 // when an airloophvac is contructed, its constructor automatically creates a sizing:system object
248 // the default sizing:system contstructor makes a system:sizing object appropriate for a multizone VAV system
249 // this systems is a constant volume system with no VAV terminals, and needs different default settings
250
251 // get the sizing:system object associated with the airloophvac
252
1/1
✓ Branch 1 taken 8 times.
8 SizingSystem sizingSystem = airLoopHVAC.sizingSystem();
253
254 //set the default parameters correctly for a constant volume system with no VAV terminals
255
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 sizingSystem.setTypeofLoadtoSizeOn("Sensible");
256
1/1
✓ Branch 1 taken 8 times.
8 sizingSystem.autosizeDesignOutdoorAirFlowRate();
257
1/1
✓ Branch 1 taken 8 times.
8 sizingSystem.setCentralHeatingMaximumSystemAirFlowRatio(1.0);
258
1/1
✓ Branch 1 taken 8 times.
8 sizingSystem.setPreheatDesignTemperature(7.0);
259
1/1
✓ Branch 1 taken 8 times.
8 sizingSystem.setPreheatDesignHumidityRatio(0.008);
260
1/1
✓ Branch 1 taken 8 times.
8 sizingSystem.setPrecoolDesignTemperature(12.8);
261
1/1
✓ Branch 1 taken 8 times.
8 sizingSystem.setPrecoolDesignHumidityRatio(0.008);
262
1/1
✓ Branch 1 taken 8 times.
8 sizingSystem.setCentralCoolingDesignSupplyAirTemperature(12.8);
263
1/1
✓ Branch 1 taken 8 times.
8 sizingSystem.setCentralHeatingDesignSupplyAirTemperature(40.0);
264
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 sizingSystem.setSizingOption("NonCoincident");
265
1/1
✓ Branch 1 taken 8 times.
8 sizingSystem.setAllOutdoorAirinCooling(false);
266
1/1
✓ Branch 1 taken 8 times.
8 sizingSystem.setAllOutdoorAirinHeating(false);
267
1/1
✓ Branch 1 taken 8 times.
8 sizingSystem.setCentralCoolingDesignSupplyAirHumidityRatio(0.0085);
268
1/1
✓ Branch 1 taken 8 times.
8 sizingSystem.setCentralHeatingDesignSupplyAirHumidityRatio(0.0080);
269
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 sizingSystem.setCoolingDesignAirFlowMethod("DesignDay");
270
1/1
✓ Branch 1 taken 8 times.
8 sizingSystem.setCoolingDesignAirFlowRate(0.0);
271
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 sizingSystem.setHeatingDesignAirFlowMethod("DesignDay");
272
1/1
✓ Branch 1 taken 8 times.
8 sizingSystem.setHeatingDesignAirFlowRate(0.0);
273
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 sizingSystem.setSystemOutdoorAirMethod("ZoneSum");
274
275
1/1
✓ Branch 1 taken 8 times.
8 FanConstantVolume fan = FanConstantVolume(model);
276
1/1
✓ Branch 1 taken 8 times.
8 fan.setPressureRise(500);
277
278
1/1
✓ Branch 1 taken 8 times.
8 CoilHeatingGas coilHeatingGas = CoilHeatingGas(model, _alwaysOnSchedule);
279
280
1/1
✓ Branch 1 taken 8 times.
8 CoilCoolingDXSingleSpeed coilCooling = CoilCoolingDXSingleSpeed(model);
281
282
1/1
✓ Branch 1 taken 8 times.
8 SetpointManagerSingleZoneReheat setpointMSZR(model);
283
284
1/1
✓ Branch 1 taken 8 times.
8 ControllerOutdoorAir controllerOutdoorAir = ControllerOutdoorAir(model);
285
286
1/1
✓ Branch 1 taken 8 times.
8 AirLoopHVACOutdoorAirSystem outdoorAirSystem = AirLoopHVACOutdoorAirSystem(model, controllerOutdoorAir);
287
288
1/1
✓ Branch 1 taken 8 times.
8 Node supplyOutletNode = airLoopHVAC.supplyOutletNode();
289
290
1/1
✓ Branch 1 taken 8 times.
8 outdoorAirSystem.addToNode(supplyOutletNode);
291
1/1
✓ Branch 1 taken 8 times.
8 coilCooling.addToNode(supplyOutletNode);
292
1/1
✓ Branch 1 taken 8 times.
8 coilHeatingGas.addToNode(supplyOutletNode);
293
1/1
✓ Branch 1 taken 8 times.
8 fan.addToNode(supplyOutletNode);
294
295
3/3
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
8 Node node1 = fan.outletModelObject()->cast<Node>();
296
1/1
✓ Branch 1 taken 8 times.
8 setpointMSZR.addToNode(node1);
297
298
1/1
✓ Branch 1 taken 8 times.
8 AirTerminalSingleDuctConstantVolumeNoReheat terminal(model, _alwaysOnSchedule);
299
300
1/1
✓ Branch 1 taken 8 times.
8 airLoopHVAC.addBranchForHVACComponent(terminal);
301
302 16 return std::move(airLoopHVAC);
303 8 }
304
305 ✗ Loop addSystemType4(Model& model) {
306 ✗ Model tempModel;
307
308 ✗ Schedule _alwaysOnSchedule = model.alwaysOnDiscreteSchedule();
309
310 ✗ AirLoopHVAC airLoopHVAC(model);
311 ✗ airLoopHVAC.setName("Packaged Rooftop Heat Pump");
312 // when an airloophvac is contructed, its constructor automatically creates a sizing:system object
313 // the default sizing:system contstructor makes a system:sizing object appropriate for a multizone VAV system
314 // this systems is a constant volume system with no VAV terminals, and needs different default settings
315
316 // get the sizing:system object associated with the airloophvac
317 ✗ SizingSystem sizingSystem = airLoopHVAC.sizingSystem();
318
319 //set the default parameters correctly for a constant volume system with no VAV terminals
320 ✗ sizingSystem.setTypeofLoadtoSizeOn("Sensible");
321 ✗ sizingSystem.autosizeDesignOutdoorAirFlowRate();
322 ✗ sizingSystem.setCentralHeatingMaximumSystemAirFlowRatio(1.0);
323 ✗ sizingSystem.setPreheatDesignTemperature(7.0);
324 ✗ sizingSystem.setPreheatDesignHumidityRatio(0.008);
325 ✗ sizingSystem.setPrecoolDesignTemperature(12.8);
326 ✗ sizingSystem.setPrecoolDesignHumidityRatio(0.008);
327 ✗ sizingSystem.setCentralCoolingDesignSupplyAirTemperature(12.8);
328 ✗ sizingSystem.setCentralHeatingDesignSupplyAirTemperature(40.0);
329 ✗ sizingSystem.setSizingOption("NonCoincident");
330 ✗ sizingSystem.setAllOutdoorAirinCooling(false);
331 ✗ sizingSystem.setAllOutdoorAirinHeating(false);
332 ✗ sizingSystem.setCentralCoolingDesignSupplyAirHumidityRatio(0.0085);
333 ✗ sizingSystem.setCentralHeatingDesignSupplyAirHumidityRatio(0.0080);
334 ✗ sizingSystem.setCoolingDesignAirFlowMethod("DesignDay");
335 ✗ sizingSystem.setCoolingDesignAirFlowRate(0.0);
336 ✗ sizingSystem.setHeatingDesignAirFlowMethod("DesignDay");
337 ✗ sizingSystem.setHeatingDesignAirFlowRate(0.0);
338 ✗ sizingSystem.setSystemOutdoorAirMethod("ZoneSum");
339
340 ✗ FanConstantVolume supplyFan(model, _alwaysOnSchedule);
341 ✗ supplyFan.setPressureRise(500);
342
343 ✗ CoilCoolingDXSingleSpeed coolingCoil = CoilCoolingDXSingleSpeed(model);
344
345 ✗ CoilHeatingDXSingleSpeed heatingCoil(model);
346
347 ✗ CoilHeatingElectric coilHeatingElectric = CoilHeatingElectric(model);
348
349 ✗ ControllerOutdoorAir controllerOutdoorAir = ControllerOutdoorAir(model);
350
351 ✗ AirLoopHVACOutdoorAirSystem outdoorAirSystem = AirLoopHVACOutdoorAirSystem(model, controllerOutdoorAir);
352
353 ✗ Node supplyOutletNode = airLoopHVAC.supplyOutletNode();
354 ✗ outdoorAirSystem.addToNode(supplyOutletNode);
355 ✗ coolingCoil.addToNode(supplyOutletNode);
356 ✗ heatingCoil.addToNode(supplyOutletNode);
357 ✗ coilHeatingElectric.addToNode(supplyOutletNode);
358 ✗ supplyFan.addToNode(supplyOutletNode);
359
360 ✗ AirTerminalSingleDuctConstantVolumeNoReheat terminal(model, _alwaysOnSchedule);
361
362 ✗ airLoopHVAC.addBranchForHVACComponent(terminal);
363
364 ✗ SetpointManagerSingleZoneReheat setpointMSZR(model);
365
366 ✗ Node node1 = supplyFan.outletModelObject()->cast<Node>();
367 ✗ setpointMSZR.addToNode(node1);
368
369 ✗ return std::move(airLoopHVAC);
370 ✗ }
371
372 2 Loop addSystemType5(Model& model) {
373
1/1
✓ Branch 1 taken 2 times.
2 Model tempModel;
374
375
1/1
✓ Branch 1 taken 2 times.
2 Schedule _alwaysOnSchedule = model.alwaysOnDiscreteSchedule();
376
377
4/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
2 auto _deckTempSchedule = deckTempSchedule(tempModel).clone(model).cast<Schedule>();
378
379
4/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
2 auto _hotWaterSchedule = hotWaterTempSchedule(tempModel).clone(model).cast<Schedule>();
380
381
4/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
2 auto _chilledWaterSchedule = chilledWaterTempSchedule(tempModel).clone(model).cast<Schedule>();
382
383
1/1
✓ Branch 1 taken 2 times.
2 AirLoopHVAC airLoopHVAC = AirLoopHVAC(model);
384
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 airLoopHVAC.setName("Packaged Rooftop VAV with Reheat");
385
1/1
✓ Branch 1 taken 2 times.
2 SizingSystem sizingSystem = airLoopHVAC.sizingSystem();
386
1/1
✓ Branch 1 taken 2 times.
2 sizingSystem.setCentralCoolingDesignSupplyAirTemperature(12.8);
387
1/1
✓ Branch 1 taken 2 times.
2 sizingSystem.setCentralHeatingDesignSupplyAirTemperature(12.8);
388
389
1/1
✓ Branch 1 taken 2 times.
2 FanVariableVolume fan = FanVariableVolume(model);
390
1/1
✓ Branch 1 taken 2 times.
2 fan.setPressureRise(500);
391
392
1/1
✓ Branch 1 taken 2 times.
2 CoilHeatingWater coilHeatingWater = CoilHeatingWater(model);
393
394
1/1
✓ Branch 1 taken 2 times.
2 CoilCoolingDXTwoSpeed coilCooling = CoilCoolingDXTwoSpeed(model);
395
396
1/1
✓ Branch 1 taken 2 times.
2 SetpointManagerScheduled deckTempSPM = SetpointManagerScheduled(model, _deckTempSchedule);
397
398
1/1
✓ Branch 1 taken 2 times.
2 ControllerOutdoorAir controllerOutdoorAir = ControllerOutdoorAir(model);
399
400
1/1
✓ Branch 1 taken 2 times.
2 AirLoopHVACOutdoorAirSystem outdoorAirSystem = AirLoopHVACOutdoorAirSystem(model, controllerOutdoorAir);
401
402
1/1
✓ Branch 1 taken 2 times.
2 Node supplyOutletNode = airLoopHVAC.supplyOutletNode();
403
404
1/1
✓ Branch 1 taken 2 times.
2 outdoorAirSystem.addToNode(supplyOutletNode);
405
1/1
✓ Branch 1 taken 2 times.
2 coilCooling.addToNode(supplyOutletNode);
406
1/1
✓ Branch 1 taken 2 times.
2 coilHeatingWater.addToNode(supplyOutletNode);
407
1/1
✓ Branch 1 taken 2 times.
2 fan.addToNode(supplyOutletNode);
408
409
3/3
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
2 Node node1 = fan.outletModelObject()->cast<Node>();
410
1/1
✓ Branch 1 taken 2 times.
2 deckTempSPM.addToNode(node1);
411
412 // Hot Water Plant
413
414
1/1
✓ Branch 1 taken 2 times.
2 PlantLoop hotWaterPlant(model);
415
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 hotWaterPlant.setName("Hot Water Loop");
416
1/1
✓ Branch 1 taken 2 times.
2 SizingPlant sizingPlant = hotWaterPlant.sizingPlant();
417
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 sizingPlant.setLoopType("Heating");
418
1/1
✓ Branch 1 taken 2 times.
2 sizingPlant.setDesignLoopExitTemperature(82.0);
419
1/1
✓ Branch 1 taken 2 times.
2 sizingPlant.setLoopDesignTemperatureDifference(11.0);
420
421
1/1
✓ Branch 1 taken 2 times.
2 Node hotWaterOutletNode = hotWaterPlant.supplyOutletNode();
422
1/1
✓ Branch 1 taken 2 times.
2 Node hotWaterInletNode = hotWaterPlant.supplyInletNode();
423
424
1/1
✓ Branch 1 taken 2 times.
2 PumpVariableSpeed pump = PumpVariableSpeed(model);
425
426
1/1
✓ Branch 1 taken 2 times.
2 BoilerHotWater boiler = BoilerHotWater(model);
427
428
1/1
✓ Branch 1 taken 2 times.
2 CurveBiquadratic boilerCurve(model);
429
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 boilerCurve.setName("Boiler Efficiency");
430
1/1
✓ Branch 1 taken 2 times.
2 boilerCurve.setCoefficient1Constant(1.0);
431
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
4 boilerCurve.setInputUnitTypeforX("Dimensionless");
432
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
4 boilerCurve.setInputUnitTypeforY("Dimensionless");
433
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 boilerCurve.setOutputUnitType("Dimensionless");
434
435
1/1
✓ Branch 1 taken 2 times.
2 boiler.setNormalizedBoilerEfficiencyCurve(boilerCurve);
436
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 boiler.setEfficiencyCurveTemperatureEvaluationVariable("LeavingBoiler");
437
438
1/1
✓ Branch 1 taken 2 times.
2 pump.addToNode(hotWaterInletNode);
439
440
4/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
2 Node node = hotWaterPlant.supplySplitter().lastOutletModelObject()->cast<Node>();
441
1/1
✓ Branch 1 taken 2 times.
2 boiler.addToNode(node);
442
443
1/1
✓ Branch 1 taken 2 times.
2 PipeAdiabatic pipe(model);
444
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 hotWaterPlant.addSupplyBranchForComponent(pipe);
445
446
1/1
✓ Branch 1 taken 2 times.
2 PipeAdiabatic pipe2(model);
447
1/1
✓ Branch 1 taken 2 times.
2 pipe2.addToNode(hotWaterOutletNode);
448
449
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 hotWaterPlant.addDemandBranchForComponent(coilHeatingWater);
450
451
1/1
✓ Branch 1 taken 2 times.
2 SetpointManagerScheduled hotWaterSPM(model, _hotWaterSchedule);
452
453
1/1
✓ Branch 1 taken 2 times.
2 hotWaterSPM.addToNode(hotWaterOutletNode);
454
455 // Terminal
456
457
1/1
✓ Branch 1 taken 2 times.
2 CoilHeatingWater waterReheatCoil(model, _alwaysOnSchedule);
458
1/1
✓ Branch 1 taken 2 times.
2 AirTerminalSingleDuctVAVReheat waterTerminal(model, _alwaysOnSchedule, waterReheatCoil);
459
1/1
✓ Branch 1 taken 2 times.
2 airLoopHVAC.addBranchForHVACComponent(waterTerminal);
460
461
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 hotWaterPlant.addDemandBranchForComponent(waterReheatCoil);
462
463 4 return std::move(airLoopHVAC);
464 2 }
465
466 ✗ Loop addSystemType6(Model& model) {
467 ✗ Model tempModel;
468 ✗ Schedule _alwaysOnSchedule = model.alwaysOnDiscreteSchedule();
469
470 ✗ auto _deckTempSchedule = deckTempSchedule(tempModel).clone(model).cast<Schedule>();
471
472 ✗ AirLoopHVAC airLoopHVAC = AirLoopHVAC(model);
473 ✗ airLoopHVAC.setName("Packaged Rooftop VAV with PFP Boxes and Reheat");
474 ✗ FanVariableVolume fan = FanVariableVolume(model);
475 ✗ fan.setPressureRise(500);
476
477 ✗ CoilHeatingElectric coilHeatingElectric = CoilHeatingElectric(model);
478
479 ✗ CoilCoolingDXTwoSpeed coilCooling = CoilCoolingDXTwoSpeed(model);
480
481 ✗ SetpointManagerScheduled deckTempSPM = SetpointManagerScheduled(model, _deckTempSchedule);
482
483 ✗ ControllerOutdoorAir controllerOutdoorAir = ControllerOutdoorAir(model);
484
485 ✗ AirLoopHVACOutdoorAirSystem outdoorAirSystem = AirLoopHVACOutdoorAirSystem(model, controllerOutdoorAir);
486
487 ✗ Node supplyOutletNode = airLoopHVAC.supplyOutletNode();
488
489 ✗ outdoorAirSystem.addToNode(supplyOutletNode);
490 ✗ coilCooling.addToNode(supplyOutletNode);
491 ✗ fan.addToNode(supplyOutletNode);
492 ✗ Node fanInletNode = fan.inletModelObject()->cast<Node>();
493 ✗ coilHeatingElectric.addToNode(fanInletNode);
494
495 ✗ Node node1 = fan.outletModelObject()->cast<Node>();
496 ✗ deckTempSPM.addToNode(node1);
497
498 ✗ CoilHeatingElectric reheatCoil(model);
499 ✗ FanConstantVolume piuFan(model, _alwaysOnSchedule);
500 ✗ piuFan.setPressureRise(300);
501 ✗ AirTerminalSingleDuctParallelPIUReheat terminal(model, _alwaysOnSchedule, piuFan, reheatCoil);
502 ✗ airLoopHVAC.addBranchForHVACComponent(terminal);
503
504 ✗ return std::move(airLoopHVAC);
505 ✗ }
506
507 1 Loop addSystemType7(Model& model) {
508
1/1
✓ Branch 1 taken 1 time.
1 Model tempModel;
509
510
1/1
✓ Branch 1 taken 1 time.
1 Schedule _alwaysOnSchedule = model.alwaysOnDiscreteSchedule();
511
512
4/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
1 auto _deckTempSchedule = deckTempSchedule(tempModel).clone(model).cast<Schedule>();
513
514
4/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
1 auto _hotWaterSchedule = hotWaterTempSchedule(tempModel).clone(model).cast<Schedule>();
515
516
4/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
1 auto _chilledWaterSchedule = chilledWaterTempSchedule(tempModel).clone(model).cast<Schedule>();
517
518
1/1
✓ Branch 1 taken 1 time.
1 AirLoopHVAC airLoopHVAC = AirLoopHVAC(model);
519
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 airLoopHVAC.setName("VAV with Reheat");
520
1/1
✓ Branch 1 taken 1 time.
1 SizingSystem sizingSystem = airLoopHVAC.sizingSystem();
521
1/1
✓ Branch 1 taken 1 time.
1 sizingSystem.setCentralCoolingDesignSupplyAirTemperature(12.8);
522
1/1
✓ Branch 1 taken 1 time.
1 sizingSystem.setCentralHeatingDesignSupplyAirTemperature(12.8);
523
524
1/1
✓ Branch 1 taken 1 time.
1 FanVariableVolume fan = FanVariableVolume(model);
525
1/1
✓ Branch 1 taken 1 time.
1 fan.setPressureRise(500);
526
527
1/1
✓ Branch 1 taken 1 time.
1 CoilHeatingWater coilHeatingWater = CoilHeatingWater(model);
528
529
1/1
✓ Branch 1 taken 1 time.
1 CoilCoolingWater coilCoolingWater = CoilCoolingWater(model);
530
531
1/1
✓ Branch 1 taken 1 time.
1 SetpointManagerScheduled deckTempSPM = SetpointManagerScheduled(model, _deckTempSchedule);
532
533
1/1
✓ Branch 1 taken 1 time.
1 ControllerOutdoorAir controllerOutdoorAir = ControllerOutdoorAir(model);
534
535
1/1
✓ Branch 1 taken 1 time.
1 AirLoopHVACOutdoorAirSystem outdoorAirSystem = AirLoopHVACOutdoorAirSystem(model, controllerOutdoorAir);
536
537
1/1
✓ Branch 1 taken 1 time.
1 Node supplyOutletNode = airLoopHVAC.supplyOutletNode();
538
539
1/1
✓ Branch 1 taken 1 time.
1 outdoorAirSystem.addToNode(supplyOutletNode);
540
1/1
✓ Branch 1 taken 1 time.
1 coilCoolingWater.addToNode(supplyOutletNode);
541
1/1
✓ Branch 1 taken 1 time.
1 coilHeatingWater.addToNode(supplyOutletNode);
542
1/1
✓ Branch 1 taken 1 time.
1 fan.addToNode(supplyOutletNode);
543
544
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 Node node1 = fan.outletModelObject()->cast<Node>();
545
1/1
✓ Branch 1 taken 1 time.
1 deckTempSPM.addToNode(node1);
546
547 // Hot Water Plant
548
549
1/1
✓ Branch 1 taken 1 time.
1 PlantLoop hotWaterPlant(model);
550
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 hotWaterPlant.setName("Hot Water Loop");
551
1/1
✓ Branch 1 taken 1 time.
1 SizingPlant sizingPlant = hotWaterPlant.sizingPlant();
552
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 sizingPlant.setLoopType("Heating");
553
1/1
✓ Branch 1 taken 1 time.
1 sizingPlant.setDesignLoopExitTemperature(82.0);
554
1/1
✓ Branch 1 taken 1 time.
1 sizingPlant.setLoopDesignTemperatureDifference(11.0);
555
556
1/1
✓ Branch 1 taken 1 time.
1 Node hotWaterOutletNode = hotWaterPlant.supplyOutletNode();
557
1/1
✓ Branch 1 taken 1 time.
1 Node hotWaterInletNode = hotWaterPlant.supplyInletNode();
558
559
1/1
✓ Branch 1 taken 1 time.
1 Node hotWaterDemandOutletNode = hotWaterPlant.demandOutletNode();
560
1/1
✓ Branch 1 taken 1 time.
1 Node hotWaterDemandInletNode = hotWaterPlant.demandInletNode();
561
562
1/1
✓ Branch 1 taken 1 time.
1 PumpVariableSpeed pump = PumpVariableSpeed(model);
563
564
1/1
✓ Branch 1 taken 1 time.
1 BoilerHotWater boiler = BoilerHotWater(model);
565
566
1/1
✓ Branch 1 taken 1 time.
1 CurveBiquadratic boilerCurve(model);
567
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 boilerCurve.setName("Boiler Efficiency");
568
1/1
✓ Branch 1 taken 1 time.
1 boilerCurve.setCoefficient1Constant(1.0);
569
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 boilerCurve.setInputUnitTypeforX("Dimensionless");
570
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 boilerCurve.setInputUnitTypeforY("Dimensionless");
571
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 boilerCurve.setOutputUnitType("Dimensionless");
572
573
1/1
✓ Branch 1 taken 1 time.
1 boiler.setNormalizedBoilerEfficiencyCurve(boilerCurve);
574
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 boiler.setEfficiencyCurveTemperatureEvaluationVariable("LeavingBoiler");
575
576
1/1
✓ Branch 1 taken 1 time.
1 pump.addToNode(hotWaterInletNode);
577
578
4/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
1 Node node = hotWaterPlant.supplySplitter().lastOutletModelObject()->cast<Node>();
579
1/1
✓ Branch 1 taken 1 time.
1 boiler.addToNode(node);
580
581
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic pipe(model);
582
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 hotWaterPlant.addSupplyBranchForComponent(pipe);
583
584
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic hotWaterBypass(model);
585
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 hotWaterPlant.addDemandBranchForComponent(hotWaterBypass);
586
587
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 hotWaterPlant.addDemandBranchForComponent(coilHeatingWater);
588
589
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic hotWaterDemandInlet(model);
590
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic hotWaterDemandOutlet(model);
591
592
1/1
✓ Branch 1 taken 1 time.
1 hotWaterDemandOutlet.addToNode(hotWaterDemandOutletNode);
593
1/1
✓ Branch 1 taken 1 time.
1 hotWaterDemandInlet.addToNode(hotWaterDemandInletNode);
594
595
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic pipe2(model);
596
1/1
✓ Branch 1 taken 1 time.
1 pipe2.addToNode(hotWaterOutletNode);
597
598
1/1
✓ Branch 1 taken 1 time.
1 SetpointManagerScheduled hotWaterSPM(model, _hotWaterSchedule);
599
600
1/1
✓ Branch 1 taken 1 time.
1 hotWaterSPM.addToNode(hotWaterOutletNode);
601
602 // Chilled Water Plant
603
604
1/1
✓ Branch 1 taken 1 time.
1 PlantLoop chilledWaterPlant(model);
605
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 chilledWaterPlant.setName("Chilled Water Loop");
606
1/1
✓ Branch 1 taken 1 time.
1 SizingPlant chilledWaterSizing = chilledWaterPlant.sizingPlant();
607
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 chilledWaterSizing.setLoopType("Cooling");
608
1/1
✓ Branch 1 taken 1 time.
1 chilledWaterSizing.setDesignLoopExitTemperature(7.22);
609
1/1
✓ Branch 1 taken 1 time.
1 chilledWaterSizing.setLoopDesignTemperatureDifference(6.67);
610
611
1/1
✓ Branch 1 taken 1 time.
1 Node chilledWaterOutletNode = chilledWaterPlant.supplyOutletNode();
612
1/1
✓ Branch 1 taken 1 time.
1 Node chilledWaterInletNode = chilledWaterPlant.supplyInletNode();
613
614
1/1
✓ Branch 1 taken 1 time.
1 Node chilledWaterDemandOutletNode = chilledWaterPlant.demandOutletNode();
615
1/1
✓ Branch 1 taken 1 time.
1 Node chilledWaterDemandInletNode = chilledWaterPlant.demandInletNode();
616
617
1/1
✓ Branch 1 taken 1 time.
1 PumpVariableSpeed pump2 = PumpVariableSpeed(model);
618
619
1/1
✓ Branch 1 taken 1 time.
1 pump2.addToNode(chilledWaterInletNode);
620
621
1/1
✓ Branch 1 taken 1 time.
1 CurveBiquadratic ccFofT(model);
622
1/1
✓ Branch 1 taken 1 time.
1 ccFofT.setCoefficient1Constant(0.258);
623
1/1
✓ Branch 1 taken 1 time.
1 ccFofT.setCoefficient2x(0.0389);
624
1/1
✓ Branch 1 taken 1 time.
1 ccFofT.setCoefficient3xPOW2(-0.000217);
625
1/1
✓ Branch 1 taken 1 time.
1 ccFofT.setCoefficient4y(0.0469);
626
1/1
✓ Branch 1 taken 1 time.
1 ccFofT.setCoefficient5yPOW2(-0.000943);
627
1/1
✓ Branch 1 taken 1 time.
1 ccFofT.setCoefficient6xTIMESY(-0.000343);
628
1/1
✓ Branch 1 taken 1 time.
1 ccFofT.setMinimumValueofx(5);
629
1/1
✓ Branch 1 taken 1 time.
1 ccFofT.setMaximumValueofx(10);
630
1/1
✓ Branch 1 taken 1 time.
1 ccFofT.setMinimumValueofy(24);
631
1/1
✓ Branch 1 taken 1 time.
1 ccFofT.setMaximumValueofy(35);
632
633
1/1
✓ Branch 1 taken 1 time.
1 CurveBiquadratic eiToCORFofT(model);
634
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofT.setCoefficient1Constant(0.934);
635
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofT.setCoefficient2x(-0.0582);
636
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofT.setCoefficient3xPOW2(0.0045);
637
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofT.setCoefficient4y(0.00243);
638
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofT.setCoefficient5yPOW2(0.000486);
639
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofT.setCoefficient6xTIMESY(-0.00122);
640
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofT.setMinimumValueofx(5);
641
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofT.setMaximumValueofx(10);
642
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofT.setMinimumValueofy(24);
643
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofT.setMaximumValueofy(35);
644
645
1/1
✓ Branch 1 taken 1 time.
1 CurveQuadratic eiToCORFofPLR(model);
646
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofPLR.setCoefficient1Constant(0.222903);
647
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofPLR.setCoefficient2x(0.313387);
648
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofPLR.setCoefficient3xPOW2(0.46371);
649
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofPLR.setMinimumValueofx(0);
650
1/1
✓ Branch 1 taken 1 time.
1 eiToCORFofPLR.setMaximumValueofx(1);
651
652
1/1
✓ Branch 1 taken 1 time.
1 ChillerElectricEIR chiller(model, ccFofT, eiToCORFofT, eiToCORFofPLR);
653
654
4/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
1 node = chilledWaterPlant.supplySplitter().lastOutletModelObject()->cast<Node>();
655
1/1
✓ Branch 1 taken 1 time.
1 chiller.addToNode(node);
656
657
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic pipe3(model);
658
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 chilledWaterPlant.addSupplyBranchForComponent(pipe3);
659
660
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic pipe4(model);
661
1/1
✓ Branch 1 taken 1 time.
1 pipe4.addToNode(chilledWaterOutletNode);
662
663
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 chilledWaterPlant.addDemandBranchForComponent(coilCoolingWater);
664
665
1/1
✓ Branch 1 taken 1 time.
1 SetpointManagerScheduled chilledWaterSPM(model, _chilledWaterSchedule);
666
667
1/1
✓ Branch 1 taken 1 time.
1 chilledWaterSPM.addToNode(chilledWaterOutletNode);
668
669
1/1
✓ Branch 1 taken 1 time.
1 CoilHeatingWater waterReheatCoil(model, _alwaysOnSchedule);
670
1/1
✓ Branch 1 taken 1 time.
1 AirTerminalSingleDuctVAVReheat waterTerminal(model, _alwaysOnSchedule, waterReheatCoil);
671
1/1
✓ Branch 1 taken 1 time.
1 airLoopHVAC.addBranchForHVACComponent(waterTerminal);
672
673
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic chilledWaterDemandBypass(model);
674
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 chilledWaterPlant.addDemandBranchForComponent(chilledWaterDemandBypass);
675
676
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 hotWaterPlant.addDemandBranchForComponent(waterReheatCoil);
677
678
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic chilledWaterDemandInlet(model);
679
1/1
✓ Branch 1 taken 1 time.
1 chilledWaterDemandInlet.addToNode(chilledWaterDemandInletNode);
680
681
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic chilledWaterDemandOutlet(model);
682
1/1
✓ Branch 1 taken 1 time.
1 chilledWaterDemandOutlet.addToNode(chilledWaterDemandOutletNode);
683
684 // Condenser System
685
686
1/1
✓ Branch 1 taken 1 time.
1 PlantLoop condenserSystem(model);
687
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 condenserSystem.setName("Condenser Water Loop");
688
1/1
✓ Branch 1 taken 1 time.
1 SizingPlant condenserSizing = condenserSystem.sizingPlant();
689
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 condenserSizing.setLoopType("Condenser");
690
1/1
✓ Branch 1 taken 1 time.
1 condenserSizing.setDesignLoopExitTemperature(29.4);
691
1/1
✓ Branch 1 taken 1 time.
1 condenserSizing.setLoopDesignTemperatureDifference(5.6);
692
693
1/1
✓ Branch 1 taken 1 time.
1 CoolingTowerSingleSpeed tower(model);
694
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 condenserSystem.addSupplyBranchForComponent(tower);
695
696
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic condenserSupplyBypass(model);
697
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 condenserSystem.addSupplyBranchForComponent(condenserSupplyBypass);
698
699
1/1
✓ Branch 1 taken 1 time.
1 Node condenserSystemDemandOutletNode = condenserSystem.demandOutletNode();
700
1/1
✓ Branch 1 taken 1 time.
1 Node condenserSystemDemandInletNode = condenserSystem.demandInletNode();
701
1/1
✓ Branch 1 taken 1 time.
1 Node condenserSystemSupplyOutletNode = condenserSystem.supplyOutletNode();
702
1/1
✓ Branch 1 taken 1 time.
1 Node condenserSystemSupplyInletNode = condenserSystem.supplyInletNode();
703
704
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic condenserSupplyOutlet(model);
705
706
1/1
✓ Branch 1 taken 1 time.
1 condenserSupplyOutlet.addToNode(condenserSystemSupplyOutletNode);
707
708
1/1
✓ Branch 1 taken 1 time.
1 PumpVariableSpeed pump3 = PumpVariableSpeed(model);
709
710
1/1
✓ Branch 1 taken 1 time.
1 pump3.addToNode(condenserSystemSupplyInletNode);
711
712
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 condenserSystem.addDemandBranchForComponent(chiller);
713
714
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic condenserDemandBypass(model);
715
716
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 condenserSystem.addDemandBranchForComponent(condenserDemandBypass);
717
718
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic condenserDemandInlet(model);
719
720
1/1
✓ Branch 1 taken 1 time.
1 condenserDemandInlet.addToNode(condenserSystemDemandInletNode);
721
722
1/1
✓ Branch 1 taken 1 time.
1 PipeAdiabatic condenserDemandOutlet(model);
723
724
1/1
✓ Branch 1 taken 1 time.
1 condenserDemandOutlet.addToNode(condenserSystemDemandOutletNode);
725
726
1/1
✓ Branch 1 taken 1 time.
1 SetpointManagerFollowOutdoorAirTemperature spm(model);
727
728
1/1
✓ Branch 1 taken 1 time.
1 spm.addToNode(condenserSystemSupplyOutletNode);
729
730 2 return std::move(airLoopHVAC);
731 1 }
732
733 ✗ Loop addSystemType8(Model& model) {
734 ✗ Model tempModel;
735 ✗ Schedule _alwaysOnSchedule = model.alwaysOnDiscreteSchedule();
736
737 ✗ auto _chilledWaterSchedule = chilledWaterTempSchedule(tempModel).clone(model).cast<Schedule>();
738
739 ✗ auto _deckTempSchedule = deckTempSchedule(tempModel).clone(model).cast<Schedule>();
740
741 ✗ AirLoopHVAC airLoopHVAC = AirLoopHVAC(model);
742 ✗ airLoopHVAC.setName("VAV with PFP Boxes and Reheat");
743 ✗ FanVariableVolume fan = FanVariableVolume(model);
744 ✗ fan.setPressureRise(500);
745
746 ✗ CoilHeatingElectric coilHeatingElectric = CoilHeatingElectric(model);
747
748 ✗ CoilCoolingWater coilCoolingWater = CoilCoolingWater(model);
749
750 ✗ SetpointManagerScheduled deckTempSPM = SetpointManagerScheduled(model, _deckTempSchedule);
751
752 ✗ ControllerOutdoorAir controllerOutdoorAir = ControllerOutdoorAir(model);
753
754 ✗ AirLoopHVACOutdoorAirSystem outdoorAirSystem = AirLoopHVACOutdoorAirSystem(model, controllerOutdoorAir);
755
756 ✗ Node supplyOutletNode = airLoopHVAC.supplyOutletNode();
757
758 ✗ outdoorAirSystem.addToNode(supplyOutletNode);
759 ✗ coilCoolingWater.addToNode(supplyOutletNode);
760 ✗ fan.addToNode(supplyOutletNode);
761 ✗ Node fanInletNode = fan.inletModelObject()->cast<Node>();
762 ✗ coilHeatingElectric.addToNode(fanInletNode);
763
764 ✗ Node node1 = fan.outletModelObject()->cast<Node>();
765 ✗ deckTempSPM.addToNode(node1);
766
767 // Chilled Water Plant
768
769 ✗ PlantLoop chilledWaterPlant(model);
770 ✗ chilledWaterPlant.setName("Chilled Water Loop");
771 ✗ SizingPlant sizingPlant = chilledWaterPlant.sizingPlant();
772 ✗ sizingPlant.setLoopType("Cooling");
773 ✗ sizingPlant.setDesignLoopExitTemperature(7.22);
774 ✗ sizingPlant.setLoopDesignTemperatureDifference(6.67);
775
776 ✗ Node chilledWaterOutletNode = chilledWaterPlant.supplyOutletNode();
777 ✗ Node chilledWaterInletNode = chilledWaterPlant.supplyInletNode();
778
779 ✗ PumpVariableSpeed pump2 = PumpVariableSpeed(model);
780
781 ✗ pump2.addToNode(chilledWaterInletNode);
782
783 ✗ ChillerElectricEIR chiller(model);
784
785 ✗ Node node = chilledWaterPlant.supplySplitter().lastOutletModelObject()->cast<Node>();
786 ✗ chiller.addToNode(node);
787
788 ✗ chilledWaterPlant.addDemandBranchForComponent(coilCoolingWater);
789
790 ✗ PipeAdiabatic pipe(model);
791 ✗ chilledWaterPlant.addSupplyBranchForComponent(pipe);
792
793 ✗ PipeAdiabatic pipe2(model);
794 ✗ pipe2.addToNode(chilledWaterOutletNode);
795
796 ✗ SetpointManagerScheduled chilledWaterSPM(model, _chilledWaterSchedule);
797
798 ✗ chilledWaterSPM.addToNode(chilledWaterOutletNode);
799
800 ✗ CoilHeatingElectric reheatCoil(model);
801 ✗ FanConstantVolume piuFan(model, _alwaysOnSchedule);
802 ✗ piuFan.setPressureRise(300);
803 ✗ AirTerminalSingleDuctParallelPIUReheat terminal(model, _alwaysOnSchedule, piuFan, reheatCoil);
804 ✗ airLoopHVAC.addBranchForHVACComponent(terminal);
805
806 ✗ return std::move(airLoopHVAC);
807 ✗ }
808
809 ✗ Loop addSystemType9(Model& model) {
810 ✗ Model tempModel;
811 ✗ Schedule _alwaysOnSchedule = model.alwaysOnDiscreteSchedule();
812
813 ✗ AirLoopHVAC airLoopHVAC = AirLoopHVAC(model);
814 ✗ airLoopHVAC.setName("Gas Fired Furnace");
815 // when an airloophvac is contructed, its constructor automatically creates a sizing:system object
816 // the default sizing:system contstructor makes a system:sizing object appropriate for a multizone VAV system
817 // this systems is a constant volume system with no VAV terminals, and needs different default settings
818
819 // get the sizing:system object associated with the airloophvac
820 ✗ SizingSystem sizingSystem = airLoopHVAC.sizingSystem();
821
822 //set the default parameters correctly for a constant volume system with no VAV terminals
823 ✗ sizingSystem.setTypeofLoadtoSizeOn("Sensible");
824 ✗ sizingSystem.autosizeDesignOutdoorAirFlowRate();
825 ✗ sizingSystem.setCentralHeatingMaximumSystemAirFlowRatio(1.0);
826 ✗ sizingSystem.setPreheatDesignTemperature(7.0);
827 ✗ sizingSystem.setPreheatDesignHumidityRatio(0.008);
828 ✗ sizingSystem.setPrecoolDesignTemperature(12.8);
829 ✗ sizingSystem.setPrecoolDesignHumidityRatio(0.008);
830 ✗ sizingSystem.setCentralCoolingDesignSupplyAirTemperature(12.8);
831 ✗ sizingSystem.setCentralHeatingDesignSupplyAirTemperature(40.0);
832 ✗ sizingSystem.setSizingOption("NonCoincident");
833 ✗ sizingSystem.setAllOutdoorAirinCooling(false);
834 ✗ sizingSystem.setAllOutdoorAirinHeating(false);
835 ✗ sizingSystem.setCentralCoolingDesignSupplyAirHumidityRatio(0.0085);
836 ✗ sizingSystem.setCentralHeatingDesignSupplyAirHumidityRatio(0.0080);
837 ✗ sizingSystem.setCoolingDesignAirFlowMethod("DesignDay");
838 ✗ sizingSystem.setCoolingDesignAirFlowRate(0.0);
839 ✗ sizingSystem.setHeatingDesignAirFlowMethod("DesignDay");
840 ✗ sizingSystem.setHeatingDesignAirFlowRate(0.0);
841 ✗ sizingSystem.setSystemOutdoorAirMethod("ZoneSum");
842
843 ✗ FanConstantVolume fan = FanConstantVolume(model);
844 ✗ fan.setPressureRise(500);
845
846 ✗ CoilHeatingGas coilHeatingGas = CoilHeatingGas(model, _alwaysOnSchedule);
847
848 ✗ SetpointManagerSingleZoneReheat setpointMSZR(model);
849
850 ✗ ControllerOutdoorAir controllerOutdoorAir = ControllerOutdoorAir(model);
851
852 ✗ AirLoopHVACOutdoorAirSystem outdoorAirSystem = AirLoopHVACOutdoorAirSystem(model, controllerOutdoorAir);
853
854 ✗ Node supplyOutletNode = airLoopHVAC.supplyOutletNode();
855
856 ✗ outdoorAirSystem.addToNode(supplyOutletNode);
857 ✗ coilHeatingGas.addToNode(supplyOutletNode);
858 ✗ fan.addToNode(supplyOutletNode);
859
860 ✗ Node node1 = fan.outletModelObject()->cast<Node>();
861 ✗ setpointMSZR.addToNode(node1);
862
863 ✗ AirTerminalSingleDuctConstantVolumeNoReheat terminal(model, _alwaysOnSchedule);
864
865 ✗ airLoopHVAC.addBranchForHVACComponent(terminal);
866
867 ✗ return std::move(airLoopHVAC);
868 ✗ }
869
870 ✗ Loop addSystemType10(Model& model) {
871 ✗ Model tempModel;
872 ✗ Schedule _alwaysOnSchedule = model.alwaysOnDiscreteSchedule();
873
874 ✗ AirLoopHVAC airLoopHVAC = AirLoopHVAC(model);
875 ✗ airLoopHVAC.setName("Electric Furnace");
876 // when an airloophvac is contructed, its constructor automatically creates a sizing:system object
877 // the default sizing:system contstructor makes a system:sizing object appropriate for a multizone VAV system
878 // this systems is a constant volume system with no VAV terminals, and needs different default settings
879
880 // get the sizing:system object associated with the airloophvac
881 ✗ SizingSystem sizingSystem = airLoopHVAC.sizingSystem();
882
883 //set the default parameters correctly for a constant volume system with no VAV terminals
884 ✗ sizingSystem.setTypeofLoadtoSizeOn("Sensible");
885 ✗ sizingSystem.autosizeDesignOutdoorAirFlowRate();
886 ✗ sizingSystem.setCentralHeatingMaximumSystemAirFlowRatio(1.0);
887 ✗ sizingSystem.setPreheatDesignTemperature(7.0);
888 ✗ sizingSystem.setPreheatDesignHumidityRatio(0.008);
889 ✗ sizingSystem.setPrecoolDesignTemperature(12.8);
890 ✗ sizingSystem.setPrecoolDesignHumidityRatio(0.008);
891 ✗ sizingSystem.setCentralCoolingDesignSupplyAirTemperature(12.8);
892 ✗ sizingSystem.setCentralHeatingDesignSupplyAirTemperature(40.0);
893 ✗ sizingSystem.setSizingOption("NonCoincident");
894 ✗ sizingSystem.setAllOutdoorAirinCooling(false);
895 ✗ sizingSystem.setAllOutdoorAirinHeating(false);
896 ✗ sizingSystem.setCentralCoolingDesignSupplyAirHumidityRatio(0.0085);
897 ✗ sizingSystem.setCentralHeatingDesignSupplyAirHumidityRatio(0.0080);
898 ✗ sizingSystem.setCoolingDesignAirFlowMethod("DesignDay");
899 ✗ sizingSystem.setCoolingDesignAirFlowRate(0.0);
900 ✗ sizingSystem.setHeatingDesignAirFlowMethod("DesignDay");
901 ✗ sizingSystem.setHeatingDesignAirFlowRate(0.0);
902 ✗ sizingSystem.setSystemOutdoorAirMethod("ZoneSum");
903
904 ✗ FanConstantVolume fan = FanConstantVolume(model);
905 ✗ fan.setPressureRise(500);
906
907 ✗ CoilHeatingElectric coilHeatingElectric = CoilHeatingElectric(model);
908
909 ✗ SetpointManagerSingleZoneReheat setpointMSZR(model);
910
911 ✗ ControllerOutdoorAir controllerOutdoorAir = ControllerOutdoorAir(model);
912
913 ✗ AirLoopHVACOutdoorAirSystem outdoorAirSystem = AirLoopHVACOutdoorAirSystem(model, controllerOutdoorAir);
914
915 ✗ Node supplyOutletNode = airLoopHVAC.supplyOutletNode();
916
917 ✗ outdoorAirSystem.addToNode(supplyOutletNode);
918 ✗ coilHeatingElectric.addToNode(supplyOutletNode);
919 ✗ fan.addToNode(supplyOutletNode);
920
921 ✗ Node node1 = fan.outletModelObject()->cast<Node>();
922 ✗ setpointMSZR.addToNode(node1);
923
924 ✗ AirTerminalSingleDuctConstantVolumeNoReheat terminal(model, _alwaysOnSchedule);
925
926 ✗ airLoopHVAC.addBranchForHVACComponent(terminal);
927
928 ✗ return std::move(airLoopHVAC);
929 ✗ }
930
931 ✗ Loop addSHWLoop(Model& model) {
932
933 ✗ Model tempModel;
934 // Make a schedule at 140°F
935 ✗ auto shwSchedule = makeSchedule(tempModel, "SHW_Temperature_140F", 60).clone(model).cast<Schedule>();
936
937 ✗ Schedule _alwaysOnSchedule = model.alwaysOnDiscreteSchedule();
938
939 // SHW Plant
940 ✗ PlantLoop shwPlant(model);
941 ✗ shwPlant.setName("Service Water Loop");
942
943 // Initialize nodes
944 ✗ Node shwOutletNode = shwPlant.supplyOutletNode();
945 ✗ Node shwInletNode = shwPlant.supplyInletNode();
946 ✗ Node shwDemandOutletNode = shwPlant.demandOutletNode();
947 ✗ Node shwDemandInletNode = shwPlant.demandInletNode();
948
949 // Set temperatures
950 ✗ shwPlant.setMaximumLoopTemperature(60);
951 ✗ shwPlant.setMinimumLoopTemperature(10);
952 ✗ SizingPlant sizingPlant = shwPlant.sizingPlant();
953 ✗ sizingPlant.setLoopType("Heating");
954 // Supply at 60°C (140°F), delta is 5°K (9°F)
955 ✗ sizingPlant.setDesignLoopExitTemperature(60);
956 ✗ sizingPlant.setLoopDesignTemperatureDifference(5.0);
957
958 ✗ SetpointManagerScheduled shwSPM(model, shwSchedule);
959 ✗ shwSPM.addToNode(shwOutletNode);
960
961 // Pump: assume 10 ft of head, just from friction (recirculation)
962 ✗ PumpConstantSpeed swh_pump(model);
963 ✗ swh_pump.setRatedPumpHead(29891);
964 ✗ swh_pump.setPumpControlType("Intermittent");
965 ✗ swh_pump.addToNode(shwInletNode);
966
967 // WaterHeater
968 // Mostly taken from prototype input for HighRiseApartment
969 ✗ WaterHeaterMixed wh(model);
970 // Connect it to loop
971 ✗ shwPlant.addSupplyBranchForComponent(wh);
972 // 600 gal, 140F cut-out, delta of 5K(9F) means cut-in is 131°F
973 ✗ wh.setName("600 gal Water Heater - 600 kBtu/hr");
974 ✗ wh.setTankVolume(2.2712470703819108);
975 ✗ wh.setSetpointTemperatureSchedule(shwSchedule);
976 ✗ wh.setDeadbandTemperatureDifference(5);
977 // 600 kBTU/h
978 ✗ wh.setHeaterMaximumCapacity(175842);
979 // Max temp is 180F
980 ✗ wh.setMaximumTemperatureLimit(82.22222);
981 ✗ wh.setHeaterControlType("Cycle");
982 ✗ wh.setOffCycleParasiticHeatFractiontoTank(0.8);
983 ✗ wh.setIndirectWaterHeatingRecoveryTime(1.5); // 1.5hrs
984
985 // Assume gas
986 ✗ wh.setHeaterFuelType("NaturalGas");
987 // Result from running the prototype building for 90.1-2013 HighRiseApartment
988 ✗ wh.setHeaterThermalEfficiency(0.80154340529419);
989
990 // Set it to Ambient schedule, at 70°F
991 ✗ auto ambientSchedule = makeSchedule(tempModel, "Water Heater Ambient Temp Schedule - 70F", 21.11).clone(model).cast<Schedule>();
992 ✗ wh.setAmbientTemperatureSchedule(ambientSchedule);
993 ✗ wh.setAmbientTemperatureIndicator("Schedule");
994
995 // 8742 Btu/hr (from prototype)
996 ✗ wh.setOffCycleParasiticFuelConsumptionRate(2562);
997 ✗ wh.setOnCycleParasiticFuelConsumptionRate(2562);
998 ✗ wh.setOffCycleParasiticFuelType("NaturalGas");
999 ✗ wh.setOnCycleParasiticFuelType("NaturalGas");
1000 ✗ wh.setOffCycleLossCoefficienttoAmbientTemperature(6.0);
1001 ✗ wh.setOnCycleLossCoefficienttoAmbientTemperature(6.0);
1002 ✗ wh.setEndUseSubcategory("Service Hot Water Heating");
1003
1004 // Make a typical DHW Demand schedule
1005 ✗ ScheduleRuleset dhw_flow_sch(model);
1006 ✗ dhw_flow_sch.setName("ESTAR MFHR DHW Fraction Schedule");
1007
1008 ✗ ScheduleDay dhw_sch_day = dhw_flow_sch.defaultDaySchedule();
1009 ✗ dhw_sch_day.setName("ESTAR MFHR DHW Schedule Day");
1010
1011 // dhw_flow_sch.setScheduleTypeLimits(frac);
1012
1013 // map of schedule info:
1014 // Key is the hour until
1015 // Value is the value
1016 //
1017 std::map<int, double> schInfo = {
1018 std::pair<int, double>(6, 0.05), std::pair<int, double>(7, 0.3), std::pair<int, double>(8, 0.5), std::pair<int, double>(9, 0.4),
1019 std::pair<int, double>(11, 0.3), std::pair<int, double>(12, 0.35), std::pair<int, double>(13, 0.40), std::pair<int, double>(15, 0.35),
1020 std::pair<int, double>(17, 0.30), std::pair<int, double>(19, 0.5), std::pair<int, double>(20, 0.40), std::pair<int, double>(21, 0.35),
1021 std::pair<int, double>(22, 0.45), std::pair<int, double>(23, 0.3), std::pair<int, double>(24, 0.05),
1022 ✗ };
1023
1024 ✗ std::map<int, double>::iterator it;
1025
1026 ✗ double dhw_daily_frac = 0;
1027 ✗ int lastHour = 0;
1028 ✗ for (it = schInfo.begin(); it != schInfo.end(); it++) {
1029 ✗ int hour = it->first;
1030 ✗ double value = it->second;
1031 ✗ Time t = Time(0, hour, 0, 0);
1032 ✗ dhw_sch_day.addValue(t, value);
1033 ✗ dhw_daily_frac += (hour - lastHour) * it->second;
1034 ✗ lastHour = hour;
1035 }
1036
1037 // Assume occupancy type = "Medium" => 25 GPM / person
1038 // Assume 100 apartments, with 200 occupants, Medium Occupancy, and some standard GPMs (1.5 kitchen, 1.0 bathroom, 1.2 showerheads)
1039 ✗ int num_occupants = 200;
1040 ✗ int gpm_per_person_per_day = 25;
1041 ✗ int baseline_occupant_gal_per_day = num_occupants * gpm_per_person_per_day;
1042 // One kitchen, one bath per apartment
1043 ✗ int num_kitchen_faucets = 100;
1044 ✗ int num_bathroom_faucets = 100;
1045 ✗ double proposed_gpm_kitchen = 1.5;
1046 ✗ double proposed_gpm_bathroom = 1.0;
1047 ✗ double proposed_gpm_showerhead = 1.2;
1048
1049 // Calculate the weighted average gpm for faucets
1050 ✗ double proposed_gpm_faucet_weighted =
1051 ✗ (num_kitchen_faucets * proposed_gpm_kitchen + num_bathroom_faucets * proposed_gpm_bathroom) / (num_kitchen_faucets + num_bathroom_faucets);
1052
1053 ✗ double proposed_occupant_gal_per_day =
1054 ✗ baseline_occupant_gal_per_day * (0.36 + (0.54 * proposed_gpm_showerhead + 0.1 * proposed_gpm_faucet_weighted) / 2.5);
1055
1056 // No dishwashers nor laundry
1057 ✗ double total_gal_per_day = proposed_occupant_gal_per_day;
1058
1059 // Divide by total daily fraction
1060 ✗ double dhw_gpm = total_gal_per_day / (60 * dhw_daily_frac);
1061
1062 // Add a sample service hot water connection
1063 ✗ WaterUseEquipmentDefinition water_use_equip_def(model);
1064 ✗ water_use_equip_def.setName("SWH Definition");
1065 ✗ water_use_equip_def.setName("Whole Building Water Equipment Definition - 100 units 200 occupants");
1066 ✗ water_use_equip_def.setPeakFlowRate(dhw_gpm * 6.309019639949753e-05);
1067
1068 // Set Fraction sensible and latent
1069
1070 //Make a time stamp to use in multiple places
1071 ✗ Time osTime = Time(0, 24, 0, 0);
1072
1073 //Schedule Ruleset
1074 ✗ ScheduleRuleset fracSchedule = ScheduleRuleset(model);
1075 ✗ fracSchedule.setName("Fraction Sensible - 0.2");
1076 ✗ fracSchedule.defaultDaySchedule().setName("Fraction Sensible DefaultDay - 0.2");
1077 ✗ fracSchedule.defaultDaySchedule().addValue(osTime, 0.2);
1078 ✗ water_use_equip_def.setSensibleFractionSchedule(fracSchedule);
1079
1080 ✗ fracSchedule = ScheduleRuleset(model);
1081 ✗ fracSchedule.setName("Fraction Sensible - 0.05");
1082 ✗ fracSchedule.defaultDaySchedule().setName("Fraction Latent DefaultDay - 0.05");
1083 ✗ fracSchedule.defaultDaySchedule().addValue(osTime, 0.05);
1084 ✗ water_use_equip_def.setLatentFractionSchedule(fracSchedule);
1085
1086 // TODO: make 120F?
1087 ✗ water_use_equip_def.setTargetTemperatureSchedule(shwSchedule);
1088
1089 ✗ WaterUseEquipment water_use_equip(water_use_equip_def);
1090 ✗ water_use_equip.setFlowRateFractionSchedule(dhw_flow_sch);
1091 ✗ water_use_equip.setName("ESTAR MFHR Whole Building Water Use Equipment");
1092
1093 // add water use connection
1094 ✗ WaterUseConnections water_use_connection(model);
1095 ✗ water_use_connection.addWaterUseEquipment(water_use_equip);
1096 ✗ water_use_connection.setName("ESTAR MFHR DHW Water Use Connection");
1097
1098 ✗ shwPlant.addDemandBranchForComponent(water_use_connection);
1099
1100 /*
1101 * PipeAdiabatic shwBypass(model);
1102 * shwPlant.addDemandBranchForComponent(shwBypass);
1103 *
1104 * shwPlant.addDemandBranchForComponent(coilHeatingWater);
1105 *
1106 * PipeAdiabatic shwDemandInlet(model);
1107 * PipeAdiabatic shwDemandOutlet(model);
1108 *
1109 * shwDemandOutlet.addToNode(shwDemandOutletNode);
1110 * shwDemandInlet.addToNode(shwDemandInletNode);
1111 *
1112 * PipeAdiabatic pipe2(model);
1113 * pipe2.addToNode(shwOutletNode);
1114 *
1115 */
1116
1117 ✗ return std::move(shwPlant);
1118 ✗ }
1119
1120 } // namespace model
1121
1122 } // namespace openstudio
1123