GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 83.9% 538 / 0 / 641
Functions: 84.2% 117 / 0 / 139
Branches: 70.0% 573 / 0 / 818

src/model/HeatExchangerAirToAirSensibleAndLatent.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 "HeatExchangerAirToAirSensibleAndLatent.hpp"
7 #include "HeatExchangerAirToAirSensibleAndLatent_Impl.hpp"
8 #include "CoilSystemCoolingWaterHeatExchangerAssisted.hpp"
9 #include "CoilSystemCoolingWaterHeatExchangerAssisted_Impl.hpp"
10 #include "CoilSystemCoolingDXHeatExchangerAssisted.hpp"
11 #include "CoilSystemCoolingDXHeatExchangerAssisted_Impl.hpp"
12 #include "Schedule.hpp"
13 #include "Schedule_Impl.hpp"
14 #include "Model.hpp"
15 #include "Model_Impl.hpp"
16 #include "ScheduleTypeLimits.hpp"
17 #include "ScheduleTypeRegistry.hpp"
18 #include "AirflowNetworkEquivalentDuct.hpp"
19 #include "AirflowNetworkEquivalentDuct_Impl.hpp"
20 #include "Curve.hpp"
21 #include "Curve_Impl.hpp"
22 #include "TableLookup.hpp"
23 #include "TableLookup_Impl.hpp"
24 #include "TableIndependentVariable.hpp"
25 #include "TableIndependentVariable_Impl.hpp"
26
27 #include "../utilities/core/Assert.hpp"
28 #include "../utilities/data/DataEnums.hpp"
29 #include "../utilities/math/FloatCompare.hpp"
30
31 #include <utilities/idd/IddFactory.hxx>
32 #include <utilities/idd/OS_HeatExchanger_AirToAir_SensibleAndLatent_FieldEnums.hxx>
33 #include <utilities/idd/IddEnums.hxx>
34
35 // Remove when deprecated methods are removed
36 #include "../utilities/core/DeprecatedHelpers.hpp"
37
38 #include <limits>
39
40 namespace openstudio {
41
42 namespace model {
43
44 namespace detail {
45
46 69 HeatExchangerAirToAirSensibleAndLatent_Impl::HeatExchangerAirToAirSensibleAndLatent_Impl(const IdfObject& idfObject, Model_Impl* model,
47 69 bool keepHandle)
48 69 : AirToAirComponent_Impl(idfObject, model, keepHandle) {
49
4/6
✓ Branch 1 taken 69 times.
✓ Branch 4 taken 69 times.
✓ Branch 7 taken 69 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 69 times.
✗ Branch 13 not taken.
69 OS_ASSERT(idfObject.iddObject().type() == HeatExchangerAirToAirSensibleAndLatent::iddObjectType());
50 69 }
51
52 1 HeatExchangerAirToAirSensibleAndLatent_Impl::HeatExchangerAirToAirSensibleAndLatent_Impl(const openstudio::detail::WorkspaceObject_Impl& other,
53 1 Model_Impl* model, bool keepHandle)
54 1 : AirToAirComponent_Impl(other, model, keepHandle) {
55
4/6
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 time.
✗ Branch 13 not taken.
1 OS_ASSERT(other.iddObject().type() == HeatExchangerAirToAirSensibleAndLatent::iddObjectType());
56 1 }
57
58 34 HeatExchangerAirToAirSensibleAndLatent_Impl::HeatExchangerAirToAirSensibleAndLatent_Impl(const HeatExchangerAirToAirSensibleAndLatent_Impl& other,
59 34 Model_Impl* model, bool keepHandle)
60 34 : AirToAirComponent_Impl(other, model, keepHandle) {}
61
62 ✗ const std::vector<std::string>& HeatExchangerAirToAirSensibleAndLatent_Impl::outputVariableNames() const {
63 static const std::vector<std::string> result{"Heat Exchanger Sensible Heating Rate",
64 "Heat Exchanger Sensible Heating Energy",
65 "Heat Exchanger Latent Gain Rate",
66 "Heat Exchanger Latent Gain Energy",
67 "Heat Exchanger Total Heating Rate",
68 "Heat Exchanger Total Heating Energy",
69 "Heat Exchanger Sensible Cooling Rate",
70 "Heat Exchanger Sensible Cooling Energy",
71 "Heat Exchanger Latent Cooling Rate",
72 "Heat Exchanger Latent Cooling Energy",
73 "Heat Exchanger Total Cooling Rate",
74 "Heat Exchanger Total Cooling Energy",
75 "Heat Exchanger Electricity Rate",
76 "Heat Exchanger Electricity Energy",
77 "Heat Exchanger Sensible Effectiveness",
78 "Heat Exchanger Latent Effectiveness",
79 "Heat Exchanger Supply Air Bypass Mass Flow Rate",
80 "Heat Exchanger Exhaust Air Bypass Mass Flow Rate",
81 ✗ "Heat Exchanger Defrost Time Fraction"};
82 ✗ return result;
83 ✗ }
84
85 52 IddObjectType HeatExchangerAirToAirSensibleAndLatent_Impl::iddObjectType() const {
86 52 return HeatExchangerAirToAirSensibleAndLatent::iddObjectType();
87 }
88
89 30 std::vector<ModelObject> HeatExchangerAirToAirSensibleAndLatent_Impl::children() const {
90 30 std::vector<ModelObject> result;
91 std::vector<AirflowNetworkEquivalentDuct> myAFNItems =
92
3/3
✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 7 taken 30 times.
30 getObject<ModelObject>().getModelObjectSources<AirflowNetworkEquivalentDuct>(AirflowNetworkEquivalentDuct::iddObjectType());
93
1/1
✓ Branch 5 taken 30 times.
30 result.insert(result.end(), myAFNItems.begin(), myAFNItems.end());
94 60 return result;
95 30 }
96
97 ✗ std::vector<ScheduleTypeKey> HeatExchangerAirToAirSensibleAndLatent_Impl::getScheduleTypeKeys(const Schedule& schedule) const {
98 ✗ std::vector<ScheduleTypeKey> result;
99 ✗ UnsignedVector fieldIndices = getSourceIndices(schedule.handle());
100 ✗ UnsignedVector::const_iterator b(fieldIndices.begin());
101 ✗ UnsignedVector::const_iterator e(fieldIndices.end());
102 ✗ if (std::find(b, e, OS_HeatExchanger_AirToAir_SensibleAndLatentFields::AvailabilitySchedule) != e) {
103 ✗ result.push_back(ScheduleTypeKey("HeatExchangerAirToAirSensibleAndLatent", "Availability"));
104 }
105 ✗ return result;
106 ✗ }
107
108 12 Schedule HeatExchangerAirToAirSensibleAndLatent_Impl::availabilitySchedule() const {
109
1/1
✓ Branch 1 taken 12 times.
12 boost::optional<Schedule> value = optionalAvailabilitySchedule();
110
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
12 if (!value) {
111 ✗ LOG_AND_THROW(briefDescription() << " does not have an Availability Schedule attached.");
112 }
113
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
24 return value.get();
114 12 }
115
116 48 boost::optional<HVACComponent> HeatExchangerAirToAirSensibleAndLatent_Impl::containingHVACComponent() const {
117 // CoilSystemCoolingWaterHeatExchangerAssisted
118 {
119
2/2
✓ Branch 1 taken 48 times.
✓ Branch 4 taken 48 times.
48 auto coilSystems = model().getConcreteModelObjects<CoilSystemCoolingWaterHeatExchangerAssisted>();
120
2/2
✓ Branch 5 taken 3 times.
✓ Branch 6 taken 46 times.
49 for (const auto& coilSystem : coilSystems) {
121
6/6
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 13 taken 2 times.
✓ Branch 14 taken 1 time.
3 if (coilSystem.heatExchanger().handle() == handle()) {
122
1/1
✓ Branch 1 taken 2 times.
2 return coilSystem;
123 }
124 }
125 48 }
126
127 // CoilSystemCoolingDXHeatExchangerAssisted
128 {
129
2/2
✓ Branch 1 taken 46 times.
✓ Branch 4 taken 46 times.
46 auto coilSystems = model().getConcreteModelObjects<CoilSystemCoolingDXHeatExchangerAssisted>();
130
2/2
✓ Branch 5 taken 3 times.
✓ Branch 6 taken 44 times.
47 for (const auto& coilSystem : coilSystems) {
131
6/6
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 13 taken 2 times.
✓ Branch 14 taken 1 time.
3 if (coilSystem.heatExchanger().handle() == handle()) {
132
1/1
✓ Branch 1 taken 2 times.
2 return coilSystem;
133 }
134 }
135 46 }
136
137 44 return boost::none;
138 }
139
140 32 bool HeatExchangerAirToAirSensibleAndLatent_Impl::addToNode(Node& node) {
141 32 bool success(false);
142
143
1/1
✓ Branch 1 taken 32 times.
32 auto t_containingHVACComponent = containingHVACComponent();
144
145
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 30 times.
32 if (t_containingHVACComponent) {
146
4/4
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 1 time.
✓ Branch 8 taken 1 time.
4 if (t_containingHVACComponent->optionalCast<CoilSystemCoolingWaterHeatExchangerAssisted>()) {
147
7/7
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 14 taken 1 time.
✓ Branch 17 taken 1 time.
✓ Branch 20 taken 1 time.
1 LOG(Warn,
148 this->briefDescription() << " cannot be connected directly when it's part of a parent CoilSystemCoolingWaterHeatExchangerAssisted. "
149 "Please call CoilSystemCoolingWaterHeatExchangerAssisted::addToNode instead");
150
3/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✗ Branch 8 not taken.
2 } else if (t_containingHVACComponent->optionalCast<CoilSystemCoolingDXHeatExchangerAssisted>()) {
151
7/7
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 14 taken 1 time.
✓ Branch 17 taken 1 time.
✓ Branch 20 taken 1 time.
1 LOG(Warn, this->briefDescription() << " cannot be connected directly when it's part of a parent CoilSystemCoolingDXHeatExchangerAssisted. "
152 "Please call CoilSystemCoolingDXHeatExchangerAssisted::addToNode instead");
153 } else {
154 // Shouldn't happen
155 ✗ OS_ASSERT(false);
156 }
157 } else {
158
1/1
✓ Branch 1 taken 30 times.
30 success = AirToAirComponent_Impl::addToNode(node);
159 }
160
161 32 return success;
162 32 }
163
164 2 boost::optional<double> HeatExchangerAirToAirSensibleAndLatent_Impl::nominalSupplyAirFlowRate() const {
165 2 return getDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::NominalSupplyAirFlowRate, true);
166 }
167
168 10 bool HeatExchangerAirToAirSensibleAndLatent_Impl::isNominalSupplyAirFlowRateAutosized() const {
169 10 bool result = false;
170
1/1
✓ Branch 1 taken 10 times.
10 boost::optional<std::string> value = getString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::NominalSupplyAirFlowRate, true);
171
1/2
✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
10 if (value) {
172
3/3
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
20 result = openstudio::istringEqual(value.get(), "autosize");
173 }
174 10 return result;
175 10 }
176
177 18 double HeatExchangerAirToAirSensibleAndLatent_Impl::sensibleEffectivenessat100HeatingAirFlow() const {
178
1/1
✓ Branch 1 taken 18 times.
18 boost::optional<double> value = getDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessat100_HeatingAirFlow, true);
179
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 18 times.
✗ Branch 4 not taken.
18 OS_ASSERT(value);
180
1/1
✓ Branch 1 taken 18 times.
36 return value.get();
181 }
182
183 18 double HeatExchangerAirToAirSensibleAndLatent_Impl::latentEffectivenessat100HeatingAirFlow() const {
184
1/1
✓ Branch 1 taken 18 times.
18 boost::optional<double> value = getDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessat100_HeatingAirFlow, true);
185
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 18 times.
✗ Branch 4 not taken.
18 OS_ASSERT(value);
186
1/1
✓ Branch 1 taken 18 times.
36 return value.get();
187 }
188
189 18 double HeatExchangerAirToAirSensibleAndLatent_Impl::sensibleEffectivenessat100CoolingAirFlow() const {
190
1/1
✓ Branch 1 taken 18 times.
18 boost::optional<double> value = getDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessat100_CoolingAirFlow, true);
191
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 18 times.
✗ Branch 4 not taken.
18 OS_ASSERT(value);
192
1/1
✓ Branch 1 taken 18 times.
36 return value.get();
193 }
194
195 18 double HeatExchangerAirToAirSensibleAndLatent_Impl::latentEffectivenessat100CoolingAirFlow() const {
196
1/1
✓ Branch 1 taken 18 times.
18 boost::optional<double> value = getDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessat100_CoolingAirFlow, true);
197
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 18 times.
✗ Branch 4 not taken.
18 OS_ASSERT(value);
198
1/1
✓ Branch 1 taken 18 times.
36 return value.get();
199 }
200
201 11 double HeatExchangerAirToAirSensibleAndLatent_Impl::nominalElectricPower() const {
202
1/1
✓ Branch 1 taken 11 times.
11 boost::optional<double> value = getDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::NominalElectricPower, true);
203
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 11 times.
✗ Branch 4 not taken.
11 OS_ASSERT(value);
204
1/1
✓ Branch 1 taken 11 times.
22 return value.get();
205 }
206
207 12 bool HeatExchangerAirToAirSensibleAndLatent_Impl::supplyAirOutletTemperatureControl() const {
208
1/1
✓ Branch 1 taken 12 times.
12 boost::optional<std::string> value = getString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::SupplyAirOutletTemperatureControl, true);
209
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
✗ Branch 4 not taken.
12 OS_ASSERT(value);
210
3/3
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✓ Branch 7 taken 12 times.
24 return openstudio::istringEqual(value.get(), "Yes");
211 12 }
212
213 12 std::string HeatExchangerAirToAirSensibleAndLatent_Impl::heatExchangerType() const {
214
1/1
✓ Branch 1 taken 12 times.
12 boost::optional<std::string> value = getString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::HeatExchangerType, true);
215
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
✗ Branch 4 not taken.
12 OS_ASSERT(value);
216
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
24 return value.get();
217 12 }
218
219 12 std::string HeatExchangerAirToAirSensibleAndLatent_Impl::frostControlType() const {
220
1/1
✓ Branch 1 taken 12 times.
12 boost::optional<std::string> value = getString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::FrostControlType, true);
221
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
✗ Branch 4 not taken.
12 OS_ASSERT(value);
222
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
24 return value.get();
223 12 }
224
225 13 double HeatExchangerAirToAirSensibleAndLatent_Impl::thresholdTemperature() const {
226
1/1
✓ Branch 1 taken 13 times.
13 boost::optional<double> value = getDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::ThresholdTemperature, true);
227
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 13 times.
✗ Branch 4 not taken.
13 OS_ASSERT(value);
228
1/1
✓ Branch 1 taken 13 times.
26 return value.get();
229 }
230
231 ✗ bool HeatExchangerAirToAirSensibleAndLatent_Impl::isThresholdTemperatureDefaulted() const {
232 ✗ return isEmpty(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::ThresholdTemperature);
233 }
234
235 13 boost::optional<double> HeatExchangerAirToAirSensibleAndLatent_Impl::initialDefrostTimeFraction() const {
236 13 return getDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::InitialDefrostTimeFraction, true);
237 }
238
239 13 boost::optional<double> HeatExchangerAirToAirSensibleAndLatent_Impl::rateofDefrostTimeFractionIncrease() const {
240 13 return getDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::RateofDefrostTimeFractionIncrease, true);
241 }
242
243 12 bool HeatExchangerAirToAirSensibleAndLatent_Impl::economizerLockout() const {
244
1/1
✓ Branch 1 taken 12 times.
12 boost::optional<std::string> value = getString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::EconomizerLockout, true);
245
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 12 times.
✗ Branch 4 not taken.
12 OS_ASSERT(value);
246
3/3
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✓ Branch 7 taken 12 times.
24 return openstudio::istringEqual(value.get(), "Yes");
247 12 }
248
249 28 boost::optional<Curve> HeatExchangerAirToAirSensibleAndLatent_Impl::sensibleEffectivenessofHeatingAirFlowCurve() const {
250
1/1
✓ Branch 1 taken 28 times.
56 return getObject<ModelObject>().getModelObjectTarget<Curve>(
251
1/1
✓ Branch 1 taken 28 times.
56 OS_HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessofHeatingAirFlowCurveName);
252 }
253
254 28 boost::optional<Curve> HeatExchangerAirToAirSensibleAndLatent_Impl::latentEffectivenessofHeatingAirFlowCurve() const {
255
1/1
✓ Branch 1 taken 28 times.
56 return getObject<ModelObject>().getModelObjectTarget<Curve>(
256
1/1
✓ Branch 1 taken 28 times.
56 OS_HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessofHeatingAirFlowCurveName);
257 }
258
259 28 boost::optional<Curve> HeatExchangerAirToAirSensibleAndLatent_Impl::sensibleEffectivenessofCoolingAirFlowCurve() const {
260
1/1
✓ Branch 1 taken 28 times.
56 return getObject<ModelObject>().getModelObjectTarget<Curve>(
261
1/1
✓ Branch 1 taken 28 times.
56 OS_HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessofCoolingAirFlowCurveName);
262 }
263
264 28 boost::optional<Curve> HeatExchangerAirToAirSensibleAndLatent_Impl::latentEffectivenessofCoolingAirFlowCurve() const {
265
1/1
✓ Branch 1 taken 28 times.
56 return getObject<ModelObject>().getModelObjectTarget<Curve>(
266
1/1
✓ Branch 1 taken 28 times.
56 OS_HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessofCoolingAirFlowCurveName);
267 }
268
269 69 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setAvailabilitySchedule(Schedule& schedule) {
270
3/3
✓ Branch 1 taken 69 times.
✓ Branch 4 taken 69 times.
✓ Branch 7 taken 69 times.
276 bool result = setSchedule(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::AvailabilitySchedule, "HeatExchangerAirToAirSensibleAndLatent",
271 "Availability", schedule);
272 69 return result;
273 }
274
275 1 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setNominalSupplyAirFlowRate(boost::optional<double> nominalSupplyAirFlowRate) {
276 1 bool result(false);
277
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (nominalSupplyAirFlowRate) {
278 1 result = setDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::NominalSupplyAirFlowRate, nominalSupplyAirFlowRate.get());
279 }
280 1 return result;
281 }
282
283 68 void HeatExchangerAirToAirSensibleAndLatent_Impl::autosizeNominalSupplyAirFlowRate() {
284
2/2
✓ Branch 1 taken 68 times.
✓ Branch 4 taken 68 times.
136 bool result = setString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::NominalSupplyAirFlowRate, "autosize");
285
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 68 times.
68 OS_ASSERT(result);
286 68 }
287
288 71 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setSensibleEffectivenessat100HeatingAirFlow(double sensibleEffectivenessat100HeatingAirFlow) {
289 // FIXME: wouldn't this value need to get set on the tablelookup if it exists?
290 71 bool result = setDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessat100_HeatingAirFlow,
291 sensibleEffectivenessat100HeatingAirFlow);
292 71 return result;
293 }
294
295 71 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setLatentEffectivenessat100HeatingAirFlow(double latentEffectivenessat100HeatingAirFlow) {
296 // FIXME: wouldn't this value need to get set on the tablelookup if it exists?
297 bool result =
298 71 setDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessat100_HeatingAirFlow, latentEffectivenessat100HeatingAirFlow);
299 71 return result;
300 }
301
302 71 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setSensibleEffectivenessat100CoolingAirFlow(double sensibleEffectivenessat100CoolingAirFlow) {
303 // FIXME: wouldn't this value need to get set on the tablelookup if it exists?
304 71 bool result = setDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessat100_CoolingAirFlow,
305 sensibleEffectivenessat100CoolingAirFlow);
306 71 return result;
307 }
308
309 71 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setLatentEffectivenessat100CoolingAirFlow(double latentEffectivenessat100CoolingAirFlow) {
310 // FIXME: wouldn't this value need to get set on the tablelookup if it exists?
311 bool result =
312 71 setDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessat100_CoolingAirFlow, latentEffectivenessat100CoolingAirFlow);
313 71 return result;
314 }
315
316 69 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setNominalElectricPower(double nominalElectricPower) {
317 69 bool result = setDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::NominalElectricPower, nominalElectricPower);
318 69 return result;
319 }
320
321 107 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setSupplyAirOutletTemperatureControl(bool supplyAirOutletTemperatureControl) {
322 107 return setBooleanFieldValue(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::SupplyAirOutletTemperatureControl,
323 107 supplyAirOutletTemperatureControl);
324 }
325
326 70 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setHeatExchangerType(const std::string& heatExchangerType) {
327 70 bool result = setString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::HeatExchangerType, heatExchangerType);
328 70 return result;
329 }
330
331 70 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setFrostControlType(const std::string& frostControlType) {
332 70 bool result = setString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::FrostControlType, frostControlType);
333 70 return result;
334 }
335
336 69 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setThresholdTemperature(double thresholdTemperature) {
337 69 bool result = setDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::ThresholdTemperature, thresholdTemperature);
338
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 69 times.
69 OS_ASSERT(result);
339 69 return result;
340 }
341
342 1 void HeatExchangerAirToAirSensibleAndLatent_Impl::resetThresholdTemperature() {
343
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::ThresholdTemperature, "");
344
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
345 1 }
346
347 1 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setInitialDefrostTimeFraction(boost::optional<double> initialDefrostTimeFraction) {
348 1 bool result(false);
349
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (initialDefrostTimeFraction) {
350 1 result = setDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::InitialDefrostTimeFraction, initialDefrostTimeFraction.get());
351 } else {
352 ✗ resetInitialDefrostTimeFraction();
353 ✗ result = true;
354 }
355 1 return result;
356 }
357
358 1 void HeatExchangerAirToAirSensibleAndLatent_Impl::resetInitialDefrostTimeFraction() {
359
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::InitialDefrostTimeFraction, "");
360
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
361 1 }
362
363 bool
364 1 HeatExchangerAirToAirSensibleAndLatent_Impl::setRateofDefrostTimeFractionIncrease(boost::optional<double> rateofDefrostTimeFractionIncrease) {
365 1 bool result(false);
366
1/2
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
1 if (rateofDefrostTimeFractionIncrease) {
367 result =
368 1 setDouble(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::RateofDefrostTimeFractionIncrease, rateofDefrostTimeFractionIncrease.get());
369 } else {
370 ✗ resetRateofDefrostTimeFractionIncrease();
371 ✗ result = true;
372 }
373 1 return result;
374 }
375
376 1 void HeatExchangerAirToAirSensibleAndLatent_Impl::resetRateofDefrostTimeFractionIncrease() {
377
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::RateofDefrostTimeFractionIncrease, "");
378
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
379 1 }
380
381 70 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setEconomizerLockout(bool economizerLockout) {
382 70 return setBooleanFieldValue(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::EconomizerLockout, economizerLockout);
383 }
384
385 3 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setSensibleEffectivenessofHeatingAirFlowCurve(
386 const Curve& sensibleEffectivenessofHeatingAirFlowCurve) {
387
1/1
✓ Branch 1 taken 3 times.
3 bool result = setPointer(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessofHeatingAirFlowCurveName,
388
1/1
✓ Branch 1 taken 3 times.
3 sensibleEffectivenessofHeatingAirFlowCurve.handle());
389 3 return result;
390 }
391
392 3 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setLatentEffectivenessofHeatingAirFlowCurve(
393 const Curve& latentEffectivenessofHeatingAirFlowCurve) {
394
1/1
✓ Branch 1 taken 3 times.
3 bool result = setPointer(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessofHeatingAirFlowCurveName,
395
1/1
✓ Branch 1 taken 3 times.
3 latentEffectivenessofHeatingAirFlowCurve.handle());
396 3 return result;
397 }
398
399 3 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setSensibleEffectivenessofCoolingAirFlowCurve(
400 const Curve& sensibleEffectivenessofCoolingAirFlowCurve) {
401
1/1
✓ Branch 1 taken 3 times.
3 bool result = setPointer(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessofCoolingAirFlowCurveName,
402
1/1
✓ Branch 1 taken 3 times.
3 sensibleEffectivenessofCoolingAirFlowCurve.handle());
403 3 return result;
404 }
405
406 3 bool HeatExchangerAirToAirSensibleAndLatent_Impl::setLatentEffectivenessofCoolingAirFlowCurve(
407 const Curve& latentEffectivenessofCoolingAirFlowCurve) {
408
1/1
✓ Branch 1 taken 3 times.
3 bool result = setPointer(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessofCoolingAirFlowCurveName,
409
1/1
✓ Branch 1 taken 3 times.
3 latentEffectivenessofCoolingAirFlowCurve.handle());
410 3 return result;
411 }
412
413 5 void HeatExchangerAirToAirSensibleAndLatent_Impl::resetSensibleEffectivenessofHeatingAirFlowCurve() {
414
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
10 bool result = setString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessofHeatingAirFlowCurveName, "");
415
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
5 OS_ASSERT(result);
416 5 }
417
418 5 void HeatExchangerAirToAirSensibleAndLatent_Impl::resetLatentEffectivenessofHeatingAirFlowCurve() {
419
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
10 bool result = setString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessofHeatingAirFlowCurveName, "");
420
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
5 OS_ASSERT(result);
421 5 }
422
423 5 void HeatExchangerAirToAirSensibleAndLatent_Impl::resetSensibleEffectivenessofCoolingAirFlowCurve() {
424
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
10 bool result = setString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::SensibleEffectivenessofCoolingAirFlowCurveName, "");
425
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
5 OS_ASSERT(result);
426 5 }
427
428 5 void HeatExchangerAirToAirSensibleAndLatent_Impl::resetLatentEffectivenessofCoolingAirFlowCurve() {
429
2/2
✓ Branch 1 taken 5 times.
✓ Branch 4 taken 5 times.
10 bool result = setString(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::LatentEffectivenessofCoolingAirFlowCurveName, "");
430
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 5 times.
5 OS_ASSERT(result);
431 5 }
432
433 12 boost::optional<Schedule> HeatExchangerAirToAirSensibleAndLatent_Impl::optionalAvailabilitySchedule() const {
434
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 return getObject<ModelObject>().getModelObjectTarget<Schedule>(OS_HeatExchanger_AirToAir_SensibleAndLatentFields::AvailabilitySchedule);
435 }
436
437 ✗ std::vector<std::string> HeatExchangerAirToAirSensibleAndLatent_Impl::heatExchangerTypeValues() const {
438 ✗ return HeatExchangerAirToAirSensibleAndLatent::heatExchangerTypeValues();
439 }
440
441 ✗ std::vector<std::string> HeatExchangerAirToAirSensibleAndLatent_Impl::frostControlTypeValues() const {
442 ✗ return HeatExchangerAirToAirSensibleAndLatent::frostControlTypeValues();
443 }
444
445 ✗ boost::optional<ModelObject> HeatExchangerAirToAirSensibleAndLatent_Impl::availabilityScheduleAsModelObject() const {
446 ✗ OptionalModelObject result = availabilitySchedule();
447 ✗ return result;
448 }
449
450 ✗ bool HeatExchangerAirToAirSensibleAndLatent_Impl::setAvailabilityScheduleAsModelObject(const boost::optional<ModelObject>& modelObject) {
451 ✗ if (modelObject) {
452 ✗ OptionalSchedule intermediate = modelObject->optionalCast<Schedule>();
453 ✗ if (intermediate) {
454 ✗ Schedule schedule(*intermediate);
455 ✗ return setAvailabilitySchedule(schedule);
456 ✗ }
457 ✗ }
458 ✗ return false;
459 }
460
461 580 unsigned HeatExchangerAirToAirSensibleAndLatent_Impl::primaryAirInletPort() const {
462 580 return OS_HeatExchanger_AirToAir_SensibleAndLatentFields::SupplyAirInletNode;
463 }
464
465 74 unsigned HeatExchangerAirToAirSensibleAndLatent_Impl::primaryAirOutletPort() const {
466 74 return OS_HeatExchanger_AirToAir_SensibleAndLatentFields::SupplyAirOutletNode;
467 }
468
469 84 unsigned HeatExchangerAirToAirSensibleAndLatent_Impl::secondaryAirInletPort() const {
470 84 return OS_HeatExchanger_AirToAir_SensibleAndLatentFields::ExhaustAirInletNode;
471 }
472
473 547 unsigned HeatExchangerAirToAirSensibleAndLatent_Impl::secondaryAirOutletPort() const {
474 547 return OS_HeatExchanger_AirToAir_SensibleAndLatentFields::ExhaustAirOutletNode;
475 }
476
477 ✗ AirflowNetworkEquivalentDuct HeatExchangerAirToAirSensibleAndLatent_Impl::getAirflowNetworkEquivalentDuct(double length, double diameter) {
478 ✗ boost::optional<AirflowNetworkEquivalentDuct> opt = airflowNetworkEquivalentDuct();
479 ✗ if (opt) {
480 ✗ if (opt->airPathLength() != length) {
481 ✗ opt->setAirPathLength(length);
482 }
483 ✗ if (opt->airPathHydraulicDiameter() != diameter) {
484 ✗ opt->setAirPathHydraulicDiameter(diameter);
485 }
486 }
487 ✗ return AirflowNetworkEquivalentDuct(model(), length, diameter, handle());
488 ✗ }
489
490 ✗ boost::optional<AirflowNetworkEquivalentDuct> HeatExchangerAirToAirSensibleAndLatent_Impl::airflowNetworkEquivalentDuct() const {
491 std::vector<AirflowNetworkEquivalentDuct> myAFN =
492 ✗ getObject<ModelObject>().getModelObjectSources<AirflowNetworkEquivalentDuct>(AirflowNetworkEquivalentDuct::iddObjectType());
493 ✗ auto count = myAFN.size();
494 ✗ if (count == 1) {
495 ✗ return myAFN[0];
496 ✗ } else if (count > 1) {
497 ✗ LOG(Warn, briefDescription() << " has more than one AirflowNetwork EquivalentDuct attached, returning first.");
498 ✗ return myAFN[0];
499 }
500 ✗ return boost::none;
501 ✗ }
502
503 ✗ boost::optional<double> HeatExchangerAirToAirSensibleAndLatent_Impl::autosizedNominalSupplyAirFlowRate() const {
504 ✗ return getAutosizedValue("Design Size Nominal Supply Air Flow Rate", "m3/s");
505 }
506
507 ✗ void HeatExchangerAirToAirSensibleAndLatent_Impl::autosize() {
508 ✗ autosizeNominalSupplyAirFlowRate();
509 ✗ }
510
511 ✗ void HeatExchangerAirToAirSensibleAndLatent_Impl::applySizingValues() {
512 ✗ boost::optional<double> val;
513 ✗ val = autosizedNominalSupplyAirFlowRate();
514 ✗ if (val) {
515 ✗ setNominalSupplyAirFlowRate(val.get());
516 }
517 ✗ }
518
519 ✗ ComponentType HeatExchangerAirToAirSensibleAndLatent_Impl::componentType() const {
520 ✗ return ComponentType::None;
521 }
522
523 ✗ std::vector<FuelType> HeatExchangerAirToAirSensibleAndLatent_Impl::coolingFuelTypes() const {
524 ✗ return {};
525 }
526
527 ✗ std::vector<FuelType> HeatExchangerAirToAirSensibleAndLatent_Impl::heatingFuelTypes() const {
528 ✗ return {};
529 }
530
531 ✗ std::vector<AppGFuelType> HeatExchangerAirToAirSensibleAndLatent_Impl::appGHeatingFuelTypes() const {
532 ✗ return {};
533 }
534
535 } // namespace detail
536
537 68 HeatExchangerAirToAirSensibleAndLatent::HeatExchangerAirToAirSensibleAndLatent(const Model& model)
538 68 : AirToAirComponent(HeatExchangerAirToAirSensibleAndLatent::iddObjectType(), model) {
539
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 68 times.
✗ Branch 5 not taken.
68 OS_ASSERT(getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>());
540
541
1/1
✓ Branch 1 taken 68 times.
68 Schedule schedule = model.alwaysOnDiscreteSchedule();
542
1/1
✓ Branch 1 taken 68 times.
68 setAvailabilitySchedule(schedule);
543
544
1/1
✓ Branch 1 taken 68 times.
68 autosizeNominalSupplyAirFlowRate();
545
546
1/1
✓ Branch 1 taken 68 times.
68 setSensibleEffectivenessat100HeatingAirFlow(0.76);
547
548
1/1
✓ Branch 1 taken 68 times.
68 setLatentEffectivenessat100HeatingAirFlow(0.68);
549
550
1/1
✓ Branch 1 taken 68 times.
68 setSensibleEffectivenessat100CoolingAirFlow(0.76);
551
552
1/1
✓ Branch 1 taken 68 times.
68 setLatentEffectivenessat100CoolingAirFlow(0.68);
553
554
1/1
✓ Branch 1 taken 68 times.
68 setNominalElectricPower(0.0);
555
556
1/1
✓ Branch 1 taken 68 times.
68 setSupplyAirOutletTemperatureControl(true);
557
558
2/2
✓ Branch 1 taken 68 times.
✓ Branch 4 taken 68 times.
136 setHeatExchangerType("Plate");
559
560
2/2
✓ Branch 1 taken 68 times.
✓ Branch 4 taken 68 times.
68 setFrostControlType("None");
561
562
1/1
✓ Branch 1 taken 68 times.
68 setThresholdTemperature(1.7);
563
564
1/1
✓ Branch 1 taken 68 times.
68 setEconomizerLockout(true);
565 68 }
566
567 1 bool HeatExchangerAirToAirSensibleAndLatent::assignHistoricalEffectivenessCurves() {
568
569
1/1
✓ Branch 1 taken 1 time.
1 Model model = this->model();
570
571
1/1
✓ Branch 1 taken 1 time.
1 TableIndependentVariable var(model);
572
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 var.setName(nameString() + "_IndependentVariable");
573
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 var.setInterpolationMethod("Linear");
574
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 var.setExtrapolationMethod("Linear");
575
1/1
✓ Branch 1 taken 1 time.
1 var.setMinimumValue(0.0);
576
1/1
✓ Branch 1 taken 1 time.
1 var.setMaximumValue(10.0);
577
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 var.setUnitType("Dimensionless");
578
1/1
✓ Branch 1 taken 1 time.
1 var.addValue(0.75);
579
1/1
✓ Branch 1 taken 1 time.
1 var.addValue(1.0);
580
581 {
582
1/1
✓ Branch 1 taken 1 time.
1 TableLookup s75heating(model);
583
2/2
✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
2 s75heating.setName(fmt::format("{}_SensHeatEff", nameString()));
584
1/1
✓ Branch 1 taken 1 time.
1 s75heating.addIndependentVariable(var);
585
586
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 s75heating.setNormalizationMethod("DivisorOnly");
587
1/1
✓ Branch 1 taken 1 time.
1 s75heating.setNormalizationDivisor(0.76);
588
1/1
✓ Branch 1 taken 1 time.
1 s75heating.setMinimumOutput(0.0);
589
1/1
✓ Branch 1 taken 1 time.
1 s75heating.setMaximumOutput(10.0);
590
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 s75heating.setOutputUnitType("Dimensionless");
591
1/1
✓ Branch 1 taken 1 time.
1 s75heating.addOutputValue(0.81);
592
1/1
✓ Branch 1 taken 1 time.
1 s75heating.addOutputValue(0.76);
593
594
1/1
✓ Branch 1 taken 1 time.
1 setSensibleEffectivenessofHeatingAirFlowCurve(s75heating);
595 1 }
596
597 {
598
1/1
✓ Branch 1 taken 1 time.
1 TableLookup l75heating(model);
599
2/2
✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
2 l75heating.setName(fmt::format("{}_LatHeatEff", nameString()));
600
1/1
✓ Branch 1 taken 1 time.
1 l75heating.addIndependentVariable(var);
601
602
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 l75heating.setNormalizationMethod("DivisorOnly");
603
1/1
✓ Branch 1 taken 1 time.
1 l75heating.setNormalizationDivisor(0.68);
604
1/1
✓ Branch 1 taken 1 time.
1 l75heating.setMinimumOutput(0.0);
605
1/1
✓ Branch 1 taken 1 time.
1 l75heating.setMaximumOutput(10.0);
606
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 l75heating.setOutputUnitType("Dimensionless");
607
1/1
✓ Branch 1 taken 1 time.
1 l75heating.addOutputValue(0.73);
608
1/1
✓ Branch 1 taken 1 time.
1 l75heating.addOutputValue(0.68);
609
610
1/1
✓ Branch 1 taken 1 time.
1 setLatentEffectivenessofHeatingAirFlowCurve(l75heating);
611 1 }
612
613 {
614
1/1
✓ Branch 1 taken 1 time.
1 TableLookup s75cooling(model);
615
2/2
✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
2 s75cooling.setName(fmt::format("{}_SensCoolEff", nameString()));
616
1/1
✓ Branch 1 taken 1 time.
1 s75cooling.addIndependentVariable(var);
617
618
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 s75cooling.setNormalizationMethod("DivisorOnly");
619
1/1
✓ Branch 1 taken 1 time.
1 s75cooling.setNormalizationDivisor(0.76);
620
1/1
✓ Branch 1 taken 1 time.
1 s75cooling.setMinimumOutput(0.0);
621
1/1
✓ Branch 1 taken 1 time.
1 s75cooling.setMaximumOutput(10.0);
622
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 s75cooling.setOutputUnitType("Dimensionless");
623
1/1
✓ Branch 1 taken 1 time.
1 s75cooling.addOutputValue(0.81);
624
1/1
✓ Branch 1 taken 1 time.
1 s75cooling.addOutputValue(0.76);
625
626
1/1
✓ Branch 1 taken 1 time.
1 setSensibleEffectivenessofCoolingAirFlowCurve(s75cooling);
627 1 }
628
629 {
630
1/1
✓ Branch 1 taken 1 time.
1 TableLookup l75cooling(model);
631
2/2
✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
2 l75cooling.setName(fmt::format("{}_LatCoolEff", nameString()));
632
1/1
✓ Branch 1 taken 1 time.
1 l75cooling.addIndependentVariable(var);
633
634
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 l75cooling.setNormalizationMethod("DivisorOnly");
635
1/1
✓ Branch 1 taken 1 time.
1 l75cooling.setNormalizationDivisor(0.68);
636
1/1
✓ Branch 1 taken 1 time.
1 l75cooling.setMinimumOutput(0.0);
637
1/1
✓ Branch 1 taken 1 time.
1 l75cooling.setMaximumOutput(10.0);
638
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 l75cooling.setOutputUnitType("Dimensionless");
639
1/1
✓ Branch 1 taken 1 time.
1 l75cooling.addOutputValue(0.73);
640
1/1
✓ Branch 1 taken 1 time.
1 l75cooling.addOutputValue(0.68);
641
642
1/1
✓ Branch 1 taken 1 time.
1 setLatentEffectivenessofCoolingAirFlowCurve(l75cooling);
643 1 }
644
645 1 return true;
646 1 }
647
648 7801 IddObjectType HeatExchangerAirToAirSensibleAndLatent::iddObjectType() {
649
1/1
✓ Branch 1 taken 7801 times.
7801 return {IddObjectType::OS_HeatExchanger_AirToAir_SensibleAndLatent};
650 }
651
652 ✗ std::vector<std::string> HeatExchangerAirToAirSensibleAndLatent::heatExchangerTypeValues() {
653 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(),
654 ✗ OS_HeatExchanger_AirToAir_SensibleAndLatentFields::HeatExchangerType);
655 }
656
657 ✗ std::vector<std::string> HeatExchangerAirToAirSensibleAndLatent::frostControlTypeValues() {
658 ✗ return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(),
659 ✗ OS_HeatExchanger_AirToAir_SensibleAndLatentFields::FrostControlType);
660 }
661
662 12 Schedule HeatExchangerAirToAirSensibleAndLatent::availabilitySchedule() const {
663
1/1
✓ Branch 3 taken 12 times.
12 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->availabilitySchedule();
664 }
665
666 2 boost::optional<double> HeatExchangerAirToAirSensibleAndLatent::nominalSupplyAirFlowRate() const {
667
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->nominalSupplyAirFlowRate();
668 }
669
670 10 bool HeatExchangerAirToAirSensibleAndLatent::isNominalSupplyAirFlowRateAutosized() const {
671
1/1
✓ Branch 3 taken 10 times.
10 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->isNominalSupplyAirFlowRateAutosized();
672 }
673
674 18 double HeatExchangerAirToAirSensibleAndLatent::sensibleEffectivenessat100HeatingAirFlow() const {
675
1/1
✓ Branch 3 taken 18 times.
18 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->sensibleEffectivenessat100HeatingAirFlow();
676 }
677
678 18 double HeatExchangerAirToAirSensibleAndLatent::latentEffectivenessat100HeatingAirFlow() const {
679
1/1
✓ Branch 3 taken 18 times.
18 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->latentEffectivenessat100HeatingAirFlow();
680 }
681
682 18 double HeatExchangerAirToAirSensibleAndLatent::sensibleEffectivenessat100CoolingAirFlow() const {
683
1/1
✓ Branch 3 taken 18 times.
18 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->sensibleEffectivenessat100CoolingAirFlow();
684 }
685
686 18 double HeatExchangerAirToAirSensibleAndLatent::latentEffectivenessat100CoolingAirFlow() const {
687
1/1
✓ Branch 3 taken 18 times.
18 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->latentEffectivenessat100CoolingAirFlow();
688 }
689
690 11 double HeatExchangerAirToAirSensibleAndLatent::nominalElectricPower() const {
691
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->nominalElectricPower();
692 }
693
694 12 bool HeatExchangerAirToAirSensibleAndLatent::supplyAirOutletTemperatureControl() const {
695
1/1
✓ Branch 3 taken 12 times.
12 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->supplyAirOutletTemperatureControl();
696 }
697
698 12 std::string HeatExchangerAirToAirSensibleAndLatent::heatExchangerType() const {
699
1/1
✓ Branch 3 taken 12 times.
12 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->heatExchangerType();
700 }
701
702 12 std::string HeatExchangerAirToAirSensibleAndLatent::frostControlType() const {
703
1/1
✓ Branch 3 taken 12 times.
12 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->frostControlType();
704 }
705
706 13 double HeatExchangerAirToAirSensibleAndLatent::thresholdTemperature() const {
707
1/1
✓ Branch 3 taken 13 times.
13 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->thresholdTemperature();
708 }
709
710 ✗ bool HeatExchangerAirToAirSensibleAndLatent::isThresholdTemperatureDefaulted() const {
711 ✗ return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->isThresholdTemperatureDefaulted();
712 }
713
714 13 boost::optional<double> HeatExchangerAirToAirSensibleAndLatent::initialDefrostTimeFraction() const {
715
1/1
✓ Branch 3 taken 13 times.
13 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->initialDefrostTimeFraction();
716 }
717
718 13 boost::optional<double> HeatExchangerAirToAirSensibleAndLatent::rateofDefrostTimeFractionIncrease() const {
719
1/1
✓ Branch 3 taken 13 times.
13 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->rateofDefrostTimeFractionIncrease();
720 }
721
722 12 bool HeatExchangerAirToAirSensibleAndLatent::economizerLockout() const {
723
1/1
✓ Branch 3 taken 12 times.
12 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->economizerLockout();
724 }
725
726 28 boost::optional<Curve> HeatExchangerAirToAirSensibleAndLatent::sensibleEffectivenessofHeatingAirFlowCurve() const {
727
1/1
✓ Branch 3 taken 28 times.
28 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->sensibleEffectivenessofHeatingAirFlowCurve();
728 }
729
730 28 boost::optional<Curve> HeatExchangerAirToAirSensibleAndLatent::latentEffectivenessofHeatingAirFlowCurve() const {
731
1/1
✓ Branch 3 taken 28 times.
28 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->latentEffectivenessofHeatingAirFlowCurve();
732 }
733
734 28 boost::optional<Curve> HeatExchangerAirToAirSensibleAndLatent::sensibleEffectivenessofCoolingAirFlowCurve() const {
735
1/1
✓ Branch 3 taken 28 times.
28 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->sensibleEffectivenessofCoolingAirFlowCurve();
736 }
737
738 28 boost::optional<Curve> HeatExchangerAirToAirSensibleAndLatent::latentEffectivenessofCoolingAirFlowCurve() const {
739
1/1
✓ Branch 3 taken 28 times.
28 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->latentEffectivenessofCoolingAirFlowCurve();
740 }
741
742 69 bool HeatExchangerAirToAirSensibleAndLatent::setAvailabilitySchedule(Schedule& schedule) {
743
1/1
✓ Branch 3 taken 69 times.
69 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setAvailabilitySchedule(schedule);
744 }
745
746 1 bool HeatExchangerAirToAirSensibleAndLatent::setNominalSupplyAirFlowRate(double nominalSupplyAirFlowRate) {
747
2/2
✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
1 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setNominalSupplyAirFlowRate(nominalSupplyAirFlowRate);
748 }
749
750 68 void HeatExchangerAirToAirSensibleAndLatent::autosizeNominalSupplyAirFlowRate() {
751
1/1
✓ Branch 3 taken 68 times.
68 getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->autosizeNominalSupplyAirFlowRate();
752 68 }
753
754 71 bool HeatExchangerAirToAirSensibleAndLatent::setSensibleEffectivenessat100HeatingAirFlow(double sensibleEffectivenessat100HeatingAirFlow) {
755
1/1
✓ Branch 3 taken 71 times.
142 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setSensibleEffectivenessat100HeatingAirFlow(
756 142 sensibleEffectivenessat100HeatingAirFlow);
757 }
758
759 71 bool HeatExchangerAirToAirSensibleAndLatent::setLatentEffectivenessat100HeatingAirFlow(double latentEffectivenessat100HeatingAirFlow) {
760
1/1
✓ Branch 3 taken 71 times.
142 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setLatentEffectivenessat100HeatingAirFlow(
761 142 latentEffectivenessat100HeatingAirFlow);
762 }
763
764 71 bool HeatExchangerAirToAirSensibleAndLatent::setSensibleEffectivenessat100CoolingAirFlow(double sensibleEffectivenessat100CoolingAirFlow) {
765
1/1
✓ Branch 3 taken 71 times.
142 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setSensibleEffectivenessat100CoolingAirFlow(
766 142 sensibleEffectivenessat100CoolingAirFlow);
767 }
768
769 71 bool HeatExchangerAirToAirSensibleAndLatent::setLatentEffectivenessat100CoolingAirFlow(double latentEffectivenessat100CoolingAirFlow) {
770
1/1
✓ Branch 3 taken 71 times.
142 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setLatentEffectivenessat100CoolingAirFlow(
771 142 latentEffectivenessat100CoolingAirFlow);
772 }
773
774 69 bool HeatExchangerAirToAirSensibleAndLatent::setNominalElectricPower(double nominalElectricPower) {
775
1/1
✓ Branch 3 taken 69 times.
69 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setNominalElectricPower(nominalElectricPower);
776 }
777
778 107 bool HeatExchangerAirToAirSensibleAndLatent::setSupplyAirOutletTemperatureControl(bool supplyAirOutletTemperatureControl) {
779
1/1
✓ Branch 3 taken 107 times.
107 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setSupplyAirOutletTemperatureControl(supplyAirOutletTemperatureControl);
780 }
781
782 70 bool HeatExchangerAirToAirSensibleAndLatent::setHeatExchangerType(const std::string& heatExchangerType) {
783
1/1
✓ Branch 3 taken 70 times.
70 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setHeatExchangerType(heatExchangerType);
784 }
785
786 70 bool HeatExchangerAirToAirSensibleAndLatent::setFrostControlType(const std::string& frostControlType) {
787
1/1
✓ Branch 3 taken 70 times.
70 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setFrostControlType(frostControlType);
788 }
789
790 69 bool HeatExchangerAirToAirSensibleAndLatent::setThresholdTemperature(double thresholdTemperature) {
791
1/1
✓ Branch 3 taken 69 times.
69 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setThresholdTemperature(thresholdTemperature);
792 }
793
794 1 void HeatExchangerAirToAirSensibleAndLatent::resetThresholdTemperature() {
795
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->resetThresholdTemperature();
796 1 }
797
798 1 bool HeatExchangerAirToAirSensibleAndLatent::setInitialDefrostTimeFraction(double initialDefrostTimeFraction) {
799
2/2
✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
1 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setInitialDefrostTimeFraction(initialDefrostTimeFraction);
800 }
801
802 1 void HeatExchangerAirToAirSensibleAndLatent::resetInitialDefrostTimeFraction() {
803
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->resetInitialDefrostTimeFraction();
804 1 }
805
806 1 bool HeatExchangerAirToAirSensibleAndLatent::setRateofDefrostTimeFractionIncrease(double rateofDefrostTimeFractionIncrease) {
807
2/2
✓ Branch 3 taken 1 time.
✓ Branch 6 taken 1 time.
1 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setRateofDefrostTimeFractionIncrease(rateofDefrostTimeFractionIncrease);
808 }
809
810 1 void HeatExchangerAirToAirSensibleAndLatent::resetRateofDefrostTimeFractionIncrease() {
811
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->resetRateofDefrostTimeFractionIncrease();
812 1 }
813
814 70 bool HeatExchangerAirToAirSensibleAndLatent::setEconomizerLockout(bool economizerLockout) {
815
1/1
✓ Branch 3 taken 70 times.
70 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setEconomizerLockout(economizerLockout);
816 }
817
818 bool
819 3 HeatExchangerAirToAirSensibleAndLatent::setSensibleEffectivenessofHeatingAirFlowCurve(const Curve& sensibleEffectivenessofHeatingAirFlowCurve) {
820
1/1
✓ Branch 3 taken 3 times.
6 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setSensibleEffectivenessofHeatingAirFlowCurve(
821 6 sensibleEffectivenessofHeatingAirFlowCurve);
822 }
823
824 5 void HeatExchangerAirToAirSensibleAndLatent::resetSensibleEffectivenessofHeatingAirFlowCurve() {
825
1/1
✓ Branch 3 taken 5 times.
5 getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->resetSensibleEffectivenessofHeatingAirFlowCurve();
826 5 }
827
828 3 bool HeatExchangerAirToAirSensibleAndLatent::setLatentEffectivenessofHeatingAirFlowCurve(const Curve& latentEffectivenessofHeatingAirFlowCurve) {
829
1/1
✓ Branch 3 taken 3 times.
6 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setLatentEffectivenessofHeatingAirFlowCurve(
830 6 latentEffectivenessofHeatingAirFlowCurve);
831 }
832
833 5 void HeatExchangerAirToAirSensibleAndLatent::resetLatentEffectivenessofHeatingAirFlowCurve() {
834
1/1
✓ Branch 3 taken 5 times.
5 getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->resetLatentEffectivenessofHeatingAirFlowCurve();
835 5 }
836
837 bool
838 3 HeatExchangerAirToAirSensibleAndLatent::setSensibleEffectivenessofCoolingAirFlowCurve(const Curve& sensibleEffectivenessofCoolingAirFlowCurve) {
839
1/1
✓ Branch 3 taken 3 times.
6 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setSensibleEffectivenessofCoolingAirFlowCurve(
840 6 sensibleEffectivenessofCoolingAirFlowCurve);
841 }
842
843 5 void HeatExchangerAirToAirSensibleAndLatent::resetSensibleEffectivenessofCoolingAirFlowCurve() {
844
1/1
✓ Branch 3 taken 5 times.
5 getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->resetSensibleEffectivenessofCoolingAirFlowCurve();
845 5 }
846
847 3 bool HeatExchangerAirToAirSensibleAndLatent::setLatentEffectivenessofCoolingAirFlowCurve(const Curve& latentEffectivenessofCoolingAirFlowCurve) {
848
1/1
✓ Branch 3 taken 3 times.
6 return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->setLatentEffectivenessofCoolingAirFlowCurve(
849 6 latentEffectivenessofCoolingAirFlowCurve);
850 }
851
852 5 void HeatExchangerAirToAirSensibleAndLatent::resetLatentEffectivenessofCoolingAirFlowCurve() {
853
1/1
✓ Branch 3 taken 5 times.
5 getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->resetLatentEffectivenessofCoolingAirFlowCurve();
854 5 }
855
856 ✗ AirflowNetworkEquivalentDuct HeatExchangerAirToAirSensibleAndLatent::getAirflowNetworkEquivalentDuct(double length, double diameter) {
857 ✗ return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->getAirflowNetworkEquivalentDuct(length, diameter);
858 }
859
860 ✗ boost::optional<AirflowNetworkEquivalentDuct> HeatExchangerAirToAirSensibleAndLatent::airflowNetworkEquivalentDuct() const {
861 ✗ return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->airflowNetworkEquivalentDuct();
862 }
863
864 /// @cond
865 40 HeatExchangerAirToAirSensibleAndLatent::HeatExchangerAirToAirSensibleAndLatent(
866 40 std::shared_ptr<detail::HeatExchangerAirToAirSensibleAndLatent_Impl> impl)
867
1/1
✓ Branch 3 taken 40 times.
40 : AirToAirComponent(std::move(impl)) {}
868 /// @endcond
869
870 ✗ boost::optional<double> HeatExchangerAirToAirSensibleAndLatent::autosizedNominalSupplyAirFlowRate() const {
871 ✗ return getImpl<detail::HeatExchangerAirToAirSensibleAndLatent_Impl>()->autosizedNominalSupplyAirFlowRate();
872 }
873
874 // DEPRECATED
875
876 12 boost::optional<double> evalCurveAt75(const Curve& curve) {
877
2/3
✓ Branch 1 taken 12 times.
✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
24 if (boost::optional<TableLookup> tableLookup_ = curve.optionalCast<TableLookup>()) {
878
3/4
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✓ Branch 6 taken 12 times.
✗ Branch 7 not taken.
12 if (tableLookup_->numVariables() == 1) {
879
8/18
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✓ Branch 7 taken 12 times.
✓ Branch 11 taken 12 times.
✓ Branch 14 taken 12 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 12 times.
✗ Branch 18 not taken.
✓ Branch 20 taken 12 times.
✗ Branch 21 not taken.
✓ Branch 23 taken 12 times.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
36 if (!tableLookup_->outputValues().empty() && !tableLookup_->independentVariables().front().values().empty()
880
9/18
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 12 times.
✓ Branch 11 taken 12 times.
✓ Branch 15 taken 12 times.
✓ Branch 19 taken 12 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 12 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 12 times.
✗ Branch 25 not taken.
✓ Branch 27 taken 12 times.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
36 && openstudio::equal(tableLookup_->independentVariables().front().values().front(), 0.75)) {
881
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 auto val = tableLookup_->outputValues().front();
882
883
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 auto normMethod = tableLookup_->normalizationMethod();
884
3/4
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✓ Branch 7 taken 12 times.
✗ Branch 8 not taken.
24 if (istringEqual(normMethod, "None")) {
885 // No-op
886
887
3/4
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✓ Branch 7 taken 12 times.
✗ Branch 8 not taken.
24 } else if (istringEqual(normMethod, "DivisorOnly")) {
888
2/2
✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
12 val /= tableLookup_->normalizationDivisor();
889 ✗ } else if (istringEqual(normMethod, "AutomaticWithDivisor")) {
890 ✗ const double i = tableLookup_->independentVariables().front().normalizationReferenceValue().get_value_or(1.0);
891 ✗ val /= tableLookup_->normalizationDivisor();
892 ✗ val /= i;
893 }
894
1/1
✓ Branch 1 taken 12 times.
12 return val;
895 12 }
896 } else {
897 ✗ LOG_FREE(Warn, "openstudio.model.HeatExchangerAirToAirSensibleAndLatent", "Wrong number of variables");
898 }
899 } else {
900 ✗ return curve.evaluate(0.75);
901 12 }
902
903 ✗ return boost::none;
904 }
905
906 4 double HeatExchangerAirToAirSensibleAndLatent::sensibleEffectivenessat75HeatingAirFlow() const {
907
5/5
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
16 DEPRECATED_AT_MSG(3, 8, 0, "Use sensibleEffectivenessofHeatingAirFlowCurve instead.");
908
909
1/1
✓ Branch 1 taken 4 times.
4 auto eff100 = sensibleEffectivenessat100HeatingAirFlow();
910
911
3/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 1 time.
8 if (auto curve_ = sensibleEffectivenessofHeatingAirFlowCurve()) {
912
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 auto val = evalCurveAt75(*curve_);
913
4/7
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 3 times.
✓ Branch 5 taken 3 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
3 if (val && *val > 0.0) {
914
1/1
✓ Branch 1 taken 3 times.
3 return *val * eff100;
915 } else {
916 ✗ LOG(Warn, briefDescription() << " has a sensibleEffectivenessofHeatingAirFlowCurve assigned but failed to retrieve the value at 0.75.");
917 }
918 4 }
919
920 // Constant effectiveness if no curves
921 1 return eff100;
922 }
923
924 4 double HeatExchangerAirToAirSensibleAndLatent::latentEffectivenessat75HeatingAirFlow() const {
925
5/5
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
16 DEPRECATED_AT_MSG(3, 8, 0, "Use latentEffectivenessofHeatingAirFlowCurve instead.");
926
927
1/1
✓ Branch 1 taken 4 times.
4 auto eff100 = latentEffectivenessat100HeatingAirFlow();
928
929
3/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 1 time.
8 if (auto curve_ = latentEffectivenessofHeatingAirFlowCurve()) {
930
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 auto val = evalCurveAt75(*curve_);
931
4/7
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 3 times.
✓ Branch 5 taken 3 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
3 if (val && *val > 0.0) {
932
1/1
✓ Branch 1 taken 3 times.
3 return *val * eff100;
933 } else {
934 ✗ LOG(Warn, briefDescription() << " has a latentEffectivenessofHeatingAirFlowCurve assigned but failed to retrieve the value at 0.75.");
935 }
936 4 }
937
938 // Constant effectiveness if no curves
939 1 return eff100;
940 }
941
942 4 double HeatExchangerAirToAirSensibleAndLatent::sensibleEffectivenessat75CoolingAirFlow() const {
943
5/5
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
16 DEPRECATED_AT_MSG(3, 8, 0, "Use sensibleEffectivenessofCoolingAirFlowCurve instead.");
944
945
1/1
✓ Branch 1 taken 4 times.
4 auto eff100 = sensibleEffectivenessat100CoolingAirFlow();
946
947
3/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 1 time.
8 if (auto curve_ = sensibleEffectivenessofCoolingAirFlowCurve()) {
948
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 auto val = evalCurveAt75(*curve_);
949
4/7
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 3 times.
✓ Branch 5 taken 3 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
3 if (val && *val > 0.0) {
950
1/1
✓ Branch 1 taken 3 times.
3 return *val * eff100;
951 } else {
952 ✗ LOG(Warn, briefDescription() << " has a sensibleEffectivenessofCoolingAirFlowCurve assigned but failed to retrieve the value at 0.75.");
953 }
954 4 }
955
956 // Constant effectiveness if no curves
957 1 return eff100;
958 }
959
960 4 double HeatExchangerAirToAirSensibleAndLatent::latentEffectivenessat75CoolingAirFlow() const {
961
5/5
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 7 taken 4 times.
✓ Branch 10 taken 4 times.
✓ Branch 13 taken 4 times.
16 DEPRECATED_AT_MSG(3, 8, 0, "Use latentEffectivenessofCoolingAirFlowCurve instead.");
962
963
1/1
✓ Branch 1 taken 4 times.
4 auto eff100 = latentEffectivenessat100CoolingAirFlow();
964
965
3/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 1 time.
8 if (auto curve_ = latentEffectivenessofCoolingAirFlowCurve()) {
966
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 auto val = evalCurveAt75(*curve_);
967
4/7
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 3 times.
✓ Branch 5 taken 3 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 3 times.
✗ Branch 8 not taken.
3 if (val && *val > 0.0) {
968
1/1
✓ Branch 1 taken 3 times.
3 return *val * eff100;
969 } else {
970 ✗ LOG(Warn, briefDescription() << " has a latentEffectivenessofCoolingAirFlowCurve assigned but failed to retrieve the value at 0.75.");
971 }
972 4 }
973
974 1 return eff100;
975 }
976
977 4 bool setCurveAt75(const Curve& curve, double valueAt75) {
978
979
2/3
✓ Branch 1 taken 4 times.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
8 if (boost::optional<TableLookup> tableLookup_ = curve.optionalCast<TableLookup>()) {
980
981
3/4
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 4 times.
4 if (tableLookup_->numVariables() != 1) {
982 ✗ LOG_FREE(Warn, "openstudio.model.HeatExchangerAirToAirSensibleAndLatent", "Wrong number of variables");
983 4 return false;
984 }
985
986
3/3
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
✓ Branch 8 taken 4 times.
4 auto indVarVals = tableLookup_->independentVariables().front().values();
987
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 auto outVals = tableLookup_->outputValues();
988
989
4/8
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 9 taken 4 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 4 times.
✗ Branch 12 not taken.
4 if (!outVals.empty() && !indVarVals.empty() && openstudio::equal(indVarVals.front(), 0.75)) {
990 4 outVals.front() = valueAt75;
991
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 return tableLookup_->setOutputValues(outVals);
992 }
993 12 }
994
995 ✗ LOG_FREE(Warn, "openstudio.model.HeatExchangerAirToAirSensibleAndLatent", "Cannot set effectiveness for a Curve that isn't a TableLookup.");
996 ✗ return false;
997 }
998
999 4 TableLookup makeTable(double val75, double val100, const Model& model, const std::string& tableName) {
1000
1/1
✓ Branch 1 taken 4 times.
4 TableIndependentVariable var(model);
1001
1/1
✓ Branch 2 taken 4 times.
8 var.setName(fmt::format("{}_IndependentVariable", tableName));
1002
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 var.setInterpolationMethod("Linear");
1003
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 var.setExtrapolationMethod("Linear");
1004
1/1
✓ Branch 1 taken 4 times.
4 var.setMinimumValue(0.0);
1005
1/1
✓ Branch 1 taken 4 times.
4 var.setMaximumValue(10.0);
1006
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 var.setUnitType("Dimensionless");
1007
1/1
✓ Branch 1 taken 4 times.
4 var.addValue(0.75);
1008
1/1
✓ Branch 1 taken 4 times.
4 var.addValue(1.0);
1009
1010
1/1
✓ Branch 1 taken 4 times.
4 TableLookup tableLookup(model);
1011
1/1
✓ Branch 1 taken 4 times.
4 tableLookup.setName(tableName);
1012
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 tableLookup.setNormalizationMethod("DivisorOnly");
1013
1/1
✓ Branch 1 taken 4 times.
4 tableLookup.setNormalizationDivisor(val100);
1014
1/1
✓ Branch 1 taken 4 times.
4 tableLookup.setMinimumOutput(0.0);
1015
1/1
✓ Branch 1 taken 4 times.
4 tableLookup.setMaximumOutput(10.0);
1016
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
4 tableLookup.setOutputUnitType("Dimensionless");
1017
1/1
✓ Branch 1 taken 4 times.
4 tableLookup.addOutputValue(val75);
1018
1/1
✓ Branch 1 taken 4 times.
4 tableLookup.addOutputValue(val100);
1019
1/1
✓ Branch 1 taken 4 times.
4 tableLookup.addIndependentVariable(var);
1020
1021 8 return tableLookup;
1022 4 }
1023
1024 3 bool HeatExchangerAirToAirSensibleAndLatent::setSensibleEffectivenessat75HeatingAirFlow(double sensibleEffectivenessat75HeatingAirFlow) {
1025
5/5
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 13 taken 3 times.
12 DEPRECATED_AT_MSG(3, 8, 0, "Use sensibleEffectivenessofHeatingAirFlowCurve instead.");
1026
1027
3/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 2 times.
6 if (auto curve_ = sensibleEffectivenessofHeatingAirFlowCurve()) {
1028
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 return setCurveAt75(*curve_, sensibleEffectivenessat75HeatingAirFlow);
1029 3 }
1030
1031
1/1
✓ Branch 1 taken 2 times.
2 const auto val100 = sensibleEffectivenessat100HeatingAirFlow();
1032
2/2
✓ Branch 2 taken 1 time.
✓ Branch 3 taken 1 time.
2 if (std::abs(val100) < std::numeric_limits<double>::min()) {
1033
19/19
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
✓ Branch 17 taken 1 time.
✓ Branch 20 taken 1 time.
✓ Branch 23 taken 1 time.
✓ Branch 29 taken 1 time.
✓ Branch 32 taken 1 time.
✓ Branch 35 taken 1 time.
✓ Branch 38 taken 1 time.
✓ Branch 41 taken 1 time.
✓ Branch 44 taken 1 time.
✓ Branch 47 taken 1 time.
✓ Branch 50 taken 1 time.
✓ Branch 53 taken 1 time.
✓ Branch 58 taken 1 time.
✓ Branch 61 taken 1 time.
1 LOG_AND_THROW("Unable to set " << briefDescription()
1034 << "'s Sensible Effectiveness at 75 Heating Air Flow because the value at 100 is zero and would lead to a "
1035 "Normalization divisor equal to zero.");
1036 }
1037
3/3
✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✓ Branch 8 taken 1 time.
2 auto tableLookup = makeTable(sensibleEffectivenessat75HeatingAirFlow, val100, model(), fmt::format("{}_SensHeatEff", nameString()));
1038
1/1
✓ Branch 1 taken 1 time.
1 return setSensibleEffectivenessofHeatingAirFlowCurve(tableLookup);
1039 1 }
1040
1041 3 bool HeatExchangerAirToAirSensibleAndLatent::setLatentEffectivenessat75HeatingAirFlow(double latentEffectivenessat75HeatingAirFlow) {
1042
5/5
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 13 taken 3 times.
12 DEPRECATED_AT_MSG(3, 8, 0, "Use latentEffectivenessofHeatingAirFlowCurve instead.");
1043
1044
3/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 2 times.
6 if (auto curve_ = latentEffectivenessofHeatingAirFlowCurve()) {
1045
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 return setCurveAt75(*curve_, latentEffectivenessat75HeatingAirFlow);
1046 3 }
1047
1048
1/1
✓ Branch 1 taken 2 times.
2 const auto val100 = latentEffectivenessat100HeatingAirFlow();
1049
2/2
✓ Branch 2 taken 1 time.
✓ Branch 3 taken 1 time.
2 if (std::abs(val100) < std::numeric_limits<double>::min()) {
1050
19/19
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
✓ Branch 17 taken 1 time.
✓ Branch 20 taken 1 time.
✓ Branch 23 taken 1 time.
✓ Branch 29 taken 1 time.
✓ Branch 32 taken 1 time.
✓ Branch 35 taken 1 time.
✓ Branch 38 taken 1 time.
✓ Branch 41 taken 1 time.
✓ Branch 44 taken 1 time.
✓ Branch 47 taken 1 time.
✓ Branch 50 taken 1 time.
✓ Branch 53 taken 1 time.
✓ Branch 58 taken 1 time.
✓ Branch 61 taken 1 time.
1 LOG_AND_THROW("Unable to set " << briefDescription()
1051 << "'s Latent Effectiveness at 75 Heating Air Flow because the value at 100 is zero and would lead to a "
1052 "Normalization divisor equal to zero.");
1053 }
1054
3/3
✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✓ Branch 8 taken 1 time.
2 auto tableLookup = makeTable(latentEffectivenessat75HeatingAirFlow, val100, model(), fmt::format("{}_LatHeatEff", nameString()));
1055
1/1
✓ Branch 1 taken 1 time.
1 return setLatentEffectivenessofHeatingAirFlowCurve(tableLookup);
1056 1 }
1057
1058 3 bool HeatExchangerAirToAirSensibleAndLatent::setSensibleEffectivenessat75CoolingAirFlow(double sensibleEffectivenessat75CoolingAirFlow) {
1059
5/5
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 13 taken 3 times.
12 DEPRECATED_AT_MSG(3, 8, 0, "Use sensibleEffectivenessofCoolingAirFlowCurve instead.");
1060
1061
3/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 2 times.
6 if (auto curve_ = sensibleEffectivenessofCoolingAirFlowCurve()) {
1062
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 return setCurveAt75(*curve_, sensibleEffectivenessat75CoolingAirFlow);
1063 3 }
1064
1065
1/1
✓ Branch 1 taken 2 times.
2 const auto val100 = sensibleEffectivenessat100CoolingAirFlow();
1066
2/2
✓ Branch 2 taken 1 time.
✓ Branch 3 taken 1 time.
2 if (std::abs(val100) < std::numeric_limits<double>::min()) {
1067
19/19
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
✓ Branch 17 taken 1 time.
✓ Branch 20 taken 1 time.
✓ Branch 23 taken 1 time.
✓ Branch 29 taken 1 time.
✓ Branch 32 taken 1 time.
✓ Branch 35 taken 1 time.
✓ Branch 38 taken 1 time.
✓ Branch 41 taken 1 time.
✓ Branch 44 taken 1 time.
✓ Branch 47 taken 1 time.
✓ Branch 50 taken 1 time.
✓ Branch 53 taken 1 time.
✓ Branch 58 taken 1 time.
✓ Branch 61 taken 1 time.
1 LOG_AND_THROW("Unable to set " << briefDescription()
1068 << "'s Sensible Effectiveness at 75 Cooling Air Flow because the value at 100 is zero and would lead to a "
1069 "Normalization divisor equal to zero.");
1070 }
1071
3/3
✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✓ Branch 8 taken 1 time.
2 auto tableLookup = makeTable(sensibleEffectivenessat75CoolingAirFlow, val100, model(), fmt::format("{}_SensCoolEff", nameString()));
1072
1/1
✓ Branch 1 taken 1 time.
1 return setSensibleEffectivenessofCoolingAirFlowCurve(tableLookup);
1073 1 }
1074
1075 3 bool HeatExchangerAirToAirSensibleAndLatent::setLatentEffectivenessat75CoolingAirFlow(double latentEffectivenessat75CoolingAirFlow) {
1076
5/5
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
✓ Branch 13 taken 3 times.
12 DEPRECATED_AT_MSG(3, 8, 0, "Use latentEffectivenessofCoolingAirFlowCurve instead.");
1077
1078
3/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 2 times.
6 if (auto curve_ = latentEffectivenessofCoolingAirFlowCurve()) {
1079
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 return setCurveAt75(*curve_, latentEffectivenessat75CoolingAirFlow);
1080 3 }
1081
1082
1/1
✓ Branch 1 taken 2 times.
2 const auto val100 = latentEffectivenessat100CoolingAirFlow();
1083
2/2
✓ Branch 2 taken 1 time.
✓ Branch 3 taken 1 time.
2 if (std::abs(val100) < std::numeric_limits<double>::min()) {
1084
19/19
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 13 taken 1 time.
✓ Branch 17 taken 1 time.
✓ Branch 20 taken 1 time.
✓ Branch 23 taken 1 time.
✓ Branch 29 taken 1 time.
✓ Branch 32 taken 1 time.
✓ Branch 35 taken 1 time.
✓ Branch 38 taken 1 time.
✓ Branch 41 taken 1 time.
✓ Branch 44 taken 1 time.
✓ Branch 47 taken 1 time.
✓ Branch 50 taken 1 time.
✓ Branch 53 taken 1 time.
✓ Branch 58 taken 1 time.
✓ Branch 61 taken 1 time.
1 LOG_AND_THROW("Unable to set " << briefDescription()
1085 << "'s Latent Effectiveness at 75 Cooling Air Flow because the value at 100 is zero and would lead to a "
1086 "Normalization divisor equal to zero.");
1087 }
1088
3/3
✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
✓ Branch 8 taken 1 time.
2 auto tableLookup = makeTable(latentEffectivenessat75CoolingAirFlow, val100, model(), fmt::format("{}_LatCoolEff", nameString()));
1089
1/1
✓ Branch 1 taken 1 time.
1 return setLatentEffectivenessofCoolingAirFlowCurve(tableLookup);
1090 1 }
1091
1092 } // namespace model
1093 } // namespace openstudio
1094