3

OpenStudio measure to change the ShadingControlType

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.

alichius's avatar
75
alichius
asked 2017-03-06 06:28:43 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2017-03-06 09:41:23 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

3

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.

David Goldwasser's avatar
20.4k
David Goldwasser
answered 2017-03-06 09:53:49 -0500, updated 2017-03-06 09:56:56 -0500
edit flag offensive 0 remove flag delete link

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 -0500) edit
add a comment see more comments