Skip to content

784 fix ac dc powers#899

Merged
brtietz merged 22 commits into
developfrom
784_fix_ac_dc_powers
Oct 25, 2022
Merged

784 fix ac dc powers#899
brtietz merged 22 commits into
developfrom
784_fix_ac_dc_powers

Conversation

@brtietz

@brtietz brtietz commented Oct 23, 2022

Copy link
Copy Markdown
Collaborator

Define additional variables and conventions in the powerflow variables according to #784. Closes #784

Conventions for DC to AC conversion for AC connected batteries and DC connected batteries while discharging are preserved. DC connected batteries charging from PV needed new a convention, which is:

Convert to AC power by multiplying by the inverter max efficiency.

This PR also updates some of the losses conventions to ensure "electricity from grid to system" matches the inverter AC "output" when charging.

Alternative conventions considered included "what would it take to charge from the grid (divide by inverter efficiency)" and "use actual inverter efficiency". Some notes on what didn't work:

  • We need AC variables for LCOS to make sense (Cannot report DC only)
  • Both "electricity to/from grid" and "from system to battery" need to use the same convention, otherwise "percent charge from system" doesn't work
  • The grid charging convention is problematic because it makes the DC connected battery look less efficient than the AC connected battery
  • Using the actual inverter efficiency could push the round-trip efficiency even higher than the current convention

Additional changes:

  • Use night time losses when deciding whether or not the inverter is running in the powerflow code, rather than assuming a 5% efficiency
  • Modifications to dispatch code to be more consistent about AC vs DC power in the constraints
  • Solve a few compiler warnings

Relevant test files:
Ensure grid charging and PV charging numbers add up for a DC connected battery:
dc_charging_grid_and_pv.zip
Custom dispatch from pvsamv1_battery integration tests that produces low inverter efficiencies:
low_power_inverter_test_cases.zip

Looking for at least two approvals prior to merge.

I expect there will be some changes to the SAM_api and export_config files, but those builds are broken on develop at to time of writing (the relevant person has been emailed). I'll make a SAM PR for that when they're fixed.

Brian Mirletz and others added 21 commits October 7, 2022 16:02
Removes charging constraints for min efficiency to handle grid outage cases. Removes ac losses (such as wiring) from batt to grid to make sure batt to grid matches AC  power. Add DC DC efficency to batt power AC for full representation of convention where this number represents hypothetical grid charging when charging from PV. Update test code to better handle efficiencies
…forcing 5% efficiency. Use max efficiency for conversions in these cases
…tt. Solves issue with battery energy charged from system summary metrics being less than 100%
…iciency

Update the powerflow convention. Using actual efficiency here would result in even higher round trip efficiencies. Also fix a possible infinity in the tests
Doing this on the DC side allows grid to batt to match inverter ac output
@cpaulgilman

Copy link
Copy Markdown
Collaborator

@brtietz Thanks for going through this, and for the clear descriptions in your comment above.

The relationship between the DC and AC versions of "Electricity to battery from system" is the inverter's peak nominal efficiency, For a DC-connected battery, the calculated AC value is an approximation for LCOS calculations and not a power quantity that you would measure in a real system. Is that correct?

@brtietz

brtietz commented Oct 23, 2022

Copy link
Copy Markdown
Collaborator Author

@brtietz Thanks for going through this, and for the clear descriptions in your comment above.

The relationship between the DC and AC versions of "Electricity to battery from system" is the inverter's peak nominal efficiency, For a DC-connected battery, the calculated AC value is an approximation for LCOS calculations and not a power quantity that you would measure in a real system. Is that correct?

For system charging, yes. [Ignore what was here before about grid charging]

@sjanzou sjanzou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lots of clarifying outputs and nice use of the code-attic!

if (!m_batteryPower->canGridCharge && I < 0 && m_batteryPower->powerGridToBattery > tolerance)
{
m_batteryPower->powerBatteryTarget += m_batteryPower->powerGridToBattery;
m_batteryPower->powerBatteryTarget += m_batteryPower->powerGridToBattery * m_batteryPower->singlePointEfficiencyACToDC;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are we going to handle different efficiencies in a future issue or pull request?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, if we do some of the DC-DC converter work we talked about with the PVSAMV1 refactor. Some of the DC-DC conversions are currently handled early in the powerflow code, the current setup should work as long as we keep using single point efficiencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Electricity to/from battery is in AC sometimes and DC others

3 participants