MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / addToNode

Method addToNode

src/model/CentralHeatPumpSystem.cpp:145–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143 }
144
145 bool CentralHeatPumpSystem_Impl::addToNode(Node& node) {
146 boost::optional<PlantLoop> t_plantLoop = node.plantLoop();
147
148 // If trying to add to a node that is on the supply side of a plant loop
149 if (t_plantLoop) {
150 if (t_plantLoop->supplyComponent(node.handle())) {
151 // If there is already a cooling Plant Loop
152 boost::optional<PlantLoop> coolingPlant = this->coolingPlantLoop();
153 if (coolingPlant) {
154 // And it's not the same as the node's loop
155 if (t_plantLoop.get() != coolingPlant.get()) {
156 // And if there is no heatingPlantLoop (tertiary)
157 boost::optional<PlantLoop> heatingPlant = this->heatingPlantLoop();
158 if (!heatingPlant) {
159 // Then try to add it to the tertiary one
160 LOG(Warn, "Calling addToTertiaryNode to connect it to the tertiary (=heating) loop for " << briefDescription());
161 return this->addToTertiaryNode(node);
162 }
163 }
164 }
165 }
166 }
167
168 // All other cases, call the base class implementation
169 return WaterToWaterComponent_Impl::addToNode(node);
170 }
171
172 bool CentralHeatPumpSystem_Impl::addToTertiaryNode(Node& node) {
173 auto _model = node.model();

Callers

nothing calls this directly

Calls 7

coolingPlantLoopMethod · 0.95
heatingPlantLoopMethod · 0.95
addToTertiaryNodeMethod · 0.95
supplyComponentMethod · 0.80
plantLoopMethod · 0.45
handleMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected