EMS control is off by one hour
A bug report. I've been aware of it for a long time. Now I posted just because I have time to do so.
When we try to control actuated components in AirLoop and PlantLoop with the built-In Unique Variable "Hour
" by EMS, the components are controlled one hour later than the "Hour" we specify.
I reprodued the bug with an ExampleFile 5ZoneCAV_MaxTemp.idf (Any ExampleFiles are fine). The idf file is here (V23-2-0). I added EMS to override Fan Air Mass Flow Rate
of Supply Fan 1 as follows.
Fan:VariableVolume,
Supply Fan 1, !- Name
FanAvailSched, !- Availability Schedule Name
0.7, !- Fan Total Efficiency
600.0, !- Pressure Rise {Pa}
autosize, !- Maximum Flow Rate {m3/s}
Fraction, !- Fan Power Minimum Flow Rate Input Method
0.25, !- Fan Power Minimum Flow Fraction
, !- Fan Power Minimum Air Flow Rate {m3/s}
0.9, !- Motor Efficiency
1.0, !- Motor In Airstream Fraction
0.35071223, !- Fan Power Coefficient 1
0.30850535, !- Fan Power Coefficient 2
-0.54137364, !- Fan Power Coefficient 3
0.87198823, !- Fan Power Coefficient 4
0.000, !- Fan Power Coefficient 5
Main Heating Coil 1 Outlet Node, !- Air Inlet Node Name
VAV Sys 1 Outlet Node; !- Air Outlet Node Name
EnergyManagementSystem:Actuator,
Fan_Flow, !- Name
Supply Fan 1, !- Actuated Component Unique Name
Fan, !- Actuated Component Type
Fan Air Mass Flow Rate; !- Actuated Component Control Type
EnergyManagementSystem:ProgramCallingManager,
EMS_PCM_Fan_Flow, !- Name
InsideHVACSystemIterationLoop, !- EnergyPlus Model Calling Point
EMS_Program_Fan_Flow; !- Program Name 1
EnergyManagementSystem:Program,
EMS_Program_Fan_Flow, !- Name
IF (Hour >10) && (Hour <= 15), !- Program Line 1
SET Fan_Flow = 0, !- Program Line 2
ELSE, !- A4
SET Fan_Flow = 0.480944716911248, !- A5
ENDIF; !- A6
TimeStep is set to 6. The original Fan Availability Schedule is 1 for 24h a day from Jan to Mar. Fan Air Mass Flow Rate
of Supply Fan 1 is supposed to be 0 kg/s from 10:10:00 to 15:00:00 aftter I added EMS above. However, the simulation result shows that it is 0 kg/s from 11:10:00 to 16:00:00.
The bug occurs in other actuated components in AirLoop and PlantLoop as well such as Pumps. I haven't tested all the Calling Points, but InsideHVACSystemIterationLoop
is often used to control HVAC systems, and the "Hour
" specification in that calling point should be correctly simulated as entered by users.
Addendum
@Aaron Boranian, please let me show you another example. An ExampleFile EMSCustomSchedule.idf overrides Cooling Setpoint Temperature Schedule in ThermostatSetpoint:DualSetpoint
as follows.
EnergyManagementSystem:Actuator,
myCLGSETP_SCH_Override, !- Name
CLGSETP_SCH, !- Actuated Component Unique Name
Schedule:Constant, !- Actuated Component Type
Schedule Value; !- Actuated Component Control Type
EnergyManagementSystem:ProgramCallingManager,
My Setpoint Schedule Calculator Example, !- Name
InsideHVACSystemIterationLoop, !- EnergyPlus Model Calling Point
MyComputedCoolingSetpointProg, !- Program Name 1
EnergyManagementSystem:Program,
MyComputedCoolingSetpointProg, !- Name
IF (DayOfWeek == 1), !- Program Line 1
Set myCLGSETP_SCH_Override = 30.0, !- Program Line 2
ELSEIF (Holiday == 3.0) && (DayOfMonth == 21) && (Month == 1), !- A4
Set myCLGSETP_SCH_Override = 30.0, !- A5
ELSEIF HOUR < 6, !- A6
Set myCLGSETP_SCH_Override = 30.0, !- A7
ELSEIF (Hour >= 6) && (Hour < 22) && (DayOfWeek >=2) && (DayOfWeek < ...