EMS failed in changing actuator

asked 2021-02-21 03:01:29 -0600

rdom gravatar image

updated 2021-02-21 19:28:43 -0600

I'm using EnergyManagementSystem in EnergyPlus for research. For now, I'm trouble in modeling. I was trying to open the window, operate the fan and activate the air conditioner according to the indoor thermal situation and outdoor situation. When my model include AirflowNetwork, ZoneHVAC:PacakagedTerminalHeatPump and ZoneHVAC:OutdoorAirUnit,EMS failed to change the opening factor and availability schedule. (the fan flow rate has not been test yet). I tried to debug with simple model by just changing the opening factor and found out that even though the EMS worked but the opening factor number was empty. Here are part of lines from my .edd file:

WORKING_TIME_NEW,Line 1,SET LOCHOUR = HOUR,17.000000, Occurrence info=FOUR, 04/14 17:04 - 17:05
WORKING_TIME_NEW,Line 2,SET LOCDAYOFWEEK=DAYOFWEEK,6.000000, Occurrence info=FOUR, 04/14 17:04 - 17:05
WORKING_TIME_NEW,Line 3,IF DAYOFWEEK==1 || DAYOFWEEK==7,0.0, Occurrence info=FOUR, 04/14 17:04 - 17:05
WORKING_TIME_NEW,Line 6,ELSEIF HOUR<9 || HOUR>=18,0.0, Occurrence info=FOUR, 04/14 17:04 - 17:05
WORKING_TIME_NEW,Line 9,ELSEIF HOUR==9 && MINUTE<=5,0.0, Occurrence info=FOUR, 04/14 17:04 - 17:05
WORKING_TIME_NEW,Line 12,ELSEIF HOUR==9 && MINUTE>5,0.0, Occurrence info=FOUR, 04/14 17:04 - 17:05
WORKING_TIME_NEW,Line 15,ELSEIF HOUR>=10 && HOUR<=17,1.000000, Occurrence info=FOUR, 04/14 17:04 - 17:05
WORKING_TIME_NEW,Line 16,SET OPENING_FACTOR=0.5,0.500000, Occurrence info=FOUR, 04/14 17:04 - 17:05
WORKING_TIME_NEW,Line 17,SET LOCOPENING_FACTOR5=OPENING_FACTOR,, Occurrence info=FOUR, 04/14 17:04 - 17:05
WORKING_TIME_NEW,Line 18,ENDIF,, Occurrence info=FOUR, 04/14 17:04 - 17:05

In Line 16 the Opening_Factor was set to 0.5, while in Line 17 the value of Opening_Factor was empty. I don't know what to do now.

Addition: Here is the program WORKING_TIME_NEW. It's the only program in EMS and the calling point is 'BeginTimestepBeforPredictor'. OPENING_FACTOR is the actuator of a window. LOCOPENING_FACTOR5 is a variable for debugging to see if the opening factor was changed by EMS correctly.

working_time_New,        !- Name
    Set locHour = Hour,      !- Program Line 1
    Set locDayofWeek=DayofWeek,  !- Program Line 2
    IF DayofWeek==1 || DayofWeek==7,  !- A4
    SET Opening_Factor=0,    !- A5
    Set locOpening_Factor1=Opening_Factor,  ! echo out for debug
    ELSEIF Hour<9 || Hour>=18,  !- A7
    SET Opening_Factor=0,    !- A8
    Set locOpening_Factor2=Opening_Factor,  ! echo out for debug
    ELSEIF Hour==9 && Minute<=5,  !- A10
    SET Opening_Factor=0.5,  !- A11
    Set locOpening_Factor3=Opening_Factor,  ! echo out for debug
    ELSEIF Hour==9 && Minute>5,  !- A13
    SET Opening_Factor=0.5,  !- A14
    Set locOpening_Factor4=Opening_Factor,  ! echo out for debug
    ELSEIF Hour>=10 && Hour<=17,  !- A16
    SET Opening_Factor=0.5,  !- A17
    Set locOpening_Factor5=Opening_Factor,  ! echo out for debug
    ENDIF;                   !- A19
edit retag flag offensive close merge delete

Comments

Is LOCOPENING_FACTOR5 defined as a global EMS variable and possibly set by another program or subroutine?

Why not use SET LOCOPENING_FACTOR5 = 0.5 on Line 16 of your EMS program?

Aaron Boranian gravatar image Aaron Boranian  ( 2021-02-21 11:24:48 -0600 )edit

LOCOPENING_FACTOR5 is not a global EMS variable but a variable for debug, testing if the OPENING_FACTOR was set. Program WORKING_TIME_NEW is the only program called in EMS:ProgramCallingManager and the calling point is 'BeginTimestepBeforePredictor'.

rdom gravatar image rdom  ( 2021-02-21 19:08:21 -0600 )edit

@rdom Why not report an output variable for OPENING_FACTOR and avoid the need for multiple LOCOPENING_FACTOR debug variables?

This would make your EMS controls more streamlined, but it wouldn't explain why LOCOPENING_FACTOR5 isn't being set to 0.5 as it should.

For others to provide better help, could you include a link to the full IDF that you're using? That would be easier to review inputs and objects rather than having you copy the object text into your post.

Aaron Boranian gravatar image Aaron Boranian  ( 2021-02-23 14:04:05 -0600 )edit

@Aaron Boranian Because i want to find how the OPENING_FACTOR change during EMS program. Also, the model is a simple model with one room. Thank you for your advice, I don't know how to upload the IDF to Git_Hub, could you please give my an example?

rdom gravatar image rdom  ( 2021-02-23 20:11:17 -0600 )edit