Skip to content

Commit

Permalink
Improved error handling for battery adjust losses
Browse files Browse the repository at this point in the history
  • Loading branch information
brtietz committed Nov 11, 2024
1 parent efb7743 commit d05b4f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ssc/cmod_battery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,9 @@ battstor::battstor(var_table& vt, bool setup_model, size_t nrec, double dt_hr, c
if (vt.is_assigned("batt_adjust_costant") || vt.is_assigned("batt_adjust_periods") || vt.is_assigned("batt_adjust_timeindex")) {
adj_losses.clear();
adjustment_factors haf(&vt, "batt_adjust");
haf.setup(nrec);
if (!haf.setup(nrec)) {
throw exec_error("battery", "failed to setup battery adjustment factors: " + haf.error());
}
for (size_t i = 0; i < nrec; i++) {
adj_losses.push_back(1.0 - haf(i)); // Convert to convention within powerflow and capacity code
}
Expand Down

0 comments on commit d05b4f7

Please sign in to comment.