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

Setting SHGC in OpenStudio

asked 2015-09-02 09:20:15 -0500

Alex Bennett gravatar image

updated 2017-08-05 13:05:04 -0500

I am trying to set the SHGC(Solar Heat Gain Coefficient) in OpenStudio for a Fixed Window under the category Simple Glazing System Window Materials using a ruby measure. I am using OpenStudio 1.6.0 and there is no method to set the SHGC using ruby that I can find. The only other way I have found to set SHGC is by translating the whole model to EnergyPlus, setting SHGC and bring it back to OpenStudio. The code for that method looks like this:

ft = OpenStudio::EnergyPlus::ForwardTranslator.new
workspace = ft.translateModel(model)
win = model.getObjectsByType("WindowMaterial:SimpleGlazingSystem".to_IddObjectType)
win[0].setDouble(2,shgc) 
bt = OpenStudio::EnergyPlus::ReverseTranslator.new
model = bt.translateWorkspace(workspace)

Unfortunately the above code seems to work in the cmd but the changes do not show up in OpenStudio. What should I try next to set the SHGC?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
5

answered 2015-09-02 09:47:08 -0500

updated 2015-09-02 09:57:02 -0500

If you want to manipulate code in IDF, then you meed to make an EnergyPlus measure, which takes in and returns an IDF file vs. an OSM.

But you can edit and create simple glazing objects in OpenStudio.

# create construction and material and link them together
construction = OpenStudio::Model::Construction.new(model)
material = OpenStudio::Model::SimpleGlazing.new(model)

# add material to construction
construction.insertLayer(0,material)

# set material properties
material.setUFactor(options["uFactor"])
material.setSolarHeatGainCoefficient(options["solarHeatGainCoef"])
material.setVisibleTransmittance(options["visibleTransmittance"])

If you are have a material already in the model that you want to alter you need to do something like this.

if material.to_SimpleGlazing.is_initialized
  material = material.to_SimpleGlazing.get
  material.setSolarHeatGainCoefficient(options["solarHeatGainCoef"])
end
edit flag offensive delete link more

Comments

Thanks that worked perfectly! I realized I was looking at the subSurface rather than the Material but got confused because you can set a UFactor for subSurface.

Alex Bennett gravatar image Alex Bennett  ( 2015-09-02 10:14:50 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

 

Question Tools

2 followers

Stats

Asked: 2015-09-02 09:20:15 -0500

Seen: 428 times

Last updated: Sep 02 '15