2

Plant Component EMS On/Off - Openstudio

I am trying to turn off my ASHP and turn on my Backup boiler based on the outdoor air temperature.

Below runs without errors but i am not seeing the desired results. The boiler is not turning on:

# Outdoor Air Sensor
ems_oa_db_sensor = OpenStudio::Model::EnergyManagementSystemSensor.new(model, "Site Outdoor Air Drybulb Temperature")
ems_oa_db_sensor.setName("OutdoorTemp")
ems_oa_db_sensor.setKeyName("Environment")

# ASHP Actuator 
ashp_heating_actuator = OpenStudio::Model::EnergyManagementSystemActuator.new(ashp_heating,  "Plant Component HeatPump:PlantLoop:EIR:Heating", "On/Off Supervisory")
ashp_heating_actuator.setName("ASHP_Heating_OnOff")

# Boiler Actuator
backup_boiler_actuator = OpenStudio::Model::EnergyManagementSystemActuator.new(backup_boiler,  "Plant Component Boiler:HotWater", "On/Off Supervisory")
backup_boiler_actuator.setName("Backup_Boiler_OnOff")

# EMS
ems_program = OpenStudio::Model::EnergyManagementSystemProgram.new(model)
ems_program.setName("HW_loop_operation")
ems_program.addLine("IF (OutdoorTemp < 10.0),")
ems_program.addLine("SET Boiler_Branch_OnOff = 1,")  # Turn Boiler branch ON
ems_program.addLine("SET ASHP_Branch_OnOff = 0,")    # Turn ASHP branch OFF
ems_program.addLine("ELSE,")
ems_program.addLine("SET Boiler_Branch_OnOff = 0,")  # Turn Boiler branch OFF
ems_program.addLine("SET ASHP_Branch_OnOff = 1,")    # Turn ASHP branch ON
ems_program.addLine("ENDIF;")

# EMS program calling manager
ems_calling_manager = OpenStudio::Model::EnergyManagementSystemProgramCallingManager.new(model)
ems_calling_manager.setName("Backup Boiler OnOff Management")
ems_calling_manager.setCallingPoint("InsideHVACSystemIterationLoop")
ems_calling_manager.addProgram(ems_program)
Smarente's avatar
31
Smarente
asked 2024-03-07 18:58:06 -0500
Aaron Boranian's avatar
14.1k
Aaron Boranian
updated 2024-03-08 07:22:55 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

First of all, you should not be using commas and semicolons in the addLine methods -- OpenStudio will do that for you.

Also, I think you want to use Null instead of 1 to resume normal operation, as shown in this EMS example.

So combined, your code would be:

ems_program = OpenStudio::Model::EnergyManagementSystemProgram.new(model)
ems_program.setName("HW_loop_operation")
ems_program.addLine("IF (OutdoorTemp < 10.0)")
ems_program.addLine("SET Boiler_Branch_OnOff = Null")  # Turn Boiler branch ON
ems_program.addLine("SET ASHP_Branch_OnOff = 0")    # Turn ASHP branch OFF
ems_program.addLine("ELSE,")
ems_program.addLine("SET Boiler_Branch_OnOff = 0")  # Turn Boiler branch OFF
ems_program.addLine("SET ASHP_Branch_OnOff = Null")    # Turn ASHP branch ON
ems_program.addLine("ENDIF")

Also, 10C (50F) is an awfully high switchover temperature. Is that really what you intended?

Finally, if all of this doesn't help, you may need to debug the EMS program by setting the "EnergyPlus Runtime Language Debug Output Level" field of the Output:EnergyManagementSystem object to "Verbose" and looking at the EDD output file.

shorowit's avatar
11.8k
shorowit
answered 2024-03-08 10:57:46 -0500, updated 2024-03-08 10:58:23 -0500
edit flag offensive 0 remove flag delete link

Comments

Thanks! This is still not producing the results. The EDD file shows that the program is running. Any additional examples? Or something to look for in the EDD?

<Erl program name, line #, line text, result, occurrence timing information ... >
HW_LOOP_OPERATION,Line 1,IF (OUTDOORTEMP < 10.0),0.0, During Warmup, Occurrence info=VANCOUVER INT'L ANN CLG .4% CONDNS DB=>MWB, 08/21 00:00 - 00:10
HW_LOOP_OPERATION,Line 4,ELSE,1.000000, During Warmup, Occurrence info=VANCOUVER INT'L
Smarente's avatar Smarente (2024-03-08 12:06:05 -0500) edit
add a comment see more comments