bool ZoneHVACComponent_Impl::addToThermalZone(ThermalZone & thermalZone) { Model m = this->model(); if( thermalZone.model() != m ) { return false; } if( thermalZone.isPlenum() ) { return false; } removeFromThermalZone(); thermalZone.setUseIdealAirLoads(false); // Connect nodes if this is an air based zone hvac component if( inletPort() != 0u && outletPort() != 0u ) { // Exhaust Node Node exhaustNode(m); PortList exhaustPortList = thermalZone.exhaustPortList(); unsigned nextPort = exhaustPortList.nextPort(); m.connect(exhaustPortList,nextPort,exhaustNode,exhaustNode.inletPort()); ModelObject mo = this->getObject<ModelObject>(); m.connect(exhaustNode,exhaustNode.outletPort(),mo,this->inletPort()); // Air Inlet Node Node airInletNode(m); PortList inletPortList = thermalZone.inletPortList(); unsigned nextInletPort = inletPortList.nextPort(); m.connect(airInletNode,airInletNode.outletPort(),inletPortList,nextInletPort); m.connect(mo,this->outletPort(),airInletNode,airInletNode.inletPort()); } thermalZone.addEquipment(this->getObject<ZoneHVACComponent>()); return true; }
bool ZoneHVACComponent_Impl::addToNode(Node & node) { bool result = false; boost::optional<ThermalZone> thermalZone; boost::optional<AirTerminalSingleDuctInletSideMixer> terminal; if( boost::optional<ModelObject> outlet = node.outletModelObject() ) { if( boost::optional<PortList> pl = outlet->optionalCast<PortList>() ) { thermalZone = pl->thermalZone(); } } if( boost::optional<ModelObject> inlet = node.inletModelObject() ) { terminal = inlet->optionalCast<AirTerminalSingleDuctInletSideMixer>(); } if( thermalZone && terminal ) { if( this->thermalZone() ) { removeFromThermalZone(); } thermalZone->setUseIdealAirLoads(false); ZoneHVACComponent thisObject = getObject<ZoneHVACComponent>(); thermalZone->addEquipment(thisObject); thermalZone->setCoolingPriority(thisObject,1); thermalZone->setHeatingPriority(thisObject,1); Model t_model = model(); ModelObject thisModelObject = getObject<model::ZoneHVACComponent>(); unsigned targetPort = node.connectedObjectPort( node.outletPort() ).get(); ModelObject targetModelObject = node.connectedObject( node.outletPort() ).get(); Node newNode( t_model ); t_model.connect( node, node.outletPort(), thisModelObject, inletPort() ); t_model.connect( thisModelObject, outletPort(), newNode, newNode.inletPort() ); t_model.connect( newNode, newNode.outletPort(), targetModelObject, targetPort ); Node exhaustNode(t_model); PortList exhaustPortList = thermalZone->exhaustPortList(); unsigned nextPort = exhaustPortList.nextPort(); t_model.connect(exhaustPortList,nextPort,exhaustNode,exhaustNode.inletPort()); t_model.connect(exhaustNode,exhaustNode.outletPort(),terminal.get(),terminal->secondaryAirInletPort()); result = true; } return result; }
bool AirTerminalSingleDuctParallelPIUReheat_Impl::setInducedAirPlenumZone(ThermalZone & plenumZone) { bool result = true; if( ! plenumZone.isPlenum() ) { result = false; } boost::optional<Node> t_secondaryAirInletNode; if( result ) { t_secondaryAirInletNode = secondaryAirInletNode(); if( ! t_secondaryAirInletNode ) { result = false; } } boost::optional<AirLoopHVACReturnPlenum> plenum; if( result ) { plenum = plenumZone.getImpl<detail::ThermalZone_Impl>()->airLoopHVACReturnPlenum(); if( ! plenum ) { result = false; } } if( result ) { Model t_model = model(); PortList pl = plenum->getImpl<detail::AirLoopHVACReturnPlenum_Impl>()->inducedAirOutletPortList(); t_model.connect(pl,pl.nextPort(),t_secondaryAirInletNode.get(),t_secondaryAirInletNode->inletPort()); } return result; }
bool FanZoneExhaust_Impl::addToThermalZone(ThermalZone & thermalZone) { Model m = this->model(); if( thermalZone.model() != m ) { return false; } removeFromThermalZone(); thermalZone.setUseIdealAirLoads(false); // Zone Exhaust Node (Exhaust Fan Inlet node) Node exhaustNode(m); PortList exhaustPortList = thermalZone.exhaustPortList(); unsigned nextPort = exhaustPortList.nextPort(); m.connect(exhaustPortList,nextPort,exhaustNode,exhaustNode.inletPort()); ModelObject mo = this->getObject<ModelObject>(); m.connect(exhaustNode,exhaustNode.outletPort(),mo,this->inletPort()); // Node (Exhaust Fan Outlet Node) Node exhaustFanOutletNode(m); m.connect(mo,this->outletPort(),exhaustFanOutletNode,exhaustFanOutletNode.inletPort()); thermalZone.addEquipment(this->getObject<ZoneHVACComponent>()); return true; }
bool AirTerminalSingleDuctParallelPIUReheat_Impl::addToNode(Node & node) { Model _model = node.model(); if( boost::optional<ModelObject> outlet = node.outletModelObject() ) { boost::optional<ThermalZone> thermalZone; if( boost::optional<PortList> portList = outlet->optionalCast<PortList>() ) { thermalZone = portList->thermalZone(); } if( thermalZone || (outlet->optionalCast<Mixer>() && node.airLoopHVAC()) ) { if( boost::optional<ModelObject> inlet = node.inletModelObject() ) { if( boost::optional<Splitter> splitter = inlet->optionalCast<Splitter>() ) { boost::optional<ModelObject> sourceModelObject = inlet; boost::optional<unsigned> sourcePort = node.connectedObjectPort(node.inletPort()); if( sourcePort && sourceModelObject ) { Node inletNode(_model); ModelObject thisObject = getObject<ModelObject>(); _model.connect( sourceModelObject.get(), sourcePort.get(), inletNode, inletNode.inletPort() ); _model.connect( inletNode, inletNode.outletPort(), thisObject, inletPort() ); _model.connect( thisObject, outletPort(), node, node.inletPort() ); if( thermalZone ) { Node secondaryInletNode(_model); PortList exhaustPortList = thermalZone->exhaustPortList(); _model.connect( exhaustPortList, exhaustPortList.nextPort(), secondaryInletNode, secondaryInletNode.inletPort() ); _model.connect( secondaryInletNode, secondaryInletNode.outletPort(), thisObject, secondaryAirInletPort() ); ModelObject mo = this->getObject<ModelObject>(); thermalZone->addEquipment(mo); } if( auto airLoopHVAC = node.airLoopHVAC() ) { auto schedule = airLoopHVAC->availabilitySchedule(); setFanAvailabilitySchedule(schedule); } return true; } } } } } return false; }