Guide for Module Developers — EnergyPlus 8.3

<< Prev | Table of Contents | Next >>

How Do I Output My Variables?[LINK]

Module developers are responsible for “setting” up the variables that will appear in the OutputFileStandard.

To do this is very simple. All you need to do is place a simple call to SetupOutputVariable into your module for each variable to be available for reporting. This call should be done only once for each Variable/KeyedValue pair (see below). For HVAC and Plant components, this call is usually at the end of the “GetInput” subroutine. See the example module for an illustration of this. Other calls in the simulation routines will invoke the EnergyPlus OutputProcessor automatically at the proper time to have the data appear in the OutputFileStandard.

For you the call is:

Call SetupOutputVariable(VariableName,ActualVariable,  &
                         IndexTypeKey, VariableTypeKey,KeyedValue,ReportFreq &
                         ResourceTypeKey,EndUseKey,GroupKey)

Interface statements allow for the same call to be used for either real or integer “ActualVariable” variables. A few examples from EnergyPlus and then we will define the arguments:

CALL SetupOutputVariable('Site Outdoor Drybulb Temperature [C]', &
        OutDryBulbTemp,'Zone','Average','Environment')

CALL SetupOutputVariable('Zone Mean Air Temperature [C]', &
        ZnRpt(Loop)%MeanAirTemp,'Zone', 'State',Zone(Loop)%Name)

CALL SetupOutputVariable('Fan Coil Heating Energy [J]', &
        FanCoil(FanCoilNum)%HeatEnergy,'System',   &
       'Sum',FanCoil(FanCoilNum)%Name)

CALL SetupOutputVariable('Humidifier Electric Energy [J]',
        Humidifier(HumNum)%ElecUseEnergy,'System','Sum', &
        Humidifier(HumNum)%Name, ResourceTypeKey='ELECTRICITY',&
        EndUseKey = 'HUMIDIFIER', GroupKey = 'System')
SetupOutputVariable Arguments
SetupOutput Variable Arguments Description
VariableName String name of variable, units should be included in []. If no units, use []
ActualVariable This should be the actual variable that will store the value. The OutputProcessor sets up a pointer to this variable, so it will need to be a SAVEd variable if in a local routine. As noted in examples, can be a simple variable or part of an array/derived type.
IndexTypeKey When this variable has its proper value. ‘Zone’ is used for variables that will have value on the global timestep (alias “HeatBalance”). ‘HVAC’ is used for variables that will have values calculated on the variable system timesteps (alias “System”, “Plant”)
VariableTypeKey Two kinds of variables are produced. ‘State’ or ‘Average’ are values that are instantaneous at the timestep (zone air temperature, outdoor weather conditions). ‘NonState’ or ‘Sum’ are values which need to be summed for a period (energy).
KeyedValue Every variable to be reported needs to have an associated keyed value. Zone Air Temperature is available for each Zone, thus the keyed value is the Zone Name.
ReportFreq This optional argument should only be used during debugging of your module but it is provided for the developers so that these variables would always show up in the OutputFile. (All other variables must be requested by the user).
ResourceTypeKey Meter Resource Type; an optional argument used for including the variable in a meter. The meter resource type can be ‘Electricity’, ‘Gas’, ‘Coal’, ‘FuelOil#1’, ‘FuelOil#2’, ‘Propane’, ‘Water’, or ‘EnergyTransfer’.
EndUseKey Meter End Use Key; an optional argument used when the variable is included in a meter. The end use keys can be: ‘InteriorLights’, ‘ExteriorLights’, ‘Heating’, ‘Cooling’, ‘DHW’, ‘Cogeneration’, ‘ExteriorEquipment’, ‘ZoneSource’, ‘PurchasedHotWater’, ‘PurchasedChilledWater’, ‘Fans’, ‘HeatingCoils’, ‘CoolingCoils’, ‘Pumps’, ‘Chillers’, ‘Boilers’, ‘Baseboard’, ‘HeatRejection’, ‘Humidifier’, ‘HeatRecovery’ or ‘Refrigeration’.
EndUseSubKey Meter End Use Subcategory Key; an optional argument to further divide a particular End Use. This key is user-defined in the input object and can be any string, e.g., ‘Task Lights’, ‘Exit Lights’, ‘Landscape Lights’, ‘Computers’, or ‘Fax Machines’.
GroupKey Meter Super Group Key; an optional argument used when the variable is included in a meter. The group key denotes whether the variable belongs to the building, system, or plant.The choices are: ‘Building’, ‘HVAC’ or ‘Plant’.

: SetupOutputVariable Arguments

As described in the Input Output Reference, not all variables may be available in any particular simulation. Only those variables that will have values generated will be available for reporting. In the IDF, you can include a “Output:VariableDictionary,regular;” command that will produce the eplusout.rdd file containing all the variables with their IndexTypeKeys. This list can be used to tailor the requests for values in the OutputFileStandard.

This variable dictionary is separated into two pieces: regular reporting variables and meter variables. It can also be sorted by name (ascending).