Skip to content

Commit

Permalink
Fix REopt API Calls (#1242)
Browse files Browse the repository at this point in the history
* change reopt v2 names to v3

See https://github.com/NREL/REopt-Analysis-Scripts/wiki/3.-V3-input-and-output-changes

* Use default REopt solver option (HiGHS at the moment) instead of SCIP
  • Loading branch information
cpaulgilman authored Nov 13, 2024
1 parent 495b0a8 commit ecb119f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions ssc/cmod_battery_eqns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ bool Reopt_size_standalone_battery_params(ssc_data_t data) {

// financial inputs
map_optional_input(vt, "itc_fed_percent", &reopt_batt, "total_itc_fraction", 0., true);
// TODO: what about reopt vars total_rebate_us_dollars_per_kw?
// TODO: what about reopt vars total_rebate_per_kw?

vd = vt->lookup("total_installed_cost");
if (vd) {
Expand Down Expand Up @@ -209,10 +209,12 @@ bool Reopt_size_standalone_battery_params(ssc_data_t data) {
map_optional_input(vt, "value_of_lost_load", &reopt_fin, "value_of_lost_load_per_kwh", 0);
reopt_fin.assign("microgrid_upgrade_cost_fraction", 0);



vd = vt->lookup("federal_tax_rate");
vd2 = vt->lookup("state_tax_rate");
if (vd && vd2) {
reopt_fin.assign("offtaker_tax_pct", vd->num[0] / 100. + vd2->num[0] / 100.);
reopt_fin.assign("offtaker_tax_rate_fraction", vd->num[0] / 100. + vd2->num[0] / 100.);
}

vt_get_number(vt, "inflation_rate", &val1);
Expand Down Expand Up @@ -242,6 +244,7 @@ bool Reopt_size_standalone_battery_params(ssc_data_t data) {
}
reopt_load.assign("loads_kw", var_data(&vec[0], sim_len));
reopt_load.assign("loads_kw_is_net", false);
reopt_load.assign("year", 2018); // recent common year starting on Monday

vd = vt->lookup("crit_load");
if (vd) {
Expand All @@ -259,10 +262,11 @@ bool Reopt_size_standalone_battery_params(ssc_data_t data) {
}
reopt_load.assign("critical_loads_kw", var_data(&vec[0], vec_size));
reopt_load.assign("year", 2018); // recent common year starting on Monday
reopt_load.assign("critical_loads_kw_is_net", false);
}

reopt_settings.assign_match_case("time_steps_per_hour", var_data((int)(sim_len / 8760)));
reopt_settings.assign("solver_name", var_data("SCIP")); // "HiGHS" option does not work with large numbers like 1e38 for tier max values per https://github.com/NREL/SAM/issues/1742
//reopt_settings.assign("solver_name", var_data("SCIP")); // "HiGHS" option does not work with large numbers like 1e38 for tier max values per https://github.com/NREL/SAM/issues/1742

// assign the reopt parameter table and log messages
reopt_table->assign_match_case("Settings", reopt_settings);
Expand Down
2 changes: 1 addition & 1 deletion ssc/cmod_pvsamv1_eqns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ SSCEXPORT bool Reopt_size_battery_params(ssc_data_t data) {
//map_input(vt, "system_capacity", &reopt_pv, "existing_kw");
map_input(vt, "system_capacity", &reopt_pv, "max_kw");
}
map_optional_input(vt, "degradation", &reopt_pv, "degradation_pct", 0.5, true);
map_optional_input(vt, "degradation", &reopt_pv, "degradation_fraction", 0.5, true);

map_optional_input(vt, "module_type", &reopt_pv, "module_type", 1);

Expand Down

0 comments on commit ecb119f

Please sign in to comment.