GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 66.5% 326 / 0 / 490
Functions: 76.9% 83 / 0 / 108
Branches: 39.7% 198 / 0 / 499

src/model/CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit.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 "CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit.hpp"
7 #include "CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl.hpp"
8
9 #include "Curve.hpp"
10 #include "Curve_Impl.hpp"
11 #include "CurveQuadratic.hpp"
12 #include "CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData.hpp"
13 #include "CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData_Impl.hpp"
14 #include "ZoneHVACComponent.hpp"
15 #include "HVACComponent.hpp"
16 #include "ModelObjectList.hpp"
17 #include "ModelObjectList_Impl.hpp"
18 #include "ZoneHVACWaterToAirHeatPump.hpp"
19 #include "ZoneHVACWaterToAirHeatPump_Impl.hpp"
20 #include "AirLoopHVACUnitarySystem.hpp"
21 #include "AirLoopHVACUnitarySystem_Impl.hpp"
22 #include "AirflowNetworkEquivalentDuct.hpp"
23 #include "AirflowNetworkEquivalentDuct_Impl.hpp"
24 #include "Model.hpp"
25 #include "Model_Impl.hpp"
26 #include "Node.hpp"
27 #include "Node_Impl.hpp"
28 #include "Schedule.hpp"
29 #include "Schedule_Impl.hpp"
30 #include "ScheduleTypeRegistry.hpp"
31
32 #include <utilities/idd/OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFit_FieldEnums.hxx>
33
34 #include <utilities/idd/IddEnums.hxx>
35 #include "../utilities/core/Assert.hpp"
36 #include "../utilities/data/DataEnums.hpp"
37 #include "../utilities/idf/WorkspaceExtensibleGroup.hpp"
38
39 namespace openstudio {
40 namespace model {
41
42 namespace detail {
43
44 13 CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl(const IdfObject& idfObject,
45 Model_Impl* model,
46 13 bool keepHandle)
47 13 : WaterToAirComponent_Impl(idfObject, model, keepHandle) {
48
4/6
✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 13 times.
✗ Branch 13 not taken.
13 OS_ASSERT(idfObject.iddObject().type() == CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::iddObjectType());
49 13 }
50
51 5 CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl(
52 5 const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle)
53 5 : WaterToAirComponent_Impl(other, model, keepHandle) {
54
4/6
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 5 times.
✗ Branch 13 not taken.
5 OS_ASSERT(other.iddObject().type() == CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::iddObjectType());
55 5 }
56
57 8 CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl(
58 8 const CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl& other, Model_Impl* model, bool keepHandle)
59 8 : WaterToAirComponent_Impl(other, model, keepHandle) {}
60
61 ✗ const std::vector<std::string>& CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::outputVariableNames() const {
62 static const std::vector<std::string> result{"Cooling Coil Electricity Rate",
63 "Cooling Coil Total Cooling Rate",
64 "Cooling Coil Sensible Cooling Rate",
65 "Cooling Coil Source Side Heat Transfer Rate",
66 "Cooling Coil Part Load Ratio",
67 "Cooling Coil Runtime Fraction",
68 "Cooling Coil Air Mass Flow Rate",
69 "Cooling Coil Air Inlet Temperature",
70 "Cooling Coil Air Inlet Humidity Ratio",
71 "Cooling Coil Air Outlet Temperature",
72 "Cooling Coil Air Outlet Humidity Ratio",
73 "Cooling Coil Source Side Mass Flow Rate",
74 "Cooling Coil Source Side Inlet Temperature",
75 "Cooling Coil Source Side Outlet Temperature",
76 "Cooling Coil Upper Speed Level",
77 "Cooling Coil Neighboring Speed Levels Ratio",
78 "Cooling Coil Recoverable Heat Transfer Rate",
79 "Cooling Coil Electricity Energy",
80 "Cooling Coil Total Cooling Energy",
81 "Cooling Coil Sensible Cooling Energy",
82 "Cooling Coil Latent Cooling Energy",
83 "Cooling Coil Latent Cooling Rate",
84 ✗ "Cooling Coil Source Side Heat Transfer Energy"};
85 ✗ return result;
86 ✗ }
87
88 10 IddObjectType CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::iddObjectType() const {
89 10 return CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::iddObjectType();
90 }
91
92 ✗ std::vector<ScheduleTypeKey> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::getScheduleTypeKeys(const Schedule& schedule) const {
93 ✗ std::vector<ScheduleTypeKey> result;
94 ✗ UnsignedVector fieldIndices = getSourceIndices(schedule.handle());
95 ✗ UnsignedVector::const_iterator b(fieldIndices.begin());
96 ✗ UnsignedVector::const_iterator e(fieldIndices.end());
97 ✗ if (std::find(b, e, OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::AvailabilityScheduleName) != e) {
98 ✗ result.push_back(ScheduleTypeKey("CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit", "Availability Schedule"));
99 }
100 ✗ return result;
101 ✗ }
102
103 4 unsigned CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::airInletPort() const {
104 4 return OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::IndoorAirInletNodeName;
105 }
106
107 4 unsigned CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::airOutletPort() const {
108 4 return OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::IndoorAirOutletNodeName;
109 }
110
111 10 unsigned CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::waterInletPort() const {
112 10 return OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::WatertoRefrigerantHXWaterInletNodeName;
113 }
114
115 10 unsigned CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::waterOutletPort() const {
116 10 return OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::WatertoRefrigerantHXWaterOutletNodeName;
117 }
118
119 6 boost::optional<Schedule> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::optionalAvailabilitySchedule() const {
120
1/1
✓ Branch 1 taken 6 times.
12 return getObject<ModelObject>().getModelObjectTarget<Schedule>(
121
1/1
✓ Branch 1 taken 6 times.
12 OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::AvailabilityScheduleName);
122 }
123
124 6 Schedule CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::availabilitySchedule() const {
125
1/1
✓ Branch 1 taken 6 times.
6 boost::optional<Schedule> value = optionalAvailabilitySchedule();
126
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
6 if (!value) {
127 // it is an error if we get here, however we don't want to crash
128 // so we hook up to global always on schedule
129 ✗ LOG(Error, "Required availability schedule not set, using 'Always On' schedule");
130 ✗ value = this->model().alwaysOnDiscreteSchedule();
131 ✗ OS_ASSERT(value);
132 ✗ const_cast<CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl*>(this)->setAvailabilitySchedule(*value);
133 ✗ value = optionalAvailabilitySchedule();
134 }
135
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 6 times.
✗ Branch 4 not taken.
6 OS_ASSERT(value);
136
2/2
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
12 return value.get();
137 6 }
138
139 4 int CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::nominalSpeedLevel() const {
140
1/1
✓ Branch 1 taken 4 times.
4 boost::optional<int> value = getInt(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::NominalSpeedLevel, true);
141
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
4 OS_ASSERT(value);
142
1/1
✓ Branch 1 taken 4 times.
8 return value.get();
143 }
144
145 boost::optional<double>
146 1 CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::grossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel() const {
147 1 return getDouble(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::GrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel,
148 1 true);
149 }
150
151 4 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::isGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevelAutosized() const {
152 4 bool result = false;
153 boost::optional<std::string> value =
154
1/1
✓ Branch 1 taken 4 times.
4 getString(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::GrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel, true);
155
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (value) {
156
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
8 result = openstudio::istringEqual(value.get(), "autosize");
157 }
158 4 return result;
159 4 }
160
161 1 boost::optional<double> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::ratedAirFlowRateAtSelectedNominalSpeedLevel() const {
162 1 return getDouble(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::RatedAirFlowRateAtSelectedNominalSpeedLevel, true);
163 }
164
165 4 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::isRatedAirFlowRateAtSelectedNominalSpeedLevelAutosized() const {
166 4 bool result = false;
167 boost::optional<std::string> value =
168
1/1
✓ Branch 1 taken 4 times.
4 getString(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::RatedAirFlowRateAtSelectedNominalSpeedLevel, true);
169
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (value) {
170
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
8 result = openstudio::istringEqual(value.get(), "autosize");
171 }
172 4 return result;
173 4 }
174
175 1 boost::optional<double> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::ratedWaterFlowRateAtSelectedNominalSpeedLevel() const {
176 1 return getDouble(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::RatedWaterFlowRateAtSelectedNominalSpeedLevel, true);
177 }
178
179 4 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::isRatedWaterFlowRateAtSelectedNominalSpeedLevelAutosized() const {
180 4 bool result = false;
181 boost::optional<std::string> value =
182
1/1
✓ Branch 1 taken 4 times.
4 getString(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::RatedWaterFlowRateAtSelectedNominalSpeedLevel, true);
183
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 if (value) {
184
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
8 result = openstudio::istringEqual(value.get(), "autosize");
185 }
186 4 return result;
187 4 }
188
189 4 double CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::nominalTimeforCondensatetoBeginLeavingtheCoil() const {
190 boost::optional<double> value =
191
1/1
✓ Branch 1 taken 4 times.
4 getDouble(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::NominalTimeforCondensatetoBeginLeavingtheCoil, true);
192
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
4 OS_ASSERT(value);
193
1/1
✓ Branch 1 taken 4 times.
8 return value.get();
194 }
195
196 4 double CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::initialMoistureEvaporationRateDividedbySteadyStateACLatentCapacity() const {
197
1/1
✓ Branch 1 taken 4 times.
4 boost::optional<double> value = getDouble(
198 OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::InitialMoistureEvaporationRateDividedbySteadyStateACLatentCapacity, true);
199
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
4 OS_ASSERT(value);
200
1/1
✓ Branch 1 taken 4 times.
8 return value.get();
201 }
202
203 7 double CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::maximumCyclingRate() const {
204
1/1
✓ Branch 1 taken 7 times.
7 boost::optional<double> value = getDouble(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::MaximumCyclingRate, true);
205
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
7 OS_ASSERT(value);
206
1/1
✓ Branch 1 taken 7 times.
14 return value.get();
207 }
208
209 9 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::setAvailabilitySchedule(Schedule& schedule) {
210
3/3
✓ Branch 1 taken 9 times.
✓ Branch 4 taken 9 times.
✓ Branch 7 taken 9 times.
36 bool result = setSchedule(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::AvailabilityScheduleName,
211 "CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit", "Availability Schedule", schedule);
212 9 return result;
213 }
214
215 11 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::setMaximumCyclingRate(double maximumCyclingRate) {
216 11 const bool result = setDouble(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::MaximumCyclingRate, maximumCyclingRate);
217 // OS_ASSERT(result);
218 11 return result;
219 }
220
221 7 double CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::latentCapacityTimeConstant() const {
222
1/1
✓ Branch 1 taken 7 times.
7 boost::optional<double> value = getDouble(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::LatentCapacityTimeConstant, true);
223
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
7 OS_ASSERT(value);
224
1/1
✓ Branch 1 taken 7 times.
14 return value.get();
225 }
226
227 11 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::setLatentCapacityTimeConstant(double latentCapacityTimeConstant) {
228 const bool result =
229 11 setDouble(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::LatentCapacityTimeConstant, latentCapacityTimeConstant);
230 // OS_ASSERT(result);
231 11 return result;
232 }
233
234 7 double CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::fanDelayTime() const {
235
1/1
✓ Branch 1 taken 7 times.
7 boost::optional<double> value = getDouble(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::FanDelayTime, true);
236
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 4 not taken.
7 OS_ASSERT(value);
237
1/1
✓ Branch 1 taken 7 times.
14 return value.get();
238 }
239
240 11 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::setFanDelayTime(double fanDelayTime) {
241 11 const bool result = setDouble(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::FanDelayTime, fanDelayTime);
242 // OS_ASSERT(result);
243 11 return result;
244 }
245
246 4 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::useHotGasReheat() const {
247
1/1
✓ Branch 1 taken 4 times.
4 boost::optional<std::string> value = getString(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::UseHotGasReheat, true);
248
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
4 OS_ASSERT(value);
249
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
8 return openstudio::istringEqual(value.get(), "Yes");
250 4 }
251
252 10 Curve CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::energyPartLoadFractionCurve() const {
253
1/1
✓ Branch 1 taken 10 times.
10 boost::optional<Curve> value = optionalEnergyPartLoadFractionCurve();
254
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 10 times.
10 if (!value) {
255 ✗ LOG_AND_THROW(briefDescription() << " does not have an Energy Part Load Fraction Curve attached.");
256 }
257
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 return value.get();
258 10 }
259
260 9 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::setNominalSpeedLevel(int nominalSpeedLevel) {
261 9 bool result = setInt(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::NominalSpeedLevel, nominalSpeedLevel);
262
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 9 times.
9 OS_ASSERT(result);
263 9 return result;
264 }
265
266 1 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::setGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel(
267 boost::optional<double> grossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel) {
268 1 bool result(false);
269
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (grossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel) {
270 result =
271 1 setDouble(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::GrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel,
272 1 grossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel.get());
273 }
274
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
275 1 return result;
276 }
277
278 8 void CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::autosizeGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel() {
279
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 bool result = setString(
280 OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::GrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel, "autosize");
281
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
8 OS_ASSERT(result);
282 8 }
283
284 1 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::setRatedAirFlowRateAtSelectedNominalSpeedLevel(
285 boost::optional<double> ratedAirFlowRateAtSelectedNominalSpeedLevel) {
286 1 bool result(false);
287
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (ratedAirFlowRateAtSelectedNominalSpeedLevel) {
288 1 result = setDouble(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::RatedAirFlowRateAtSelectedNominalSpeedLevel,
289 1 ratedAirFlowRateAtSelectedNominalSpeedLevel.get());
290 }
291
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
292 1 return result;
293 }
294
295 8 void CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::autosizeRatedAirFlowRateAtSelectedNominalSpeedLevel() {
296 bool result =
297
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 setString(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::RatedAirFlowRateAtSelectedNominalSpeedLevel, "autosize");
298
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
8 OS_ASSERT(result);
299 8 }
300
301 1 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::setRatedWaterFlowRateAtSelectedNominalSpeedLevel(
302 boost::optional<double> ratedWaterFlowRateAtSelectedNominalSpeedLevel) {
303 1 bool result(false);
304
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (ratedWaterFlowRateAtSelectedNominalSpeedLevel) {
305 1 result = setDouble(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::RatedWaterFlowRateAtSelectedNominalSpeedLevel,
306 1 ratedWaterFlowRateAtSelectedNominalSpeedLevel.get());
307 }
308
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
309 1 return result;
310 }
311
312 8 void CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::autosizeRatedWaterFlowRateAtSelectedNominalSpeedLevel() {
313 bool result =
314
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
16 setString(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::RatedWaterFlowRateAtSelectedNominalSpeedLevel, "autosize");
315
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
8 OS_ASSERT(result);
316 8 }
317
318 9 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::setNominalTimeforCondensatetoBeginLeavingtheCoil(
319 double nominalTimeforCondensatetoBeginLeavingtheCoil) {
320 9 bool result = setDouble(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::NominalTimeforCondensatetoBeginLeavingtheCoil,
321 nominalTimeforCondensatetoBeginLeavingtheCoil);
322 9 return result;
323 }
324
325 9 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::setInitialMoistureEvaporationRateDividedbySteadyStateACLatentCapacity(
326 double initialMoistureEvaporationRateDividedbySteadyStateACLatentCapacity) {
327 9 bool result = setDouble(
328 OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::InitialMoistureEvaporationRateDividedbySteadyStateACLatentCapacity,
329 initialMoistureEvaporationRateDividedbySteadyStateACLatentCapacity);
330 9 return result;
331 }
332
333 9 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::setUseHotGasReheat(bool useHotGasReheat) {
334 9 return setBooleanFieldValue(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::UseHotGasReheat, useHotGasReheat);
335 ;
336 }
337
338 8 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::setEnergyPartLoadFractionCurve(const Curve& curve) {
339
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 bool result = setPointer(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::EnergyPartLoadFractionCurveName, curve.handle());
340 8 return result;
341 }
342
343 10 boost::optional<Curve> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::optionalEnergyPartLoadFractionCurve() const {
344
1/1
✓ Branch 1 taken 10 times.
20 return getObject<ModelObject>().getModelObjectTarget<Curve>(
345
1/1
✓ Branch 1 taken 10 times.
20 OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::EnergyPartLoadFractionCurveName);
346 }
347
348 ✗ ModelObject CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::clone(Model model) const {
349 ✗ auto newCoil = WaterToAirComponent_Impl::clone(model).cast<CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit>();
350
351 ✗ if (auto speedDataList = this->speedDataList()) {
352 ✗ auto speedDataListClone = speedDataList->clone(model).cast<ModelObjectList>();
353 ✗ newCoil.getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->setSpeedDataList(speedDataListClone);
354 ✗ }
355
356 ✗ return std::move(newCoil);
357 ✗ }
358
359 5 std::vector<ModelObject> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::children() const {
360 5 std::vector<ModelObject> children;
361
362
3/3
✓ Branch 1 taken 5 times.
✓ Branch 3 taken 4 times.
✓ Branch 4 taken 1 time.
10 if (auto const _stageDataList = speedDataList()) {
363
4/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 11 taken 12 times.
✓ Branch 12 taken 4 times.
16 for (const auto& mo : _stageDataList->modelObjects()) {
364
1/1
✓ Branch 1 taken 12 times.
12 children.push_back(mo);
365 4 }
366 5 }
367
368
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
5 children.push_back(energyPartLoadFractionCurve());
369
370 std::vector<AirflowNetworkEquivalentDuct> myAFNItems =
371
3/3
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
✓ Branch 7 taken 5 times.
5 getObject<ModelObject>().getModelObjectSources<AirflowNetworkEquivalentDuct>(AirflowNetworkEquivalentDuct::iddObjectType());
372
1/1
✓ Branch 5 taken 5 times.
5 children.insert(children.end(), myAFNItems.begin(), myAFNItems.end());
373
374 10 return children;
375 5 }
376
377 1 std::vector<openstudio::IdfObject> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::remove() {
378
1/2
✓ Branch 1 taken 1 time.
✗ Branch 2 not taken.
1 if (isRemovable()) {
379
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (auto _stageDataList = speedDataList()) {
380
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 _stageDataList->remove();
381 1 }
382 1 return WaterToAirComponent_Impl::remove();
383 }
384
385 ✗ return {};
386 }
387
388 3 boost::optional<HVACComponent> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::containingHVACComponent() const {
389 // AirLoopHVACUnitarySystem
390
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 auto const airLoopHVACUnitarySystems = this->model().getConcreteModelObjects<AirLoopHVACUnitarySystem>();
391
392
1/2
✗ Branch 5 not taken.
✓ Branch 6 taken 3 times.
3 for (const auto& airLoopHVACUnitarySystem : airLoopHVACUnitarySystems) {
393 ✗ if (boost::optional<HVACComponent> coolingCoil = airLoopHVACUnitarySystem.coolingCoil()) {
394 ✗ if (coolingCoil->handle() == this->handle()) {
395 ✗ return airLoopHVACUnitarySystem;
396 }
397 ✗ }
398 }
399 3 return boost::none;
400 3 }
401
402 3 boost::optional<ZoneHVACComponent> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::containingZoneHVACComponent() const {
403 // ZoneHVACWaterToAirHeatPump
404
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 auto const zoneHVACWaterToAirHeatPumps = this->model().getConcreteModelObjects<ZoneHVACWaterToAirHeatPump>();
405
406
1/2
✗ Branch 5 not taken.
✓ Branch 6 taken 3 times.
3 for (const auto& zoneHVACWaterToAirHeatPump : zoneHVACWaterToAirHeatPumps) {
407 ✗ if (boost::optional<HVACComponent> coil = zoneHVACWaterToAirHeatPump.coolingCoil()) {
408 ✗ if (coil->handle() == this->handle()) {
409 ✗ return zoneHVACWaterToAirHeatPump;
410 }
411 ✗ }
412 }
413
414 3 return boost::none;
415 3 }
416
417 27 boost::optional<ModelObjectList> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::speedDataList() const {
418
1/1
✓ Branch 1 taken 27 times.
54 return getObject<ModelObject>().getModelObjectTarget<ModelObjectList>(
419
1/1
✓ Branch 1 taken 27 times.
54 OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::SpeedDataList);
420 }
421
422 13 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::addSpeed(
423 const CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData& speed) {
424
1/1
✓ Branch 1 taken 13 times.
13 auto modelObjectList = speedDataList();
425
1/2
✓ Branch 0 taken 13 times.
✗ Branch 1 not taken.
13 if (modelObjectList) {
426
2/2
✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
13 return modelObjectList->addModelObject(speed);
427 }
428 ✗ return false;
429 13 }
430
431 ✗ void CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::removeSpeed(
432 const CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData& speed) {
433 ✗ auto modelObjectList = speedDataList();
434 ✗ if (modelObjectList) {
435 ✗ modelObjectList->removeModelObject(speed);
436 }
437 ✗ }
438
439 ✗ void CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::removeAllSpeeds() {
440 ✗ auto modelObjectList = speedDataList();
441 ✗ if (modelObjectList) {
442 ✗ auto const modelObjects = modelObjectList->modelObjects();
443
444 ✗ for (const auto& elem : modelObjects) {
445 ✗ auto const modelObject = elem.optionalCast<CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData>();
446 ✗ if (modelObject) {
447 ✗ modelObjectList->removeModelObject(elem);
448 }
449 ✗ }
450 ✗ }
451 ✗ }
452
453 std::vector<CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData>
454 8 CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::speeds() const {
455 8 std::vector<CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData> result;
456
1/1
✓ Branch 1 taken 8 times.
8 auto const modelObjectList = speedDataList();
457
1/2
✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
8 if (modelObjectList) {
458
2/2
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
8 auto const modelObjects = modelObjectList->modelObjects();
459
460
2/2
✓ Branch 5 taken 26 times.
✓ Branch 6 taken 8 times.
34 for (const auto& elem : modelObjects) {
461
1/1
✓ Branch 1 taken 26 times.
26 auto const modelObject = elem.optionalCast<CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData>();
462
1/2
✓ Branch 0 taken 26 times.
✗ Branch 1 not taken.
26 if (modelObject) {
463
2/2
✓ Branch 1 taken 26 times.
✓ Branch 4 taken 26 times.
26 result.push_back(modelObject.get());
464 }
465 26 }
466 8 }
467 16 return result;
468 8 }
469
470 8 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::setSpeedDataList(const boost::optional<ModelObjectList>& modelObjectList) {
471 8 bool result(false);
472
1/2
✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
8 if (modelObjectList) {
473
3/3
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
8 result = setPointer(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::SpeedDataList, modelObjectList.get().handle());
474 } else {
475 ✗ resetSpeedDataList();
476 ✗ result = true;
477 }
478 8 return result;
479 }
480
481 ✗ void CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::resetSpeedDataList() {
482 ✗ bool result = setString(OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFitFields::SpeedDataList, "");
483 ✗ OS_ASSERT(result);
484 ✗ }
485
486 ✗ AirflowNetworkEquivalentDuct CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::getAirflowNetworkEquivalentDuct(double length,
487 double diameter) {
488 ✗ boost::optional<AirflowNetworkEquivalentDuct> opt = airflowNetworkEquivalentDuct();
489 ✗ if (opt) {
490 ✗ if (opt->airPathLength() != length) {
491 ✗ opt->setAirPathLength(length);
492 }
493 ✗ if (opt->airPathHydraulicDiameter() != diameter) {
494 ✗ opt->setAirPathHydraulicDiameter(diameter);
495 }
496 }
497 ✗ return AirflowNetworkEquivalentDuct(model(), length, diameter, handle());
498 ✗ }
499
500 ✗ boost::optional<AirflowNetworkEquivalentDuct> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::airflowNetworkEquivalentDuct() const {
501 std::vector<AirflowNetworkEquivalentDuct> myAFN =
502 ✗ getObject<ModelObject>().getModelObjectSources<AirflowNetworkEquivalentDuct>(AirflowNetworkEquivalentDuct::iddObjectType());
503 ✗ auto count = myAFN.size();
504 ✗ if (count == 1) {
505 ✗ return myAFN[0];
506 ✗ } else if (count > 1) {
507 ✗ LOG(Warn, briefDescription() << " has more than one AirflowNetwork EquivalentDuct attached, returning first.");
508 ✗ return myAFN[0];
509 }
510 ✗ return boost::none;
511 ✗ }
512
513 boost::optional<double>
514 ✗ CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::autosizedGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel() const {
515 // EPLUS-SQL-INCONSISTENCY
516 ✗ return getAutosizedValue("Design Size Rated Total Cooling Capacity", "W", "COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT");
517 }
518
519 ✗ boost::optional<double> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::autosizedRatedAirFlowRateAtSelectedNominalSpeedLevel() const {
520 // EPLUS-SQL-INCONSISTENCY
521 ✗ return getAutosizedValue("Design Size Rated Air Flow Rate", "m3/s", "COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT");
522 }
523
524 boost::optional<double>
525 ✗ CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::autosizedRatedWaterFlowRateAtSelectedNominalSpeedLevel() const {
526 // EPLUS-SQL-INCONSISTENCY
527 ✗ return getAutosizedValue("Design Size Rated Air Flow Rate", "m3/s", "COIL:COOLING:WATERTOAIRHEATPUMP:VARIABLESPEEDEQUATIONFIT");
528 }
529
530 ✗ void CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::autosize() {
531 ✗ autosizeGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel();
532 ✗ autosizeRatedAirFlowRateAtSelectedNominalSpeedLevel();
533 ✗ autosizeRatedWaterFlowRateAtSelectedNominalSpeedLevel();
534 ✗ }
535
536 ✗ void CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::applySizingValues() {
537 ✗ boost::optional<double> val;
538 ✗ val = autosizedGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel();
539 ✗ if (val) {
540 ✗ setGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel(val.get());
541 }
542
543 ✗ val = autosizedRatedAirFlowRateAtSelectedNominalSpeedLevel();
544 ✗ if (val) {
545 ✗ setRatedAirFlowRateAtSelectedNominalSpeedLevel(val.get());
546 }
547
548 ✗ val = autosizedRatedWaterFlowRateAtSelectedNominalSpeedLevel();
549 ✗ if (val) {
550 ✗ setRatedWaterFlowRateAtSelectedNominalSpeedLevel(val.get());
551 }
552 ✗ }
553
554 ✗ ComponentType CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::componentType() const {
555 ✗ return ComponentType::Cooling;
556 }
557
558 ✗ std::vector<FuelType> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::coolingFuelTypes() const {
559 ✗ std::set<FuelType> result;
560 ✗ result.insert(FuelType::Electricity);
561 ✗ if (auto p_ = plantLoop()) {
562 ✗ for (auto ft : p_->coolingFuelTypes()) {
563 ✗ result.insert(ft);
564 ✗ }
565 ✗ }
566 ✗ return {result.begin(), result.end()};
567 ✗ }
568
569 ✗ std::vector<FuelType> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::heatingFuelTypes() const {
570 ✗ return {};
571 }
572
573 ✗ std::vector<AppGFuelType> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl::appGHeatingFuelTypes() const {
574 ✗ return {};
575 }
576
577 } // namespace detail
578
579 8 CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit(const Model& model)
580 8 : WaterToAirComponent(CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::iddObjectType(), model) {
581
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 8 times.
✗ Branch 5 not taken.
8 OS_ASSERT(getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>());
582
583
1/1
✓ Branch 1 taken 8 times.
8 auto always_on = model.alwaysOnDiscreteSchedule();
584
1/1
✓ Branch 1 taken 8 times.
8 bool ok = setAvailabilitySchedule(always_on);
585
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
8 OS_ASSERT(ok);
586
1/1
✓ Branch 1 taken 8 times.
8 ok = setNominalSpeedLevel(1);
587
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
8 OS_ASSERT(ok);
588
1/1
✓ Branch 1 taken 8 times.
8 autosizeGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel();
589
1/1
✓ Branch 1 taken 8 times.
8 autosizeRatedAirFlowRateAtSelectedNominalSpeedLevel();
590
1/1
✓ Branch 1 taken 8 times.
8 autosizeRatedWaterFlowRateAtSelectedNominalSpeedLevel();
591
1/1
✓ Branch 1 taken 8 times.
8 ok = setNominalTimeforCondensatetoBeginLeavingtheCoil(0);
592
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
8 OS_ASSERT(ok);
593
1/1
✓ Branch 1 taken 8 times.
8 ok = setInitialMoistureEvaporationRateDividedbySteadyStateACLatentCapacity(0);
594
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
8 OS_ASSERT(ok);
595 // E+ 23.2.0 defaults Maximum Cycling Rate and Latent Capacity Time Constant to 0.0, we don't, cf #4999
596
1/1
✓ Branch 1 taken 8 times.
8 ok = setMaximumCyclingRate(2.5);
597
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
8 OS_ASSERT(ok);
598
1/1
✓ Branch 1 taken 8 times.
8 ok = setLatentCapacityTimeConstant(60.0);
599
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
8 OS_ASSERT(ok);
600
1/1
✓ Branch 1 taken 8 times.
8 ok = setFanDelayTime(60.0);
601
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
8 OS_ASSERT(ok);
602
1/1
✓ Branch 1 taken 8 times.
8 setUseHotGasReheat(false);
603
604 // Note: this predates v23.2.0. Consider switching to CurveLinear::defaultHeatPumpCoilPLFCorrelationCurve (would calculate c1=0.8337, c2=0.1662)
605
1/1
✓ Branch 1 taken 8 times.
8 auto partLoadFraction = CurveQuadratic(model);
606
1/1
✓ Branch 1 taken 8 times.
8 partLoadFraction.setCoefficient1Constant(0.85);
607
1/1
✓ Branch 1 taken 8 times.
8 partLoadFraction.setCoefficient2x(0.15);
608
1/1
✓ Branch 1 taken 8 times.
8 partLoadFraction.setCoefficient3xPOW2(0.0);
609
1/1
✓ Branch 1 taken 8 times.
8 partLoadFraction.setMinimumValueofx(0.0);
610
1/1
✓ Branch 1 taken 8 times.
8 partLoadFraction.setMaximumValueofx(1.0);
611
612
1/1
✓ Branch 1 taken 8 times.
8 ok = setEnergyPartLoadFractionCurve(partLoadFraction);
613
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
8 OS_ASSERT(ok);
614
615
1/1
✓ Branch 1 taken 8 times.
8 auto speedDataList = ModelObjectList(model);
616
4/4
✓ Branch 1 taken 8 times.
✓ Branch 4 taken 8 times.
✓ Branch 7 taken 8 times.
✓ Branch 10 taken 8 times.
8 speedDataList.setName(this->name().get() + " Speed Data List");
617
2/2
✓ Branch 3 taken 8 times.
✓ Branch 6 taken 8 times.
8 ok = getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->setSpeedDataList(speedDataList);
618
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
✗ Branch 3 not taken.
8 OS_ASSERT(ok);
619 8 }
620
621 ✗ CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit(const Model& model,
622 ✗ const Curve& partLoadFraction)
623 ✗ : WaterToAirComponent(CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::iddObjectType(), model) {
624 ✗ OS_ASSERT(getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>());
625
626 ✗ auto always_on = model.alwaysOnDiscreteSchedule();
627 ✗ bool ok = setAvailabilitySchedule(always_on);
628 ✗ OS_ASSERT(ok);
629 ✗ ok = setNominalSpeedLevel(1);
630 ✗ OS_ASSERT(ok);
631 ✗ autosizeGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel();
632 ✗ autosizeRatedAirFlowRateAtSelectedNominalSpeedLevel();
633 ✗ autosizeRatedWaterFlowRateAtSelectedNominalSpeedLevel();
634 ✗ ok = setNominalTimeforCondensatetoBeginLeavingtheCoil(0);
635 ✗ OS_ASSERT(ok);
636 ✗ ok = setInitialMoistureEvaporationRateDividedbySteadyStateACLatentCapacity(0);
637 ✗ OS_ASSERT(ok);
638 // E+ 23.2.0 defaults Maximum Cycling Rate and Latent Capacity Time Constant to 0.0, we don't, cf #4999
639 ✗ ok = setMaximumCyclingRate(2.5);
640 ✗ OS_ASSERT(ok);
641 ✗ ok = setLatentCapacityTimeConstant(60.0);
642 ✗ OS_ASSERT(ok);
643 ✗ ok = setFanDelayTime(60.0);
644 ✗ OS_ASSERT(ok);
645 ✗ setUseHotGasReheat(false);
646 ✗ ok = setEnergyPartLoadFractionCurve(partLoadFraction);
647 ✗ OS_ASSERT(ok);
648
649 ✗ auto speedDataList = ModelObjectList(model);
650 ✗ speedDataList.setName(this->name().get() + " Speed Data List");
651 ✗ ok = getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->setSpeedDataList(speedDataList);
652 ✗ OS_ASSERT(ok);
653 ✗ }
654
655 7675 IddObjectType CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::iddObjectType() {
656
1/1
✓ Branch 1 taken 7675 times.
7675 return {IddObjectType::OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFit};
657 }
658
659 6 Schedule CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::availabilitySchedule() const {
660
1/1
✓ Branch 3 taken 6 times.
6 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->availabilitySchedule();
661 }
662
663 4 int CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::nominalSpeedLevel() const {
664
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->nominalSpeedLevel();
665 }
666
667 1 boost::optional<double> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::grossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel() const {
668
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->grossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel();
669 }
670
671 4 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::isGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevelAutosized() const {
672 8 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()
673
1/1
✓ Branch 2 taken 4 times.
8 ->isGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevelAutosized();
674 }
675
676 1 boost::optional<double> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::ratedAirFlowRateAtSelectedNominalSpeedLevel() const {
677
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->ratedAirFlowRateAtSelectedNominalSpeedLevel();
678 }
679
680 4 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::isRatedAirFlowRateAtSelectedNominalSpeedLevelAutosized() const {
681
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->isRatedAirFlowRateAtSelectedNominalSpeedLevelAutosized();
682 }
683
684 1 boost::optional<double> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::ratedWaterFlowRateAtSelectedNominalSpeedLevel() const {
685
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->ratedWaterFlowRateAtSelectedNominalSpeedLevel();
686 }
687
688 4 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::isRatedWaterFlowRateAtSelectedNominalSpeedLevelAutosized() const {
689
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->isRatedWaterFlowRateAtSelectedNominalSpeedLevelAutosized();
690 }
691
692 4 double CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::nominalTimeforCondensatetoBeginLeavingtheCoil() const {
693
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->nominalTimeforCondensatetoBeginLeavingtheCoil();
694 }
695
696 4 double CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::initialMoistureEvaporationRateDividedbySteadyStateACLatentCapacity() const {
697 8 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()
698
1/1
✓ Branch 2 taken 4 times.
8 ->initialMoistureEvaporationRateDividedbySteadyStateACLatentCapacity();
699 }
700
701 4 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::useHotGasReheat() const {
702
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->useHotGasReheat();
703 }
704
705 5 Curve CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::energyPartLoadFractionCurve() const {
706
1/1
✓ Branch 3 taken 5 times.
5 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->energyPartLoadFractionCurve();
707 }
708
709 9 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::setAvailabilitySchedule(Schedule& schedule) {
710
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->setAvailabilitySchedule(schedule);
711 }
712
713 9 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::setNominalSpeedLevel(int nominalSpeedLevel) {
714
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->setNominalSpeedLevel(nominalSpeedLevel);
715 }
716
717 1 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::setGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel(
718 double grossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel) {
719 2 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()
720
2/2
✓ Branch 2 taken 1 time.
✓ Branch 5 taken 1 time.
2 ->setGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel(grossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel);
721 }
722
723 8 void CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::autosizeGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel() {
724 16 getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()
725
1/1
✓ Branch 2 taken 8 times.
8 ->autosizeGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel();
726 8 }
727
728 1 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::setRatedAirFlowRateAtSelectedNominalSpeedLevel(
729 double ratedAirFlowRateAtSelectedNominalSpeedLevel) {
730
2/2
✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
2 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->setRatedAirFlowRateAtSelectedNominalSpeedLevel(
731 2 ratedAirFlowRateAtSelectedNominalSpeedLevel);
732 }
733
734 8 void CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::autosizeRatedAirFlowRateAtSelectedNominalSpeedLevel() {
735
1/1
✓ Branch 3 taken 8 times.
8 getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->autosizeRatedAirFlowRateAtSelectedNominalSpeedLevel();
736 8 }
737
738 1 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::setRatedWaterFlowRateAtSelectedNominalSpeedLevel(
739 double ratedWaterFlowRateAtSelectedNominalSpeedLevel) {
740
2/2
✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
2 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->setRatedWaterFlowRateAtSelectedNominalSpeedLevel(
741 2 ratedWaterFlowRateAtSelectedNominalSpeedLevel);
742 }
743
744 8 void CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::autosizeRatedWaterFlowRateAtSelectedNominalSpeedLevel() {
745
1/1
✓ Branch 3 taken 8 times.
8 getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->autosizeRatedWaterFlowRateAtSelectedNominalSpeedLevel();
746 8 }
747
748 9 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::setNominalTimeforCondensatetoBeginLeavingtheCoil(
749 double nominalTimeforCondensatetoBeginLeavingtheCoil) {
750
1/1
✓ Branch 3 taken 9 times.
18 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->setNominalTimeforCondensatetoBeginLeavingtheCoil(
751 18 nominalTimeforCondensatetoBeginLeavingtheCoil);
752 }
753
754 9 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::setInitialMoistureEvaporationRateDividedbySteadyStateACLatentCapacity(
755 double initialMoistureEvaporationRateDividedbySteadyStateACLatentCapacity) {
756 18 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()
757
1/1
✓ Branch 2 taken 9 times.
18 ->setInitialMoistureEvaporationRateDividedbySteadyStateACLatentCapacity(initialMoistureEvaporationRateDividedbySteadyStateACLatentCapacity);
758 }
759
760 9 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::setUseHotGasReheat(bool useHotGasReheat) {
761
1/1
✓ Branch 3 taken 9 times.
9 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->setUseHotGasReheat(useHotGasReheat);
762 }
763
764 8 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::setEnergyPartLoadFractionCurve(const Curve& curve) {
765
1/1
✓ Branch 3 taken 8 times.
8 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->setEnergyPartLoadFractionCurve(curve);
766 }
767
768 8 std::vector<CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::speeds() const {
769
1/1
✓ Branch 3 taken 8 times.
8 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->speeds();
770 }
771
772 13 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::addSpeed(const CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData& speed) {
773
1/1
✓ Branch 3 taken 13 times.
13 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->addSpeed(speed);
774 }
775
776 void
777 ✗ CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::removeSpeed(const CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData& speed) {
778 ✗ getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->removeSpeed(speed);
779 ✗ }
780
781 ✗ void CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::removeAllSpeeds() {
782 ✗ getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->removeAllSpeeds();
783 ✗ }
784
785 7 double CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::maximumCyclingRate() const {
786
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->maximumCyclingRate();
787 }
788
789 11 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::setMaximumCyclingRate(double maximumCyclingRate) {
790
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->setMaximumCyclingRate(maximumCyclingRate);
791 }
792
793 7 double CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::latentCapacityTimeConstant() const {
794
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->latentCapacityTimeConstant();
795 }
796
797 11 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::setLatentCapacityTimeConstant(double latentCapacityTimeConstant) {
798
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->setLatentCapacityTimeConstant(latentCapacityTimeConstant);
799 }
800
801 7 double CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::fanDelayTime() const {
802
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->fanDelayTime();
803 }
804
805 11 bool CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::setFanDelayTime(double fanDelayTime) {
806
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->setFanDelayTime(fanDelayTime);
807 }
808
809 /// @cond
810 7 CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit(
811 7 std::shared_ptr<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl> impl)
812
1/1
✓ Branch 3 taken 7 times.
7 : WaterToAirComponent(std::move(impl)) {}
813 /// @endcond
814
815 ✗ AirflowNetworkEquivalentDuct CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::getAirflowNetworkEquivalentDuct(double length,
816 double diameter) {
817 ✗ return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->getAirflowNetworkEquivalentDuct(length, diameter);
818 }
819
820 ✗ boost::optional<AirflowNetworkEquivalentDuct> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::airflowNetworkEquivalentDuct() const {
821 ✗ return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->airflowNetworkEquivalentDuct();
822 }
823
824 boost::optional<double>
825 ✗ CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::autosizedGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel() const {
826 ✗ return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()
827 ✗ ->autosizedGrossRatedTotalCoolingCapacityAtSelectedNominalSpeedLevel();
828 }
829
830 ✗ boost::optional<double> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::autosizedRatedAirFlowRateAtSelectedNominalSpeedLevel() const {
831 ✗ return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->autosizedRatedAirFlowRateAtSelectedNominalSpeedLevel();
832 }
833
834 ✗ boost::optional<double> CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit::autosizedRatedWaterFlowRateAtSelectedNominalSpeedLevel() const {
835 ✗ return getImpl<detail::CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl>()->autosizedRatedWaterFlowRateAtSelectedNominalSpeedLevel();
836 }
837
838 } // namespace model
839 } // namespace openstudio
840