784 fix ac dc powers#899
Conversation
… Move old powerflow code to attic
…atch for this variable
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
…es for a few tests
…ests to new conventions
|
@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
left a comment
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Are we going to handle different efficiencies in a future issue or pull request?
There was a problem hiding this comment.
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.
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:
Additional changes:
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.