First time here? Check out the Help page!
1 | initial version |
here is some sample ruby code that you would use in a measure to create a sensor, an actuator and a program:
output_var = "Site Outdoor Air Drybulb Temperature" output_var_oat = OpenStudio::Model::OutputVariable.new(output_var, model)
oat_sensor = OpenStudio::Model::EnergyManagementSystemSensor.new(model, output_var_oat) oat_sensor_name = "OATdb Sensor" oat_sensor.setName(oat_sensor_name)
always_on = model.alwaysOnDiscreteSchedule fan = OpenStudio::Model::FanConstantVolume.new(model,always_on)
fan_press = "Fan Pressure Rise" fan_actuator = OpenStudio::Model::EnergyManagementSystemActuator.new(fan, "fan", fan_press) fan_actuator.setName("#{fan.name} Press Actuator")
fan_program_1 = OpenStudio::Model::EnergyManagementSystemProgram.new(model) fan_program_1.setName("#{fan.name} Pressure Rise Program by Line") fan_program_1_body = <<-EMS SET mult = #{oat_sensor.handle} / 15.0 !- This is nonsense SET #{fan_actuator.handle} = 250 * mult !- More nonsense EMS fan_program_1.setBody(fan_program_1_body)
fan_program_2 = OpenStudio::Model::EnergyManagementSystemProgram.new(model) fan_program_2.setName("#{fan.name} Pressure Rise Program by Line") fan_program_2.addLine("SET mult = #{oat_sensor.handle} / 15.0 !- This is nonsense") fan_program_2.addLine("SET #{fan_actuator.handle} = 250 * mult !- More nonsense")
fan_program_3 = OpenStudio::Model::EnergyManagementSystemProgram.new(model) fan_program_3.setName("#{fan.name} Pressure Rise Program by Vector of Lines") fan_program_3_lines = [] fan_program_3_lines << "SET mult = #{oat_sensor.handle} / 15.0 !- This is nonsense" fan_program_3_lines << "SET #{fan_actuator.handle} = 250 * mult !- More nonsense" fan_program_3.setLines(fan_program_3_lines)
2 | No.2 Revision |
here is some sample ruby code that you would use in a measure to create a sensor, an actuator and a program:
output_var = "Site Outdoor Air Drybulb Temperature"
Temperature"
output_var_oat = OpenStudio::Model::OutputVariable.new(output_var, model)
oat_sensor = OpenStudio::Model::EnergyManagementSystemSensor.new(model, output_var_oat)
output_var_oat)
oat_sensor_name = "OATdb Sensor"
Sensor"
oat_sensor.setName(oat_sensor_name)
always_on = model.alwaysOnDiscreteSchedule
model.alwaysOnDiscreteSchedule
fan = OpenStudio::Model::FanConstantVolume.new(model,always_on)
fan_press = "Fan Pressure Rise"
Rise"
fan_actuator = OpenStudio::Model::EnergyManagementSystemActuator.new(fan, "fan", fan_press)
fan_press)
fan_actuator.setName("#{fan.name} Press Actuator")
fan_program_1 = OpenStudio::Model::EnergyManagementSystemProgram.new(model)
OpenStudio::Model::EnergyManagementSystemProgram.new(model)
fan_program_1.setName("#{fan.name} Pressure Rise Program by Line")
Line")
fan_program_1_body = <<-EMS
<<-EMS
SET mult = #{oat_sensor.handle} / 15.0 !- This is nonsense
nonsense
SET #{fan_actuator.handle} = 250 * mult !- More nonsense
EMS
nonsense
EMS
fan_program_1.setBody(fan_program_1_body)
fan_program_2 = OpenStudio::Model::EnergyManagementSystemProgram.new(model)
OpenStudio::Model::EnergyManagementSystemProgram.new(model)
fan_program_2.setName("#{fan.name} Pressure Rise Program by Line")
Line")
fan_program_2.addLine("SET mult = #{oat_sensor.handle} / 15.0 !- This is nonsense")
nonsense")
fan_program_2.addLine("SET #{fan_actuator.handle} = 250 * mult !- More nonsense")
fan_program_3 = OpenStudio::Model::EnergyManagementSystemProgram.new(model)
OpenStudio::Model::EnergyManagementSystemProgram.new(model)
fan_program_3.setName("#{fan.name} Pressure Rise Program by Vector of Lines")
Lines")
fan_program_3_lines = []
[]
fan_program_3_lines << "SET mult = #{oat_sensor.handle} / 15.0 !- This is nonsense"
nonsense"
fan_program_3_lines << "SET #{fan_actuator.handle} = 250 * mult !- More nonsense"
nonsense"
fan_program_3.setLines(fan_program_3_lines)
3 | No.3 Revision |
here is some sample ruby code that you would use in a measure to create a sensor, an actuator and a program:
output_var = "Site Outdoor Air Drybulb Temperature"
output_var_oat = OpenStudio::Model::OutputVariable.new(output_var, model)
oat_sensor = OpenStudio::Model::EnergyManagementSystemSensor.new(model, output_var_oat)
oat_sensor_name = "OATdb Sensor"
oat_sensor.setName(oat_sensor_name)
always_on = model.alwaysOnDiscreteSchedule
fan = OpenStudio::Model::FanConstantVolume.new(model,always_on)
fan_press = "Fan Pressure Rise"
fan_actuator = OpenStudio::Model::EnergyManagementSystemActuator.new(fan, "fan", fan_press)
fan_actuator.setName("#{fan.name} Press Actuator")
fan_program_1 = OpenStudio::Model::EnergyManagementSystemProgram.new(model)
fan_program_1.setName("#{fan.name} Pressure Rise Program by Line")
fan_program_1_body = <<-EMS
SET mult = #{oat_sensor.handle} / 15.0 !- This is nonsense
SET #{fan_actuator.handle} = 250 * mult !- More nonsense
EMS
fan_program_1.setBody(fan_program_1_body)
fan_program_2 = OpenStudio::Model::EnergyManagementSystemProgram.new(model)
fan_program_2.setName("#{fan.name} Pressure Rise Program by Line")
fan_program_2.addLine("SET mult = #{oat_sensor.handle} / 15.0 !- This is nonsense")
fan_program_2.addLine("SET #{fan_actuator.handle} = 250 * mult !- More nonsense")
fan_program_3 = OpenStudio::Model::EnergyManagementSystemProgram.new(model)
fan_program_3.setName("#{fan.name} Pressure Rise Program by Vector of Lines")
fan_program_3_lines = []
fan_program_3_lines << "SET mult = #{oat_sensor.handle} / 15.0 !- This is nonsense"
fan_program_3_lines << "SET #{fan_actuator.handle} = 250 * mult !- More nonsense"
fan_program_3.setLines(fan_program_3_lines)
4 | No.4 Revision |
here is some sample ruby code that you would use in a measure to create a sensor, an actuator and a program:
output_var = "Site Outdoor Air Drybulb
oat_sensor = OpenStudio::Model::EnergyManagementSystemSensor.new(model, oat_sensor.setName(oat_sensor_name)
always_on =
fan_press = "Fan Pressure
fan_program_1 = EMS
fan_program_1.setBody(fan_program_1_body)
fan_program_2 =
fan_program_3 = fan_program_3.setLines(fan_program_3_lines)