src/model/PlantLoop_Impl.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_PLANTLOOP_IMPL_HPP | ||
| 7 | #define MODEL_PLANTLOOP_IMPL_HPP | ||
| 8 | |||
| 9 | #include "Loop_Impl.hpp" | ||
| 10 | |||
| 11 | namespace openstudio { | ||
| 12 | |||
| 13 | namespace model { | ||
| 14 | |||
| 15 | class Node; | ||
| 16 | class HVACComponent; | ||
| 17 | class Mixer; | ||
| 18 | class Splitter; | ||
| 19 | class SizingPlant; | ||
| 20 | class PlantEquipmentOperationScheme; | ||
| 21 | class PlantEquipmentOperationHeatingLoad; | ||
| 22 | class PlantEquipmentOperationCoolingLoad; | ||
| 23 | class AvailabilityManager; | ||
| 24 | class AvailabilityManagerAssignmentList; | ||
| 25 | |||
| 26 | namespace detail { | ||
| 27 | |||
| 28 | class Model_Impl; | ||
| 29 | |||
| 30 | class MODEL_API PlantLoop_Impl : public Loop_Impl | ||
| 31 | { | ||
| 32 | public: | ||
| 33 | PlantLoop_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle); | ||
| 34 | |||
| 35 | PlantLoop_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 36 | |||
| 37 | PlantLoop_Impl(const PlantLoop_Impl& other, Model_Impl* model, bool keepHandle); | ||
| 38 | |||
| 39 | 818 | virtual ~PlantLoop_Impl() override = default; | |
| 40 | |||
| 41 | //@} | ||
| 42 | /** @name Virtual Methods */ | ||
| 43 | //@{ | ||
| 44 | |||
| 45 | virtual const std::vector<std::string>& outputVariableNames() const override; | ||
| 46 | |||
| 47 | virtual IddObjectType iddObjectType() const override; | ||
| 48 | |||
| 49 | /** | ||
| 50 | * This method creates the basic, barebone, PlantLoop topology: | ||
| 51 | * - Supply inlet & oulet nodes, | ||
| 52 | * - Supply splitter & mixer, | ||
| 53 | * - A Suply branch with a node (Connector Node) | ||
| 54 | * - Demand inlet & outlet nodes, | ||
| 55 | * - Demand splitter & mixer, | ||
| 56 | * - A Demand branch with a node (Branch Node) | ||
| 57 | */ | ||
| 58 | virtual void createTopology() override; | ||
| 59 | |||
| 60 | std::string loadDistributionScheme(); | ||
| 61 | |||
| 62 | bool setLoadDistributionScheme(const std::string& scheme); | ||
| 63 | |||
| 64 | std::string fluidType(); | ||
| 65 | |||
| 66 | bool setFluidType(const std::string& value); | ||
| 67 | |||
| 68 | bool setGlycolConcentration(int glycolConcentration); | ||
| 69 | |||
| 70 | int glycolConcentration() const; | ||
| 71 | |||
| 72 | double maximumLoopTemperature(); | ||
| 73 | |||
| 74 | bool setMaximumLoopTemperature(double value); | ||
| 75 | |||
| 76 | double minimumLoopTemperature(); | ||
| 77 | |||
| 78 | bool setMinimumLoopTemperature(double value); | ||
| 79 | |||
| 80 | boost::optional<double> maximumLoopFlowRate(); | ||
| 81 | |||
| 82 | bool setMaximumLoopFlowRate(double value); | ||
| 83 | |||
| 84 | bool isMaximumLoopFlowRateAutosized(); | ||
| 85 | |||
| 86 | void autosizeMaximumLoopFlowRate(); | ||
| 87 | |||
| 88 | boost::optional<double> minimumLoopFlowRate(); | ||
| 89 | |||
| 90 | bool setMinimumLoopFlowRate(double value); | ||
| 91 | |||
| 92 | bool isMinimumLoopFlowRateAutosized(); | ||
| 93 | |||
| 94 | void autosizeMinimumLoopFlowRate(); | ||
| 95 | |||
| 96 | boost::optional<double> plantLoopVolume(); | ||
| 97 | |||
| 98 | bool setPlantLoopVolume(double value); | ||
| 99 | |||
| 100 | bool isPlantLoopVolumeAutocalculated(); | ||
| 101 | |||
| 102 | void autocalculatePlantLoopVolume(); | ||
| 103 | |||
| 104 | std::string commonPipeSimulation() const; | ||
| 105 | |||
| 106 | bool isCommonPipeSimulationDefaulted() const; | ||
| 107 | |||
| 108 | bool setCommonPipeSimulation(const std::string& value); | ||
| 109 | |||
| 110 | void resetCommonPipeSimulation(); | ||
| 111 | |||
| 112 | boost::optional<PlantEquipmentOperationHeatingLoad> plantEquipmentOperationHeatingLoad() const; | ||
| 113 | |||
| 114 | bool setPlantEquipmentOperationHeatingLoad(const boost::optional<PlantEquipmentOperationHeatingLoad>& plantOperation); | ||
| 115 | |||
| 116 | void resetPlantEquipmentOperationHeatingLoad(); | ||
| 117 | |||
| 118 | boost::optional<PlantEquipmentOperationCoolingLoad> plantEquipmentOperationCoolingLoad() const; | ||
| 119 | |||
| 120 | bool setPlantEquipmentOperationCoolingLoad(const boost::optional<PlantEquipmentOperationCoolingLoad>& plantOperation); | ||
| 121 | |||
| 122 | void resetPlantEquipmentOperationCoolingLoad(); | ||
| 123 | |||
| 124 | boost::optional<PlantEquipmentOperationScheme> primaryPlantEquipmentOperationScheme() const; | ||
| 125 | |||
| 126 | bool setPrimaryPlantEquipmentOperationScheme(const boost::optional<PlantEquipmentOperationScheme>& plantOperation); | ||
| 127 | |||
| 128 | void resetPrimaryPlantEquipmentOperationScheme(); | ||
| 129 | |||
| 130 | bool setPlantEquipmentOperationHeatingLoadSchedule(Schedule&); | ||
| 131 | |||
| 132 | void resetPlantEquipmentOperationHeatingLoadSchedule(); | ||
| 133 | |||
| 134 | boost::optional<Schedule> plantEquipmentOperationHeatingLoadSchedule() const; | ||
| 135 | |||
| 136 | bool setPlantEquipmentOperationCoolingLoadSchedule(Schedule&); | ||
| 137 | |||
| 138 | boost::optional<Schedule> plantEquipmentOperationCoolingLoadSchedule() const; | ||
| 139 | |||
| 140 | void resetPlantEquipmentOperationCoolingLoadSchedule(); | ||
| 141 | |||
| 142 | bool setPrimaryPlantEquipmentOperationSchemeSchedule(Schedule&); | ||
| 143 | |||
| 144 | void resetPrimaryPlantEquipmentOperationSchemeSchedule(); | ||
| 145 | |||
| 146 | boost::optional<Schedule> primaryPlantEquipmentOperationSchemeSchedule() const; | ||
| 147 | |||
| 148 | bool setComponentSetpointOperationSchemeSchedule(Schedule&); | ||
| 149 | |||
| 150 | boost::optional<Schedule> componentSetpointOperationSchemeSchedule() const; | ||
| 151 | |||
| 152 | void resetComponentSetpointOperationSchemeSchedule(); | ||
| 153 | |||
| 154 | virtual std::vector<openstudio::IdfObject> remove() override; | ||
| 155 | |||
| 156 | /** | ||
| 157 | * This method will clone a Plant Loop with the following rationale: | ||
| 158 | * - Handle all non-branch components from both the supply and the demand side | ||
| 159 | * - Handle branch components on the supply side (between supply splitter and mixer) | ||
| 160 | * - Clone any SetpointManagers and add them to the correct location | ||
| 161 | * - If the component that is cloned is connected to another PlantLoop, we try to connect the clone | ||
| 162 | * to the same other PlantLoop (if comp is on the supply side, we add a demand branch to the other plantloop) | ||
| 163 | */ | ||
| 164 | virtual ModelObject clone(Model model) const override; | ||
| 165 | |||
| 166 | unsigned supplyInletPort() const; | ||
| 167 | |||
| 168 | unsigned supplyOutletPort() const; | ||
| 169 | |||
| 170 | unsigned demandInletPort() const; | ||
| 171 | |||
| 172 | unsigned demandOutletPort() const; | ||
| 173 | |||
| 174 | virtual Node supplyInletNode() const override; | ||
| 175 | |||
| 176 | virtual Node supplyOutletNode() const override; | ||
| 177 | |||
| 178 | virtual std::vector<Node> supplyOutletNodes() const override; | ||
| 179 | |||
| 180 | virtual Node demandInletNode() const override; | ||
| 181 | |||
| 182 | virtual std::vector<Node> demandInletNodes() const override; | ||
| 183 | |||
| 184 | virtual Node demandOutletNode() const override; | ||
| 185 | |||
| 186 | Mixer supplyMixer() const; | ||
| 187 | |||
| 188 | bool setSupplyMixer(Mixer const& mixer); | ||
| 189 | |||
| 190 | Splitter supplySplitter() const; | ||
| 191 | |||
| 192 | bool setSupplySplitter(Splitter const& splitter); | ||
| 193 | |||
| 194 | virtual Mixer demandMixer() const override; | ||
| 195 | |||
| 196 | bool setDemandMixer(Mixer const& mixer); | ||
| 197 | |||
| 198 | virtual Splitter demandSplitter() const override; | ||
| 199 | |||
| 200 | bool setDemandSplitter(Splitter const& splitter); | ||
| 201 | |||
| 202 | bool addSupplyBranchForComponent(HVACComponent component); | ||
| 203 | |||
| 204 | bool removeSupplyBranchWithComponent(HVACComponent hvacComponent); | ||
| 205 | |||
| 206 | bool addDemandBranchForComponent(HVACComponent component, bool tertiary = false); | ||
| 207 | |||
| 208 | bool removeDemandBranchWithComponent(HVACComponent hvacComponent); | ||
| 209 | |||
| 210 | Node loopTemperatureSetpointNode(); | ||
| 211 | |||
| 212 | bool setLoopTemperatureSetpointNode(Node& node); | ||
| 213 | |||
| 214 | std::vector<ModelObject> children() const override; | ||
| 215 | |||
| 216 | SizingPlant sizingPlant() const; | ||
| 217 | |||
| 218 | boost::optional<double> autosizedMaximumLoopFlowRate() const; | ||
| 219 | |||
| 220 | boost::optional<double> autosizedPlantLoopVolume() const; | ||
| 221 | |||
| 222 | virtual void autosize() override; | ||
| 223 | |||
| 224 | virtual void applySizingValues() override; | ||
| 225 | |||
| 226 | virtual std::vector<EMSActuatorNames> emsActuatorNames() const override; | ||
| 227 | |||
| 228 | virtual std::vector<std::string> emsInternalVariableNames() const override; | ||
| 229 | |||
| 230 | // AVM | ||
| 231 | // Impl_only | ||
| 232 | virtual AvailabilityManagerAssignmentList availabilityManagerAssignmentList() const override; | ||
| 233 | |||
| 234 | std::vector<AvailabilityManager> availabilityManagers() const; | ||
| 235 | bool setAvailabilityManagers(const std::vector<AvailabilityManager>& avms); | ||
| 236 | void resetAvailabilityManagers(); | ||
| 237 | |||
| 238 | bool addAvailabilityManager(const AvailabilityManager& availabilityManager); | ||
| 239 | bool addAvailabilityManager(const AvailabilityManager& availabilityManager, unsigned priority); | ||
| 240 | |||
| 241 | unsigned availabilityManagerPriority(const AvailabilityManager& availabilityManager) const; | ||
| 242 | bool setAvailabilityManagerPriority(const AvailabilityManager& availabilityManager, unsigned priority); | ||
| 243 | |||
| 244 | bool removeAvailabilityManager(const AvailabilityManager& avm); | ||
| 245 | bool removeAvailabilityManager(unsigned priority); | ||
| 246 | |||
| 247 | private: | ||
| 248 | bool isDemandBranchEmpty(); | ||
| 249 | |||
| 250 | bool removeBranchWithComponent(HVACComponent component, Splitter splitter, Mixer mixer, bool isSupplyComponent); | ||
| 251 | |||
| 252 | − | REGISTER_LOGGER("openstudio.model.PlantLoop"); | |
| 253 | }; | ||
| 254 | |||
| 255 | } // namespace detail | ||
| 256 | |||
| 257 | } // namespace model | ||
| 258 | |||
| 259 | } // namespace openstudio | ||
| 260 | |||
| 261 | #endif // MODEL_PLANTLOOP_IMPL_HPP | ||
| 262 |