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

Method setReturnPlenum

src/model/ThermalZone.cpp:2389–2432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2387 }
2388
2389 bool ThermalZone_Impl::setReturnPlenum(const ThermalZone& plenumZone, AirLoopHVAC& airLoop) {
2390 bool result = true;
2391
2392 if (!plenumZone.canBePlenum()) {
2393 result = false;
2394 }
2395
2396 boost::optional<AirLoopHVACReturnPlenum> plenum;
2397
2398 if (result) {
2399 plenum = plenumZone.getImpl<ThermalZone_Impl>()->airLoopHVACReturnPlenum();
2400 boost::optional<AirLoopHVAC> plenumAirLoop;
2401
2402 if (plenum) {
2403 plenumAirLoop = plenum->airLoopHVAC();
2404 }
2405
2406 if (plenumAirLoop) {
2407 if (plenumAirLoop.get() != airLoop) {
2408 result = false;
2409 }
2410 }
2411 }
2412
2413 Model t_model = model();
2414
2415 if (result) {
2416 if (!plenum) {
2417 plenum = AirLoopHVACReturnPlenum(t_model);
2418 plenum->setThermalZone(plenumZone);
2419 }
2420 }
2421
2422 if (result) {
2423 removeReturnPlenum(airLoop);
2424
2425 auto node = airLoop.demandComponents(getObject<ThermalZone>(), airLoop.zoneMixer(), Node::iddObjectType()).front().cast<Node>();
2426
2427 OS_ASSERT(plenum);
2428 result = plenum->addToNode(node);
2429 }
2430
2431 return result;
2432 }
2433
2434 bool ThermalZone_Impl::setReturnPlenum(const ThermalZone& plenumZone) {
2435 auto loop = airLoopHVAC();

Callers 7

translateThermalZoneMethod · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45

Calls 10

canBePlenumMethod · 0.80
demandComponentsMethod · 0.80
zoneMixerMethod · 0.80
iddObjectTypeFunction · 0.70
airLoopHVACMethod · 0.45
getMethod · 0.45
setThermalZoneMethod · 0.45
addToNodeMethod · 0.45

Tested by 6

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