Skip to content

Commit

Permalink
Merge branch 'ev_batteries' into ev_schedules
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeee committed Jan 2, 2025
2 parents 30da3d8 + d44ac99 commit 40ad8e8
Show file tree
Hide file tree
Showing 69 changed files with 10,405 additions and 1,205 deletions.
17 changes: 2 additions & 15 deletions BuildResidentialHPXML/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4499,7 +4499,7 @@ The round trip efficiency of the lithium ion battery. If not provided, the OS-HP

**Electric Vehicle: Present**

Whether there is an electric vehicle battery present. Cannot be included if an electric vehicle is modeled as a plug load as specified by the `misc_plug_loads_vehicle_present` argument.
Whether there is an electric vehicle battery present. If the `misc_plug_loads_vehicle_present` argument is true, this argument is superseded and vehicle charging will be modeled as a plug load only.

- **Name:** ``ev_battery_present``
- **Type:** ``Boolean``
Expand All @@ -4508,19 +4508,6 @@ Whether there is an electric vehicle battery present. Cannot be included if an e

<br/>

**Electric Vehicle: Rated Battery Power Output**

The rated power output of the EV battery. If not provided, the OS-HPXML default is used.

- **Name:** ``ev_battery_discharge_power``
- **Type:** ``Double``

- **Units:** ``W``

- **Required:** ``false``

<br/>

**Electric Vehicle: Nominal Battery Capacity**

The nominal capacity of the EV battery. If not provided, the OS-HPXML default is used.
Expand Down Expand Up @@ -5654,7 +5641,7 @@ Multiplier on the well pump energy usage that can reflect, e.g., high/low usage

**Misc Plug Loads: Vehicle Present**

Whether there is an electric vehicle. Cannot be included if an electric vehicle is modeled as a battery as specified by the `ev_battery_present` argument.
Whether there is an electric vehicle. Specifying this argument will model EV charging as a plug load and take precendence over the `ev_battery_present` argument.

- **Name:** ``misc_plug_loads_vehicle_present``
- **Type:** ``Boolean``
Expand Down
14 changes: 3 additions & 11 deletions BuildResidentialHPXML/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2678,16 +2678,10 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument

arg = OpenStudio::Measure::OSArgument::makeBoolArgument('ev_battery_present', false)
arg.setDisplayName('Electric Vehicle: Present')
arg.setDescription('Whether there is an electric vehicle battery present. Cannot be included if an electric vehicle is modeled as a plug load as specified by the `misc_plug_loads_vehicle_present` argument.')
arg.setDescription('Whether there is an electric vehicle battery present. If the `misc_plug_loads_vehicle_present` argument is true, this argument is superseded and vehicle charging will be modeled as a plug load only.')
arg.setDefaultValue(false)
args << arg

arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('ev_battery_discharge_power', false)
arg.setDisplayName('Electric Vehicle: Rated Battery Power Output')
arg.setDescription('The rated power output of the EV battery. If not provided, the OS-HPXML default is used.')
arg.setUnits('W')
args << arg

arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('ev_battery_capacity', false)
arg.setDisplayName('Electric Vehicle: Nominal Battery Capacity')
arg.setDescription('The nominal capacity of the EV battery. If not provided, the OS-HPXML default is used.')
Expand Down Expand Up @@ -3278,7 +3272,7 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument

arg = OpenStudio::Measure::OSArgument::makeBoolArgument('misc_plug_loads_vehicle_present', true)
arg.setDisplayName('Misc Plug Loads: Vehicle Present')
arg.setDescription('Whether there is an electric vehicle. Cannot be included if an electric vehicle is modeled as a battery as specified by the `ev_battery_present` argument.')
arg.setDescription('Whether there is an electric vehicle. Specifying this argument will model EV charging as a plug load and take precendence over the `ev_battery_present` argument.')
arg.setDefaultValue(false)
args << arg

Expand Down Expand Up @@ -6976,10 +6970,8 @@ def self.set_electric_vehicle(hpxml_bldg, args)
charging_power: args[:ev_charger_power])
end

