-
Notifications
You must be signed in to change notification settings - Fork 58
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
Appendix G dev swh single building #1692
Changes from 28 commits
d6b87f3
1136187
0789749
49a70a0
d1c39f1
4373118
7a2b8ab
47fdc19
5a96948
0b13eb8
70b087b
8b20f11
8048cc3
7a3aff4
a9fa54d
52bb35d
3e82d1f
b60765e
4f9de06
8e76845
3e5dd2f
70ba3bb
d3c5c99
93e47dd
08ca98a
134e463
9848c1c
1a14429
7f801c9
dfdc686
6fab85f
8e451f5
a346a74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
class ASHRAE901PRM2019 < ASHRAE901PRM | ||
|
||
# Apply the prm parameter to a water heater based on the | ||
# building area type. | ||
# @param water_heater_mixed [OpenStudio::Model::WaterHeaterMixed] water heater mixed object | ||
# @param building_type_swh [String] the swh building are type | ||
# @return [Boolean] returns true if successful, false if not | ||
def model_apply_water_heater_prm_parameter(water_heater_mixed, building_type_swh) | ||
new_fuel = water_heater_mixed_apply_prm_baseline_fuel_type(building_type_swh) | ||
water_heater_mixed_apply_efficiency(water_heater_mixed) | ||
# Change the fuel type if necessary | ||
old_fuel = water_heater_mixed.heaterFuelType | ||
unless new_fuel == old_fuel | ||
water_heater_mixed.setHeaterFuelType(new_fuel) | ||
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.WaterHeaterMixed', "For #{water_heater_mixed.name}, changed baseline water heater fuel from #{old_fuel} to #{new_fuel}.") | ||
end | ||
return true | ||
end | ||
# Apply the prm fuel type to a water heater based on the | ||
# building area type. | ||
# @param building_type [String] the building type (For consistency with the standard class, not used in the method) | ||
# @return [string] returns the new fuel | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use enum There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep using string as discussed. |
||
def water_heater_mixed_apply_prm_baseline_fuel_type(building_type) | ||
# Get the fuel type data | ||
heater_prop = model_find_object(standards_data['prm_swh_bldg_type'], {'swh_building_type' => building_type}) | ||
new_fuel_data = heater_prop['baseline_heating_method'] | ||
# There are only two water heater fuel type in the prm database: | ||
# ("Gas Storage" and "Electric Resistance Storage") | ||
# Change the prm fuel type to openstudio fuel type | ||
if new_fuel_data == "Gas Storage" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to start using enums instead of strings. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep using string as discussed. |
||
new_fuel = "NaturalGas" | ||
else | ||
new_fuel = "Electricity" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use single quote for strings There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Modified. |
||
end | ||
return new_fuel | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest commenting out the else for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done