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

Method tertiaryPlantLoop

src/model/WaterToWaterComponent.cpp:290–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288 }
289
290 boost::optional<PlantLoop> WaterToWaterComponent_Impl::tertiaryPlantLoop() const {
291 if (m_tertiaryPlantLoop) {
292 return m_tertiaryPlantLoop;
293 } else {
294 boost::optional<HVACComponent> tertiaryOutletHVACComponent;
295
296 if (auto t_tertiaryOutletModelObject = tertiaryOutletModelObject()) {
297 tertiaryOutletHVACComponent = t_tertiaryOutletModelObject->optionalCast<HVACComponent>();
298 }
299
300 if (tertiaryOutletHVACComponent) {
301 auto plantLoops = this->model().getConcreteModelObjects<PlantLoop>();
302
303 // WaterToWaterComponent instances can be connected to tertiary plants
304 // from the demand or supply side so check for both possibilities
305 for (const auto& plantLoop : plantLoops) {
306 if (!plantLoop.supplyComponents(plantLoop.supplyInletNode(), tertiaryOutletHVACComponent.get()).empty()) {
307 m_tertiaryPlantLoop = plantLoop;
308 return plantLoop;
309 }
310 }
311
312 for (const auto& plantLoop : plantLoops) {
313 if (!plantLoop.demandComponents(plantLoop.demandInletNode(), tertiaryOutletHVACComponent.get()).empty()) {
314 m_tertiaryPlantLoop = plantLoop;
315 return plantLoop;
316 }
317 }
318 }
319 }
320
321 return boost::none;
322 }
323
324 bool WaterToWaterComponent_Impl::removeFromTertiaryPlantLoop() {
325 if (auto plant = tertiaryPlantLoop()) {

Callers 8

plantLoopMethod · 0.95
secondaryPlantLoopMethod · 0.95
translateChillerMethod · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45

Calls 7

supplyComponentsMethod · 0.80
demandComponentsMethod · 0.80
modelMethod · 0.45
emptyMethod · 0.45
supplyInletNodeMethod · 0.45
getMethod · 0.45
demandInletNodeMethod · 0.45

Tested by 5

TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36