Skip to content

Commit

Permalink
Merge branch 'develop' into ui-fixes-2024
Browse files Browse the repository at this point in the history
  • Loading branch information
cpaulgilman committed Dec 9, 2024
2 parents 9b0321c + 9ca6539 commit 672d8ea
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 19 deletions.
2 changes: 1 addition & 1 deletion deploy/runtime/defaults/MSLF IPH_Commercial.json
Original file line number Diff line number Diff line change
Expand Up @@ -19995,7 +19995,7 @@
],
"ur_has_unused_items": 0.0,
"ur_is_default": 0.0,
"ur_metering_option": 0.0,
"ur_metering_option": 4.0,
"ur_monthly_fixed_charge": 0.0,
"ur_monthly_min_charge": 0.0,
"ur_name": "",
Expand Down
2 changes: 1 addition & 1 deletion deploy/runtime/defaults/MSLF IPH_Single Owner.json
Original file line number Diff line number Diff line change
Expand Up @@ -11233,7 +11233,7 @@
],
"ur_has_unused_items": 0.0,
"ur_is_default": 0.0,
"ur_metering_option": 0.0,
"ur_metering_option": 4.0,
"ur_monthly_fixed_charge": 0.0,
"ur_monthly_min_charge": 0.0,
"ur_name": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12833,7 +12833,7 @@
],
"ur_has_unused_items": 0.0,
"ur_is_default": 0.0,
"ur_metering_option": 0.0,
"ur_metering_option": 4.0,
"ur_monthly_fixed_charge": 0.0,
"ur_monthly_min_charge": 0.0,
"ur_name": "",
Expand Down
16 changes: 14 additions & 2 deletions deploy/runtime/startup.lk
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,13 @@ addpage( [[ 'Financial Debt Min DSCR',
{ 'sidebar'='Financial Parameters','help'='fin_commercial'} );
addpage( [[ 'Financial Tax Credits IPH','Financial Cash Incentives IPH']],
{ 'sidebar'='Incentives', 'help'='incentives' } );
setup_utility_rate();
addpage( [[ 'Utility Rate - Flat',
{ 'name'='Utility Rate - Description', 'caption'='Description and Applicability', 'collapsible'=true, 'collapsible_var'='ur_desc_is_shown', 'collapsed_by_default'=true },
{ 'name'='Utility Rate - Energy Charge', 'caption'='Energy Charges', 'collapsible'=true, 'collapsible_var'='ur_ec_is_shown', 'collapsed_by_default'=false },
{ 'name'='Utility Rate - Billing Demand', 'caption'='Billing Demand', 'collapsible'=true, 'collapsible_var'='ur_billing_demand_is_shown', 'collapsed_by_default'=true },
{ 'name'='Utility Rate - Demand Charge', 'caption'='Demand Charges', 'collapsible'=true, 'collapsible_var'='ur_dc_is_shown', 'collapsed_by_default'=false },
{ 'name'='Utility Rate - Unused', 'caption'='Unused Items', 'collapsible'=true, 'collapsible_var'='ur_unused_is_shown', 'collapsed_by_default'=true },]],
{ 'sidebar'='Electricity Purchases', 'help'='electricity_purchases' } );
setup_elec_load_page( LOAD_SIMPLE );
addpage( [[ 'Thermal Rate IPH' ]],
{'sidebar' = 'Thermal Rates','help' = 'thermal_rates'});
Expand Down Expand Up @@ -2356,7 +2362,13 @@ addpage( [[ 'Financial Debt Min DSCR',
{ 'sidebar'='Financial Parameters','help'='fin_commercial'} );
addpage( [[ 'Financial Tax Credits IPH','Financial Cash Incentives IPH']],
{ 'sidebar'='Incentives', 'help'='incentives' } );
setup_utility_rate();
addpage( [[ 'Utility Rate - Flat',
{ 'name'='Utility Rate - Description', 'caption'='Description and Applicability', 'collapsible'=true, 'collapsible_var'='ur_desc_is_shown', 'collapsed_by_default'=true },
{ 'name'='Utility Rate - Energy Charge', 'caption'='Energy Charges', 'collapsible'=true, 'collapsible_var'='ur_ec_is_shown', 'collapsed_by_default'=false },
{ 'name'='Utility Rate - Billing Demand', 'caption'='Billing Demand', 'collapsible'=true, 'collapsible_var'='ur_billing_demand_is_shown', 'collapsed_by_default'=true },
{ 'name'='Utility Rate - Demand Charge', 'caption'='Demand Charges', 'collapsible'=true, 'collapsible_var'='ur_dc_is_shown', 'collapsed_by_default'=false },
{ 'name'='Utility Rate - Unused', 'caption'='Unused Items', 'collapsible'=true, 'collapsible_var'='ur_unused_is_shown', 'collapsed_by_default'=true },]],
{ 'sidebar'='Electricity Purchases', 'help'='electricity_purchases' } );
setup_elec_load_page( LOAD_SIMPLE );
addpage( [[ 'Thermal Rate IPH' ]],
{'sidebar' = 'Thermal Rates','help' = 'thermal_rates'});
Expand Down
2 changes: 1 addition & 1 deletion deploy/runtime/ui/Utility Rate - Energy Charge.json
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@
"// can happen via LK script or URDB rate download",
"function check_fom_sell_rates()",
"{",
"\tif ( is_fom_bool() || is_merchant_plant() )",
"\tif ( is_fom_bool() || is_merchant_plant() || is_iph())",
"\t{",
"\t\tx = value('ur_ec_tou_mat');",
"\t\tis_sell_rate = false;",
Expand Down
32 changes: 23 additions & 9 deletions deploy/runtime/ui/Utility Rate - Flat.json
Original file line number Diff line number Diff line change
Expand Up @@ -1712,6 +1712,20 @@
"\tis_mp = financing() == \"Merchant Plant\";",
"\treturn (is_mp);",
"}",
"\r",
"function is_iph()\r",
"{\r",
"\ttech = technology();\r",
"\tis_iph_bool = false;\r",
"\tif (tech == \"Physical Trough IPH\"\r",
"\t\t\t|| tech == \"MSPT IPH\"\r",
"\t\t\t|| tech == \"MSLF IPH\"\r",
"\t\t\t|| tech == \"DSGL IPH\")\r",
"\t{\r",
"\t\tis_iph_bool = true;\r",
"\t}\r",
"\treturn is_iph_bool;\r",
"}\r",
"",
"// set inputs on Utility Rate - Energy Charge form",
"// based on values of inputs on Utility Rate - Flat form",
Expand Down Expand Up @@ -1741,11 +1755,11 @@
"\t\t{",
"\t\t\tproperty('ur_ec_tou_mat','ShowColumn',4);",
"\t\t}",
"\t\tif (en_ts_sell || is_fom_bool() || is_merchant_plant() )",
"\t\tif (en_ts_sell || is_fom_bool() || is_merchant_plant() || is_iph())",
"\t\t{",
"\t\t\tproperty('ur_ec_tou_mat','HideColumn',5);",
"\t\t}",
"\t\telseif ( !is_fom_bool() || !is_merchant_plant() )",
"\t\telseif ( !is_fom_bool() || !is_merchant_plant() || !is_iph())",
"\t\t{",
"\t\t\tproperty('ur_ec_tou_mat','ShowColumn',5);",
"\t\t}",
Expand All @@ -1771,19 +1785,19 @@
"function set_metering_billing_inputs()",
"{\t",
"\teme = value('ur_metering_option');",
"\tenable('ur_metering_option', !is_fom_bool() && !is_merchant_plant());",
"\tenable('ur_en_ts_sell_rate', !is_fom_bool() && !is_merchant_plant());",
"\tenable('ur_ts_sell_rate', !is_fom_bool() && !is_merchant_plant());",
"\tshow('lbl_metering_option',is_fom_bool() && !is_merchant_plant());",
"\tenable('ur_metering_option', !is_fom_bool() && !is_merchant_plant() && !is_iph());",
"\tenable('ur_en_ts_sell_rate', !is_fom_bool() && !is_merchant_plant() && !is_iph());",
"\tenable('ur_ts_sell_rate', !is_fom_bool() && !is_merchant_plant() && !is_iph());",
"\tshow('lbl_metering_option',is_fom_bool() && !is_merchant_plant() && is_iph());",
"\tenable( 'ur_nm_yearend_sell_rate', eme==0 );",
"\tenable( 'ur_nm_credit_rollover', eme==0 );",
"\tenable( 'ur_nm_credit_month', eme==0 || eme==1 || eme==3 );\r",
"\tenable( 'ur_nb_credit_expire', eme==3 );\r",
"\tenable( 'ur_nb_apply_credit_current_month', eme==3 );",
"\tif (eme==2 || eme==3|| eme==4)",
"\t{",
"\t\tenable( 'ur_en_ts_sell_rate', !is_fom_bool() && !is_merchant_plant() );",
"\t\tenable( 'ur_ts_sell_rate', value('ur_en_ts_sell_rate') && (!is_fom_bool() && !is_merchant_plant()) );",
"\t\tenable( 'ur_en_ts_sell_rate', !is_fom_bool() && !is_merchant_plant() && !is_iph() );",
"\t\tenable( 'ur_ts_sell_rate', value('ur_en_ts_sell_rate') && (!is_fom_bool() && !is_merchant_plant() && !is_iph()) );",
"\t\tenable( 'ur_en_ts_buy_rate', true );",
"\t\tenable( 'ur_ts_buy_rate', value('ur_en_ts_buy_rate') );",
"\t}",
Expand Down Expand Up @@ -1934,7 +1948,7 @@
"\tvalue ('ur_annual_min_charge', hash{'annual_min_charge'});",
"\t",
"\t// metering option",
"\tif ( !is_fom_bool() ) {value('ur_metering_option',hash{'metering_option'});\t}",
"\tif ( !is_fom_bool() && !is_iph()) {value('ur_metering_option',hash{'metering_option'});\t}",
"\tvalue( 'ur_dc_enable', hash{'dc_enable'});",
"\ton_change{'ur_dc_enable'}(); // invoke callback for ur_ec_enable to set up enable/disable of widgets",
"\t",
Expand Down
44 changes: 40 additions & 4 deletions deploy/runtime/versions.lk
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ version_upgrade{'2024.12.12'} = define() {
{
// Piston Cylinder TES is now tes_type == 3 (two tank == 1, packed bed == 2)
old_tes_type = value('tes_type');
if(old_tes_type == 1)
tes_type = old_tes_type;
if(old_tes_type == 0)
{
tes_type = 1;
}
else if(old_tes_type == 1)
{
tes_type = 3;
}
Expand Down Expand Up @@ -105,9 +110,40 @@ version_upgrade{'2024.12.12'} = define() {
' The default relative factors for minimum and maximum mass flow are 0.25 and 1.2, respectively.'
, 'warning');

value('use_abs_or_rel_mdot_limit', 0, 'Use relative minimum and maximum flow rate limits (fractions) by default');
value('f_htfmin', 0.25, 'Set default minimum mass flow rate fraction');
value('f_htfmax', 1.2, 'Set default maximum mass flow rate fraction');
value('use_abs_or_rel_mdot_limit', 0, 'Use relative minimum and maximum flow rate limits (fractions) by default');
value('f_htfmin', 0.25, 'Set default minimum mass flow rate fraction');
value('f_htfmax', 1.2, 'Set default maximum mass flow rate fraction');


message('We added an option on the Thermal Storage page to size the tank with either a fixed diameter or fixed height.', 'warning');
h_tank = oldvalue('h_tank');
if(h_tank != null)
{
variable_name_change('h_tank_in', 'h_tank');
value('is_h_tank_fixed', 1, 'Set default tank sizing to fixed height');
}

if(oldvalue('T_shutdown') == null)
{
message('We added the ability to set the field startup and shutdown temperatures, which were previously set internally by SAM.'
' The startup and shutdown temperatures will be set to the previous SAM-calculated value. ', 'warning');

T_loop_out = oldvalue('T_loop_out');
T_loop_in = oldvalue('T_loop_in_des');

T_startup_min = T_loop_in;
if(T_loop_out > 600)
{
T_startup_min = T_loop_out - 70.0;
}
T_startup = max(T_startup_min, 0.67 * T_loop_in + 0.33 * T_loop_out);
T_shutdown = T_startup;
value('T_startup', T_startup, 'Field startup temperature set using the previous SAM version method.');
value('T_shutdown', T_shutdown, 'Field shutdown temperature set equal to startup.');
}



}

// Linear Fresnel Model Changes
Expand Down

0 comments on commit 672d8ea

Please sign in to comment.