Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

I think some of the confusion is that method to take in system type 1 and 2 take in the model and an array of zones and results in zone equipment, without an air loop. System types 3-10 result in an air loop. Then zones manually have to be added to the system. Some systems also add one or more plant loops.

Here is the header file for HVACTemplates. I'm not sure why it does' show on our developer API documentation. I'll look into that. We do have some same code that uses this on a private repo. I'll put a few ruby examples below that may be helpful.

In the example below "conditioned_zones" is an array of zones.

  #add a system type 1 - PTAC to each zone
  hvac = OpenStudio::Model::addSystemType1(model, conditioned_zones)

The code above results in zone equipment linked to a hot water plant loop. System 2 (PTHP) looks just like this but only creates zone equipment.

To create single zone systems loop through conditioned zones adding a system for each one. (types 3,4,9,10)

  #add a system type 3 - PSZ-AC to each zone and set this zone to be the controlling zone
  conditioned_zones.each do|zone|
    hvac = OpenStudio::Model::addSystemType3(model)
    hvac = hvac.to_AirLoopHVAC.get
    hvac.addBranchForZone(zone)      
    outlet_node = hvac.supplyOutletNode
    setpoint_manager = outlet_node.getSetpointManagerSingleZoneReheat.get
    setpoint_manager.setControlZone(zone)
  end

To create a multizone system, make the system first then loop through the zones adding them to the demand side of the loop. (types 5,6,7,8)

  #add a system type 5 - Packaged VAV with Reheat to the model and hook up
  #each zone to this system
  hvac = OpenStudio::Model::addSystemType5(model)
  hvac = hvac.to_AirLoopHVAC.get      
  conditioned_zones.each do|zone|
    hvac.addBranchForZone(zone)      
  end

Please let us know if you have additional questions. We can provide more code for other system types or advise on how to build up custom system types instead of using the "addSystemType" call; this gives you a lot of flexibility.

I think some of the confusion is that method to take in make system type 1 and 2 take in the model and an array of zones and results in zone equipment, without an air loop. System types 3-10 result in an air loop. Then loop, with zones manually have to be added to the system. system with additional API calls. Some systems also add one or more plant loops.

Here is the header file for HVACTemplates. I'm not sure why it does' show on our developer API documentation. I'll look into that. We do have some same code that uses this on a private repo. I'll put a few ruby examples below that may be helpful.

In the example below "conditioned_zones" is an array of zones.

  #add a system type 1 - PTAC to each zone
  hvac = OpenStudio::Model::addSystemType1(model, conditioned_zones)

The code above results in zone equipment linked to a hot water plant loop. System 2 (PTHP) looks just like this but only creates zone equipment.

To create single zone systems loop through conditioned zones adding a system for each one. (types 3,4,9,10)

  #add a system type 3 - PSZ-AC to each zone and set this zone to be the controlling zone
  conditioned_zones.each do|zone|
    hvac = OpenStudio::Model::addSystemType3(model)
    hvac = hvac.to_AirLoopHVAC.get
    hvac.addBranchForZone(zone)      
    outlet_node = hvac.supplyOutletNode
    setpoint_manager = outlet_node.getSetpointManagerSingleZoneReheat.get
    setpoint_manager.setControlZone(zone)
  end

To create a multizone system, make the system first then loop through the zones adding them to the demand side of the loop. (types 5,6,7,8)

  #add a system type 5 - Packaged VAV with Reheat to the model and hook up
  #each zone to this system
  hvac = OpenStudio::Model::addSystemType5(model)
  hvac = hvac.to_AirLoopHVAC.get      
  conditioned_zones.each do|zone|
    hvac.addBranchForZone(zone)      
  end

Please let us know if you have additional questions. We can provide more code for other system types or advise on how to build up custom system types instead of using the "addSystemType" call; this gives you a lot of flexibility.

I think some of the confusion is that method to make system type 1 and 2 take in the model and an array of zones and results in zone equipment, without an air loop. System types 3-10 result in an air loop, with zones added to the system with additional API calls. Some systems also add one or more plant loops.

Here is the header file for HVACTemplates. I'm not sure why it does' show on our developer API documentation. I'll look into that. We do have some same code that uses this on a private repo. I'll put a few ruby examples below that may be helpful.

In the example below "conditioned_zones" is an array of zones.

  #add a system type 1 - PTAC to each zone
  hvac = OpenStudio::Model::addSystemType1(model, conditioned_zones)

The code above results in zone equipment linked to a hot water plant loop. System 2 (PTHP) looks just like this but only creates zone equipment.

To create single zone systems loop through conditioned zones adding a system for each one. (types 3,4,9,10)3,4,9,10) Updated to remove un-necessary lines per Kyle's comment

  #add a system type 3 - PSZ-AC to each zone and set this zone to be the controlling zone
  conditioned_zones.each do|zone|
    hvac = OpenStudio::Model::addSystemType3(model)
    hvac = hvac.to_AirLoopHVAC.get
    hvac.addBranchForZone(zone)      
    outlet_node = hvac.supplyOutletNode
    setpoint_manager = outlet_node.getSetpointManagerSingleZoneReheat.get
    setpoint_manager.setControlZone(zone)
  end

To create a multizone system, make the system first then loop through the zones adding them to the demand side of the loop. (types 5,6,7,8)

  #add a system type 5 - Packaged VAV with Reheat to the model and hook up
  #each zone to this system
  hvac = OpenStudio::Model::addSystemType5(model)
  hvac = hvac.to_AirLoopHVAC.get      
  conditioned_zones.each do|zone|
    hvac.addBranchForZone(zone)      
  end

Please let us know if you have additional questions. We can provide more code for other system types or advise on how to build up custom system types instead of using the "addSystemType" call; this gives you a lot of flexibility.