src/model/WaterToAirComponent.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_WATERTOAIRCOMPONENT_HPP | ||
| 7 | #define MODEL_WATERTOAIRCOMPONENT_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "HVACComponent.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | |||
| 14 | namespace model { | ||
| 15 | |||
| 16 | namespace detail { | ||
| 17 | class WaterToAirComponent_Impl; | ||
| 18 | } | ||
| 19 | |||
| 20 | class AirLoopHVAC; | ||
| 21 | |||
| 22 | class PlantLoop; | ||
| 23 | |||
| 24 | /** WaterToAirComponent is the base class for model objects which interact with | ||
| 25 | * an air stream and a water stream. | ||
| 26 | * | ||
| 27 | * These objects are typically water coils such as the EnergyPlus IDD objects | ||
| 28 | * named Coil:Heating:Water and Coil:Cooling:Water. | ||
| 29 | */ | ||
| 30 | class MODEL_API WaterToAirComponent : public HVACComponent | ||
| 31 | { | ||
| 32 | public: | ||
| 33 | 1528 | virtual ~WaterToAirComponent() override = default; | |
| 34 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 35 | 51 | WaterToAirComponent(const WaterToAirComponent& other) = default; | |
| 36 | 584 | WaterToAirComponent(WaterToAirComponent&& other) = default; | |
| 37 | ✗ | WaterToAirComponent& operator=(const WaterToAirComponent&) = default; | |
| 38 | ✗ | WaterToAirComponent& operator=(WaterToAirComponent&&) = default; | |
| 39 | |||
| 40 | /** Returns the air inlet port. **/ | ||
| 41 | virtual unsigned airInletPort() const; | ||
| 42 | |||
| 43 | /** Returns the air outlet port. **/ | ||
| 44 | virtual unsigned airOutletPort() const; | ||
| 45 | |||
| 46 | /** Returns the optional ModelObject connected to the air inlet port. **/ | ||
| 47 | virtual boost::optional<ModelObject> airInletModelObject() const; | ||
| 48 | |||
| 49 | /** Returns the optional ModelObject connected to the air outlet port. **/ | ||
| 50 | virtual boost::optional<ModelObject> airOutletModelObject() const; | ||
| 51 | |||
| 52 | /** Returns the water inlet port. **/ | ||
| 53 | virtual unsigned waterInletPort() const; | ||
| 54 | |||
| 55 | /** Returns the water outlet port. **/ | ||
| 56 | virtual unsigned waterOutletPort() const; | ||
| 57 | |||
| 58 | /** Returns the optional ModelObject connected to the water inlet port. **/ | ||
| 59 | virtual boost::optional<ModelObject> waterInletModelObject() const; | ||
| 60 | |||
| 61 | /** Returns the optional ModelObject connected to the water outlet port. **/ | ||
| 62 | virtual boost::optional<ModelObject> waterOutletModelObject() const; | ||
| 63 | |||
| 64 | virtual boost::optional<AirLoopHVAC> airLoopHVAC() const; | ||
| 65 | |||
| 66 | virtual boost::optional<PlantLoop> plantLoop() const; | ||
| 67 | |||
| 68 | virtual bool addToNode(Node& node); | ||
| 69 | |||
| 70 | virtual bool addToSplitter(Splitter& splitter); | ||
| 71 | |||
| 72 | virtual std::vector<openstudio::IdfObject> remove(); | ||
| 73 | |||
| 74 | virtual ModelObject clone(Model model) const; | ||
| 75 | |||
| 76 | void disconnectWaterSide(); | ||
| 77 | |||
| 78 | void disconnectAirSide(); | ||
| 79 | |||
| 80 | /** Removes the component from the airLoopHVAC if one is attached. | ||
| 81 | * Repairs the airLoopHVAC connections preserving the integrity of the loop. | ||
| 82 | * Does not remove the component from the model | ||
| 83 | */ | ||
| 84 | bool removeFromAirLoopHVAC(); | ||
| 85 | |||
| 86 | /** Removes the component from the plantLoop if one is attached. | ||
| 87 | * Repairs the plantLoop connections preserving the integrity of the loop. | ||
| 88 | * Does not remove the component from the model | ||
| 89 | */ | ||
| 90 | bool removeFromPlantLoop(); | ||
| 91 | |||
| 92 | protected: | ||
| 93 | friend class Model; | ||
| 94 | |||
| 95 | friend class openstudio::IdfObject; | ||
| 96 | |||
| 97 | /// @cond | ||
| 98 | |||
| 99 | using ImplType = detail::WaterToAirComponent_Impl; | ||
| 100 | |||
| 101 | explicit WaterToAirComponent(std::shared_ptr<detail::WaterToAirComponent_Impl> impl); | ||
| 102 | |||
| 103 | WaterToAirComponent(IddObjectType type, const Model& model); | ||
| 104 | |||
| 105 | private: | ||
| 106 | REGISTER_LOGGER("openstudio.model.WaterToAirComponent"); | ||
| 107 | |||
| 108 | /// @endcond | ||
| 109 | }; | ||
| 110 | |||
| 111 | using OptionalWaterToAirComponent = boost::optional<WaterToAirComponent>; | ||
| 112 | |||
| 113 | } // namespace model | ||
| 114 | |||
| 115 | } // namespace openstudio | ||
| 116 | |||
| 117 | #endif // MODEL_WATERTOAIRCOMPONENT_HPP | ||
| 118 |