GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 80.2% 69 / 0 / 86
Functions: 100.0% 1 / 0 / 1
Branches: 55.3% 78 / 0 / 141

src/energyplus/ForwardTranslator/ForwardTranslateGeneratorFuelCellExhaustGasToWaterHeatExchanger.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 "../ForwardTranslator.hpp"
7
8 #include "../../model/Model.hpp"
9 #include "../../model/GeneratorFuelCellExhaustGasToWaterHeatExchanger.hpp"
10 #include "../../model/GeneratorFuelCellExhaustGasToWaterHeatExchanger_Impl.hpp"
11
12 #include "../../model/Connection.hpp"
13 #include "../../model/Connection_Impl.hpp"
14 #include "../../model/Node.hpp"
15 #include "../../model/Node_Impl.hpp"
16
17 #include "../../utilities/idf/IdfExtensibleGroup.hpp"
18
19 #include <utilities/idd/Generator_FuelCell_ExhaustGasToWaterHeatExchanger_FieldEnums.hxx>
20 #include "../../utilities/idd/IddEnums.hpp"
21 #include <utilities/idd/IddEnums.hxx>
22 #include <utilities/idd/IddFactory.hxx>
23
24 using namespace openstudio::model;
25
26 using namespace std;
27
28 namespace openstudio {
29
30 namespace energyplus {
31
32 boost::optional<IdfObject>
33 3 ForwardTranslator::translateGeneratorFuelCellExhaustGasToWaterHeatExchanger(GeneratorFuelCellExhaustGasToWaterHeatExchanger& modelObject) {
34 3 boost::optional<std::string> s;
35 3 boost::optional<double> d;
36 3 boost::optional<Connection> connection;
37 3 boost::optional<Node> node;
38
39
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 IdfObject pcm = createAndRegisterIdfObject(openstudio::IddObjectType::Generator_FuelCell_ExhaustGasToWaterHeatExchanger, modelObject);
40 //Name
41
1/1
✓ Branch 1 taken 3 times.
3 s = modelObject.name();
42
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
3 if (s) {
43
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 pcm.setName(*s);
44 }
45
46 // HeatRecoveryWaterInletNodeName
47
48
2/3
✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
6 if (boost::optional<ModelObject> mo = modelObject.inletModelObject()) {
49 ✗ if (boost::optional<Node> node = mo->optionalCast<Node>()) {
50 ✗ pcm.setString(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::HeatRecoveryWaterInletNodeName, node->name().get());
51 ✗ }
52 3 }
53
54 // HeatRecoveryWaterOutletNodeName
55
56
2/3
✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
6 if (boost::optional<ModelObject> mo = modelObject.outletModelObject()) {
57 ✗ if (boost::optional<Node> node = mo->optionalCast<Node>()) {
58 ✗ pcm.setString(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::HeatRecoveryWaterOutletNodeName, node->name().get());
59 ✗ }
60 3 }
61
62 //HeatRecoveryWaterMaximumFlowRate
63
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 d = modelObject.heatRecoveryWaterMaximumFlowRate();
64
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
3 if (d) {
65
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::HeatRecoveryWaterMaximumFlowRate, d.get());
66 }
67
68 //ExhaustOutletAirNodeName
69
1/1
✓ Branch 1 taken 3 times.
3 node = modelObject.exhaustOutletAirNode();
70
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 if (node) {
71 ✗ pcm.setString(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::ExhaustOutletAirNodeName, node.get().nameString());
72 } else {
73
1/1
✓ Branch 1 taken 3 times.
3 pcm.setString(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::ExhaustOutletAirNodeName,
74
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
6 modelObject.nameString() + " Exhaust Outlet Air Node");
75 }
76
77 //HeatExchangerCalculationMethod
78
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 s = modelObject.heatExchangerCalculationMethod();
79
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
3 if (s) {
80
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 pcm.setString(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::HeatExchangerCalculationMethod, s.get());
81 }
82
83 //Method1HeatExchangerEffectiveness
84
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method1HeatExchangerEffectiveness();
85
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 if (d) {
86 ✗ pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method1HeatExchangerEffectiveness, d.get());
87 }
88
89 //Method2Parameterhxs0
90
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method2Parameterhxs0();
91
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
3 if (d) {
92
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method2Parameterhxs0, d.get());
93 }
94
95 //Method2Parameterhxs1
96
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method2Parameterhxs1();
97
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
3 if (d) {
98
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method2Parameterhxs1, d.get());
99 }
100
101 //Method2Parameterhxs2
102
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method2Parameterhxs2();
103
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
3 if (d) {
104
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method2Parameterhxs2, d.get());
105 }
106
107 //Method2Parameterhxs3
108
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method2Parameterhxs3();
109
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
3 if (d) {
110
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method2Parameterhxs3, d.get());
111 }
112
113 //Method2Parameterhxs4
114
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method2Parameterhxs4();
115
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
3 if (d) {
116
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method2Parameterhxs4, d.get());
117 }
118
119 //Method3h0GasCoefficient
120
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method3h0GasCoefficient();
121
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 if (d) {
122 ✗ pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method3h0GasCoefficient, d.get());
123 }
124
125 //Method3NdotGasRefCoefficient
126
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method3NdotGasRefCoefficient();
127
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 if (d) {
128 ✗ pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method3NdotGasRefCoefficient, d.get());
129 }
130
131 //Method3nCoefficient
132
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method3nCoefficient();
133
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 if (d) {
134 ✗ pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method3nCoefficient, d.get());
135 }
136
137 //Method3GasArea
138
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method3GasArea();
139
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 if (d) {
140 ✗ pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method3GasArea, d.get());
141 }
142
143 //Method3h0WaterCoefficient
144
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method3h0WaterCoefficient();
145
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 if (d) {
146 ✗ pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method3h0WaterCoefficient, d.get());
147 }
148
149 //Method3NdotWaterrefCoefficient
150
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method3NdotWaterrefCoefficient();
151
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 if (d) {
152 ✗ pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method3NdotWaterrefCoefficient, d.get());
153 }
154
155 //Method3mCoefficient
156
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method3mCoefficient();
157
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 if (d) {
158 ✗ pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method3mCoefficient, d.get());
159 }
160
161 //Method3WaterArea
162
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method3WaterArea();
163
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 if (d) {
164 ✗ pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method3WaterArea, d.get());
165 }
166
167 //Method3FAdjustmentFactor
168
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method3FAdjustmentFactor();
169
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3 times.
3 if (d) {
170 ✗ pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method3FAdjustmentFactor, d.get());
171 }
172
173 //Method4hxl1Coefficient
174
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method4hxl1Coefficient();
175
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
3 if (d) {
176
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method4hxl1Coefficient, d.get());
177 }
178
179 //Method4hxl2Coefficient
180
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method4hxl2Coefficient();
181
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
3 if (d) {
182
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method4hxl2Coefficient, d.get());
183 }
184
185 //Method4CondensationThreshold
186
1/1
✓ Branch 1 taken 3 times.
3 d = modelObject.method4CondensationThreshold();
187
1/2
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
3 if (d) {
188
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 pcm.setDouble(Generator_FuelCell_ExhaustGasToWaterHeatExchangerFields::Method4CondensationThreshold, d.get());
189 }
190
191
1/1
✓ Branch 1 taken 3 times.
6 return pcm;
192 3 }
193
194 } // namespace energyplus
195
196 } // namespace openstudio
197