Skip to content

Commit

Permalink
Bunch of hacky UI form fixes for FOM hybrid with fuel cell
Browse files Browse the repository at this point in the history
  • Loading branch information
cpaulgilman committed Aug 24, 2023
1 parent 2e29fca commit fee021c
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11271,36 +11271,10 @@
"batt_discharge_percent_4": 25.0,
"batt_discharge_percent_5": 25.0,
"batt_discharge_percent_6": 25.0,
"batt_dispatch_auto_can_charge": 0.0,
"batt_dispatch_auto_can_clipcharge": 0.0,
"batt_dispatch_auto_can_fuelcellcharge": 0.0,
"batt_dispatch_auto_can_gridcharge": 0.0,
"batt_dispatch_choice": 0.0,
"batt_dispatch_choice_ui": 3.0,
"batt_dispatch_excl": 0.0,
"batt_dispatch_pvs_ac_lb": -0.1,
"batt_dispatch_pvs_ac_lb_enable": 0.0,
"batt_dispatch_pvs_ac_ub": 1.05,
"batt_dispatch_pvs_ac_ub_enable": 0.0,
"batt_dispatch_pvs_battery_energy": 0.0,
"batt_dispatch_pvs_battery_power": 0.0,
"batt_dispatch_pvs_battery_rte": 0.0,
"batt_dispatch_pvs_curtail_as_control": 0.0,
"batt_dispatch_pvs_curtail_if_violation": 0.0,
"batt_dispatch_pvs_forecast_shift_periods": 3.0,
"batt_dispatch_pvs_interconnection_limit": 20000.0,
"batt_dispatch_pvs_kf": 0.3,
"batt_dispatch_pvs_ki": 1.8,
"batt_dispatch_pvs_kp": 1.2,
"batt_dispatch_pvs_max_ramp": 10.0,
"batt_dispatch_pvs_nameplate": 0.0,
"batt_dispatch_pvs_nameplate_ac": 0.0,
"batt_dispatch_pvs_ramp_interval": 10.0,
"batt_dispatch_pvs_short_forecast_enable": 0.0,
"batt_dispatch_pvs_soc_rest": 50.0,
"batt_dispatch_pvs_timestep_multiplier": 3.0,
"batt_dispatch_pvs_wf_forecast_choice": 0.0,
"batt_dispatch_pvs_wf_timestep": 60.0,
"batt_dispatch_update_frequency_hours": 0.0,
"batt_dispatch_wf_forecast_choice": 0.0,
"batt_gridcharge_percent_1": 100.0,
Expand All @@ -11323,10 +11297,6 @@
"batt_pv_clipping_forecast": [
0.0
],
"batt_pvs_pv_ac_forecast": [
0.0
],
"batt_pvs_user_specified_weather_file": "",
"batt_replacement_option": 1.0,
"batt_salvage_percentage": 0.0,
"batt_salvage_value": 0.0,
Expand Down Expand Up @@ -11419,6 +11389,9 @@
"debt_message": "",
"debt_option": 1.0,
"debt_percent": 50.0,
"degradation": [
0.0
],
"depr_alloc_custom_percent": 0.0,
"depr_alloc_macrs_15_percent": 0.0,
"depr_alloc_macrs_5_percent": 100.0,
Expand Down Expand Up @@ -20938,6 +20911,7 @@
"dscr_limit_debt_fraction": 0.0,
"dscr_maximum_debt_fraction": 100.0,
"dscr_reserve_months": 0.0,
"en_batt": 1.0,
"en_electricity_rates": 0.0,
"enable_interconnection_limit": 0.0,
"equip1_reserve_cost": 0.1,
Expand Down Expand Up @@ -30573,6 +30547,7 @@
7.0
],
"system_capacity": 439418.0,
"system_use_lifetime_output": 1.0,
"term_int_rate": 4.0,
"term_tenor": 18.0,
"tod_library": "Uniform Dispatch",
Expand Down
2 changes: 1 addition & 1 deletion deploy/runtime/startup.lk
Original file line number Diff line number Diff line change
Expand Up @@ -2738,7 +2738,7 @@ addpage( [[ 'Operating Costs Fuel Cell Hybrid' ]], { 'sidebar'='Fuel Cell Operat
// battery
setup_pages_battery_cell_and_system(false, false); // No REopt and FOM
setup_pages_battery_life();
addpage( [[ {'name'='Battery Dispatch Automated FOM', 'caption'='Automated'} ], [{'name'='Battery Dispatch PV Smoothing', 'caption'='PV Smoothing'}], [ {'name'='Battery Dispatch Custom Time Series', 'caption'='Custom Time Series'} ], [{'name'='Fuel Cell Dispatch Manual', 'caption'='Manual'}]], { 'sidebar'='Dispatch', 'help'='fuelcell_dispatch', 'exclusive_var' = 'batt_dispatch_excl', 'exclusive_header_pages' = ['Fuel Cell Dispatch', 'Battery Dispatch Common', 'Battery Dispatch Options FOM'], 'exclusive_tabs'=true, 'exclusive_hide'=true} );
addpage( [[ {'name'='Battery Dispatch Automated FOM', 'caption'='Automated'} ], [ {'name'='Battery Dispatch Custom Time Series', 'caption'='Custom Time Series'} ], [{'name'='Fuel Cell Dispatch Manual', 'caption'='Manual'}]], { 'sidebar'='Dispatch', 'help'='fuelcell_dispatch', 'exclusive_var' = 'batt_dispatch_excl', 'exclusive_header_pages' = ['Fuel Cell Dispatch', 'Battery Dispatch Common', 'Battery Dispatch Standalone Options FOM'], 'exclusive_tabs'=true, 'exclusive_hide'=true} );
addpage( [[ 'Standalone Battery Costs', 'Battery Enable' ]], { 'sidebar'='Battery Installation Costs', 'help'='cc_standalone_battery', 'bin_name'='Battery' } );
addpage( [[ 'Operating Costs Standalone Battery']], { 'sidebar'='Battery Operating Costs', 'help'='oc_battery', 'bin_name'='Battery' } );
setup_grid_limits_page();
Expand Down
5 changes: 2 additions & 3 deletions deploy/runtime/ui/Battery Dispatch Manual.json
Original file line number Diff line number Diff line change
Expand Up @@ -5588,14 +5588,15 @@
"",
"function toggle_dispatch()",
"{",
"\tmode = value('batt_dispatch_choice');\r",
"\r",
"\tallow_grid_charge = true;",
"\tallow_pv_charge = true;",
"\tallow_discharge = true;",
"\t",
"\tfront_of_meter = !behind_the_meter();",
"\tif (front_of_meter == true)",
"\t{",
"\t\tmode = ${batt_dispatch_choice};",
"\t\tif (mode == 3)",
"\t\t{",
"\t\t\tallow_grid_charge = true;",
Expand All @@ -5610,8 +5611,6 @@
"\t}",
"\telse",
"\t{",
"\t\tmode = ${batt_dispatch_choice};",
"",
"\t\tif (mode != 3)",
"\t\t\tenable_manual_inputs(false, false, false, false);",
"\t\telse",
Expand Down
4 changes: 1 addition & 3 deletions deploy/runtime/ui/Battery Dispatch Options FOM.json
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,7 @@
"\tenable_charge_from_clip();",
"\tshow_hide_charge_options();",
"\twave_batt_smoothing_msg();",
"\tif ( technology() == 'Fuel Cell' \r",
"\t || technology() == 'PVWatts Wind FuelCell Battery Hybrid' \r",
"\t || technology() == 'Generic PVWatts Wind FuelCell Battery Hybrid' )",
"\tif ( technology() == 'Fuel Cell' )",
"\t{",
"\t\tcheck_fuel_cell_dispatch(); // function defined in Fuel Cell Dispatch callback",
"\t}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,13 @@
"on_change{'batt_dispatch_choice_ui'} = define() ",
"{",
"\tshow_hide_charge_options();",
"\tcheck_auto_ppa();",
"\tcheck_auto_ppa();\r",
"\tif ( technology() == 'PVWatts Wind FuelCell Battery Hybrid' \r",
"\t || technology() == 'Generic PVWatts Wind FuelCell Battery Hybrid' )\r",
"\t{\r",
"\t\tcheck_fuel_cell_dispatch(); // function defined in Fuel Cell Dispatch callback\r",
"\t}\r",
"\t",
"\tvalue('batt_dispatch_excl', value('batt_dispatch_choice_ui'));",
"};",
"",
Expand Down
12 changes: 10 additions & 2 deletions deploy/runtime/ui/Fuel Cell Dispatch Manual.json
Original file line number Diff line number Diff line change
Expand Up @@ -6443,8 +6443,16 @@
"",
"function toggle_discharge_percent()",
"{",
"\tbtm = behind_the_meter();",
"\ten_manual = value('en_batt') && (value('batt_dispatch_choice_ui') == 3);",
"\tbtm = behind_the_meter();\r",
"\tif ( technology() == 'PVWatts Wind FuelCell Battery Hybrid' \r",
"\t || technology() == 'Generic PVWatts Wind FuelCell Battery Hybrid' )\r",
"\t{\r",
"\t\ten_manual = value('batt_dispatch_choice_ui') == 2;\r",
"\t}\r",
"\telse\r",
"\t{",
"\t\ten_manual = value('en_batt') && (value('batt_dispatch_choice_ui') == 3);\r",
"\t}\t",
"\tenable('batt_discharge_percent_1', en_manual && (value('pv.storage.p1.discharge')==1));",
"\tenable('batt_discharge_percent_2', en_manual && (value('pv.storage.p2.discharge')==1));",
"\tenable('batt_discharge_percent_3', en_manual && (value('pv.storage.p3.discharge')==1));",
Expand Down
23 changes: 19 additions & 4 deletions deploy/runtime/ui/Fuel Cell Dispatch.json
Original file line number Diff line number Diff line change
Expand Up @@ -525,15 +525,30 @@
"}",
"",
"function check_fuel_cell_dispatch()",
"{",
"\tfix_manual_dispatch = value('fuelcell_dispatch_choice') == 2 &&",
"\t\t\t\t value('batt_dispatch_choice_ui') != 3;",
"{\r",
"\tif ( technology() == 'PVWatts Wind FuelCell Battery Hybrid' || technology() == 'Generic PVWatts Wind FuelCell Battery Hybrid' )\r",
"\t{\r",
"\t\tfix_manual_dispatch = value('fuelcell_dispatch_choice') == 2 \r",
"\t\t\t && value('batt_dispatch_choice_ui') != 2;\r",
"\t}\r",
"\telse\r",
"\t{",
"\t\tfix_manual_dispatch = value('fuelcell_dispatch_choice') == 2 \r",
"\t\t\t && value('batt_dispatch_choice_ui') != 3;",
"\t}\r",
"\tif ( fix_manual_dispatch )",
"\t{",
"\t\tok = yesno('Fuel cell manual dispatch requires battery manual dispatch.\\nThe fuel cell manual dispatch option requires that the battery dispatch option be set to manual (even if the system does not include a battery).\\n\\nWould you like SAM to automatically set the battery dispatch option to manual dispatch?');",
"\t\tif ( ok )",
"\t\t{ ",
"\t\t\tvalue('batt_dispatch_choice_ui',3); // 3=manual dispatch for FOM and BTM battery",
"\t\t\tif ( technology() == 'PVWatts Wind FuelCell Battery Hybrid' || technology() == 'Generic PVWatts Wind FuelCell Battery Hybrid' )\r",
"\t\t\t{\r",
"\t\t\t\tvalue('batt_dispatch_choice_ui', 2);\r",
"\t\t\t}\r",
"\t\t\telse\r",
"\t\t\t{\r",
"\t\t\t\tvalue('batt_dispatch_choice_ui', 3);\r",
"\t\t\t}\r",
"\t\t}",
"\t\telse",
"\t\t{",
Expand Down

0 comments on commit fee021c

Please sign in to comment.