Skip to content

Unitialized EMS variable is misused #11360

@shorowit

Description

@shorowit

Issue overview

The provided IDF has an EMS program like so:

EnergyManagementSystem:Program,
  ev_discharge_program,                   !- Name
  Set power_mult = (1.412768*(site_temp_adj^0))+(-0.03910397*(site_temp_adj^1))+(0.0009408235*(site_temp_adj^2))+(8.97156e-06*(site_temp_adj^3))+(-7.699244e-07*(site_temp_adj^4))+(1.265614e-08*(site_temp_adj^5)), !- Program Line 1
  Set site_temp_adj = site_temp,          !- Program Line 2
  If site_temp < -17.778,                 !- Program Line 3
  Set site_temp_adj = -17.778,            !- Program Line 4
  ElseIf site_temp > 37.778,              !- Program Line 5
  Set site_temp_adj = 37.778,             !- Program Line 6
  EndIf,                                  !- Program Line 7
  ...

The EMS variable site_temp_adj is being referenced before it is defined. This is supposed to be caught, but is not. If you look at the eplusout.edd file, power_mult is calculated as zero on the first timestep, suggesting that site_temp_adj was initialized as zero and used.

Operating System (Multiple choices)

Ubuntu

Operating System Version

24.04

Version of EnergyPlus

25.1

Unmethours link or helpdesk ticket number

N/A

Defect file

ems_bug.idf.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    TriageIssue needs to be assessed and labeled, further information on reported might be neededUnconfirmedDefectDefect has not yet confirmed to be an actual issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions