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

Method addToThermalZone

src/model/ZoneHVACComponent.cpp:208–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206 }
207
208 bool ZoneHVACComponent_Impl::addToThermalZone(ThermalZone& thermalZone) {
209 Model m = this->model();
210
211 if (thermalZone.model() != m) {
212 return false;
213 }
214
215 if (thermalZone.isPlenum()) {
216 return false;
217 }
218
219 removeFromThermalZone();
220
221 thermalZone.setUseIdealAirLoads(false);
222
223 // Connect nodes if this is an air based zone hvac component
224 if (inletPort() != 0u && outletPort() != 0u) {
225 // Exhaust Node
226 Node exhaustNode(m);
227 PortList exhaustPortList = thermalZone.exhaustPortList();
228 unsigned nextPort = exhaustPortList.nextPort();
229 m.connect(exhaustPortList, nextPort, exhaustNode, exhaustNode.inletPort());
230 auto mo = this->getObject<ModelObject>();
231 m.connect(exhaustNode, exhaustNode.outletPort(), mo, this->inletPort());
232
233 // Air Inlet Node
234 Node airInletNode(m);
235 PortList inletPortList = thermalZone.inletPortList();
236 unsigned nextInletPort = inletPortList.nextPort();
237 m.connect(airInletNode, airInletNode.outletPort(), inletPortList, nextInletPort);
238 m.connect(mo, this->outletPort(), airInletNode, airInletNode.inletPort());
239 }
240
241 thermalZone.addEquipment(this->getObject<ZoneHVACComponent>());
242
243 return true;
244 }
245
246 void ZoneHVACComponent_Impl::removeFromThermalZone() {
247 boost::optional<ThermalZone> thermalZone = this->thermalZone();

Callers

nothing calls this directly

Calls 10

setUseIdealAirLoadsMethod · 0.80
exhaustPortListMethod · 0.80
nextPortMethod · 0.80
inletPortListMethod · 0.80
modelMethod · 0.45
isPlenumMethod · 0.45
connectMethod · 0.45
inletPortMethod · 0.45
outletPortMethod · 0.45
addEquipmentMethod · 0.45

Tested by

no test coverage detected