Skip to content

Commit

Permalink
Merge pull request #833 from NREL/ssc_832_enforce_lead_acid_soc_limits
Browse files Browse the repository at this point in the history
add function that was enforcing dispatch soc limits for lithium ion batteries
  • Loading branch information
brtietz authored Jun 2, 2022
2 parents 7b3a5eb + bf64f54 commit 3bc32d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions shared/lib_battery_capacity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ void capacity_kibam_t::updateCapacity(double &I, double dt_hour) {
state->leadacid.q2_0 = q2;
state->q0 = q1 + q2;

check_SOC();

update_SOC();
check_charge_change();

Expand Down
4 changes: 2 additions & 2 deletions test/ssc_test/cmod_battwatts_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ TEST_F(CMBattwatts_cmod_battwatts, ResidentialDefaultsLeadAcid) {
EXPECT_FALSE(errors);

double charge_percent = data.as_number("batt_system_charge_percent");
EXPECT_NEAR(charge_percent, 95.70, 0.1);
EXPECT_NEAR(charge_percent, 96.13, 0.1);

auto batt_power_data = data.as_vector_ssc_number_t("batt_power");
ssc_number_t peakKwDischarge = *std::max_element(batt_power_data.begin(), batt_power_data.end());
Expand All @@ -139,7 +139,7 @@ TEST_F(CMBattwatts_cmod_battwatts, ResidentialDefaultsLeadAcid) {

auto cycles = data.as_vector_ssc_number_t("batt_cycles");
ssc_number_t maxCycles = *std::max_element(cycles.begin(), cycles.end());
EXPECT_NEAR(maxCycles, 614, 0.1);
EXPECT_NEAR(maxCycles, 613, 0.1);
}

TEST_F(CMBattwatts_cmod_battwatts, NoPV) {
Expand Down

0 comments on commit 3bc32d9

Please sign in to comment.