src/model/HeatPumpAirToWaterCooling.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_HEATPUMPAIRTOWATERCOOLING_HPP | ||
| 7 | #define MODEL_HEATPUMPAIRTOWATERCOOLING_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 HeatPumpAirToWaterCoolingSpeedData; | ||
| 19 | class Schedule; | ||
| 20 | |||
| 21 | namespace detail { | ||
| 22 | |||
| 23 | class HeatPumpAirToWaterCooling_Impl; | ||
| 24 | |||
| 25 | } // namespace detail | ||
| 26 | |||
| 27 | /** HeatPumpAirToWaterCooling is a StraightComponent that wraps the OpenStudio IDD object 'OS:HeatPump:AirToWater:Cooling'. */ | ||
| 28 | class MODEL_API HeatPumpAirToWaterCooling : public StraightComponent | ||
| 29 | { | ||
| 30 | public: | ||
| 31 | /** @name Constructors and Destructors */ | ||
| 32 | //@{ | ||
| 33 | |||
| 34 | explicit HeatPumpAirToWaterCooling(const Model& model); | ||
| 35 | |||
| 36 | 187 | virtual ~HeatPumpAirToWaterCooling() = default; | |
| 37 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 38 | 11 | HeatPumpAirToWaterCooling(const HeatPumpAirToWaterCooling& other) = default; | |
| 39 | 87 | HeatPumpAirToWaterCooling(HeatPumpAirToWaterCooling&& other) = default; | |
| 40 | ✗ | HeatPumpAirToWaterCooling& operator=(const HeatPumpAirToWaterCooling&) = default; | |
| 41 | ✗ | HeatPumpAirToWaterCooling& operator=(HeatPumpAirToWaterCooling&&) = 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<HeatPumpAirToWaterCoolingSpeedData> 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 HeatPumpAirToWaterCoolingSpeedData& boosterModeOnSpeed); | ||
| 111 | |||
| 112 | void resetBoosterModeOnSpeed(); | ||
| 113 | |||
| 114 | //@} | ||
| 115 | /** @name Other */ | ||
| 116 | //@{ | ||
| 117 | |||
| 118 | /** Return the performance data for each stage. **/ | ||
| 119 | std::vector<HeatPumpAirToWaterCoolingSpeedData> speeds() const; | ||
| 120 | |||
| 121 | unsigned numberOfSpeeds() const; | ||
| 122 | |||
| 123 | /* | ||
| 124 | * Get the index of a given HeatPumpAirToWaterCoolingSpeedData (1-indexed) | ||
| 125 | */ | ||
| 126 | boost::optional<unsigned> speedIndex(const HeatPumpAirToWaterCoolingSpeedData& speed) const; | ||
| 127 | |||
| 128 | /* | ||
| 129 | * Add a new speed after all of the existing speeds. | ||
| 130 | */ | ||
| 131 | bool addSpeed(const HeatPumpAirToWaterCoolingSpeedData& speed); | ||
| 132 | |||
| 133 | /* | ||
| 134 | * Add a new HeatPumpAirToWaterCoolingSpeedData to the list which a given index (1 to x). | ||
| 135 | * Internally calls addSpeed then setSpeedIndex, see remarks there | ||
| 136 | */ | ||
| 137 | bool addSpeed(const HeatPumpAirToWaterCoolingSpeedData& speed, unsigned index); | ||
| 138 | |||
| 139 | /* | ||
| 140 | * You can shuffle the priority of a given HeatPumpAirToWaterCoolingSpeedData 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 HeatPumpAirToWaterCoolingSpeedData& speed, unsigned index); | ||
| 145 | |||
| 146 | /* | ||
| 147 | * Set all speeds using a list of HeatPumpAirToWaterCoolingSpeedDatas | ||
| 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<HeatPumpAirToWaterCoolingSpeedData>& speeds); | ||
| 153 | |||
| 154 | /* | ||
| 155 | * Removes all HeatPumpAirToWaterCoolingSpeedDatas in this object | ||
| 156 | */ | ||
| 157 | void removeAllSpeeds(); | ||
| 158 | |||
| 159 | /* | ||
| 160 | * Remove the given HeatPumpAirToWaterCoolingSpeedData from this object's speeds | ||
| 161 | */ | ||
| 162 | bool removeSpeed(const HeatPumpAirToWaterCoolingSpeedData& speed); | ||
| 163 | |||
| 164 | /* | ||
| 165 | * Remove the HeatPumpAirToWaterCoolingSpeedData at the given index (1-indexed) | ||
| 166 | */ | ||
| 167 | bool removeSpeed(unsigned index); | ||
| 168 | |||
| 169 | // Convenience function to return the HeatPumpAirToWater object that reference this cooling 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> autosizedRatedCoolingCapacity() const; // Convenience method | ||
| 176 | |||
| 177 | //@} | ||
| 178 | protected: | ||
| 179 | /// @cond | ||
| 180 | using ImplType = detail::HeatPumpAirToWaterCooling_Impl; | ||
| 181 | |||
| 182 | explicit HeatPumpAirToWaterCooling(std::shared_ptr<detail::HeatPumpAirToWaterCooling_Impl> impl); | ||
| 183 | |||
| 184 | friend class detail::HeatPumpAirToWaterCooling_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.HeatPumpAirToWaterCooling"); | ||
| 191 | }; | ||
| 192 | |||
| 193 | /** \relates HeatPumpAirToWaterCooling*/ | ||
| 194 | using OptionalHeatPumpAirToWaterCooling = boost::optional<HeatPumpAirToWaterCooling>; | ||
| 195 | |||
| 196 | /** \relates HeatPumpAirToWaterCooling*/ | ||
| 197 | using HeatPumpAirToWaterCoolingVector = std::vector<HeatPumpAirToWaterCooling>; | ||
| 198 | |||
| 199 | } // namespace model | ||
| 200 | } // namespace openstudio | ||
| 201 | |||
| 202 | #endif // MODEL_HEATPUMPAIRTOWATERCOOLING_HPP | ||
| 203 |