GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 96.9% 95 / 0 / 98
Functions: 100.0% 1 / 0 / 1
Branches: 84.1% 127 / 0 / 151

src/energyplus/ForwardTranslator/ForwardTranslateHeatPumpAirToWaterFuelFiredHeating.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 #include "../../model/Model.hpp"
8
9 #include "../../model/HeatPumpAirToWaterFuelFiredHeating.hpp"
10 #include "../../model/Node.hpp"
11 #include "../../model/Node_Impl.hpp"
12 #include "../../model/HeatPumpAirToWaterFuelFiredCooling.hpp"
13 #include "../../model/HeatPumpAirToWaterFuelFiredCooling_Impl.hpp"
14 #include "../../model/CurveBiquadratic.hpp"
15 #include "../../model/CurveQuadratic.hpp"
16
17 #include <utilities/idd/HeatPump_AirToWater_FuelFired_Heating_FieldEnums.hxx>
18 #include <utilities/idd/IddEnums.hxx>
19
20 using namespace openstudio::model;
21
22 namespace openstudio {
23
24 namespace energyplus {
25
26 1 boost::optional<IdfObject> ForwardTranslator::translateHeatPumpAirToWaterFuelFiredHeating(model::HeatPumpAirToWaterFuelFiredHeating& modelObject) {
27
28 // Instantiate an IdfObject of the class to store the values
29
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::HeatPump_AirToWater_FuelFired_Heating, modelObject);
30
31 // Water Inlet Node Name: Required Node
32
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (auto node_ = modelObject.inletModelObject()) {
33
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::WaterInletNodeName, node_->nameString());
34 1 }
35
36 // Water Outlet Node Name: Required Node
37
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (auto node_ = modelObject.outletModelObject()) {
38
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::WaterOutletNodeName, node_->nameString());
39 1 }
40
41 // Air Source Node Name
42
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 const std::string oaNodeName = modelObject.nameString() + " OA Node";
43
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::AirSourceNodeName, oaNodeName);
44
45
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
1 IdfObject _oaNode(openstudio::IddObjectType::OutdoorAir_Node);
46
1/1
✓ Branch 1 taken 1 time.
1 _oaNode.setString(0, oaNodeName);
47
1/1
✓ Branch 1 taken 1 time.
1 m_idfObjects.push_back(_oaNode);
48
49 // Companion Cooling Heat Pump Name: Optional Object
50
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (boost::optional<HeatPumpAirToWaterFuelFiredCooling> companionCoolingHeatPump_ = modelObject.companionCoolingHeatPump()) {
51
3/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
2 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(companionCoolingHeatPump_.get())) {
52
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::CompanionCoolingHeatPumpName, wo_->nameString());
53 1 }
54 1 }
55
56 // Fuel Type: Optional String
57
1/1
✓ Branch 1 taken 1 time.
1 const std::string fuelType = modelObject.fuelType();
58
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::FuelType, fuelType);
59
60 // End-Use Subcategory: Optional String
61
1/1
✓ Branch 1 taken 1 time.
1 const std::string endUseSubcategory = modelObject.endUseSubcategory();
62
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::EndUseSubcategory, endUseSubcategory);
63
64 // Nominal Heating Capacity
65
2/3
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
1 if (modelObject.isNominalHeatingCapacityAutosized()) {
66 ✗ idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::NominalHeatingCapacity, "Autosize");
67 } else {
68
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setDouble(HeatPump_AirToWater_FuelFired_HeatingFields::NominalHeatingCapacity, modelObject.nominalHeatingCapacity().get());
69 }
70
71 // Nominal COP: Optional Double
72
1/1
✓ Branch 1 taken 1 time.
1 const double nominalCOP = modelObject.nominalCOP();
73
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setDouble(HeatPump_AirToWater_FuelFired_HeatingFields::NominalCOP, nominalCOP);
74
75 // Design Flow Rate
76
2/3
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
1 if (modelObject.isDesignFlowRateAutosized()) {
77 ✗ idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::DesignFlowRate, "Autosize");
78 } else {
79
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setDouble(HeatPump_AirToWater_FuelFired_HeatingFields::DesignFlowRate, modelObject.designFlowRate().get());
80 }
81
82 // Design Supply Temperature: Optional Double
83
1/1
✓ Branch 1 taken 1 time.
1 const double designSupplyTemperature = modelObject.designSupplyTemperature();
84
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setDouble(HeatPump_AirToWater_FuelFired_HeatingFields::DesignSupplyTemperature, designSupplyTemperature);
85
86
2/3
✓ Branch 1 taken 1 time.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 time.
1 if (modelObject.isDesignTemperatureLiftAutosized()) {
87 ✗ idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::DesignTemperatureLift, "Autosize");
88 } else {
89
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setDouble(HeatPump_AirToWater_FuelFired_HeatingFields::DesignTemperatureLift, modelObject.designTemperatureLift().get());
90 }
91
92 // Sizing Factor: Optional Double
93
1/1
✓ Branch 1 taken 1 time.
1 const double sizingFactor = modelObject.sizingFactor();
94
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setDouble(HeatPump_AirToWater_FuelFired_HeatingFields::SizingFactor, sizingFactor);
95
96 // Flow Mode: Optional String
97
1/1
✓ Branch 1 taken 1 time.
1 const std::string flowMode = modelObject.flowMode();
98
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::FlowMode, flowMode);
99
100 // Outdoor Air Temperature Curve Input Variable: Optional String
101
1/1
✓ Branch 1 taken 1 time.
1 const std::string outdoorAirTemperatureCurveInputVariable = modelObject.outdoorAirTemperatureCurveInputVariable();
102
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::OutdoorAirTemperatureCurveInputVariable,
103 outdoorAirTemperatureCurveInputVariable);
104
105 // Water Temperature Curve Input Variable: Optional String
106
1/1
✓ Branch 1 taken 1 time.
1 const std::string waterTemperatureCurveInputVariable = modelObject.waterTemperatureCurveInputVariable();
107
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::WaterTemperatureCurveInputVariable, waterTemperatureCurveInputVariable);
108
109 // Normalized Capacity Function of Temperature Curve Name: Required Object
110
1/1
✓ Branch 1 taken 1 time.
1 Curve normalizedCapacityFunctionofTemperatureCurve = modelObject.normalizedCapacityFunctionofTemperatureCurve();
111
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(normalizedCapacityFunctionofTemperatureCurve)) {
112
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::NormalizedCapacityFunctionofTemperatureCurveName, wo_->nameString());
113 1 }
114
115 // Fuel Energy Input Ratio Function of Temperature Curve Name: Required Object
116
1/1
✓ Branch 1 taken 1 time.
1 Curve fuelEnergyInputRatioFunctionofTemperatureCurve = modelObject.fuelEnergyInputRatioFunctionofTemperatureCurve();
117
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(fuelEnergyInputRatioFunctionofTemperatureCurve)) {
118
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::FuelEnergyInputRatioFunctionofTemperatureCurveName, wo_->nameString());
119 1 }
120
121 // Fuel Energy Input Ratio Function of PLR Curve Name: Required Object
122
1/1
✓ Branch 1 taken 1 time.
1 Curve fuelEnergyInputRatioFunctionofPLRCurve = modelObject.fuelEnergyInputRatioFunctionofPLRCurve();
123
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(fuelEnergyInputRatioFunctionofPLRCurve)) {
124
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::FuelEnergyInputRatioFunctionofPLRCurveName, wo_->nameString());
125 1 }
126
127 // Minimum Part Load Ratio: Optional Double
128
1/1
✓ Branch 1 taken 1 time.
1 const double minimumPartLoadRatio = modelObject.minimumPartLoadRatio();
129
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setDouble(HeatPump_AirToWater_FuelFired_HeatingFields::MinimumPartLoadRatio, minimumPartLoadRatio);
130
131 // Maximum Part Load Ratio: Optional Double
132
1/1
✓ Branch 1 taken 1 time.
1 const double maximumPartLoadRatio = modelObject.maximumPartLoadRatio();
133
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setDouble(HeatPump_AirToWater_FuelFired_HeatingFields::MaximumPartLoadRatio, maximumPartLoadRatio);
134
135 // Defrost Control Type: Optional String
136
1/1
✓ Branch 1 taken 1 time.
1 const std::string defrostControlType = modelObject.defrostControlType();
137
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::DefrostControlType, defrostControlType);
138
139 // Defrost Operation Time Fraction: Optional Double
140
1/1
✓ Branch 1 taken 1 time.
1 const double defrostOperationTimeFraction = modelObject.defrostOperationTimeFraction();
141
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setDouble(HeatPump_AirToWater_FuelFired_HeatingFields::DefrostOperationTimeFraction, defrostOperationTimeFraction);
142
143 // Fuel Energy Input Ratio Defrost Adjustment Curve Name: Optional Object
144
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (boost::optional<Curve> fuelEnergyInputRatioDefrostAdjustmentCurve_ = modelObject.fuelEnergyInputRatioDefrostAdjustmentCurve()) {
145
3/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
2 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(fuelEnergyInputRatioDefrostAdjustmentCurve_.get())) {
146
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::FuelEnergyInputRatioDefrostAdjustmentCurveName, wo_->nameString());
147 1 }
148 1 }
149
150 // Resistive Defrost Heater Capacity: Optional Double
151
1/1
✓ Branch 1 taken 1 time.
1 const double resistiveDefrostHeaterCapacity = modelObject.resistiveDefrostHeaterCapacity();
152
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setDouble(HeatPump_AirToWater_FuelFired_HeatingFields::ResistiveDefrostHeaterCapacity, resistiveDefrostHeaterCapacity);
153
154 // Maximum Outdoor Dry-bulb Temperature for Defrost Operation: Optional Double
155
1/1
✓ Branch 1 taken 1 time.
1 const double maximumOutdoorDrybulbTemperatureforDefrostOperation = modelObject.maximumOutdoorDrybulbTemperatureforDefrostOperation();
156
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setDouble(HeatPump_AirToWater_FuelFired_HeatingFields::MaximumOutdoorDrybulbTemperatureforDefrostOperation,
157 maximumOutdoorDrybulbTemperatureforDefrostOperation);
158
159 // Cycling Ratio Factor Curve Name: Optional Object
160
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 if (boost::optional<Curve> cyclingRatioFactorCurve_ = modelObject.cyclingRatioFactorCurve()) {
161
3/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
2 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(cyclingRatioFactorCurve_.get())) {
162
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::CyclingRatioFactorCurveName, wo_->nameString());
163 1 }
164 1 }
165
166 // Nominal Auxiliary Electric Power: Optional Double
167
1/1
✓ Branch 1 taken 1 time.
1 const double nominalAuxiliaryElectricPower = modelObject.nominalAuxiliaryElectricPower();
168
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setDouble(HeatPump_AirToWater_FuelFired_HeatingFields::NominalAuxiliaryElectricPower, nominalAuxiliaryElectricPower);
169
170 // Auxiliary Electric Energy Input Ratio Function of Temperature Curve Name: Optional Object
171 1 if (boost::optional<Curve> auxiliaryElectricEnergyInputRatioFunctionofTemperatureCurve_ =
172
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 modelObject.auxiliaryElectricEnergyInputRatioFunctionofTemperatureCurve()) {
173
3/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
2 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(auxiliaryElectricEnergyInputRatioFunctionofTemperatureCurve_.get())) {
174
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::AuxiliaryElectricEnergyInputRatioFunctionofTemperatureCurveName,
175
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 wo_->nameString());
176 1 }
177 1 }
178
179 // Auxiliary Electric Energy Input Ratio Function of PLR Curve Name: Optional Object
180 1 if (boost::optional<Curve> auxiliaryElectricEnergyInputRatioFunctionofPLRCurve_ =
181
2/3
✓ Branch 1 taken 1 time.
✓ Branch 3 taken 1 time.
✗ Branch 4 not taken.
2 modelObject.auxiliaryElectricEnergyInputRatioFunctionofPLRCurve()) {
182
3/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
2 if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(auxiliaryElectricEnergyInputRatioFunctionofPLRCurve_.get())) {
183
3/3
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 7 taken 1 time.
1 idfObject.setString(HeatPump_AirToWater_FuelFired_HeatingFields::AuxiliaryElectricEnergyInputRatioFunctionofPLRCurveName, wo_->nameString());
184 1 }
185 1 }
186
187 // Standby Electric Power: Optional Double
188
1/1
✓ Branch 1 taken 1 time.
1 const double standbyElectricPower = modelObject.standbyElectricPower();
189
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setDouble(HeatPump_AirToWater_FuelFired_HeatingFields::StandbyElectricPower, standbyElectricPower);
190
191 // Minimum Unloading Ratio: Optional Double
192
1/1
✓ Branch 1 taken 1 time.
1 const double minimumUnloadingRatio = modelObject.minimumUnloadingRatio();
193
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setDouble(HeatPump_AirToWater_FuelFired_HeatingFields::MinimumUnloadingRatio, minimumUnloadingRatio);
194
195
1/1
✓ Branch 1 taken 1 time.
2 return idfObject;
196 1 } // End of translate function
197
198 } // end namespace energyplus
199 } // end namespace openstudio
200