GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 98.6% 69 / 0 / 70
Functions: 100.0% 1 / 0 / 1
Branches: 88.2% 90 / 0 / 102

src/energyplus/ForwardTranslator/ForwardTranslateCoilWaterHeatingAirToWaterHeatPumpWrapped.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/CoilWaterHeatingAirToWaterHeatPumpWrapped.hpp"
8 #include "../../model/CoilWaterHeatingAirToWaterHeatPumpWrapped_Impl.hpp"
9 #include "../../model/Model.hpp"
10 #include "../../model/Schedule.hpp"
11 #include "../../model/Schedule_Impl.hpp"
12 #include "../../model/Curve.hpp"
13 #include "../../model/Curve_Impl.hpp"
14 #include "../../utilities/core/Assert.hpp"
15 #include <utilities/idd/Coil_WaterHeating_AirToWaterHeatPump_Wrapped_FieldEnums.hxx>
16 #include <utilities/idd/IddEnums.hxx>
17
18 using namespace openstudio::model;
19 using namespace std;
20
21 namespace openstudio {
22
23 namespace energyplus {
24
25 boost::optional<IdfObject>
26 3 ForwardTranslator::translateCoilWaterHeatingAirToWaterHeatPumpWrapped(CoilWaterHeatingAirToWaterHeatPumpWrapped& modelObject) {
27
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 IdfObject idfObject(IddObjectType::Coil_WaterHeating_AirToWaterHeatPump_Wrapped);
28
1/1
✓ Branch 1 taken 3 times.
3 m_idfObjects.push_back(idfObject);
29
30 // Name
31
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto s = modelObject.name()) {
32
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 idfObject.setName(*s);
33 3 }
34
35 //double ratedHeatingCapacity() const;
36 //double ratedCOP() const;
37 //double ratedSensibleHeatRatio() const;
38 //double ratedEvaporatorInletAirDryBulbTemperature() const;
39 //double ratedEvaporatorInletAirWetBulbTemperature() const;
40 //double ratedCondenserWaterTemperature() const;
41 //boost::optional<double> ratedEvaporatorAirFlowRate() const;
42 //bool isRatedEvaporatorAirFlowRateAutocalculated() const;
43 //bool evaporatorFanPowerIncludedinRatedCOP() const;
44 //double crankcaseHeaterCapacity() const;
45 //double maximumAmbientTemperatureforCrankcaseHeaterOperation() const;
46 //std::string evaporatorAirTemperatureTypeforCurveObjects() const;
47 //Curve heatingCapacityFunctionofTemperatureCurve() const;
48 //Curve heatingCapacityFunctionofAirFlowFractionCurve() const;
49 //Curve heatingCOPFunctionofTemperatureCurve() const;
50 //Curve heatingCOPFunctionofAirFlowFractionCurve() const;
51 //Curve partLoadFractionCorrelationCurve() const;
52
53 //{ Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::Name, "Name", "Name"},
54 //{ Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::RatedHeatingCapacity, "RatedHeatingCapacity", "Rated Heating Capacity"},
55
56 // AvailabilityScheduleName
57 {
58
1/1
✓ Branch 1 taken 3 times.
3 auto schedule = modelObject.availabilitySchedule();
59
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (boost::optional<IdfObject> _schedule = translateAndMapModelObject(schedule)) {
60
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
3 idfObject.setString(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::AvailabilityScheduleName, _schedule->name().get());
61 3 }
62 3 }
63
64 {
65
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.ratedHeatingCapacity();
66
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::RatedHeatingCapacity, value);
67 }
68
69 {
70
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.ratedCOP();
71
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::RatedCOP, value);
72 }
73
74 {
75
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.ratedSensibleHeatRatio();
76
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::RatedSensibleHeatRatio, value);
77 }
78
79 {
80
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.ratedEvaporatorInletAirDryBulbTemperature();
81
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::RatedEvaporatorInletAirDryBulbTemperature, value);
82 }
83
84 {
85
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.ratedEvaporatorInletAirWetBulbTemperature();
86
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::RatedEvaporatorInletAirWetBulbTemperature, value);
87 }
88
89 {
90
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.ratedCondenserWaterTemperature();
91
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::RatedCondenserWaterTemperature, value);
92 }
93
94
2/3
✓ Branch 1 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 3 times.
3 if (modelObject.isRatedEvaporatorAirFlowRateAutocalculated()) {
95 ✗ idfObject.setString(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::RatedEvaporatorAirFlowRate, "Autocalculate");
96
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 } else if (auto value = modelObject.ratedEvaporatorAirFlowRate()) {
97
2/2
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
3 idfObject.setDouble(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::RatedEvaporatorAirFlowRate, value.get());
98 }
99
100 {
101
3/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 1 time.
3 if (modelObject.evaporatorFanPowerIncludedinRatedCOP()) {
102
2/2
✓ Branch 1 taken 2 times.
✓ Branch 4 taken 2 times.
4 idfObject.setString(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::EvaporatorFanPowerIncludedinRatedCOP, "Yes");
103 } else {
104
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 idfObject.setString(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::EvaporatorFanPowerIncludedinRatedCOP, "No");
105 }
106 }
107
108 {
109
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.crankcaseHeaterCapacity();
110
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::CrankcaseHeaterCapacity, value);
111 }
112
113
3/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 1 time.
✓ Branch 4 taken 2 times.
6 if (auto crankCurve_ = modelObject.crankcaseHeaterCapacityFunctionofTemperatureCurve()) {
114
3/4
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
✓ Branch 6 taken 1 time.
✗ Branch 7 not taken.
2 if (auto curve_ = translateAndMapModelObject(*crankCurve_)) {
115
1/1
✓ Branch 1 taken 1 time.
1 idfObject.setString(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::CrankcaseHeaterCapacityFunctionofTemperatureCurveName,
116
2/2
✓ Branch 1 taken 1 time.
✓ Branch 4 taken 1 time.
2 curve_->nameString());
117 1 }
118 3 }
119
120 {
121
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.maximumAmbientTemperatureforCrankcaseHeaterOperation();
122
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setDouble(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::MaximumAmbientTemperatureforCrankcaseHeaterOperation, value);
123 }
124
125 {
126
1/1
✓ Branch 1 taken 3 times.
3 auto value = modelObject.evaporatorAirTemperatureTypeforCurveObjects();
127
1/1
✓ Branch 1 taken 3 times.
3 idfObject.setString(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::EvaporatorAirTemperatureTypeforCurveObjects, value);
128 3 }
129
130 {
131
1/1
✓ Branch 1 taken 3 times.
3 auto curve = modelObject.heatingCapacityFunctionofTemperatureCurve();
132
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto idf = translateAndMapModelObject(curve)) {
133
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
3 idfObject.setString(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::HeatingCapacityFunctionofTemperatureCurveName, idf->name().get());
134 3 }
135 3 }
136
137 {
138
1/1
✓ Branch 1 taken 3 times.
3 auto curve = modelObject.heatingCapacityFunctionofAirFlowFractionCurve();
139
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto idf = translateAndMapModelObject(curve)) {
140
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
3 idfObject.setString(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::HeatingCapacityFunctionofAirFlowFractionCurveName, idf->name().get());
141 3 }
142 3 }
143
144 {
145
1/1
✓ Branch 1 taken 3 times.
3 auto curve = modelObject.heatingCOPFunctionofTemperatureCurve();
146
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto idf = translateAndMapModelObject(curve)) {
147
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
3 idfObject.setString(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::HeatingCOPFunctionofTemperatureCurveName, idf->name().get());
148 3 }
149 3 }
150
151 {
152
1/1
✓ Branch 1 taken 3 times.
3 auto curve = modelObject.heatingCOPFunctionofAirFlowFractionCurve();
153
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto idf = translateAndMapModelObject(curve)) {
154
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
3 idfObject.setString(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::HeatingCOPFunctionofAirFlowFractionCurveName, idf->name().get());
155 3 }
156 3 }
157
158 {
159
1/1
✓ Branch 1 taken 3 times.
3 auto curve = modelObject.partLoadFractionCorrelationCurve();
160
2/3
✓ Branch 1 taken 3 times.
✓ Branch 3 taken 3 times.
✗ Branch 4 not taken.
6 if (auto idf = translateAndMapModelObject(curve)) {
161
4/4
✓ Branch 1 taken 3 times.
✓ Branch 4 taken 3 times.
✓ Branch 7 taken 3 times.
✓ Branch 10 taken 3 times.
3 idfObject.setString(Coil_WaterHeating_AirToWaterHeatPump_WrappedFields::PartLoadFractionCorrelationCurveName, idf->name().get());
162 3 }
163 3 }
164
165
1/1
✓ Branch 1 taken 3 times.
6 return idfObject;
166 3 }
167
168 } // namespace energyplus
169 } // namespace openstudio
170