Skip to content

Conversation

@sjanzou
Copy link
Collaborator

@sjanzou sjanzou commented Sep 28, 2021

No description provided.

P_battery_ac = P_battery_ac > 0 ? P_battery_ac : 0; // Don't swap from charging to discharging
m_BatteryPower->powerBatteryDC = -P_battery_ac * m_BatteryPower->singlePointEfficiencyACToDC;
// m_BatteryPower->powerBatteryDC = -P_battery_ac * m_BatteryPower->singlePointEfficiencyACToDC;
m_BatteryPower->powerBatteryDC = P_battery_ac * m_BatteryPower->singlePointEfficiencyACToDC;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This code will only run when the battery is charging (see line 489), therefore the sign on line 493 is correct. We don't want this code swapping from charging to discharging, which is what line 494 now does.

If there's a less confusing way to do the sign swap between 491 and 493, I'm open to that, but at the end of this section powerBatteryDC needs to be a negative number. The StackOverflow issue needs to be solved between lines 304 and 385. (I'll try to narrow that down today)

Copy link
Collaborator

Choose a reason for hiding this comment

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

My hunch on the lines was incorrect - proposed fix here: https://github.com/NREL/ssc/pull/620/files

Happy to accept a PR with just the "batt_annual_charge_energy" change.

@sjanzou sjanzou changed the title Add missing vtab_lcos_input so that cash_load will run from lk script Add missing vtab_lcos_input so that cash_loan will run from lk script Sep 29, 2021
@brtietz
Copy link
Collaborator

brtietz commented Sep 29, 2021

I cherry-picked 23e4bac over to develop so we get that change included while I debug the powerflow stack overflow.

@brtietz brtietz closed this Sep 29, 2021
@sjanzou
Copy link
Collaborator Author

sjanzou commented Sep 29, 2021 via email

@sjanzou sjanzou deleted the Fix_issues branch September 30, 2021 09:03
@brtietz brtietz added this to the SAM Fall 2021 Release milestone Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants