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

Revision history [back]

click to hide/show revision 1
initial version

Accessing OpenStudio Model Objects from EnergyPlus Measure

I attempt to answer my own question. As usual it leads to more problem. In a nutshell, I am trying to define a dual-duct HVAC system in OpenStudio. As one answer suggested, it can be done as EnergyPlus Measure.

So I went down this road. My plan of attack is:

  1. Create a model in OpenStudio without any HVAC system
  2. Execute an EnergyPlus Measure to add HVACTemplate objects for dual-duct system

I managed to get all the zones attached to the HVACTemplate:Zone:DualDuct objects. But the problem is: I cannot create the system objects. Ideally, I want to have one AHU per floor.

So the question is: can I get to the OpenStudio "model" objects in EnergyPlus measure? What I imagine is to create one dual-duct system per building story, and then attach zones in that building story to the system. This requires access to "model" objects.

What I have tried is something like this:

# GET the building story
model.getBuildingStorys.sort.each do |building_story|

  #IDF object text for Dual Duct
  string_objects << "
      HVACTemplate:System:DualDuct,
        #{building_story},                !- zone name
        FanAvailSched,           !- System Availability Schedule Name
        DualFanConstantVolume,   !- System Configuration Type
        !!!!!!! CUT short for brevity
        InletVaneDampers;        !- Return Fan Part-Load Power Coefficients
        "
end

#add all of the strings to workspace to create IDF objects
string_objects.each do |string_object|
  idfObject = OpenStudio::IdfObject::load(string_object)
  object = idfObject.get
  wsObject = workspace.addObject(object)
end

Well, the above snippets failed.

So, how can I access "model" objects from an EnergyPlus measure?

Accessing OpenStudio Model Objects from EnergyPlus Measure

I attempt to answer my own question. As usual it leads to more problem. In a nutshell, I am trying to define a dual-duct HVAC system in OpenStudio. As one answer suggested, it can be done as EnergyPlus Measure.

So I went down this road. My plan of attack is:

  1. Create a model in OpenStudio without any HVAC system
  2. Execute an EnergyPlus Measure to add HVACTemplate objects for dual-duct system

I managed to get all the zones attached to the HVACTemplate:Zone:DualDuct objects. But the problem is: I cannot create the system objects. Ideally, I want to have one AHU per floor.

So the question is: can I get to the OpenStudio "model" objects in EnergyPlus measure? What I imagine is to create one dual-duct system per building story, and then attach zones in that building story to the system. This requires access to "model" objects.

What I have tried is something like this:

# GET the building story
model.getBuildingStorys.sort.each do |building_story|

  #IDF object text for Dual Duct
  string_objects << "
      HVACTemplate:System:DualDuct,
        #{building_story},                !- zone name
        FanAvailSched,           !- System Availability Schedule Name
        DualFanConstantVolume,   !- System Configuration Type
        !!!!!!! CUT short for brevity
        InletVaneDampers;        !- Return Fan Part-Load Power Coefficients
        "
end

#add all of the strings to workspace to create IDF objects
string_objects.each do |string_object|
  idfObject = OpenStudio::IdfObject::load(string_object)
  object = idfObject.get
  wsObject = workspace.addObject(object)
end

Well, the above snippets failed.

So, how can I access "model" objects from an EnergyPlus measure?

Accessing OpenStudio Model Objects from EnergyPlus Measure

I attempt to answer my own question. As usual it leads to more problem. In a nutshell, I am trying to define a dual-duct HVAC system in OpenStudio. As one answer suggested, it can be done as EnergyPlus Measure.

So I went down this road. My plan of attack is:

  1. Create a model in OpenStudio without any HVAC system
  2. Execute an EnergyPlus Measure to add HVACTemplate objects for dual-duct system

I managed to get all the zones attached to the HVACTemplate:Zone:DualDuct objects. But the problem is: I cannot create the system objects. Ideally, I want to have one AHU per floor.

So the question is: can I get to the OpenStudio "model" objects in EnergyPlus measure? What I imagine is to create one dual-duct system per building story, and then attach zones in that building story to the system. This requires access to "model" objects.

What I have tried is something like this:

# GET the building story
model.getBuildingStorys.sort.each do |building_story|

  #IDF object text for Dual Duct
  string_objects << "
      HVACTemplate:System:DualDuct,
        #{building_story},                !- zone name
        FanAvailSched,           !- System Availability Schedule Name
        DualFanConstantVolume,   !- System Configuration Type
        !!!!!!! CUT short for brevity
        InletVaneDampers;        !- Return Fan Part-Load Power Coefficients
        "
end

#add all of the strings to workspace to create IDF objects
string_objects.each do |string_object|
  idfObject = OpenStudio::IdfObject::load(string_object)
  object = idfObject.get
  wsObject = workspace.addObject(object)
end

Well, the above snippets failed.

So, how can I access "model" objects from an EnergyPlus measure?

Accessing OpenStudio Model Objects from EnergyPlus Measure

I attempt to answer my own question. As usual it leads to more problem. In a nutshell, I am trying to define a dual-duct HVAC system in OpenStudio. As one answer suggested, it can be done as EnergyPlus Measure.

So I went down this road. My plan of attack is:

  1. Create a model in OpenStudio without any HVAC system
  2. Execute an EnergyPlus Measure to add HVACTemplate objects for dual-duct system

I managed to get all the zones attached to the HVACTemplate:Zone:DualDuct objects. But the problem is: I cannot create the system objects. Ideally, I want to have one AHU per floor.

So the question is: can I get to the OpenStudio "model" objects in EnergyPlus measure? What I imagine is to create one dual-duct system per building story, and then attach zones in that building story to the system. This requires access to "model" objects.

What I have tried is something like this:

# GET the building story
model.getBuildingStorys.sort.each do |building_story|

  #IDF object text for Dual Duct
  string_objects << "
      HVACTemplate:System:DualDuct,
        #{building_story},                !- zone name
        FanAvailSched,           !- System Availability Schedule Name
        DualFanConstantVolume,   !- System Configuration Type
        !!!!!!! CUT short for brevity
        InletVaneDampers;        !- Return Fan Part-Load Power Coefficients
        "
end

#add all of the strings to workspace to create IDF objects
string_objects.each do |string_object|
  idfObject = OpenStudio::IdfObject::load(string_object)
  object = idfObject.get
  wsObject = workspace.addObject(object)
end

Well, the above snippets failed.

So, how can I access "model" objects from an EnergyPlus measure?