ev_ct = hpxml_bldg.vehicles.count { |vehicle| vehicle.vehicle_type == Constants::ObjectTypeBatteryElectricVehicle }
ev_ct = hpxml_bldg.vehicles.count { |vehicle| vehicle.vehicle_type == HPXML::VehicleTypeBEV }
hpxml_bldg.vehicles.add(id: "ElectricVehicle#{ev_ct + 1}",
type: HPXML::BatteryTypeLithiumIon,
rated_power_output: args[:ev_battery_discharge_power],
nominal_capacity_kwh: args[:ev_battery_capacity],
usable_capacity_kwh: args[:ev_battery_usable_capacity],
energy_efficiency: args[:ev_energy_efficiency],
Expand Down
29 changes: 13 additions & 16 deletions BuildResidentialHPXML/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>build_residential_hpxml</name>
<uid>a13a8983-2b01-4930-8af2-42030b6e4233</uid>
<version_id>10e1324b-856d-4fbb-83e1-77bdf073f7e0</version_id>
<version_modified>2024-12-11T04:08:06Z</version_modified>
<version_id>ce5bdcd6-6dd5-4350-abfd-496c47dbcc10</version_id>
<version_modified>2024-12-31T00:29:35Z</version_modified>
<xml_checksum>2C38F48B</xml_checksum>
<class_name>BuildResidentialHPXML</class_name>
<display_name>HPXML Builder</display_name>
Expand Down Expand Up @@ -5513,7 +5513,7 @@
<argument>
<name>ev_battery_present</name>
<display_name>Electric Vehicle: Present</display_name>
<description>Whether there is an electric vehicle battery present. Cannot be included if an electric vehicle is modeled as a plug load as specified by the `misc_plug_loads_vehicle_present` argument.</description>
<description>Whether there is an electric vehicle battery present. If the `misc_plug_loads_vehicle_present` argument is true, this argument is superseded and vehicle charging will be modeled as a plug load only.</description>
<type>Boolean</type>
<required>false</required>
<model_dependent>false</model_dependent>
Expand All @@ -5529,15 +5529,6 @@
</choice>
</choices>
</argument>
<argument>
<name>ev_battery_discharge_power</name>
<display_name>Electric Vehicle: Rated Battery Power Output</display_name>
<description>The rated power output of the EV battery. If not provided, the OS-HPXML default is used.</description>
<type>Double</type>
<units>W</units>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>ev_battery_capacity</name>
<display_name>Electric Vehicle: Nominal Battery Capacity</display_name>
Expand Down Expand Up @@ -6861,7 +6852,7 @@
<argument>
<name>misc_plug_loads_vehicle_present</name>
<display_name>Misc Plug Loads: Vehicle Present</display_name>
<description>Whether there is an electric vehicle. Cannot be included if an electric vehicle is modeled as a battery as specified by the `ev_battery_present` argument.</description>
<description>Whether there is an electric vehicle. Specifying this argument will model EV charging as a plug load and take precendence over the `ev_battery_present` argument.</description>
<type>Boolean</type>
<required>true</required>
<model_dependent>false</model_dependent>
Expand Down Expand Up @@ -7654,7 +7645,7 @@
<filename>README.md</filename>
<filetype>md</filetype>
<usage_type>readme</usage_type>
<checksum>14C8C894</checksum>
<checksum>F3A34ADE</checksum>
</file>
<file>
<filename>README.md.erb</filename>
Expand All @@ -7671,7 +7662,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>1FA66639</checksum>
<checksum>F04A1EE0</checksum>
</file>
<file>
<filename>constants.rb</filename>
Expand All @@ -7685,11 +7676,17 @@
<usage_type>resource</usage_type>
<checksum>425682E4</checksum>
</file>
<file>
<filename>version.txt</filename>
<filetype>txt</filetype>
<usage_type>resource</usage_type>
<checksum>0E8669F5</checksum>
</file>
<file>
<filename>test_build_residential_hpxml.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>C3A7B090</checksum>
<checksum>438246CA</checksum>
</file>
</files>
</measure>
1 change: 1 addition & 0 deletions BuildResidentialHPXML/resources/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18af4ebdce3fee792861f1b710bf8f8f
16 changes: 0 additions & 16 deletions BuildResidentialHPXML/tests/test_build_residential_hpxml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -388,22 +388,6 @@ def test_workflows
assert_equal(31, hvac_control.seasons_cooling_end_day)
end

def test_version
found_match = false
measure_xml_path = File.join(File.dirname(__FILE__), '..', 'measure.xml')
File.readlines(measure_xml_path).each do |xml_line|
next unless xml_line.include? '<description>'
next unless xml_line.include? 'https://openstudio-hpxml.readthedocs.io'

found_match = true
if not xml_line.include? Version::OS_HPXML_Version
puts "ERROR: Found incorrect OS-HPXML version. Manually edit the BuildResidentialHPXML/measure.rb and run 'openstudio tasks.rb update_measures' to force the measure.xml to be regenerated."
end
assert(xml_line.include? Version::OS_HPXML_Version)
end
assert(found_match)
end

private

def _set_measure_argument_values(hpxml_file, args)
Expand Down
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
__New Features__

__Bugfixes__
- Fixes zero occupants specified for one unit in a whole MF building from being treated like zero occupants for every unit.
- Fixes using detailed schedules with higher resolution (e.g., 10-min data) than the simulation timestep (e.g., 60-min).

## OpenStudio-HPXML v1.9.1

Expand Down
14 changes: 0 additions & 14 deletions HPXMLtoOpenStudio/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -408,20 +408,6 @@ def init(model, hpxml_bldg, hpxml_header)
if hpxml_header.apply_ashrae140_assumptions.nil?
hpxml_header.apply_ashrae140_assumptions = false
end

if not hpxml_bldg.building_occupancy.number_of_residents.nil?
# If zero occupants, ensure end uses of interest are zeroed out
if (hpxml_bldg.building_occupancy.number_of_residents == 0) && (not hpxml_header.apply_ashrae140_assumptions)
hpxml_header.unavailable_periods.add(column_name: 'Vacancy',
begin_month: hpxml_header.sim_begin_month,
begin_day: hpxml_header.sim_begin_day,
begin_hour: 0,
end_month: hpxml_header.sim_end_month,
end_day: hpxml_header.sim_end_day,
end_hour: 24,
natvent_availability: HPXML::ScheduleUnavailable)
end
end
end
end

Expand Down
Loading

0 comments on commit 40ad8e8

Please sign in to comment.