OpenStudio Measure - Weather Output via EMS

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

tenna031 gravatar image

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

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 gravatar imageBrianLBall ( 2020-03-12 13:58:42 -0500 )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 gravatar imagetenna031 ( 2020-03-15 12:46:04 -0500 )edit