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

Model EV Batteries #1533

Draft
wants to merge 99 commits into
base: master
Choose a base branch
from
Draft

Model EV Batteries #1533

wants to merge 99 commits into from

Conversation

aspeake
Copy link
Collaborator

@aspeake aspeake commented Oct 30, 2023

Pull Request Description

Allows detailed modeling of EVs using the EnergyPlus battery model, whereas previous EV charging was limited to a simple plug load. This PR adds arguments to define EV battery parameters, charger parameters, driving behavior such as miles traveled, and detailed charging and discharging schedules.

The existing E+ battery model was used to eventually support bidirectional charging, but this capability is not included in this PR.

Companion HPXML PR: hpxmlwg/hpxml#403

Checklist

PR Author: Check these when they're done. Not all may apply. strikethrough and check any that do not apply.

PR Reviewer: Verify each has been completed.

  • Schematron validator (EPvalidator.xml) has been updated
  • Sample files have been added/updated (via tasks.rb)
  • Tests have been added/updated (e.g., HPXMLtoOpenStudio/tests and/or workflow/tests/hpxml_translator_test.rb)
  • Documentation has been updated
  • Changelog has been updated
  • openstudio tasks.rb update_measures has been run
  • No unexpected changes to simulation results of sample files

@shorowit shorowit added the enhancement New feature or request label Oct 31, 2023
@shorowit
Copy link
Contributor

@aspeake I assume we will need to add error-checking for multiple batteries? I.e., you can't have two EV batteries, and you can't have one EV battery and one home battery. See here for context. Unless you are trying to address this limitation.

@aspeake
Copy link
Collaborator Author

aspeake commented Jan 23, 2024

@aspeake I assume we will need to add error-checking for multiple batteries? I.e., you can't have two EV batteries, and you can't have one EV battery and one home battery. See here for context. Unless you are trying to address this limitation.

Yes, for now we plan to limit to 1 EV/unit. However, the current implementation does allow for one home battery and one EV battery and expects separate schedules for each.

@shorowit
Copy link
Contributor

However, the current implementation does allow for one home battery and one EV battery and expects separate schedules for each.

I assume that probably won't work, for the same reason that modeling two home batteries wasn't previously supported. But we can worry about that later. More of a heads up for now.

aspeake and others added 22 commits November 21, 2024 10:49
…o ev_batteries

# Conflicts:
#	BuildResidentialHPXML/measure.xml
#	BuildResidentialHPXML/tests/test_build_residential_hpxml.rb
#	HPXMLtoOpenStudio/measure.xml
#	HPXMLtoOpenStudio/resources/misc_loads.rb
#	HPXMLtoOpenStudio/tests/test_validation.rb
#	ReportSimulationOutput/measure.xml
# @param vehicle [HPXML::Vehicle] Object that defines a single electric vehicle
# @param schedules_file [SchedulesFile] SchedulesFile wrapper class instance of detailed schedule files
# @return [Array<OpenStudio::Model::ScheduleRuleset or OpenStudio::Model::ScheduleFile>] The charging and discharging schedules, either as a ScheduleRuleset or as a ScheduleFile
def self.get_ev_charging_schedules(runner, model, vehicle, schedules_file)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This method was created so that the discharge schedule could be accessed and the rated power output could be set prior to the Battery.apply call. The process looks like:

  • call get_ev_charging_schedules() to get discharge schedule
  • parse discharge schedule and sum the annual hours
  • calculate effective discharge power based on annual driving hours, efficiency, and annual miles
  • estimate the rated power output using the effective discharge * 2.25
  • apply battery (which does call get_ev_charging_schedules() once more)

Comment on lines +115 to +116
if !(vehicle.hours_per_week_isdefaulted || vehicle.ev_charging_weekday_fractions_isdefaulted || vehicle.ev_charging_weekend_fractions_isdefaulted)
runner.registerWarning("Electric vehicle hours per week inputted (#{vehicle.hours_per_week.round(1)}) do not match the hours per week calculated from the discharging schedule (#{sch_hours_per_week.round(1)}). The inputted hours per week value will be ignored.")
Copy link
Collaborator Author

@aspeake aspeake Dec 24, 2024

Choose a reason for hiding this comment

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

Possible enhancement - write the default schedule based on the user-inputed hours_per_week, then there would only be a warning thrown if the hours_per_week does not match the user-supplied schedule file.

Alternatively, make the default hours_perk_week match the default schedules

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thoughts on including this file which shows the calculation of the default vehicle charging/discharging schedules?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority high
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

3 participants