esignBuilder Erl

Beta test feature

 

DesignBuilder provides access to the full EnergyPlus Runtime Language (Erl) which is described in detail in the EMS application guide. You can enter Erl script to modify your simulations on the EMS Program dialog.

 

This page describes a powerful set of extensions to Erl which allow code to be made portable between models. Zone loops, if blocks and site, building and zone attributes offer ways to reference the model data without referring to zones by name in the Erl scripts.

 

The combined Erl plus DB extensions language is referred to as DB Erl in the documentation.

 

Note: Erl is case sensitive.

Zone loops

In models having more than one zone it is usually more convenient to write code using Zone loop statements. These have the general format:

 

<ForAllZones>,

IF <LoopZoneVariableName>_DeltaT < 0 ,

SET <LoopZoneVariableName>_DeltaT = 0,

ENDIF,

<LoopNextZone>,

 

When code is written in this way it becomes easier to manage, especially in models having more than a handful of zones or where the code is to made portable for use in any model.

 

A summary of all the zone loop-related statements is given in the table below.

 

DB Erl statement Description  
<ForAllZones> Loop through all zones in the current building.  
<ForAllOccupiedZones> Loop through all occupied zones in the current building.  
<ForAllUnoccupiedZones> Loop through all unoccupied zones in the current building.  
<ForAllOccupiedNonCooledZones> Loop through all zones in the current building that do not have the Cooled checkbox on the HVAC tab checked.  
<ForAllOccupiedCooledZones> Loop through all occupied zones in the current building that have the Cooled checkbox on the HVAC tab checked.  
<ForAllOccupiedHeatedZones> Loop through all occupied zones in the current building that have the Heated checkbox on the HVAC tab checked.  
<ForAllOccupiedNonHeatedZones> Loop through all occupied zones in the current building that do not have the Heated checkbox on the HVAC tab checked.  
<LoopNextZone> End of the zone loop.  
<LoopZoneIDFName> Replace <LoopZoneIDFName> with the IDF zone name of the current zone in the loop.  
<LoopZoneVariableName> Replace <LoopZoneVariableName> with the IDF zone name of the current zone in the loop modified to be a legal Erl variable name. LoopZoneVariableName are the same as LoopZoneIDFName but with characters ":" and "." replaced by "_".  
<Any_Occupied_ZoneIDFName> Replace <Any_Occupied_ZoneIDFName> with the IDF zone name of any occupied zone in the model.  
<LoopZoneAttribute AttributeName> Look up and replace with current loop zone attribute. E.g. <LoopZoneAttribute OccupancySchedule> might be replaced with Office_Open_off. See full list of valid attribute names below.  

 

Occupied zones are the zones where number of occupants are > 0 and Zone type is 1-Standard.

Include/exclude blocks of code

When the DB Erl pre-processor encounters an <If...> directive, followed eventually by an <Endif> directive, it will include the code between the <If...> and the <Endif> only if the boolean expression following <If ... evaluates to True. Otherwise the block of code is not passed through to EnergyPlus.

 

DB Erl statement Description  
<If Boolean expression Then>

Where Boolean expression is an expression evaluating to True or False. E.g.

 

<If BuildingAttribute HourlyOutput = 1 Then>

Erl statements for hourly output

<Endif>

 

Boolean expression must be in the form:

 

  • SiteAttribute, BuildingAttribute or LoopZoneAttribute followed by,
  • Attribute name followed by,
  • an operator which must be one of "=, <>, >, <, >=, <=, followed by,
  • Test value. Note for numbered list items, only the number part of should be tested for. e.g.:

 

This is correct:

<If LoopZoneAttribute MechanicalVentilationRateType = 2 Then>,

 

This is incorrect:

<If LoopZoneAttribute MechanicalVentilationRateType = 2-Min Fresh Air (Per Person)

 

 
<Endif> marks the end of the block of text to be included/excluded.  

 

 

DB Erl Changes to Standard EnergyPlus Erl

DesignBuilder Erl is identical to the standard Erl language syntax with 1 exception:

 

List of Valid Attribute Names