Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace existing zone thermostat with constant thermostat to control radiant system #1546

Merged
merged 3 commits into from
Aug 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def model_add_radiant_proportional_controls(model, zone, radiant_loop,

# radiant system heating control actuator
sch_radiant_htgsetp = model_add_constant_schedule_ruleset(model,
20,
20.0,
name = "#{zone_name}_Sch_Radiant_HtgSetP")
coil_heating_radiant.setHeatingControlTemperatureSchedule(sch_radiant_htgsetp)
cmd_hot_water_ctrl = OpenStudio::Model::EnergyManagementSystemActuator.new(sch_radiant_htgsetp,
Expand Down Expand Up @@ -172,15 +172,43 @@ def model_add_radiant_proportional_controls(model, zone, radiant_loop,
zone_ctrl_temperature.setName("#{zone_name}_ctrl_temperature")
zone_ctrl_temperature.setKeyName(zone.name.get)

# check for zone thermostats
# check for zone thermostat and replace heat/cool schedules for radiant system control
# if there is no zone thermostat, then create one
zone_thermostat = zone.thermostatSetpointDualSetpoint
unless zone_thermostat.is_initialized
OpenStudio.logFree(OpenStudio::Error, 'openstudio.Model.Model', "Zone #{zone.name} does not have thermostats.")
return false

if zone_thermostat.is_initialized
OpenStudio.logFree(OpenStudio::Info, 'openstudio.Model.Model', "Replacing thermostat schedules in zone #{zone.name} for radiant system control.")
zone_thermostat = zone.thermostatSetpointDualSetpoint.get
else
OpenStudio.logFree(OpenStudio::Info, 'openstudio.Model.Model', "Zone #{zone.name} does not have a thermostat. Creating a thermostat for radiant system control.")
zone_thermostat = OpenStudio::Model::ThermostatSetpointDualSetpoint.new(model)
zone_thermostat.setName("#{zone_name}_Thermostat_DualSetpoint")
end

# create new heating and cooling schedules to be used with all radiant systems
zone_htg_thermostat = model.getScheduleRulesetByName("Radiant System Heating Setpoint")
if zone_htg_thermostat.is_initialized
zone_htg_thermostat = zone_htg_thermostat.get
else
zone_htg_thermostat = model_add_constant_schedule_ruleset(model,
20.0,
name = "Radiant System Heating Setpoint",
sch_type_limit: "Temperature")
end
zone_thermostat = zone.thermostatSetpointDualSetpoint.get
zone_clg_thermostat = zone_thermostat.coolingSetpointTemperatureSchedule.get
zone_htg_thermostat = zone_thermostat.heatingSetpointTemperatureSchedule.get

zone_clg_thermostat = model.getScheduleRulesetByName("Radiant System Cooling Setpoint")
if zone_clg_thermostat.is_initialized
zone_clg_thermostat = zone_clg_thermostat.get
else
zone_clg_thermostat = model_add_constant_schedule_ruleset(model,
26.0,
name = "Radiant System Cooling Setpoint",
sch_type_limit: "Temperature")
end

# implement new heating and cooling schedules
zone_thermostat.setHeatingSetpointTemperatureSchedule(zone_htg_thermostat)
zone_thermostat.setCoolingSetpointTemperatureSchedule(zone_clg_thermostat)

# Upper comfort limit for the zone. Taken from existing thermostat schedules in the zone.
zone_upper_comfort_limit = OpenStudio::Model::EnergyManagementSystemSensor.new(model, 'Schedule Value')
Expand Down