First time here? Check our help page!
5

EnergyPlus output variables in OpenStudio

Is there a way to output EnergyPlus variables that are not in the OpenStudio Output Variables tab such as "HVAC,Average,Fan Runtime Fraction" within the OpenStudio framework?

clguen's avatar
153
clguen
asked 2016-09-26 10:39:25 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

9

You can export single variables with the "Export Output Variable to csv" measure, and export single meters with the "Export Meter to csv" measure, available on BCL.

More detail on applying these is described in this unmet hours post

If you have several variables, use Julien Marrec's "Output Variables from csv" measure, which reads a list of output variables you would like from a csv file, also available on BCL.

On the unmet hours slack channel, Andrew Parker posted the DView measure, which will take the output variables you've requested and put them into a .csv file that can be read by DView for visual analysis.

mdahlhausen's avatar
9.5k
mdahlhausen
answered 2016-09-26 11:00:23 -0500
edit flag offensive 0 remove flag delete link

Comments

3

There is also the more basic Add Output Variable and Add Meter measures if you just want to get the variable into the EnergyPlus SQL file.

David Goldwasser's avatar David Goldwasser (2016-09-26 12:01:42 -0500) edit

Another option is to save all the OVs for a particular object class (e.g. boilers) to an IDF and use the Inject IDF Objects measure with the path to that IDF.

MatthewSteen's avatar MatthewSteen (2016-09-26 12:47:48 -0500) edit

has the "Export Output Variable to CSV" been retired? I am unable to find it on the BCL library and the link above does not return any useful page.

Vishak's avatar Vishak (2022-02-22 07:23:53 -0500) edit

@Vishak, it is still on BCL here. You can also find it on GitHub.com here..

David Goldwasser's avatar David Goldwasser (2022-02-22 09:49:45 -0500) edit

Hi! Just to be clear, does the measure linked in the previous post now export variables like (Zone temperature, humidity, Site Air Temperature-.rdd file list) and meters like (electricity:facility, heating:electricity-.mdd file list)? I recall that export variable to csv and export meter to csv used to be two different measures with a separate reporting capability for each.

Vishak's avatar Vishak (2022-02-22 11:26:52 -0500) edit
add a comment see more comments
2

Hi All

I just updated the "Export Meter to csv" for the OpenStudio Application 1.1.0, because I found the original one from BCL doesn't work anymore with new OpenStudio Application. Thus I learned from other OpenStudio measure and modified the original one. Thanks mdahlhausen for the original measure. It is great measure.

The modified measure.rb works well. As I do not have enough points to upload the .rb file, just put the related parts below.

1: the reporting class name

class ExportMetertoCSV < OpenStudio::Measure::ReportingMeasure

2: the arguments function

def arguments(model=nil)
    args = OpenStudio::Measure::OSArgumentVector.new

    #make an argument for the variable name
    meter_name = OpenStudio::Measure::OSArgument.makeStringArgument("meter_name",true)
    meter_name.setDisplayName("Enter Meter Name.")
    args << meter_name

    #make an argument for the reporting frequency
    reporting_frequency_chs = OpenStudio::StringVector.new
    reporting_frequency_chs << "Hourly"
    reporting_frequency_chs << "Zone Timestep"
    reporting_frequency = OpenStudio::Measure::OSArgument.makeChoiceArgument('reporting_frequency', reporting_frequency_chs, true)
    reporting_frequency.setDisplayName("Reporting Frequency.")
    reporting_frequency.setDefaultValue("Hourly")
    args << reporting_frequency

3: in run function

 def run(runner, user_arguments)
    super(runner, user_arguments)

    # use the built-in error checking 
    if !runner.validateUserArguments(arguments, user_arguments)
      return false
    end
wei_zhang's avatar
137
wei_zhang
answered 2021-07-05 12:57:30 -0500, updated 2021-07-05 14:42:05 -0500
edit flag offensive 0 remove flag delete link

Comments

I've updated the measure on BCL to work with the newer OpenStudio API. https://bcl.nrel.gov/node/83269

mdahlhausen's avatar mdahlhausen (2021-07-06 15:36:38 -0500) edit

Thanks Matthew, But when I download the measure as you gave (https://bcl.nrel.gov/node/83269), I can only found one XML file inside. Maybe something missing or I missed something?

wei_zhang's avatar wei_zhang (2021-07-06 19:10:54 -0500) edit

I re-uploaded it.

mdahlhausen's avatar mdahlhausen (2021-07-07 10:14:29 -0500) edit

Cool, thanks a lot

wei_zhang's avatar wei_zhang (2021-07-07 12:48:32 -0500) edit

Hi Matthew. It seems that the measure Inject IDF Objects (https://bcl.nrel.gov/node/83269) is messing from the site https://bcl.nrel.gov/node/83281

kgobakis's avatar kgobakis (2021-10-17 15:02:16 -0500) edit
add a comment see more comments