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

OpenStudio measure to change the ShadingControlType

asked 2017-03-06 06:28:43 -0600

alichius's avatar

updated 2017-03-06 09:41:23 -0600

As a follow up of this (https://unmethours.com/question/23088...) I created an OpenStudio measure to change the ShadingControlType to one of the "unsupported" values like OnIfHighZoneAirTemperature.

The measure let me choose out of the existing ShadingControlobjects, a new ShadingControlType (String) and a new setpoint. The measure basically works when I choose a supported control type, but I can not choose one of the unsupported values. OpenStudio always resets this to OnIfHighSolarOnWindows.

Is there an implicit input validation in the OpenStudio sources?

I had a look at ShadingControl.cpp and the developer documentation.
Would it be sufficient to patch the OpenStudio.idd to contain the necessary keywords and rebuild OpenStudio?

Or should I go for a EnergyPlus measure to change the control type strategy?

I can share my measure if it would be helpful.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2017-03-06 09:53:49 -0600

updated 2017-03-06 09:56:56 -0600

You are correct, OpenStudio only supports a subset of the ShadingControlTypes as EnergyPlus. If you set a field to an invalid value, you won't know it unless you specifically check it like this or echo the value back by getting what you just set.

var = object.setValue("SomethingBad")
if var == false
  puts "did not accept value"
end

The following Shading Control Types are supported by OpenStudio:

  • Always On
  • Always Off
  • OnIfScheduleAllows
  • OnIfHighSolarOnWindow

Here is a link to the types EnergyPlus supports.

I don't know if changing the IDD will work, it might, but an easier approach might be to alter the ShadingControlType with an EnergyPlus measure, as shown in the code snippet below. Because this happens after the OSM is translated to an IDF you have access to anything EnergyPlus supports.

workspace.getObjectsByType("WindowProperty:ShadingControl".to_IddObjectType).each do |shading_control|
  shading_control.setString(3,"OnIfHighZoneAirTemperature") # shading control type field
end

Feel free to add this as a feature request.

edit flag offensive delete link more

Comments

Thanks again for the clarification. I will start with en EnergyPlus measure and maybe try a recompilation when I habe some more time for "experiments".

alichius's avatar alichius  ( 2017-03-07 02:11:02 -0600 )edit

Your Answer

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

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2017-03-06 06:28:43 -0600

Seen: 148 times

Last updated: Mar 06 '17