GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 27.6% 51 / 0 / 185
Functions: 100.0% 1 / 0 / 1
Branches: 12.4% 52 / 0 / 421

src/energyplus/ReverseTranslator/ReverseTranslateGeneratorMicroTurbine.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 "../ReverseTranslator.hpp"
7
8 #include "../../model/GeneratorMicroTurbine.hpp"
9 #include "../../model/GeneratorMicroTurbine_Impl.hpp"
10 #include "../../model/GeneratorMicroTurbineHeatRecovery.hpp"
11 #include "../../model/GeneratorMicroTurbineHeatRecovery_Impl.hpp"
12
13 #include "../../model/Schedule.hpp"
14 #include "../../model/Schedule_Impl.hpp"
15
16 #include "../../model/Curve.hpp"
17 #include "../../model/Curve_Impl.hpp"
18 #include "../../model/CurveBicubic.hpp"
19 #include "../../model/CurveBicubic_Impl.hpp"
20 #include "../../model/CurveBiquadratic.hpp"
21 #include "../../model/CurveBiquadratic_Impl.hpp"
22 #include "../../model/CurveCubic.hpp"
23 #include "../../model/CurveCubic_Impl.hpp"
24 #include "../../model/CurveQuadratic.hpp"
25 #include "../../model/CurveQuadratic_Impl.hpp"
26
27 #include <utilities/idd/Generator_MicroTurbine_FieldEnums.hxx>
28 //#include <utilities/idd/Generator_MicroTurbine_HeatRecoveryFieldEnums.hxx>
29 #include "../../utilities/idd/IddEnums.hpp"
30 #include <utilities/idd/IddEnums.hxx>
31
32 using namespace openstudio::model;
33
34 namespace openstudio {
35
36 namespace energyplus {
37
38 2 OptionalModelObject ReverseTranslator::translateGeneratorMicroTurbine(const WorkspaceObject& workspaceObject) {
39
40 2 OptionalModelObject result;
41 2 OptionalModelObject temp;
42 2 OptionalDouble d;
43 2 boost::optional<WorkspaceObject> owo;
44 2 OptionalString optS;
45
46 // TODO: The availability schedule is in the ElectricLoadCenter:Generators (list) in E+, here it's carried by the generator itself
47 // Should also get the Rated Thermal To Electrical Power Ratio in the list
48
49 //Generator:MicroTurbine,
50 // Capstone C65, !- Name
51
52
1/1
✓ Branch 1 taken 2 times.
2 openstudio::model::GeneratorMicroTurbine mchp(m_model);
53
54 // Name
55
1/1
✓ Branch 1 taken 2 times.
2 optS = workspaceObject.name();
56
1/2
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
2 if (optS) {
57
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
2 mchp.setName(*optS);
58 }
59
60 // 65000, !- Reference Electrical Power Output {W}
61
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Generator_MicroTurbineFields::ReferenceElectricalPowerOutput);
62
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (d) {
63 ✗ mchp.setReferenceElectricalPowerOutput(*d);
64 }
65 // 29900, !- Minimum Full Load Electrical Power Output {W}
66
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Generator_MicroTurbineFields::MinimumFullLoadElectricalPowerOutput);
67
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (d) {
68 ✗ mchp.setMinimumFullLoadElectricalPowerOutput(*d);
69 }
70 // 65000, !- Maximum Full Load Electrical Power Output {W} setMaximumFullLoadElectricalPowerOutput
71
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Generator_MicroTurbineFields::MaximumFullLoadElectricalPowerOutput);
72
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (d) {
73 ✗ mchp.setMaximumFullLoadElectricalPowerOutput(*d);
74 }
75
76 // 0.29, !- Reference Electrical Efficiency Using Lower Heating Value
77
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Generator_MicroTurbineFields::ReferenceElectricalEfficiencyUsingLowerHeatingValue);
78
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (d) {
79 ✗ mchp.setReferenceElectricalEfficiencyUsingLowerHeatingValue(*d);
80 }
81
82 // 15.0, !- Reference Combustion Air Inlet Temperature {C}
83
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Generator_MicroTurbineFields::ReferenceCombustionAirInletTemperature);
84
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (d) {
85 ✗ mchp.setReferenceCombustionAirInletTemperature(*d);
86 }
87
88 // 0.00638, !- Reference Combustion Air Inlet Humidity Ratio {kgWater/kgDryAir}
89
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Generator_MicroTurbineFields::ReferenceCombustionAirInletHumidityRatio);
90
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (d) {
91 ✗ mchp.setReferenceCombustionAirInletHumidityRatio(*d);
92 }
93
94 // 0.0, !- Reference Elevation {m}
95
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Generator_MicroTurbineFields::MinimumFullLoadElectricalPowerOutput);
96
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (d) {
97 ✗ mchp.setMinimumFullLoadElectricalPowerOutput(*d);
98 }
99
100 // Capstone C65 Power_vs_Temp_Elev, !- Electrical Power Function of Temperature and Elevation Curve Name
101 // BiquadraticCurves
102
2/3
✓ Branch 1 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
4 if ((owo = workspaceObject.getTarget(Generator_MicroTurbineFields::ElectricalPowerFunctionofTemperatureandElevationCurveName))) {
103 ✗ if (boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(owo.get())) {
104 ✗ if (boost::optional<CurveBiquadratic> curve = mo->optionalCast<CurveBiquadratic>()) {
105 ✗ mchp.setElectricalPowerFunctionofTemperatureandElevationCurve(curve.get());
106 } else {
107 ✗ LOG(Warn, workspaceObject.briefDescription()
108 << " has a wrong type curve for field Electrical Power Function of Temperature and Elevation Curve Name");
109 ✗ }
110 ✗ }
111 }
112
113 // Capstone C65 Efficiency_vs_Temp, !- Electrical Efficiency Function of Temperature Curve Name
114 // QuadraticCubicCurves
115
2/3
✓ Branch 1 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
4 if ((owo = workspaceObject.getTarget(Generator_MicroTurbineFields::ElectricalEfficiencyFunctionofTemperatureCurveName))) {
116 ✗ if (boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(owo.get())) {
117 ✗ if (boost::optional<CurveQuadratic> curve = mo->optionalCast<CurveQuadratic>()) {
118 ✗ mchp.setElectricalEfficiencyFunctionofTemperatureCurve(curve.get());
119 ✗ } else if (boost::optional<CurveCubic> curve = mo->optionalCast<CurveCubic>()) {
120 ✗ mchp.setElectricalEfficiencyFunctionofTemperatureCurve(curve.get());
121 } else {
122 ✗ LOG(Warn, workspaceObject.briefDescription()
123 << " has a wrong type curve for field Electrical Efficiency Function of Temperature Curve Name");
124 ✗ }
125 ✗ }
126 }
127
128 // Capstone C65 Efficiency_vs_PLR, !- Electrical Efficiency Function of Part Load Ratio Curve Name
129 // QuadraticCubicCurves
130 // setElectricalEfficiencyFunctionofPartLoadRatioCurve
131
2/3
✓ Branch 1 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
4 if ((owo = workspaceObject.getTarget(Generator_MicroTurbineFields::ElectricalEfficiencyFunctionofPartLoadRatioCurveName))) {
132 ✗ if (boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(owo.get())) {
133 ✗ if (boost::optional<CurveQuadratic> curve = mo->optionalCast<CurveQuadratic>()) {
134 ✗ mchp.setElectricalEfficiencyFunctionofPartLoadRatioCurve(curve.get());
135 ✗ } else if (boost::optional<CurveCubic> curve = mo->optionalCast<CurveCubic>()) {
136 ✗ mchp.setElectricalEfficiencyFunctionofPartLoadRatioCurve(curve.get());
137 } else {
138 ✗ LOG(Warn, workspaceObject.briefDescription()
139 << " has a wrong type curve for field Electrical Efficiency Function of Part Load Ratio Curve Name");
140 ✗ }
141 ✗ }
142 }
143
144 // NaturalGas, !- Fuel Type
145
1/1
✓ Branch 1 taken 2 times.
2 optS = workspaceObject.getString(Generator_MicroTurbineFields::FuelType);
146
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (optS) {
147 ✗ mchp.setFuelType(*optS);
148 }
149
150 // 50000, !- Fuel Higher Heating Value {kJ/kg}
151
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Generator_MicroTurbineFields::FuelHigherHeatingValue);
152
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (d) {
153 ✗ mchp.setFuelHigherHeatingValue(*d);
154 }
155
156 // 45450, !- Fuel Lower Heating Value {kJ/kg}
157
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Generator_MicroTurbineFields::FuelLowerHeatingValue);
158
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (d) {
159 ✗ mchp.setFuelLowerHeatingValue(*d);
160 }
161
162 // 300, !- Standby Power {W}
163
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Generator_MicroTurbineFields::StandbyPower);
164
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (d) {
165 ✗ mchp.setStandbyPower(*d);
166 }
167
168 // 4500, !- Ancillary Power {W}
169
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Generator_MicroTurbineFields::AncillaryPower);
170
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (d) {
171 ✗ mchp.setAncillaryPower(*d);
172 }
173
174 // , !- Ancillary Power Function of Fuel Input Curve Name
175 // QuadraticCurves
176 // mchp.setAncillaryPowerFunctionofFuelInputCurve
177
2/3
✓ Branch 1 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
4 if ((owo = workspaceObject.getTarget(Generator_MicroTurbineFields::AncillaryPowerFunctionofFuelInputCurveName))) {
178 ✗ if (boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(owo.get())) {
179 ✗ if (boost::optional<CurveQuadratic> curve = mo->optionalCast<CurveQuadratic>()) {
180 ✗ mchp.setAncillaryPowerFunctionofFuelInputCurve(curve.get());
181 } else {
182 ✗ LOG(Warn, workspaceObject.briefDescription() << " has a wrong type curve for field Ancillary Power Function of Fuel Input Curve Name");
183 ✗ }
184 ✗ }
185 }
186
187 // Fields in between (in E+.idd) are moved at the end in the Heat Recovery section
188
189 // Capstone C65 Combustion Air Inlet Node, !- Combustion Air Inlet Node Name
190 // Capstone C65 Combustion Air Outlet Node, !- Combustion Air Outlet Node Name
191
192 // 0.489885, !- Reference Exhaust Air Mass Flow Rate {kg/s}
193
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Generator_MicroTurbineFields::ReferenceExhaustAirMassFlowRate);
194
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (d) {
195 ✗ mchp.setReferenceExhaustAirMassFlowRate(*d);
196 }
197
198 // Capstone C65 ExhAirFlowRate_vs_InletTemp, !- Exhaust Air Flow Rate Function of Temperature Curve Name
199 // QuadraticCubicCurves
200 // mchp.setExhaustAirFlowRateFunctionofTemperatureCurve
201
2/3
✓ Branch 1 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
4 if ((owo = workspaceObject.getTarget(Generator_MicroTurbineFields::ExhaustAirFlowRateFunctionofTemperatureCurveName))) {
202 ✗ if (boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(owo.get())) {
203 ✗ if (boost::optional<CurveQuadratic> curve = mo->optionalCast<CurveQuadratic>()) {
204 ✗ mchp.setExhaustAirFlowRateFunctionofTemperatureCurve(curve.get());
205 ✗ } else if (boost::optional<CurveCubic> curve = mo->optionalCast<CurveCubic>()) {
206 ✗ mchp.setExhaustAirFlowRateFunctionofTemperatureCurve(curve.get());
207 } else {
208 ✗ LOG(Warn, workspaceObject.briefDescription()
209 << " has a wrong type curve for field Exhaust Air Flow Rate Function of Temperature Curve Name");
210 ✗ }
211 ✗ }
212 }
213
214 // Capstone C65 ExhAirFlowRate_vs_PLR, !- Exhaust Air Flow Rate Function of Part Load Ratio Curve Name
215 // QuadraticCubicCurves
216 // mchp.setExhaustAirFlowRateFunctionofPartLoadRatioCurve(curve)
217
2/3
✓ Branch 1 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
4 if ((owo = workspaceObject.getTarget(Generator_MicroTurbineFields::ExhaustAirFlowRateFunctionofPartLoadRatioCurveName))) {
218 ✗ if (boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(owo.get())) {
219 ✗ if (boost::optional<CurveQuadratic> curve = mo->optionalCast<CurveQuadratic>()) {
220 ✗ mchp.setExhaustAirFlowRateFunctionofPartLoadRatioCurve(curve.get());
221 ✗ } else if (boost::optional<CurveCubic> curve = mo->optionalCast<CurveCubic>()) {
222 ✗ mchp.setExhaustAirFlowRateFunctionofPartLoadRatioCurve(curve.get());
223 } else {
224 ✗ LOG(Warn, workspaceObject.briefDescription()
225 << " has a wrong type curve for field Exhaust Air Flow Rate Function of Part Load Ratio Curve Name");
226 ✗ }
227 ✗ }
228 }
229
230 // 308.9, !- Nominal Exhaust Air Outlet Temperature
231
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Generator_MicroTurbineFields::NominalExhaustAirOutletTemperature);
232
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (d) {
233 ✗ mchp.setNominalExhaustAirOutletTemperature(*d);
234 }
235
236 // Capstone C65 ExhaustTemp_vs_InletTemp, !- Exhaust Air Temperature Function of Temperature Curve Name
237 // QuadraticCubicCurves
238 // mchp.setExhaustAirTemperatureFunctionofTemperatureCurve(curve)
239
2/3
✓ Branch 1 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
4 if ((owo = workspaceObject.getTarget(Generator_MicroTurbineFields::ExhaustAirTemperatureFunctionofTemperatureCurveName))) {
240 ✗ if (boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(owo.get())) {
241 ✗ if (boost::optional<CurveQuadratic> curve = mo->optionalCast<CurveQuadratic>()) {
242 ✗ mchp.setExhaustAirTemperatureFunctionofTemperatureCurve(curve.get());
243 ✗ } else if (boost::optional<CurveCubic> curve = mo->optionalCast<CurveCubic>()) {
244 ✗ mchp.setExhaustAirTemperatureFunctionofTemperatureCurve(curve.get());
245 } else {
246 ✗ LOG(Warn, workspaceObject.briefDescription()
247 << " has a wrong type curve for field Exhaust Air Temperature Function of Temperature Curve Name");
248 ✗ }
249 ✗ }
250 }
251
252 // Capstone C65 ExhaustTemp_vs_PLR; !- Exhaust Air Temperature Function of Part Load Ratio Curve Name
253 // QuadraticCubicCurves
254 // mchp.setExhaustAirTemperatureFunctionofPartLoadRatioCurve(curve)
255
2/3
✓ Branch 1 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
4 if ((owo = workspaceObject.getTarget(Generator_MicroTurbineFields::ExhaustAirTemperatureFunctionofPartLoadRatioCurveName))) {
256 ✗ if (boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(owo.get())) {
257 ✗ if (boost::optional<CurveQuadratic> curve = mo->optionalCast<CurveQuadratic>()) {
258 ✗ mchp.setExhaustAirTemperatureFunctionofPartLoadRatioCurve(curve.get());
259 ✗ } else if (boost::optional<CurveCubic> curve = mo->optionalCast<CurveCubic>()) {
260 ✗ mchp.setExhaustAirTemperatureFunctionofPartLoadRatioCurve(curve.get());
261 } else {
262 ✗ LOG(Warn, workspaceObject.briefDescription()
263 << " has a wrong type curve for field Exhaust Air Temperature Function of Part Load Ratio Curve Name");
264 ✗ }
265 ✗ }
266 }
267
268 /// HEAT RECOVERY PORTION
269
270 // Would need to add that to the plantLoop reverse translator
271 // Capstone C65 Heat Recovery Water Inlet Node, !- Heat Recovery Water Inlet Node Name
272 // Capstone C65 Heat Recovery Water Outlet Node, !- Heat Recovery Water Outlet Node Name
273
274 // TODO: For now, I trigger the creation is the 'Reference Thermal Efficiency Using Lower Heat Value' is filled.
275 // TODO: I should trigger it based on the `Rated Thermal To Electrical Power Ratio in the list` in the ElectricLoadCenter:Generators (list)
276 // TODO: But in order to do that, the ElectricLoadCenter:Distribution & ElectricLoadCenter:Generators need to have a reverse translator
277
278 // 0.4975, !- Reference Thermal Efficiency Using Lower Heat Value
279
1/1
✓ Branch 1 taken 2 times.
2 d = workspaceObject.getDouble(Generator_MicroTurbineFields::ReferenceThermalEfficiencyUsingLowerHeatValue);
280
281
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
2 if (d) {
282
283 // Create a GeneratorMicroTurbineHeatRecovery module, and assign it to the MicroTurbine
284 // I've Set the Name in the constructor
285 ✗ openstudio::model::GeneratorMicroTurbineHeatRecovery mchpHR(m_model, mchp);
286
287 // Assign the Reference Thermal Efficiency Using Lower Heat Value
288 ✗ mchpHR.setReferenceThermalEfficiencyUsingLowerHeatValue(*d);
289
290 // 60.0, !- Reference Inlet Water Temperature {C}
291 ✗ d = workspaceObject.getDouble(Generator_MicroTurbineFields::ReferenceInletWaterTemperature);
292 ✗ if (d) {
293 ✗ mchpHR.setReferenceInletWaterTemperature(*d);
294 }
295
296 // PlantControl, !- Heat Recovery Water Flow Operating Mode
297 ✗ optS = workspaceObject.getString(Generator_MicroTurbineFields::HeatRecoveryWaterFlowOperatingMode);
298 ✗ if (optS) {
299 ✗ mchpHR.setHeatRecoveryWaterFlowOperatingMode(*optS);
300 }
301
302 // 0.00252362, !- Reference Heat Recovery Water Flow Rate {m3/s}
303 ✗ d = workspaceObject.getDouble(Generator_MicroTurbineFields::ReferenceHeatRecoveryWaterFlowRate);
304 ✗ if (d) {
305 ✗ mchpHR.setReferenceHeatRecoveryWaterFlowRate(*d);
306 }
307
308 // , !- Heat Recovery Water Flow Rate Function of Temperature and Power Curve Name
309 // BiquadraticCurves
310 // mchpHR.setHeatRecoveryWaterFlowRateFunctionofTemperatureandPowerCurve();
311 ✗ if ((owo = workspaceObject.getTarget(Generator_MicroTurbineFields::HeatRecoveryWaterFlowRateFunctionofTemperatureandPowerCurveName))) {
312 ✗ if (boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(owo.get())) {
313 ✗ if (boost::optional<CurveBiquadratic> curve = mo->optionalCast<CurveBiquadratic>()) {
314 ✗ mchpHR.setHeatRecoveryWaterFlowRateFunctionofTemperatureandPowerCurve(curve.get());
315 } else {
316 ✗ LOG(Warn, workspaceObject.briefDescription()
317 << " has a wrong type curve for field Heat Recovery Water Flow Rate Function of Temperature and Power Curve Name");
318 ✗ }
319 ✗ }
320 }
321
322 // Capstone C65 ThermalEff_vs_Temp_Elev, !- Thermal Efficiency Function of Temperature and Elevation Curve Name
323 // BicubicBiquadraticCurves
324 // mchpHR.setThermalEfficiencyFunctionofTemperatureandElevationCurve();
325 ✗ if ((owo = workspaceObject.getTarget(Generator_MicroTurbineFields::ThermalEfficiencyFunctionofTemperatureandElevationCurveName))) {
326 ✗ if (boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(owo.get())) {
327 ✗ if (boost::optional<CurveBicubic> curve = mo->optionalCast<CurveBicubic>()) {
328 ✗ mchpHR.setThermalEfficiencyFunctionofTemperatureandElevationCurve(curve.get());
329 ✗ } else if (boost::optional<CurveBiquadratic> curve = mo->optionalCast<CurveBiquadratic>()) {
330 ✗ mchpHR.setThermalEfficiencyFunctionofTemperatureandElevationCurve(curve.get());
331 } else {
332 ✗ LOG(Warn, workspaceObject.briefDescription()
333 << " has a wrong type curve for field Thermal Efficiency Function of Temperature and Elevation Curve Name");
334 ✗ }
335 ✗ }
336 }
337
338 // Capstone C65 HeatRecoveryRate_vs_PLR, !- Heat Recovery Rate Function of Part Load Ratio Curve Name
339 // QuadraticCubicCurves
340 // mchpHR.setHeatRecoveryRateFunctionofPartLoadRatioCurve();
341 ✗ if ((owo = workspaceObject.getTarget(Generator_MicroTurbineFields::HeatRecoveryRateFunctionofPartLoadRatioCurveName))) {
342 ✗ if (boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(owo.get())) {
343 ✗ if (boost::optional<CurveQuadratic> curve = mo->optionalCast<CurveQuadratic>()) {
344 ✗ mchpHR.setHeatRecoveryRateFunctionofPartLoadRatioCurve(curve.get());
345 ✗ } else if (boost::optional<CurveCubic> curve = mo->optionalCast<CurveCubic>()) {
346 ✗ mchpHR.setHeatRecoveryRateFunctionofPartLoadRatioCurve(curve.get());
347 } else {
348 ✗ LOG(Warn, workspaceObject.briefDescription()
349 << " has a wrong type curve for field Heat Recovery Rate Function of Part Load Ratio Curve Name");
350 ✗ }
351 ✗ }
352 }
353
354 // Capstone C65 HeatRecoveryRate_vs_InletTemp, !- Heat Recovery Rate Function of Inlet Water Temperature Curve Name
355 // QuadraticCurves
356 // mchpHR.setHeatRecoveryRateFunctionofInletWaterTemperatureCurve();
357 ✗ if ((owo = workspaceObject.getTarget(Generator_MicroTurbineFields::HeatRecoveryRateFunctionofInletWaterTemperatureCurveName))) {
358 ✗ if (boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(owo.get())) {
359 ✗ if (boost::optional<CurveQuadratic> curve = mo->optionalCast<CurveQuadratic>()) {
360 ✗ mchpHR.setHeatRecoveryRateFunctionofInletWaterTemperatureCurve(curve.get());
361 } else {
362 ✗ LOG(Warn, workspaceObject.briefDescription()
363 << " has a wrong type curve for field Heat Recovery Rate Function of Part Load Ratio Curve Name");
364 ✗ }
365 ✗ }
366 }
367
368 // Capstone C65 HeatRecoveryRate_vs_WaterFlow, !- Heat Recovery Rate Function of Water Flow Rate Curve Name
369 // QuadraticCurves
370 // mchpHR.setHeatRecoveryRateFunctionofInletWaterFlowRateCurve();
371 ✗ if ((owo = workspaceObject.getTarget(Generator_MicroTurbineFields::HeatRecoveryRateFunctionofWaterFlowRateCurveName))) {
372 ✗ if (boost::optional<ModelObject> mo = translateAndMapWorkspaceObject(owo.get())) {
373 ✗ if (boost::optional<CurveQuadratic> curve = mo->optionalCast<CurveQuadratic>()) {
374 ✗ mchpHR.setHeatRecoveryRateFunctionofWaterFlowRateCurve(curve.get());
375 } else {
376 ✗ LOG(Warn, workspaceObject.briefDescription()
377 << " has a wrong type curve for field Heat Recovery Rate Function of Water Flow Rate Curve Name");
378 ✗ }
379 ✗ }
380 }
381
382 // 0.001577263, !- Minimum Heat Recovery Water Flow Rate {m3/s}
383 ✗ d = workspaceObject.getDouble(Generator_MicroTurbineFields::MinimumHeatRecoveryWaterFlowRate);
384 ✗ if (d) {
385 ✗ mchpHR.setMinimumHeatRecoveryWaterFlowRate(*d);
386 }
387
388 // 0.003785432, !- Maximum Heat Recovery Water Flow Rate {m3/s}
389 ✗ d = workspaceObject.getDouble(Generator_MicroTurbineFields::MaximumHeatRecoveryWaterFlowRate);
390 ✗ if (d) {
391 ✗ mchpHR.setMaximumHeatRecoveryWaterFlowRate(*d);
392 }
393
394 // 82.2, !- Maximum Heat Recovery Water Temperature {C}
395 ✗ d = workspaceObject.getDouble(Generator_MicroTurbineFields::MaximumHeatRecoveryWaterTemperature);
396 ✗ if (d) {
397 ✗ mchpHR.setMaximumHeatRecoveryWaterTemperature(*d);
398 }
399 ✗ }
400
401
1/1
✓ Branch 1 taken 2 times.
2 result = mchp;
402 4 return result;
403 2 }
404
405 } // namespace energyplus
406
407 } // namespace openstudio
408