OpenStudio Measure - Weather Output via EMS

asked 2020-03-12 10:27:29 -0600

tenna031's avatar

updated 2020-03-12 10:51:18 -0600

Hey folks,

I've been trying to output the following weather variables via EMS:

  • Output:Variable,*,Site Wind Speed,hourly; !- Zone Average [m/s]
  • Output:Variable,*,Site Wind Direction,hourly; !- Zone Average [deg]
  • Output:Variable,*,Site Sky Temperature,hourly; !- Zone Average [C]
  • Output:Variable,*,Site Horizontal Infrared Radiation Rate per Area,hourly; !- Zone Average [W/m2]
  • Output:Variable,*,Site Diffuse Solar Radiation Rate per Area,hourly; !- Zone Average [W/m2]
  • Output:Variable,*,Site Direct Solar Radiation Rate per Area,hourly; !- Zone Average [W/m2]
  • Output:Variable,*,Site Precipitation Depth,hourly; !- Zone Sum [m]

Is this possible via an OpenStudio measure? I was only able to output the environment temperature from the outdoor air. node. When I try the same thing for the above fields, the simulation errors out because of an invalid keyName. The OpenStudio measure code I'm using is given below:

outVarName = "Site Wind Direction"
keyName = "*"
outputVariable = OpenStudio::Model::OutputVariable.new(outVarName,model)
outputVariable.setKeyValue("#{keyName}")
outputVariable.setReportingFrequency(report_freq)
outputVariable.setName(outVarName)
outputVariable.setExportToBCVTB(true)
edit retag flag offensive close merge delete

Comments

1

try outputVariable.setKeyValue('#{keyName}'). you might have too many quotes

BrianLBall's avatar BrianLBall  ( 2020-03-12 13:58:42 -0600 )edit

Thanks for your comment Brian. What did the trick for me was setting the keyName to "Environment".

outVarName = "Site Wind Direction"
keyName = "Environment"
outputVariable = OpenStudio::Model::OutputVariable.new(outVarName,model)
outputVariable.setKeyValue(keyName)
outputVariable.setReportingFrequency(report_freq)
outputVariable.setName(outVarName)
outputVariable.setExportToBCVTB(true)

sensor = OpenStudio::Model::EnergyManagementSystemSensor.new(model, outputVariable)
sensor.setKeyName(keyName)
sensor.setName(create_ems_str(emsName))
tenna031's avatar tenna031  ( 2020-03-15 12:46:04 -0600 )edit