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

Mech Vent Preconditioning - Loads #753

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
26 changes: 23 additions & 3 deletions HPXMLtoOpenStudio/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,7 @@ def self.add_total_loads_output(runner, model, living_zone)
tot_load_sensors[:clg] = OpenStudio::Model::EnergyManagementSystemSensor.new(model, 'Cooling:EnergyTransfer')
tot_load_sensors[:clg].setName('clg_load_tot')

# Need to adjusted E+ EnergyTransfer meters for dehumidifiers
# Need to adjust E+ EnergyTransfer meters for dehumidifiers
intgain_dehumidifier = nil
model.getZoneHVACDehumidifierDXs.each do |e|
next unless e.thermalZone.get.name.to_s == living_zone.name.to_s
Expand All @@ -2138,14 +2138,25 @@ def self.add_total_loads_output(runner, model, living_zone)
program.setName(Constants.ObjectNameTotalLoadsProgram)
program.addLine('Set loads_htg_tot = 0')
program.addLine('Set loads_clg_tot = 0')
# Need to adjust E+ EnergyTransfer meters for mech vent preconditioning
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjust total loads read from E+ output meter

# Fixme: is it possible to have cooling in hvac but heating in mech vent preconditioning? How to report load in that case?
# Fixme: Proceed reporting both
model.getEnergyManagementSystemGlobalVariables.sort.each do |ems_var|
next unless ems_var.name.to_s.start_with? 'Precond_'
if ems_var.name.to_s.start_with? 'Precond_HeatingLoad'
program.addLine("Set loads_htg_tot = loads_htg_tot + #{ems_var.name.get}")
else
program.addLine("Set loads_clg_tot = loads_clg_tot + #{ems_var.name.get}")
end
end
program.addLine("If #{liv_load_sensors[:htg].name} > 0")
s = " Set loads_htg_tot = #{tot_load_sensors[:htg].name} - #{tot_load_sensors[:clg].name}"
s = " Set loads_htg_tot = loads_htg_tot + #{tot_load_sensors[:htg].name} - #{tot_load_sensors[:clg].name}"
if not intgain_dehumidifier.nil?
s += " - #{intgain_dehumidifier.name}"
end
program.addLine(s)
program.addLine("ElseIf #{liv_load_sensors[:clg].name} > 0")
s = " Set loads_clg_tot = #{tot_load_sensors[:clg].name} - #{tot_load_sensors[:htg].name}"
s = " Set loads_clg_tot = loads_clg_tot + #{tot_load_sensors[:clg].name} - #{tot_load_sensors[:htg].name}"
if not intgain_dehumidifier.nil?
s += " + #{intgain_dehumidifier.name}"
end
Expand Down Expand Up @@ -2516,6 +2527,15 @@ def self.add_component_loads_output(runner, model, living_zone, liv_load_sensors
mechvent_sensors.each do |sensor|
program.addLine("Set hr_mechvent = hr_mechvent - #{sensor.name}")
end
# Adjust component load reporting for preconditioning
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjust component loads read from equipment objects (add preconditioning loads to mechvent subitem).

model.getEnergyManagementSystemGlobalVariables.sort.each do |ems_var|
next unless ems_var.name.to_s.start_with? 'Precond_'
if ems_var.name.to_s.start_with? 'Precond_HeatingLoad'
program.addLine("Set hr_mechvent = hr_mechvent + #{ems_var.name.get}")
else
program.addLine("Set hr_mechvent = hr_mechvent - #{ems_var.name.get}")
end
end
program.addLine('Set hr_ducts = 0')
ducts_sensors.each do |duct_sensors|
s = 'Set hr_ducts = hr_ducts'
Expand Down
4 changes: 4 additions & 0 deletions HPXMLtoOpenStudio/resources/airflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,7 @@ def self.calculate_precond_loads(model, infil_program, vent_mech_preheat, vent_m
vent_mech_preheat.each_with_index do |f_preheat, i|
infil_program.addLine("If (OASupInTemp < HtgStp) && (#{clg_ssn_sensor.name} < 1)")
htg_energy_actuator = create_other_equipment_object_and_actuator(model: model, name: "shared mech vent preheating energy #{i}", space: @living_space, frac_lat: 0.0, frac_lost: 1.0, hpxml_fuel_type: f_preheat.preheating_fuel, end_use: Constants.ObjectNameMechanicalVentilationPreconditioning)
htg_load_var = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(model, "Precond_HeatingLoad_#{i}")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Global variables created here for load reporting.

hvac_map["#{f_preheat.id}_preheat"] = [htg_energy_actuator.actuatedComponent.get]
infil_program.addLine(" Set Qpreheat = #{UnitConversions.convert(f_preheat.average_oa_unit_flow_rate, 'cfm', 'm^3/s').round(4)}")
if [HPXML::MechVentTypeERV, HPXML::MechVentTypeHRV].include? f_preheat.fan_type
Expand All @@ -1557,11 +1558,13 @@ def self.calculate_precond_loads(model, infil_program, vent_mech_preheat, vent_m
infil_program.addLine('Else')
infil_program.addLine(' Set PreHeatingWatt = 0.0')
infil_program.addLine('EndIf')
infil_program.addLine("Set #{htg_load_var.name.get} = PreHeatingWatt * ZoneTimeStep*3600")
infil_program.addLine("Set #{htg_energy_actuator.name} = PreHeatingWatt / #{f_preheat.preheating_efficiency_cop}")
end
vent_mech_precool.each_with_index do |f_precool, i|
infil_program.addLine("If (OASupInTemp > ClgStp) && (#{clg_ssn_sensor.name} > 0)")
clg_energy_actuator = create_other_equipment_object_and_actuator(model: model, name: "shared mech vent precooling energy #{i}", space: @living_space, frac_lat: 0.0, frac_lost: 1.0, hpxml_fuel_type: f_precool.precooling_fuel, end_use: Constants.ObjectNameMechanicalVentilationPreconditioning)
clg_load_var = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(model, "Precond_CoolingLoad_#{i}")
hvac_map["#{f_precool.id}_precool"] = [clg_energy_actuator.actuatedComponent.get]
infil_program.addLine(" Set Qprecool = #{UnitConversions.convert(f_precool.average_oa_unit_flow_rate, 'cfm', 'm^3/s').round(4)}")
if [HPXML::MechVentTypeERV, HPXML::MechVentTypeHRV].include? f_precool.fan_type
Expand All @@ -1582,6 +1585,7 @@ def self.calculate_precond_loads(model, infil_program, vent_mech_preheat, vent_m
infil_program.addLine('Else')
infil_program.addLine(' Set PreCoolingWatt = 0.0')
infil_program.addLine('EndIf')
infil_program.addLine("Set #{clg_load_var.name.get} = PreCoolingWatt * ZoneTimeStep*3600")
infil_program.addLine("Set #{clg_energy_actuator.name} = PreCoolingWatt / #{f_precool.precooling_efficiency_cop}")
end
end
Expand Down
4 changes: 2 additions & 2 deletions workflow/tests/base_results/results.csv
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ base-bldgtype-multifamily-shared-cooling-tower-only-water-loop-heat-pump.xml,26.
base-bldgtype-multifamily-shared-generator.xml,25.45,22.6,0.78,0.0,14.17,0.0,0.0,0.0,0.0,0.02,2.26,0.41,9.67,0.0,0.0,2.03,0.0,0.21,0.0,0.0,0.0,0.0,2.22,0.0,0.0,0.32,0.37,1.51,1.53,0.0,2.11,2.79,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-2.84,0.78,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,14.17,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.74,6.49,9.52,0.58,0.0,0.0,0.0,0.01,6188.0,6177.0,8.63,6.98,0.0,-0.01,2.61,0.0,0.0,0.41,1.46,0.0,-0.01,0.0,-0.34,1.64,0.0,0.51,0.0,0.0,-5.57,0.0,-0.0,-0.86,0.0,0.0,-0.04,3.33,0.0,-0.0,0.0,-0.33,-0.65,-3.11,-0.17,0.0,0.0,8.44,1354.0,998.0,11594.0,3210.0
base-bldgtype-multifamily-shared-ground-loop-ground-to-air-heat-pump.xml,27.48,27.48,0.0,0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,0.01,2882.0,2943.0,3.78,7.01,0.0,-0.01,2.64,0.0,0.0,0.41,1.44,0.0,-0.01,0.0,-0.33,2.08,0.0,0.0,0.0,0.0,-5.45,0.0,-0.0,-0.82,0.0,0.0,-0.03,3.34,0.0,-0.0,0.0,-0.32,-0.8,-3.07,0.0,0.0,0.0,7.95,1355.0,998.0,11403.0,3157.0
base-bldgtype-multifamily-shared-mechvent-multiple.xml,29.85,29.85,20.36,0.0,0.0,0.0,0.0,0.0,0.0,0.21,1.73,0.25,9.71,0.0,0.0,2.03,0.0,0.21,3.75,0.95,0.17,0.0,2.22,0.0,0.0,0.32,0.37,1.51,1.53,0.0,2.11,2.79,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,8.18,0.0,0.0,0.0,12.17,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,7.74,4.01,9.52,0.62,0.0,0.0,0.0,0.0,6412.0,6364.0,8.45,8.37,0.0,-0.01,2.83,0.0,0.0,0.4,0.44,0.0,-0.01,0.0,-0.25,0.15,0.0,12.34,0.0,0.0,-7.97,0.0,-0.0,-0.01,0.0,0.0,0.07,3.31,0.0,-0.01,0.0,-0.24,-0.01,-1.57,-3.77,0.0,0.0,6.08,1354.0,998.0,11593.0,3210.0
base-bldgtype-multifamily-shared-mechvent-preconditioning.xml,26.71,26.71,5.6,0.0,0.0,0.0,0.0,0.0,0.0,0.04,2.02,0.34,9.68,0.0,0.0,2.03,0.0,0.21,1.49,0.0,0.05,0.0,2.22,0.0,0.0,0.32,0.37,1.51,1.53,0.0,2.11,2.79,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.64,0.0,0.0,0.0,3.95,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.55,5.3,9.52,0.59,0.0,0.0,0.0,0.01,6242.0,6237.0,8.8,7.21,0.0,-0.01,2.78,0.0,0.0,0.41,1.19,0.0,-0.01,0.0,-0.27,1.71,0.0,2.35,0.0,0.0,-6.6,0.0,-0.0,-0.5,0.0,0.0,0.0,3.37,0.0,-0.01,0.0,-0.26,-0.43,-2.57,-1.68,0.0,0.0,7.42,1354.0,998.0,11593.0,3210.0
base-bldgtype-multifamily-shared-mechvent-multiple.xml,29.85,29.85,20.36,0.0,0.0,0.0,0.0,0.0,0.0,0.21,1.73,0.25,9.71,0.0,0.0,2.03,0.0,0.21,3.75,0.95,0.17,0.0,2.22,0.0,0.0,0.32,0.37,1.51,1.53,0.0,2.11,2.79,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,8.18,0.0,0.0,0.0,12.17,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,22.34,4.67,9.52,0.62,0.0,0.0,0.0,0.0,6412.0,6364.0,8.45,8.37,0.0,-0.01,2.83,0.0,0.0,0.4,0.44,0.0,-0.01,0.0,-0.25,0.15,0.0,26.92,0.0,0.0,-7.97,0.0,-0.0,-0.01,0.0,0.0,0.07,3.31,0.0,-0.01,0.0,-0.24,-0.01,-1.57,-3.13,0.0,0.0,6.08,1354.0,998.0,11593.0,3210.0
base-bldgtype-multifamily-shared-mechvent-preconditioning.xml,26.71,26.71,5.6,0.0,0.0,0.0,0.0,0.0,0.0,0.04,2.02,0.34,9.68,0.0,0.0,2.03,0.0,0.21,1.49,0.0,0.05,0.0,2.22,0.0,0.0,0.32,0.37,1.51,1.53,0.0,2.11,2.79,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.64,0.0,0.0,0.0,3.95,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,5.19,5.48,9.52,0.59,0.0,0.0,0.0,0.01,6242.0,6237.0,8.8,7.21,0.0,-0.01,2.78,0.0,0.0,0.41,1.19,0.0,-0.01,0.0,-0.27,1.71,0.0,5.86,0.0,0.0,-6.6,0.0,-0.0,-0.5,0.0,0.0,0.0,3.37,0.0,-0.01,0.0,-0.26,-0.43,-2.57,-1.64,0.0,0.0,7.42,1354.0,998.0,11593.0,3210.0
base-bldgtype-multifamily-shared-mechvent.xml,26.68,26.68,4.09,0.0,0.0,0.0,0.0,0.0,0.0,0.11,1.98,0.33,9.69,0.0,0.0,2.03,0.0,0.21,1.49,0.0,0.0,0.0,2.22,0.0,0.0,0.32,0.37,1.51,1.53,0.0,2.11,2.79,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,4.09,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,3.87,5.16,9.52,0.6,0.0,0.0,0.0,0.01,6254.0,6240.0,10.43,7.88,0.0,-0.01,2.75,0.0,0.0,0.38,0.68,0.0,-0.01,0.0,-0.18,1.65,0.0,5.71,0.0,0.0,-7.03,0.0,-0.0,-0.37,0.0,0.0,-0.0,3.1,0.0,-0.0,0.0,-0.17,-0.38,-2.57,-1.43,0.0,0.0,7.0,1354.0,998.0,11593.0,3210.0
base-bldgtype-multifamily-shared-pv.xml,25.45,1.01,0.78,0.0,0.0,0.0,0.0,0.0,0.0,0.02,2.26,0.41,9.67,0.0,0.0,2.03,0.0,0.21,0.0,0.0,0.0,0.0,2.22,0.0,0.0,0.32,0.37,1.51,1.53,0.0,2.11,2.79,0.0,0.0,0.0,0.0,0.0,0.0,-24.43,0.0,0.78,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.74,6.49,9.52,0.58,0.0,0.0,0.0,0.01,6188.0,6177.0,8.63,6.98,0.0,-0.01,2.61,0.0,0.0,0.41,1.46,0.0,-0.01,0.0,-0.34,1.64,0.0,0.51,0.0,0.0,-5.57,0.0,-0.0,-0.86,0.0,0.0,-0.04,3.33,0.0,-0.0,0.0,-0.33,-0.65,-3.11,-0.17,0.0,0.0,8.44,1354.0,998.0,11594.0,3210.0
base-bldgtype-multifamily-shared-water-heater-recirc.xml,16.79,16.79,13.48,0.0,0.0,0.0,0.0,0.0,0.0,0.03,2.19,0.39,0.0,1.1,0.0,2.03,0.0,0.21,0.0,0.0,0.0,0.0,2.22,0.0,0.0,0.32,0.37,1.51,1.53,0.0,2.11,2.79,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.97,12.51,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.92,6.2,9.54,0.57,0.0,0.0,0.0,0.01,2931.0,3065.0,8.78,7.01,0.0,-0.01,2.65,0.0,0.0,0.41,1.4,0.0,-0.01,0.0,-0.34,2.0,0.0,0.51,0.0,0.0,-5.71,0.0,-0.0,-0.79,0.0,0.0,-0.03,3.33,0.0,-0.0,0.0,-0.33,-0.74,-3.05,-0.17,0.0,0.0,8.09,1355.0,998.0,11403.0,3157.0
Expand Down