EnergyPlus EMS sensors not read at first timestep of warmup?

asked 2023-08-31 21:54:36 -0500

Jamie Sullivan's avatar

updated 2023-09-01 09:07:18 -0500

I was attempting to write a simple EMS script to vary the cooling setpoint but my model ran into errors during warmup, claiming that the cooling setpoint was too low.

Upon inspection of the EMS debugging output, it became apparent that the sensors I was using to read Schedule:Constant values (a convenient way to consolidate input variables for easy tweaking) were not actually being read correctly during the first timestep of warmup. Instead of pulling the actual schedule values (28 and 25), they are instead just read as 0.

By the second timestep, their values are being read correctly. Also, oddly, the other sensors I have for reading zone temperature do work perfectly fine on the first timestep, so this isn't necessarily an EMS sensor read time thing per se.

Illustrated in the snippets from the first few lines of my EDD file below. During the first timestep EMSCOOLON and EMSCOOLSET (the two sensors) are just being read as 0. The sensors for zone temperature however (ZONE_TA and ZONE_TR) are both being read fine:

Line 1,SET ZONE1_TOP = 0.5 * ZONE1_TA + 0.5 * ZONE1_TR,22.733351, During Warmup, 
Line 2,SET A = EMSCOOLON,0.0, During Warmup, Occurrence info=ANNUALRUNPERIOD, 01/01 00:00 - 00:10
Line 3,SET B = EMSCOOLSET,0.0, During Warmup, Occurrence info=ANNUALRUNPERIOD, 01/01 00:00 - 00:10

But in the second timestep both have their correct scheduled values read:

Line 2,SET A = EMSCOOLON,28.000000, During Warmup, Occurrence info=ANNUALRUNPERIOD, 01/01 00:00 - 00:10
Line 3,SET B = EMSCOOLSET,25.000000, During Warmup, Occurrence info=ANNUALRUNPERIOD, 01/01 00:00 - 00:10

I was wondering if anyone knew what was going on with the EMS here since this doesn't really strike me as correct behaviour? If you call a sensor it should find out what it's actual value is, not default it to 0 or not read the schedule because it doesn't feel like it.

It's easy enough to bypass here since this is a very simple program and just hardcoding the values in rather than having them in schedules isn't a problem, but this could easily be an annoyance in more complex programs.

edit retag flag offensive close merge delete