GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 60.0% 3 / 0 / 5
Functions: 60.0% 3 / 0 / 5
Branches: -% 0 / 0 / 0

src/model/HeatPumpAirToWaterHeating.hpp
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 #ifndef MODEL_HEATPUMPAIRTOWATERHEATING_HPP
7 #define MODEL_HEATPUMPAIRTOWATERHEATING_HPP
8
9 #include "ModelAPI.hpp"
10 #include "StraightComponent.hpp"
11
12 namespace openstudio {
13
14 namespace model {
15
16 class Curve;
17 class HeatPumpAirToWater;
18 class HeatPumpAirToWaterHeatingSpeedData;
19 class Schedule;
20
21 namespace detail {
22
23 class HeatPumpAirToWaterHeating_Impl;
24
25 } // namespace detail
26
27 /** HeatPumpAirToWaterHeating is a StraightComponent that wraps the OpenStudio IDD object 'OS:HeatPump:AirToWater:Heating'. */
28 class MODEL_API HeatPumpAirToWaterHeating : public StraightComponent
29 {
30 public:
31 /** @name Constructors and Destructors */
32 //@{
33
34 explicit HeatPumpAirToWaterHeating(const Model& model);
35
36 196 virtual ~HeatPumpAirToWaterHeating() = default;
37 // Default the copy and move operators because the virtual dtor is explicit
38 11 HeatPumpAirToWaterHeating(const HeatPumpAirToWaterHeating& other) = default;
39 92 HeatPumpAirToWaterHeating(HeatPumpAirToWaterHeating&& other) = default;
40 ✗ HeatPumpAirToWaterHeating& operator=(const HeatPumpAirToWaterHeating&) = default;
41 ✗ HeatPumpAirToWaterHeating& operator=(HeatPumpAirToWaterHeating&&) = default;
42
43 //@}
44
45 static IddObjectType iddObjectType();
46
47 static constexpr unsigned maximum_number_of_speeds = 5;
48
49 /** @name Getters */
50 //@{
51
52 Schedule availabilitySchedule() const;
53
54 double ratedInletAirTemperature() const;
55
56 boost::optional<double> ratedAirFlowRate() const;
57
58 bool isRatedAirFlowRateAutosized() const;
59
60 double ratedLeavingWaterTemperature() const;
61
62 boost::optional<double> ratedWaterFlowRate() const;
63
64 bool isRatedWaterFlowRateAutosized() const;
65
66 double minimumOutdoorAirTemperature() const;
67
68 double maximumOutdoorAirTemperature() const;
69
70 boost::optional<Curve> minimumLeavingWaterTemperatureCurve() const;
71
72 boost::optional<Curve> maximumLeavingWaterTemperatureCurve() const;
73
74 double sizingFactor() const;
75
76 boost::optional<HeatPumpAirToWaterHeatingSpeedData> boosterModeOnSpeed() const;
77
78 //@}
79 /** @name Setters */
80 //@{
81
82 bool setAvailabilitySchedule(Schedule& availabilitySchedule);
83
84 bool setRatedInletAirTemperature(double ratedInletAirTemperature);
85
86 bool setRatedAirFlowRate(double ratedAirFlowRate);
87
88 void autosizeRatedAirFlowRate();
89
90 bool setRatedLeavingWaterTemperature(double ratedLeavingWaterTemperature);
91
92 bool setRatedWaterFlowRate(double ratedWaterFlowRate);
93
94 void autosizeRatedWaterFlowRate();
95
96 bool setMinimumOutdoorAirTemperature(double minimumOutdoorAirTemperature);
97
98 bool setMaximumOutdoorAirTemperature(double maximumOutdoorAirTemperature);
99
100 bool setMinimumLeavingWaterTemperatureCurve(const Curve& minimumLeavingWaterTemperatureCurve);
101
102 void resetMinimumLeavingWaterTemperatureCurve();
103
104 bool setMaximumLeavingWaterTemperatureCurve(const Curve& maximumLeavingWaterTemperatureCurve);
105
106 void resetMaximumLeavingWaterTemperatureCurve();
107
108 bool setSizingFactor(double sizingFactor);
109
110 bool setBoosterModeOnSpeed(const HeatPumpAirToWaterHeatingSpeedData& boosterModeOnSpeed);
111
112 void resetBoosterModeOnSpeed();
113
114 //@}
115 /** @name Other */
116 //@{
117
118 /** Return the performance data for each stage. **/
119 std::vector<HeatPumpAirToWaterHeatingSpeedData> speeds() const;
120
121 unsigned numberOfSpeeds() const;
122
123 /*
124 * Get the index of a given HeatPumpAirToWaterHeatingSpeedData (1-indexed)
125 */
126 boost::optional<unsigned> speedIndex(const HeatPumpAirToWaterHeatingSpeedData& speed) const;
127
128 /*
129 * Add a new speed after all of the existing speeds.
130 */
131 bool addSpeed(const HeatPumpAirToWaterHeatingSpeedData& speed);
132
133 /*
134 * Add a new HeatPumpAirToWaterHeatingSpeedData to the list which a given index (1 to x).
135 * Internally calls addSpeed then setSpeedIndex, see remarks there
136 */
137 bool addSpeed(const HeatPumpAirToWaterHeatingSpeedData& speed, unsigned index);
138
139 /*
140 * You can shuffle the priority of a given HeatPumpAirToWaterHeatingSpeedData after having added it
141 * If index is below 1, it's reset to 1.
142 * If index is greater than the number of speeds, will reset to last
143 */
144 bool setSpeedIndex(const HeatPumpAirToWaterHeatingSpeedData& speed, unsigned index);
145
146 /*
147 * Set all speeds using a list of HeatPumpAirToWaterHeatingSpeedDatas
148 * Internally calls addSpeed, and will return the global status, but will continue trying if there are problems
149 * (eg: if you make a vector larger than the number of accepted speeds, or a vector that has a speed from another model, the valid speeds will be
150 * added indeed, but it'll eventually return false)
151 */
152 bool setSpeeds(const std::vector<HeatPumpAirToWaterHeatingSpeedData>& speeds);
153
154 /*
155 * Removes all HeatPumpAirToWaterHeatingSpeedDatas in this object
156 */
157 void removeAllSpeeds();
158
159 /*
160 * Remove the given HeatPumpAirToWaterHeatingSpeedData from this object's speeds
161 */
162 bool removeSpeed(const HeatPumpAirToWaterHeatingSpeedData& speed);
163
164 /*
165 * Remove the HeatPumpAirToWaterHeatingSpeedData at the given index (1-indexed)
166 */
167 bool removeSpeed(unsigned index);
168
169 // Convenience function to return the HeatPumpAirToWater object that reference this heating coil if any
170 boost::optional<HeatPumpAirToWater> heatPumpAirToWater() const;
171
172 // Autosize methods
173 boost::optional<double> autosizedRatedAirFlowRate() const;
174 boost::optional<double> autosizedRatedWaterFlowRate() const;
175 boost::optional<double> autosizedRatedHeatingCapacity() const; // Convenience method
176
177 //@}
178 protected:
179 /// @cond
180 using ImplType = detail::HeatPumpAirToWaterHeating_Impl;
181
182 explicit HeatPumpAirToWaterHeating(std::shared_ptr<detail::HeatPumpAirToWaterHeating_Impl> impl);
183
184 friend class detail::HeatPumpAirToWaterHeating_Impl;
185 friend class Model;
186 friend class IdfObject;
187 friend class openstudio::detail::IdfObject_Impl;
188 /// @endcond
189 private:
190 REGISTER_LOGGER("openstudio.model.HeatPumpAirToWaterHeating");
191 };
192
193 /** \relates HeatPumpAirToWaterHeating*/
194 using OptionalHeatPumpAirToWaterHeating = boost::optional<HeatPumpAirToWaterHeating>;
195
196 /** \relates HeatPumpAirToWaterHeating*/
197 using HeatPumpAirToWaterHeatingVector = std::vector<HeatPumpAirToWaterHeating>;
198
199 } // namespace model
200 } // namespace openstudio
201
202 #endif // MODEL_HEATPUMPAIRTOWATERHEATING_HPP
203