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

Open
wants to merge 172 commits into
base: master
Choose a base branch
from
Open

Model EV Batteries #1533

wants to merge 172 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, EV charger parameters, driving behavior such as miles traveled, and detailed charging and discharging schedules. The E+ battery model was used so that bidirectional charging can be supported in the future, but this capability is not included in this PR.

Key aspects of this PR include:

  • Leveraging the new Vehicles element in HPXML
  • A new vehicles.rb file to apply an EV as ElectricLoadCenter:Storage:LiIonNMCBattery object
  • Calls methods in battery.rb and uses some existing battery defaults
  • Default charging/discharging schedules based on stock data and potential for user-defined schedule files. The methods for generating these schedules can be found in ev_national_average_schedules.csv
  • EMS program in vehicles.rb to
    • Scale the effective discharge power based on ambient temperature
    • Track "unmet driving hours"
  • Outputs charging energy with the existing "End Use" type Electricity: Electric Vehicle Charging (MBtu) and writes a new "Unmet Hours" output type Driving (hr) (if specified)

Companion HPXML PR: hpxmlwg/hpxml#403
Schedule generation PR: #1757

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.

@shorowit

This comment was marked as resolved.

@shorowit

This comment was marked as resolved.

<ElectricVehicleChargers>
<ElectricVehicleCharger>
<SystemIdentifier id='EVCharger1'/>
<Location>garage</Location>
Copy link
Contributor

Choose a reason for hiding this comment

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

I changed the location from garage to outside and saw no change in results. Should I have?

Copy link
Collaborator Author

@aspeake aspeake Jan 25, 2025

Choose a reason for hiding this comment

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

I thought maybe we could see minor HVAC differences when relaxing the is_ev logic here https://github.com/NREL/OpenStudio-HPXML/blob/ev_batteries/HPXMLtoOpenStudio/resources/battery.rb#L98, but I don't see any changes. I am going to leave that line in case there are changes under some conditions, we could run the risk of including the discharge energy.

HPXMLtoOpenStudio/resources/defaults.rb Outdated Show resolved Hide resolved
========================= =====

These numbers reflect the number of hours during the heating/cooling season when the conditioned space temperature deviates more than 0.2 deg-C (0.36 deg-F) from the heating/cooling setpoint.
The unmet heating and cooling numbers reflect the number of hours during the heating/cooling season when the conditioned space temperature deviates more than 0.2 deg-C (0.36 deg-F) from the heating/cooling setpoint.
The unmet driving number represents the total time in which the charging schedule fails to meet the demand from the driving schedule. This includes periods when the discharge schedule exceeds zero while the EV battery's state of charge is at its minimum level. Unmet driving hours indicate unrealized discharging events, resulting in reduced charging energy.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm still a bit unclear on whether this is hours of unmet discharging or charging (or both). The first sentence says "represents the total time in which the charging schedule fails to meet the demand" but the second sentence says it "includes periods when the discharge schedule exceeds zero while the EV battery's state of charge is at its minimum level".

I also would prefer a clearer output name than "Driving". Ideally it would be "EV Charging", but like I said above, I'm not actually sure if that's what it is. "EV Driving" would also be fine.

<sch:assert role='ERROR' test='count(../../h:MilesDrivenPerYear) &lt;= 1'>Expected 0 or 1 element(s) for xpath: ../../MilesDrivenPerYear</sch:assert>
<sch:assert role='ERROR' test='count(../../h:HoursDrivenPerWeek) &lt;= 1'>Expected 0 or 1 element(s) for xpath: ../../HoursDrivenPerWeek</sch:assert>
<sch:assert role='ERROR' test='count(../../h:FuelEconomyCombined[h:Units="kWh/mile"]/h:Value) &lt;= 1'>Expected 0 or 1 element(s) for xpath: ../../FuelEconomyCombined[Units="kWh/mile"]/Value</sch:assert>
<sch:assert role='ERROR' test='../../h:FuelEconomyCombined[h:Units="kWh/mile"] or not(../../h:FuelEconomyCombined/h:Units)'>Expected ../../FuelEconomyCombined/Units to be "kWh/mile"</sch:assert>
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't love this. There's nothing wrong with a software tool creating an EV and using mile/kWh or mpge instead, that shouldn't cause an error. We want OS-HPXML to be as flexible as possible and not create undue burden on a downstream user. Ideally we would support any fuel economy units that can make sense for an EV.

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