Skip to content

Commit

Permalink
Merge pull request #132 from NREL/create_typical_unit_tests
Browse files Browse the repository at this point in the history
unit test fixes
  • Loading branch information
mdahlhausen authored Mar 6, 2024
2 parents ca3cfcd + 7a671e2 commit 27290a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>create_typical_building_from_model</name>
<uid>339a2e3a-273c-4494-bb50-bfe586a0647c</uid>
<version_id>5815cc73-0b2b-46bc-9ae2-7ead558f15ce</version_id>
<version_modified>2024-01-03T18:32:46Z</version_modified>
<version_id>0d175608-4423-4f34-b2e0-80c11ecfbeca</version_id>
<version_modified>2024-03-06T20:35:24Z</version_modified>
<xml_checksum>EE13F09F</xml_checksum>
<class_name>CreateTypicalBuildingFromModel</class_name>
<display_name>Create Typical Building from Model</display_name>
Expand Down Expand Up @@ -1465,7 +1465,7 @@
<filename>Model.hvac.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>C6E68B0D</checksum>
<checksum>12DE0C84</checksum>
</file>
<file>
<filename>deer_vintages.rb</filename>
Expand All @@ -1483,7 +1483,7 @@
<filename>os_lib_model_generation.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>3097D1DE</checksum>
<checksum>477FE285</checksum>
</file>
<file>
<filename>GenericGbxml.osm</filename>
Expand Down Expand Up @@ -1543,7 +1543,7 @@
<filename>create_typical_building_from_model_test.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>484CE1FC</checksum>
<checksum>7389B9AD</checksum>
</file>
<file>
<filename>ecc.osm</filename>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,7 @@ def typical_building_from_model(model, runner, user_arguments)

# validate climate zone
if !args.key?('climate_zone') || args['climate_zone'] == 'Lookup From Model'
climate_zone = standard.model_get_building_climate_zone_and_building_type(model)['climate_zone']
climate_zone = standard.model_get_building_properties(model)['climate_zone']
runner.registerInfo("Using climate zone #{climate_zone} from model")
else
climate_zone = args['climate_zone']
Expand Down Expand Up @@ -2679,7 +2679,7 @@ def typical_building_from_model(model, runner, user_arguments)
occ_type = 'Nonresidential'
end
if !args.has_key?('climate_zone') || args['climate_zone'] == 'Lookup From Model'
climate_zone = standard.model_get_building_climate_zone_and_building_type(model)['climate_zone']
climate_zone = standard.model_get_building_properties(model)['climate_zone']
runner.registerInfo("Using climate zone #{climate_zone} from model")
else
climate_zone = args['climate_zone']
Expand Down Expand Up @@ -2920,26 +2920,6 @@ def typical_building_from_model(model, runner, user_arguments)
if !stripmall_swh_loops.empty?
runner.registerInfo("Adding #{stripmall_swh_loops.size} RetailStripmall service water heating loops.")
end

# Modify Pipe:Indoor objects to have an ambient temperature that's always
# higher than the warmest Site:WaterMainsTemperature found in the year
# TODO remove once this EnergyPlus issue is closed: https://github.com/NREL/EnergyPlus/issues/9650
water_temp = model.getSiteWaterMainsTemperature
mean_c = water_temp.annualAverageOutdoorAirTemperature.get
max_delta_c = water_temp.maximumDifferenceInMonthlyAverageOutdoorAirTemperatures.get
max_temp_c = mean_c + (0.5 * max_delta_c) + 3.0 # To ensure higher than mains temp
max_temp_c = max_temp_c.round(1)
max_temp_f = OpenStudio.convert(max_temp_c, 'C', 'F').get
max_temp_f = max_temp_f.round(1)
pipe_indoor_temp_sch = OpenStudio::Model::ScheduleConstant.new(model)
pipe_indoor_temp_sch.setName("Temporary Pipe Indoor Ambient Temp #{max_temp_f}F")
pipe_indoor_temp_sch.setValue(max_temp_c)
model.getPipeIndoors.each do |heat_loss_pipe|
# TODO schedule type registry error for this setter
# heat_loss_pipe.setAmbientTemperatureSchedule(pipe_indoor_temp_sch)
heat_loss_pipe.setPointer(7, pipe_indoor_temp_sch.handle)
end
runner.registerWarning("Set Pipe:Indoor ambient temp schedules to #{max_temp_f}F to avoid E+ issue 9650, remove once fixed.")
end

# add_daylighting_controls (since outdated measure don't have this default to true if arg not found)
Expand Down

0 comments on commit 27290a0

Please sign in to comment.