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

Switch to E+ Coil:Cooling:DX #1903

Draft
wants to merge 4 commits into
base: resnet_heat_pump
Choose a base branch
from
Draft
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
12 changes: 6 additions & 6 deletions HPXMLtoOpenStudio/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>hpxm_lto_openstudio</name>
<uid>b1543b30-9465-45ff-ba04-1d1f85e763bc</uid>
<version_id>97fc349a-4201-4428-8454-cd6cbb5e4a2e</version_id>
<version_modified>2024-12-24T01:14:23Z</version_modified>
<version_id>189a87d0-7370-466b-94a3-76a41b7cbb10</version_id>
<version_modified>2024-12-25T01:55:02Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -387,7 +387,7 @@
<filename>hvac.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>6C8C42B4</checksum>
<checksum>53C0A83F</checksum>
</file>
<file>
<filename>hvac_sizing.rb</filename>
Expand Down Expand Up @@ -627,7 +627,7 @@
<filename>waterheater.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>B6FE7ABC</checksum>
<checksum>DC0AA5D1</checksum>
</file>
<file>
<filename>weather.rb</filename>
Expand Down Expand Up @@ -687,7 +687,7 @@
<filename>test_hvac.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>20BDB294</checksum>
<checksum>1D58558E</checksum>
</file>
<file>
<filename>test_hvac_sizing.rb</filename>
Expand Down Expand Up @@ -741,7 +741,7 @@
<filename>test_water_heater.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>60CD4A1F</checksum>
<checksum>6A47D4C3</checksum>
</file>
<file>
<filename>test_weather.rb</filename>
Expand Down
185 changes: 98 additions & 87 deletions HPXMLtoOpenStudio/resources/hvac.rb

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions HPXMLtoOpenStudio/resources/waterheater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1497,9 +1497,7 @@ def self.apply_desuperheater(model, runner, water_heating_system, tank, loc_spac

# Get the HVAC cooling coil for the desuperheater
desuperheater_clg_coil = nil
(model.getCoilCoolingDXSingleSpeeds +
model.getCoilCoolingDXMultiSpeeds +
model.getCoilCoolingWaterToAirHeatPumpEquationFits).each do |clg_coil|
(model.getCoilCoolingDXs + model.getCoilCoolingWaterToAirHeatPumpEquationFits).each do |clg_coil|
sys_id = clg_coil.additionalProperties.getFeatureAsString('HPXML_ID')
if sys_id.is_initialized && sys_id.get == water_heating_system.related_hvac_idref
desuperheater_clg_coil = clg_coil
Expand Down
358 changes: 225 additions & 133 deletions HPXMLtoOpenStudio/tests/test_hvac.rb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions HPXMLtoOpenStudio/tests/test_water_heater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def test_dsh_1_speed
assert_equal(1, model.getCoilWaterHeatingDesuperheaters.size)
preheat_tank = model.getWaterHeaterMixeds.find { |wh| wh.name.get.include? 'storage tank' }
dsh_coil = model.getCoilWaterHeatingDesuperheaters[0]
assert_equal(true, dsh_coil.heatingSource.get.to_CoilCoolingDXSingleSpeed.is_initialized)
assert_equal(true, dsh_coil.heatingSource.get.to_CoilCoolingDX.is_initialized)
assert_equal(preheat_tank, dsh_coil.heatRejectionTarget.get.to_WaterHeaterMixed.get)
end

Expand Down Expand Up @@ -430,7 +430,7 @@ def test_dsh_var_speed
assert_equal(1, model.getCoilWaterHeatingDesuperheaters.size)
preheat_tank = model.getWaterHeaterMixeds.find { |wh| wh.name.get.include? 'storage tank' }
dsh_coil = model.getCoilWaterHeatingDesuperheaters[0]
assert_equal(true, dsh_coil.heatingSource.get.to_CoilCoolingDXMultiSpeed.is_initialized)
assert_equal(true, dsh_coil.heatingSource.get.to_CoilCoolingDX.is_initialized)
assert_equal(preheat_tank, dsh_coil.heatRejectionTarget.get.to_WaterHeaterMixed.get)
end

Expand Down
28 changes: 4 additions & 24 deletions ReportSimulationOutput/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2195,7 +2195,7 @@ def create_all_object_outputs_by_key
next if object.to_AdditionalProperties.is_initialized

[EUT, HWT, LT, RT].each do |class_name|
vars_by_key = get_object_outputs_by_key(@model, object, class_name)
vars_by_key = get_object_outputs_by_key(object, class_name)
next if vars_by_key.size == 0

sys_id = object.additionalProperties.getFeatureAsString('HPXML_ID')
Expand Down Expand Up @@ -2816,11 +2816,10 @@ def get_hpxml_system_ids

# TODO
#
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param object [TODO] TODO
# @param class_name [TODO] TODO
# @return [TODO] TODO
def get_object_outputs_by_key(model, object, class_name)
def get_object_outputs_by_key(object, class_name)
# For a given object, returns the Output:Variables or Output:Meters to be requested,
# and associates them with the appropriate keys (e.g., [FT::Elec, EUT::Heating]).

Expand Down Expand Up @@ -2884,27 +2883,8 @@ def get_object_outputs_by_key(model, object, class_name)
return { [to_ft[fuel], EUT::HotWater] => ["Boiler #{fuel} Energy", "Boiler Ancillary #{fuel} Energy"] }
end

elsif object.to_CoilCoolingDXSingleSpeed.is_initialized || object.to_CoilCoolingDXMultiSpeed.is_initialized
vars = { [FT::Elec, EUT::Cooling] => ["Cooling Coil #{EPlus::FuelTypeElectricity} Energy"] }
parent = model.getAirLoopHVACUnitarySystems.select { |u| u.coolingCoil.is_initialized && u.coolingCoil.get.handle.to_s == object.handle.to_s }
if (not parent.empty?) && parent[0].heatingCoil.is_initialized
htg_coil = parent[0].heatingCoil.get
end
if parent.empty?
parent = model.getZoneHVACPackagedTerminalAirConditioners.select { |u| u.coolingCoil.handle.to_s == object.handle.to_s }
if not parent.empty?
htg_coil = parent[0].heatingCoil
end
end
if parent.empty?
fail 'Could not find parent object.'
end

if htg_coil.nil? || (not (htg_coil.to_CoilHeatingDXSingleSpeed.is_initialized || htg_coil.to_CoilHeatingDXMultiSpeed.is_initialized))
# Crankcase variable only available if no DX heating coil on parent
vars[[FT::Elec, EUT::Cooling]] << "Cooling Coil Crankcase Heater #{EPlus::FuelTypeElectricity} Energy"
end
return vars
elsif object.to_CoilCoolingDX.is_initialized
return { [FT::Elec, EUT::Cooling] => ["Cooling Coil #{EPlus::FuelTypeElectricity} Energy", "Cooling Coil Crankcase Heater #{EPlus::FuelTypeElectricity} Energy"] }

elsif object.to_CoilCoolingWaterToAirHeatPumpEquationFit.is_initialized
return { [FT::Elec, EUT::Cooling] => ["Cooling Coil #{EPlus::FuelTypeElectricity} Energy"] }
Expand Down
6 changes: 3 additions & 3 deletions ReportSimulationOutput/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>report_simulation_output</name>
<uid>df9d170c-c21a-4130-866d-0d46b06073fd</uid>
<version_id>5e609cb1-8e83-479b-afda-c1de10cd62ea</version_id>
<version_modified>2024-11-27T02:33:41Z</version_modified>
<version_id>28f7cad1-b2cc-4e4a-82fa-fa9bb9e5cf95</version_id>
<version_modified>2024-12-25T00:00:26Z</version_modified>
<xml_checksum>9BF1E6AC</xml_checksum>
<class_name>ReportSimulationOutput</class_name>
<display_name>HPXML Simulation Output Report</display_name>
Expand Down Expand Up @@ -1929,7 +1929,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>4C7478A8</checksum>
<checksum>293C17AF</checksum>
</file>
<file>
<filename>test_report_sim_output.rb</filename>
Expand Down
2 changes: 1 addition & 1 deletion workflow/tests/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def _verify_outputs(rundir, hpxml_path, results, hpxml, unit_multiplier)
end
# variable system SHR adjustment
if (hpxml_bldg.heat_pumps + hpxml_bldg.cooling_systems).count { |hp| hp.compressor_type == HPXML::HVACCompressorTypeVariableSpeed } > 0
next if message.include?('CalcCBF: SHR adjusted to achieve valid outlet air properties and the simulation continues.')
next if message.include?('CalcBypassFactor') || message.include?('CalcCBF')
end
# Evaporative coolers
if hpxml_bldg.cooling_systems.count { |c| c.cooling_system_type == HPXML::HVACTypeEvaporativeCooler } > 0
Expand Down