GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 84.4% 221 / 0 / 262
Functions: 84.7% 50 / 0 / 59
Branches: 59.0% 177 / 0 / 300

src/model/CoilHeatingFourPipeBeam.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 "CoilHeatingFourPipeBeam.hpp"
7 #include "CoilHeatingFourPipeBeam_Impl.hpp"
8
9 #include "Node.hpp"
10 #include "Node_Impl.hpp"
11 #include "Curve.hpp"
12 #include "Curve_Impl.hpp"
13 #include "Model.hpp"
14 #include "PlantLoop.hpp"
15 #include "AirTerminalSingleDuctConstantVolumeFourPipeBeam.hpp"
16 #include "AirTerminalSingleDuctConstantVolumeFourPipeBeam_Impl.hpp"
17
18 // For Ctor default curves
19 #include "CurveLinear.hpp"
20 #include "TableLookup.hpp"
21 #include "TableIndependentVariable.hpp"
22
23 #include <utilities/idd/IddEnums.hxx>
24 #include <utilities/idd/OS_Coil_Heating_FourPipeBeam_FieldEnums.hxx>
25
26 #include "../utilities/core/Assert.hpp"
27 #include "../utilities/data/DataEnums.hpp"
28
29 namespace openstudio {
30 namespace model {
31
32 namespace detail {
33
34 10 CoilHeatingFourPipeBeam_Impl::CoilHeatingFourPipeBeam_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle)
35 10 : StraightComponent_Impl(idfObject, model, keepHandle) {
36
4/6
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
✓ Branch 7 taken 10 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 10 times.
✗ Branch 13 not taken.
10 OS_ASSERT(idfObject.iddObject().type() == CoilHeatingFourPipeBeam::iddObjectType());
37 10 }
38
39 ✗ CoilHeatingFourPipeBeam_Impl::CoilHeatingFourPipeBeam_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model,
40 ✗ bool keepHandle)
41 ✗ : StraightComponent_Impl(other, model, keepHandle) {
42 ✗ OS_ASSERT(other.iddObject().type() == CoilHeatingFourPipeBeam::iddObjectType());
43 ✗ }
44
45 7 CoilHeatingFourPipeBeam_Impl::CoilHeatingFourPipeBeam_Impl(const CoilHeatingFourPipeBeam_Impl& other, Model_Impl* model, bool keepHandle)
46 7 : StraightComponent_Impl(other, model, keepHandle) {}
47
48 ✗ const std::vector<std::string>& CoilHeatingFourPipeBeam_Impl::outputVariableNames() const {
49 ✗ static const std::vector<std::string> result;
50 // None: all in parent AirTerminalSingleDuctConstantVolumeFourPipeBeam
51 ✗ return result;
52 }
53
54 ✗ IddObjectType CoilHeatingFourPipeBeam_Impl::iddObjectType() const {
55 ✗ return CoilHeatingFourPipeBeam::iddObjectType();
56 }
57
58 20 unsigned CoilHeatingFourPipeBeam_Impl::inletPort() const {
59 20 return OS_Coil_Heating_FourPipeBeamFields::HotWaterInletNodeName;
60 }
61
62 49 unsigned CoilHeatingFourPipeBeam_Impl::outletPort() const {
63 49 return OS_Coil_Heating_FourPipeBeamFields::HotWaterOutletNodeName;
64 }
65
66 // contaningHVACComponent is important: used for airLoopHVAC::addBranchForZone to connect the coil to the right loop
67 1 boost::optional<HVACComponent> CoilHeatingFourPipeBeam_Impl::containingHVACComponent() const {
68 //return this->airTerminalSingleDuctConstantVolumeFourPipeBeam();
69 1 std::vector<AirTerminalSingleDuctConstantVolumeFourPipeBeam> atuFourPipeBeams;
70
71
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 atuFourPipeBeams = this->model().getConcreteModelObjects<AirTerminalSingleDuctConstantVolumeFourPipeBeam>();
72
73
1/2
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
2 for (const auto& elem : atuFourPipeBeams) {
74
2/3
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
4 if (boost::optional<HVACComponent> coil = elem.heatingCoil()) {
75
6/6
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
✓ Branch 7 taken 2 times.
✓ Branch 10 taken 2 times.
✓ Branch 12 taken 1 time.
✓ Branch 13 taken 1 time.
2 if (coil->handle() == this->handle()) {
76
1/1
✓ Branch 1 taken 1 time.
1 return elem;
77 }
78 2 }
79 }
80 ✗ return boost::none;
81 1 }
82
83 1 boost::optional<StraightComponent> CoilHeatingFourPipeBeam_Impl::containingStraightComponent() const {
84 //return this->airTerminalSingleDuctConstantVolumeFourPipeBeam();
85 1 std::vector<AirTerminalSingleDuctConstantVolumeFourPipeBeam> atuFourPipeBeams;
86
87
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 atuFourPipeBeams = this->model().getConcreteModelObjects<AirTerminalSingleDuctConstantVolumeFourPipeBeam>();
88
89
1/2
✓ Branch 5 taken 1 time.
✗ Branch 6 not taken.
1 for (const auto& elem : atuFourPipeBeams) {
90
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (boost::optional<HVACComponent> coil = elem.heatingCoil()) {
91
5/6
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
✓ Branch 10 taken 1 time.
✓ Branch 12 taken 1 time.
✗ Branch 13 not taken.
1 if (coil->handle() == this->handle()) {
92
1/1
✓ Branch 1 taken 1 time.
1 return elem;
93 }
94 1 }
95 }
96 ✗ return boost::none;
97 1 }
98
99 /* Only allow connection on the demand side of a plantLoop */
100 7 bool CoilHeatingFourPipeBeam_Impl::addToNode(Node& node) {
101
2/3
✓ Branch 1 taken 7 times.
✓ Branch 3 taken 7 times.
✗ Branch 4 not taken.
14 if (boost::optional<PlantLoop> plant = node.plantLoop()) {
102
5/5
✓ Branch 1 taken 7 times.
✓ Branch 4 taken 7 times.
✓ Branch 7 taken 7 times.
✓ Branch 10 taken 6 times.
✓ Branch 11 taken 1 time.
14 if (plant->demandComponent(node.handle())) {
103
1/1
✓ Branch 1 taken 6 times.
6 return StraightComponent_Impl::addToNode(node);
104 }
105 7 }
106
107 1 return false;
108 }
109
110 /* Nodes */
111
112 7 boost::optional<Node> CoilHeatingFourPipeBeam_Impl::hotWaterInletNode() const {
113
1/1
✓ Branch 1 taken 7 times.
7 unsigned port = inletPort();
114
1/1
✓ Branch 1 taken 7 times.
7 boost::optional<ModelObject> mo = connectedObject(port);
115 7 boost::optional<Node> result;
116
117
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 1 time.
7 if (mo) {
118
3/4
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 6 taken 6 times.
✗ Branch 7 not taken.
12 if (boost::optional<Node> node = mo->optionalCast<Node>()) {
119
1/1
✓ Branch 1 taken 6 times.
6 result = node;
120 6 }
121 }
122
123 14 return result;
124 7 }
125
126 7 boost::optional<Node> CoilHeatingFourPipeBeam_Impl::hotWaterOutletNode() const {
127
1/1
✓ Branch 1 taken 7 times.
7 unsigned port = outletPort();
128
129
1/1
✓ Branch 1 taken 7 times.
7 boost::optional<ModelObject> mo = connectedObject(port);
130 7 boost::optional<Node> result;
131
132
2/2
✓ Branch 0 taken 6 times.
✓ Branch 1 taken 1 time.
7 if (mo) {
133
3/4
✓ Branch 1 taken 6 times.
✓ Branch 4 taken 6 times.
✓ Branch 6 taken 6 times.
✗ Branch 7 not taken.
12 if (boost::optional<Node> node = mo->optionalCast<Node>()) {
134
1/1
✓ Branch 1 taken 6 times.
6 result = node;
135 6 }
136 }
137
138 14 return result;
139 7 }
140
141 /* double with default fields */
142
143 // Beam Rated Heating Capacity per Beam Length
144
145 2 double CoilHeatingFourPipeBeam_Impl::beamRatedHeatingCapacityperBeamLength() const {
146
1/1
✓ Branch 1 taken 2 times.
2 boost::optional<double> value = getDouble(OS_Coil_Heating_FourPipeBeamFields::BeamRatedHeatingCapacityperBeamLength, true);
147
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
2 OS_ASSERT(value);
148
1/1
✓ Branch 1 taken 2 times.
4 return value.get();
149 }
150
151 2 bool CoilHeatingFourPipeBeam_Impl::isBeamRatedHeatingCapacityperBeamLengthDefaulted() const {
152 2 return isEmpty(OS_Coil_Heating_FourPipeBeamFields::BeamRatedHeatingCapacityperBeamLength);
153 }
154
155 1 bool CoilHeatingFourPipeBeam_Impl::setBeamRatedHeatingCapacityperBeamLength(double beamRatedHeatingCapacityperBeamLength) {
156 1 bool result = setDouble(OS_Coil_Heating_FourPipeBeamFields::BeamRatedHeatingCapacityperBeamLength, beamRatedHeatingCapacityperBeamLength);
157 1 return result;
158 }
159
160 1 void CoilHeatingFourPipeBeam_Impl::resetBeamRatedHeatingCapacityperBeamLength() {
161
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_Coil_Heating_FourPipeBeamFields::BeamRatedHeatingCapacityperBeamLength, "");
162
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
163 1 }
164
165 // Beam Rated Heating Room Air Hot Water Temperature Difference
166
167 2 double CoilHeatingFourPipeBeam_Impl::beamRatedHeatingRoomAirHotWaterTemperatureDifference() const {
168
1/1
✓ Branch 1 taken 2 times.
2 boost::optional<double> value = getDouble(OS_Coil_Heating_FourPipeBeamFields::BeamRatedHeatingRoomAirHotWaterTemperatureDifference, true);
169
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
2 OS_ASSERT(value);
170
1/1
✓ Branch 1 taken 2 times.
4 return value.get();
171 }
172
173 2 bool CoilHeatingFourPipeBeam_Impl::isBeamRatedHeatingRoomAirHotWaterTemperatureDifferenceDefaulted() const {
174 2 return isEmpty(OS_Coil_Heating_FourPipeBeamFields::BeamRatedHeatingRoomAirHotWaterTemperatureDifference);
175 }
176
177 1 bool CoilHeatingFourPipeBeam_Impl::setBeamRatedHeatingRoomAirHotWaterTemperatureDifference(
178 double beamRatedHeatingRoomAirHotWaterTemperatureDifference) {
179 1 bool result = setDouble(OS_Coil_Heating_FourPipeBeamFields::BeamRatedHeatingRoomAirHotWaterTemperatureDifference,
180 beamRatedHeatingRoomAirHotWaterTemperatureDifference);
181 1 return result;
182 }
183
184 1 void CoilHeatingFourPipeBeam_Impl::resetBeamRatedHeatingRoomAirHotWaterTemperatureDifference() {
185
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_Coil_Heating_FourPipeBeamFields::BeamRatedHeatingRoomAirHotWaterTemperatureDifference, "");
186
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
187 1 }
188
189 // Beam Rated Hot Water Volume Flow Rate per Beam Length
190
191 2 double CoilHeatingFourPipeBeam_Impl::beamRatedHotWaterVolumeFlowRateperBeamLength() const {
192
1/1
✓ Branch 1 taken 2 times.
2 boost::optional<double> value = getDouble(OS_Coil_Heating_FourPipeBeamFields::BeamRatedHotWaterVolumeFlowRateperBeamLength, true);
193
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 4 not taken.
2 OS_ASSERT(value);
194
1/1
✓ Branch 1 taken 2 times.
4 return value.get();
195 }
196
197 2 bool CoilHeatingFourPipeBeam_Impl::isBeamRatedHotWaterVolumeFlowRateperBeamLengthDefaulted() const {
198 2 return isEmpty(OS_Coil_Heating_FourPipeBeamFields::BeamRatedHotWaterVolumeFlowRateperBeamLength);
199 }
200
201 1 bool CoilHeatingFourPipeBeam_Impl::setBeamRatedHotWaterVolumeFlowRateperBeamLength(double beamRatedHotWaterVolumeFlowRateperBeamLength) {
202 bool result =
203 1 setDouble(OS_Coil_Heating_FourPipeBeamFields::BeamRatedHotWaterVolumeFlowRateperBeamLength, beamRatedHotWaterVolumeFlowRateperBeamLength);
204 1 return result;
205 }
206
207 1 void CoilHeatingFourPipeBeam_Impl::resetBeamRatedHotWaterVolumeFlowRateperBeamLength() {
208
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 bool result = setString(OS_Coil_Heating_FourPipeBeamFields::BeamRatedHotWaterVolumeFlowRateperBeamLength, "");
209
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1 time.
1 OS_ASSERT(result);
210 1 }
211
212 /* Curves */
213
214 // Beam Heating Capacity Temperature Difference Modification Factor Curve
215
216 4 Curve CoilHeatingFourPipeBeam_Impl::beamHeatingCapacityTemperatureDifferenceModificationFactorCurve() const {
217
1/1
✓ Branch 1 taken 4 times.
8 boost::optional<Curve> c = getObject<ModelObject>().getModelObjectTarget<Curve>(
218
1/1
✓ Branch 1 taken 4 times.
4 OS_Coil_Heating_FourPipeBeamFields::BeamHeatingCapacityTemperatureDifferenceModificationFactorCurveName);
219
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
4 if (!c) {
220 ✗ LOG_AND_THROW(briefDescription() << " doesn't have the required Beam Heating Capacity Temperature Difference Modification Factor Curve");
221 }
222
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
4 OS_ASSERT(c);
223
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 return c.get();
224 4 }
225
226 11 bool CoilHeatingFourPipeBeam_Impl::setBeamHeatingCapacityTemperatureDifferenceModificationFactorCurve(const Curve& curve) {
227 bool result =
228
2/2
✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
11 setPointer(OS_Coil_Heating_FourPipeBeamFields::BeamHeatingCapacityTemperatureDifferenceModificationFactorCurveName, curve.handle());
229 11 return result;
230 }
231
232 // Beam Heating Capacity Air Flow Modification Factor Curve
233
234 4 Curve CoilHeatingFourPipeBeam_Impl::beamHeatingCapacityAirFlowModificationFactorCurve() const {
235
1/1
✓ Branch 1 taken 4 times.
8 boost::optional<Curve> c = getObject<ModelObject>().getModelObjectTarget<Curve>(
236
1/1
✓ Branch 1 taken 4 times.
4 OS_Coil_Heating_FourPipeBeamFields::BeamHeatingCapacityAirFlowModificationFactorCurveName);
237
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
4 if (!c) {
238 ✗ LOG_AND_THROW(briefDescription() << " doesn't have the required Beam Heating Capacity Air Flow Modification Factor Curve");
239 }
240
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
4 OS_ASSERT(c);
241
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 return c.get();
242 4 }
243
244 11 bool CoilHeatingFourPipeBeam_Impl::setBeamHeatingCapacityAirFlowModificationFactorCurve(const Curve& curve) {
245
2/2
✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
11 bool result = setPointer(OS_Coil_Heating_FourPipeBeamFields::BeamHeatingCapacityAirFlowModificationFactorCurveName, curve.handle());
246 11 return result;
247 }
248
249 // Beam Heating Capacity Hot Water Flow Modification Factor Curve
250
251 4 Curve CoilHeatingFourPipeBeam_Impl::beamHeatingCapacityHotWaterFlowModificationFactorCurve() const {
252
1/1
✓ Branch 1 taken 4 times.
8 boost::optional<Curve> c = getObject<ModelObject>().getModelObjectTarget<Curve>(
253
1/1
✓ Branch 1 taken 4 times.
4 OS_Coil_Heating_FourPipeBeamFields::BeamHeatingCapacityHotWaterFlowModificationFactorCurveName);
254
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
4 if (!c) {
255 ✗ LOG_AND_THROW(briefDescription() << " doesn't have the required Beam Heating Capacity Hot Water Flow Modification Factor Curve");
256 }
257
1/3
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✗ Branch 4 not taken.
4 OS_ASSERT(c);
258
2/2
✓ Branch 1 taken 4 times.
✓ Branch 4 taken 4 times.
8 return c.get();
259 4 }
260
261 11 bool CoilHeatingFourPipeBeam_Impl::setBeamHeatingCapacityHotWaterFlowModificationFactorCurve(const Curve& curve) {
262
2/2
✓ Branch 1 taken 11 times.
✓ Branch 4 taken 11 times.
11 bool result = setPointer(OS_Coil_Heating_FourPipeBeamFields::BeamHeatingCapacityHotWaterFlowModificationFactorCurveName, curve.handle());
263 11 return result;
264 }
265
266 /* Convenience functions */
267
268 boost::optional<AirTerminalSingleDuctConstantVolumeFourPipeBeam>
269 ✗ CoilHeatingFourPipeBeam_Impl::airTerminalSingleDuctConstantVolumeFourPipeBeam() const {
270 // this coil can only be found in a AirTerminalSingleDuctConstantVolumeFourPipeBeam
271 // check all AirTerminalSingleDuctConstantVolumeFourPipeBeam in the models, seeing if this coil
272 // is inside of one of them. Return the one it is inside of.
273
274 ✗ std::vector<AirTerminalSingleDuctConstantVolumeFourPipeBeam> atuFourPipeBeams;
275
276 ✗ atuFourPipeBeams = this->model().getConcreteModelObjects<AirTerminalSingleDuctConstantVolumeFourPipeBeam>();
277
278 ✗ for (const auto& elem : atuFourPipeBeams) {
279 ✗ if (boost::optional<HVACComponent> coil = elem.heatingCoil()) {
280 ✗ if (coil->handle() == this->handle()) {
281 ✗ return elem;
282 }
283 ✗ }
284 }
285 ✗ return boost::none;
286 ✗ }
287
288 ✗ ComponentType CoilHeatingFourPipeBeam_Impl::componentType() const {
289 ✗ return ComponentType::Heating;
290 }
291
292 ✗ std::vector<FuelType> CoilHeatingFourPipeBeam_Impl::coolingFuelTypes() const {
293 ✗ return {};
294 }
295
296 ✗ std::vector<FuelType> CoilHeatingFourPipeBeam_Impl::heatingFuelTypes() const {
297 ✗ if (auto p_ = plantLoop()) {
298 ✗ return p_->heatingFuelTypes();
299 ✗ }
300 ✗ return {};
301 }
302
303 ✗ std::vector<AppGFuelType> CoilHeatingFourPipeBeam_Impl::appGHeatingFuelTypes() const {
304 ✗ if (auto p_ = plantLoop()) {
305 ✗ return p_->appGHeatingFuelTypes();
306 ✗ }
307 ✗ return {};
308 }
309
310 } // namespace detail
311
312 /* Ctor: defaulting Curves like in the FourPipeBeamLargeOffice.idf Example File from E+ */
313 10 CoilHeatingFourPipeBeam::CoilHeatingFourPipeBeam(const Model& model) : StraightComponent(CoilHeatingFourPipeBeam::iddObjectType(), model) {
314
1/3
✗ Branch 2 not taken.
✓ Branch 3 taken 10 times.
✗ Branch 5 not taken.
10 OS_ASSERT(getImpl<detail::CoilHeatingFourPipeBeam_Impl>());
315
316 10 bool ok = true;
317
318 //Beam Heating Capacity Temperature Difference Modification Factor Curve Nam
319
1/1
✓ Branch 1 taken 10 times.
10 CurveLinear capModFuncOfTempDiff(model);
320
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 capModFuncOfTempDiff.setName("CapModFuncOfTempDiff");
321
1/1
✓ Branch 1 taken 10 times.
10 capModFuncOfTempDiff.setCoefficient1Constant(0);
322
1/1
✓ Branch 1 taken 10 times.
10 capModFuncOfTempDiff.setCoefficient2x(1);
323
1/1
✓ Branch 1 taken 10 times.
10 capModFuncOfTempDiff.setMinimumValueofx(0.0);
324
1/1
✓ Branch 1 taken 10 times.
10 capModFuncOfTempDiff.setMaximumValueofx(1.5);
325
1/1
✓ Branch 1 taken 10 times.
10 capModFuncOfTempDiff.setMinimumCurveOutput(0.0);
326
1/1
✓ Branch 1 taken 10 times.
10 capModFuncOfTempDiff.setMaximumCurveOutput(1.5);
327
328
1/1
✓ Branch 1 taken 10 times.
10 ok = setBeamHeatingCapacityTemperatureDifferenceModificationFactorCurve(capModFuncOfTempDiff);
329
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
10 OS_ASSERT(ok);
330
331 // Beam Heating Capacity Air Flow Modification Factor Curve Name
332 // HeatCapModFuncOfSAFlow: Table:OneIndependentVariable,
333
334
1/1
✓ Branch 1 taken 10 times.
10 TableLookup heatCapModFuncOfSAFlow(model);
335 {
336
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 heatCapModFuncOfSAFlow.setName("HeatCapModFuncOfSAFlow");
337
1/1
✓ Branch 1 taken 10 times.
10 heatCapModFuncOfSAFlow.setMinimumOutput(0.8234);
338
1/1
✓ Branch 1 taken 10 times.
10 heatCapModFuncOfSAFlow.setMaximumOutput(1.0778);
339
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 heatCapModFuncOfSAFlow.setOutputUnitType("Dimensionless");
340
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 heatCapModFuncOfSAFlow.setOutputValues({0.8554, 1.0, 1.0778});
341
342
1/1
✓ Branch 1 taken 10 times.
10 TableIndependentVariable heatCapModFuncOfSAFlowVar1(model);
343
1/1
✓ Branch 1 taken 10 times.
10 heatCapModFuncOfSAFlow.addIndependentVariable(heatCapModFuncOfSAFlowVar1);
344
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 heatCapModFuncOfSAFlowVar1.setName("HeatCapModFuncOfWaterFlow_IndependentVariable1");
345
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 heatCapModFuncOfSAFlowVar1.setInterpolationMethod("Cubic");
346
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 heatCapModFuncOfSAFlowVar1.setExtrapolationMethod("Constant");
347
1/1
✓ Branch 1 taken 10 times.
10 heatCapModFuncOfSAFlowVar1.setMinimumValue(0.714);
348
1/1
✓ Branch 1 taken 10 times.
10 heatCapModFuncOfSAFlowVar1.setMaximumValue(1.2857);
349
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 heatCapModFuncOfSAFlowVar1.setUnitType("Dimensionless");
350
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 heatCapModFuncOfSAFlowVar1.setValues({0.714286, 1.0, 1.2857});
351 10 }
352
353
1/1
✓ Branch 1 taken 10 times.
10 ok = setBeamHeatingCapacityAirFlowModificationFactorCurve(heatCapModFuncOfSAFlow);
354
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
10 OS_ASSERT(ok);
355
356 // Beam Heating Capacity Hot Water Flow Modification Factor Curve
357 // CapModFuncOfWaterFlow: Table:OneIndependentVariable
358
359
1/1
✓ Branch 1 taken 10 times.
10 TableLookup heatCapModFuncOfWaterFlow(model);
360 {
361
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 heatCapModFuncOfWaterFlow.setName("HeatCapModFuncOfWaterFlow");
362
1/1
✓ Branch 1 taken 10 times.
10 heatCapModFuncOfWaterFlow.setMinimumOutput(0.0);
363
1/1
✓ Branch 1 taken 10 times.
10 heatCapModFuncOfWaterFlow.setMaximumOutput(1.04);
364
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 heatCapModFuncOfWaterFlow.setOutputUnitType("Dimensionless");
365
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 heatCapModFuncOfWaterFlow.setOutputValues({0.0, 0.001, 0.71, 0.85, 0.92, 0.97, 1.0, 1.04});
366
367
1/1
✓ Branch 1 taken 10 times.
10 TableIndependentVariable heatCapModFuncOfWaterFlowVar1(model);
368
1/1
✓ Branch 1 taken 10 times.
10 heatCapModFuncOfWaterFlow.addIndependentVariable(heatCapModFuncOfWaterFlowVar1);
369
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 heatCapModFuncOfWaterFlowVar1.setName("HeatCapModFuncOfWaterFlow_IndependentVariable1");
370
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 heatCapModFuncOfWaterFlowVar1.setInterpolationMethod("Cubic");
371
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 heatCapModFuncOfWaterFlowVar1.setExtrapolationMethod("Constant");
372
1/1
✓ Branch 1 taken 10 times.
10 heatCapModFuncOfWaterFlowVar1.setMinimumValue(0.0);
373
1/1
✓ Branch 1 taken 10 times.
10 heatCapModFuncOfWaterFlowVar1.setMaximumValue(1.33);
374
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
10 heatCapModFuncOfWaterFlowVar1.setUnitType("Dimensionless");
375
2/2
✓ Branch 1 taken 10 times.
✓ Branch 4 taken 10 times.
20 heatCapModFuncOfWaterFlowVar1.setValues({0.0, 0.05, 0.33333, 0.5, 0.666667, 0.833333, 1.0, 1.333333});
376 10 }
377
378
1/1
✓ Branch 1 taken 10 times.
10 ok = setBeamHeatingCapacityHotWaterFlowModificationFactorCurve(heatCapModFuncOfWaterFlow);
379
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
✗ Branch 3 not taken.
10 OS_ASSERT(ok);
380 10 }
381
382 7752 IddObjectType CoilHeatingFourPipeBeam::iddObjectType() {
383
1/1
✓ Branch 1 taken 7752 times.
7752 return {IddObjectType::OS_Coil_Heating_FourPipeBeam};
384 }
385
386 /* Nodes */
387
388 7 boost::optional<Node> CoilHeatingFourPipeBeam::hotWaterInletNode() const {
389
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->hotWaterInletNode();
390 }
391
392 7 boost::optional<Node> CoilHeatingFourPipeBeam::hotWaterOutletNode() const {
393
1/1
✓ Branch 3 taken 7 times.
7 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->hotWaterOutletNode();
394 }
395
396 /* double with default fields */
397
398 // Beam Rated Heating Capacity per Beam Length
399
400 2 double CoilHeatingFourPipeBeam::beamRatedHeatingCapacityperBeamLength() const {
401
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->beamRatedHeatingCapacityperBeamLength();
402 }
403
404 2 bool CoilHeatingFourPipeBeam::isBeamRatedHeatingCapacityperBeamLengthDefaulted() const {
405
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->isBeamRatedHeatingCapacityperBeamLengthDefaulted();
406 }
407
408 1 bool CoilHeatingFourPipeBeam::setBeamRatedHeatingCapacityperBeamLength(double beamRatedHeatingCapacityperBeamLength) {
409
1/1
✓ Branch 3 taken 1 time.
1 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->setBeamRatedHeatingCapacityperBeamLength(beamRatedHeatingCapacityperBeamLength);
410 }
411
412 1 void CoilHeatingFourPipeBeam::resetBeamRatedHeatingCapacityperBeamLength() {
413
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->resetBeamRatedHeatingCapacityperBeamLength();
414 1 }
415
416 // Beam Rated Heating Room Air Hot Water Temperature Difference
417
418 2 double CoilHeatingFourPipeBeam::beamRatedHeatingRoomAirHotWaterTemperatureDifference() const {
419
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->beamRatedHeatingRoomAirHotWaterTemperatureDifference();
420 }
421
422 2 bool CoilHeatingFourPipeBeam::isBeamRatedHeatingRoomAirHotWaterTemperatureDifferenceDefaulted() const {
423
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->isBeamRatedHeatingRoomAirHotWaterTemperatureDifferenceDefaulted();
424 }
425
426 1 bool CoilHeatingFourPipeBeam::setBeamRatedHeatingRoomAirHotWaterTemperatureDifference(double beamRatedHeatingRoomAirHotWaterTemperatureDifference) {
427
1/1
✓ Branch 3 taken 1 time.
2 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->setBeamRatedHeatingRoomAirHotWaterTemperatureDifference(
428 2 beamRatedHeatingRoomAirHotWaterTemperatureDifference);
429 }
430
431 1 void CoilHeatingFourPipeBeam::resetBeamRatedHeatingRoomAirHotWaterTemperatureDifference() {
432
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->resetBeamRatedHeatingRoomAirHotWaterTemperatureDifference();
433 1 }
434
435 // Beam Rated Hot Water Volume Flow Rate per Beam Length
436
437 2 double CoilHeatingFourPipeBeam::beamRatedHotWaterVolumeFlowRateperBeamLength() const {
438
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->beamRatedHotWaterVolumeFlowRateperBeamLength();
439 }
440
441 2 bool CoilHeatingFourPipeBeam::isBeamRatedHotWaterVolumeFlowRateperBeamLengthDefaulted() const {
442
1/1
✓ Branch 3 taken 2 times.
2 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->isBeamRatedHotWaterVolumeFlowRateperBeamLengthDefaulted();
443 }
444
445 1 bool CoilHeatingFourPipeBeam::setBeamRatedHotWaterVolumeFlowRateperBeamLength(double beamRatedHotWaterVolumeFlowRateperBeamLength) {
446
1/1
✓ Branch 3 taken 1 time.
2 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->setBeamRatedHotWaterVolumeFlowRateperBeamLength(
447 2 beamRatedHotWaterVolumeFlowRateperBeamLength);
448 }
449
450 1 void CoilHeatingFourPipeBeam::resetBeamRatedHotWaterVolumeFlowRateperBeamLength() {
451
1/1
✓ Branch 3 taken 1 time.
1 getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->resetBeamRatedHotWaterVolumeFlowRateperBeamLength();
452 1 }
453
454 /* Curves */
455
456 // Beam Heating Capacity Temperature Difference Modification Factor Curve
457
458 4 Curve CoilHeatingFourPipeBeam::beamHeatingCapacityTemperatureDifferenceModificationFactorCurve() const {
459
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->beamHeatingCapacityTemperatureDifferenceModificationFactorCurve();
460 }
461
462 11 bool CoilHeatingFourPipeBeam::setBeamHeatingCapacityTemperatureDifferenceModificationFactorCurve(const Curve& curve) {
463
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->setBeamHeatingCapacityTemperatureDifferenceModificationFactorCurve(curve);
464 }
465
466 // Beam Heating Capacity Air Flow Modification Factor Curve
467
468 4 Curve CoilHeatingFourPipeBeam::beamHeatingCapacityAirFlowModificationFactorCurve() const {
469
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->beamHeatingCapacityAirFlowModificationFactorCurve();
470 }
471
472 11 bool CoilHeatingFourPipeBeam::setBeamHeatingCapacityAirFlowModificationFactorCurve(const Curve& curve) {
473
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->setBeamHeatingCapacityAirFlowModificationFactorCurve(curve);
474 }
475
476 // Beam Heating Capacity Hot Water Flow Modification Factor Curve
477
478 4 Curve CoilHeatingFourPipeBeam::beamHeatingCapacityHotWaterFlowModificationFactorCurve() const {
479
1/1
✓ Branch 3 taken 4 times.
4 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->beamHeatingCapacityHotWaterFlowModificationFactorCurve();
480 }
481
482 11 bool CoilHeatingFourPipeBeam::setBeamHeatingCapacityHotWaterFlowModificationFactorCurve(const Curve& curve) {
483
1/1
✓ Branch 3 taken 11 times.
11 return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->setBeamHeatingCapacityHotWaterFlowModificationFactorCurve(curve);
484 }
485
486 /* Convenience functions */
487
488 ✗ boost::optional<AirTerminalSingleDuctConstantVolumeFourPipeBeam> CoilHeatingFourPipeBeam::airTerminalSingleDuctConstantVolumeFourPipeBeam() const {
489 ✗ return getImpl<detail::CoilHeatingFourPipeBeam_Impl>()->airTerminalSingleDuctConstantVolumeFourPipeBeam();
490 }
491
492 /// @cond
493
1/1
✓ Branch 2 taken 23 times.
23 CoilHeatingFourPipeBeam::CoilHeatingFourPipeBeam(std::shared_ptr<detail::CoilHeatingFourPipeBeam_Impl> impl) : StraightComponent(impl) {}
494 /// @endcond
495
496 } // namespace model
497 } // namespace openstudio
498