From 0fe8ac7fd016e6892b7b230af3ba1388e3e63e4f Mon Sep 17 00:00:00 2001 From: Paul Gilman Date: Tue, 12 Apr 2022 10:20:05 -0700 Subject: [PATCH 1/4] Fix issues with custom HTF selection Make sure the UIObject property for all instances of MaterialProperties widgets is set to MaterialProperties instead of Default. Disable MaterialProperties "Edit" button unless HTF option is set to "User-defined" for all CSP configurations that use widget. --- .../Molten Salt Linear Fresnel Solar Field.txt | 2 +- .../ui/Molten Salt Linear Fresnel Storage.txt | 2 +- deploy/runtime/ui/Molten Salt Tower Receiver.txt | 6 +++++- deploy/runtime/ui/Phys Trough Solar Field.txt | 6 ++++-- .../runtime/ui/Physical Trough Solar Field.txt | 16 ++++++++++++++-- 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/deploy/runtime/ui/Molten Salt Linear Fresnel Solar Field.txt b/deploy/runtime/ui/Molten Salt Linear Fresnel Solar Field.txt index f6adf8ff02..aee38d6cce 100644 --- a/deploy/runtime/ui/Molten Salt Linear Fresnel Solar Field.txt +++ b/deploy/runtime/ui/Molten Salt Linear Fresnel Solar Field.txt @@ -2986,7 +2986,7 @@ MSLF Solar Field 9 1 7 0 0 0 0 0 0 0 -Default +MaterialProperties I_bn_des 3 1 diff --git a/deploy/runtime/ui/Molten Salt Linear Fresnel Storage.txt b/deploy/runtime/ui/Molten Salt Linear Fresnel Storage.txt index f390eb75c1..7bb92d218d 100644 --- a/deploy/runtime/ui/Molten Salt Linear Fresnel Storage.txt +++ b/deploy/runtime/ui/Molten Salt Linear Fresnel Storage.txt @@ -2019,7 +2019,7 @@ MSLF Thermal Storage 9 1 7 0 0 0 0 0 0 0 -Default +MaterialProperties store_fluid 3 1 diff --git a/deploy/runtime/ui/Molten Salt Tower Receiver.txt b/deploy/runtime/ui/Molten Salt Tower Receiver.txt index fac9d02d5f..73132571d0 100644 --- a/deploy/runtime/ui/Molten Salt Tower Receiver.txt +++ b/deploy/runtime/ui/Molten Salt Tower Receiver.txt @@ -3213,7 +3213,11 @@ equations{ 'REC_COPY_T_htf_hot_des' } = define() { equations{ 'REC_COPY_T_htf_cold_des' } = define() { return ${T_htf_cold_des}; }; -1503 +1630 +// UI FORM NOT USED IN ANY CONFIGURATIONS SEE STARTUP SCRIPT +// SEE MSPT Receiver THAT SUPPORTS CAVITY AND EXTERNAL RECEIVER + + on_load{'Molten Salt Tower Receiver'} = define() { on_change{"csp.pt.rec.htf_type"}(); }; diff --git a/deploy/runtime/ui/Phys Trough Solar Field.txt b/deploy/runtime/ui/Phys Trough Solar Field.txt index 7d06943fd5..c8b762649e 100644 --- a/deploy/runtime/ui/Phys Trough Solar Field.txt +++ b/deploy/runtime/ui/Phys Trough Solar Field.txt @@ -3733,7 +3733,7 @@ User-defined HTF fluid 9 1 7 0 0 0 0 0 0 0 -Default +MaterialProperties field_htf_cp_avg 3 1 @@ -4737,7 +4737,9 @@ equations{ 'Type_cpnt' } = define() { return T; }; -3501 +3552 +// THIS UI FORM IS NOT USED BY ANY CONFIGURATIONS + on_load{'Phys Trough Solar Field'} = define() { on_change{'combo_htf_type'}(); on_change{'trough_loop_control'}(); diff --git a/deploy/runtime/ui/Physical Trough Solar Field.txt b/deploy/runtime/ui/Physical Trough Solar Field.txt index 13ea60bc3d..d3cfcf9063 100644 --- a/deploy/runtime/ui/Physical Trough Solar Field.txt +++ b/deploy/runtime/ui/Physical Trough Solar Field.txt @@ -4034,7 +4034,7 @@ field_fl_props 9 1 7 0 0 0 0 0 0 0 -Default +MaterialProperties field_htf_cp_avg 3 1 @@ -4956,4 +4956,16 @@ equations{ '$MIMO$ Physical_Trough_Solar_Field_Equations' } = define() { return 0; }; -0 \ No newline at end of file +274 +on_load{'Physical Trough Solar Field'} = define() { + enable_custom_htf(); +}; + +on_change{'combo_htf_type'} = define() { + enable_custom_htf(); +}; + +function enable_custom_htf() { + bUserDefined = (value('combo_htf_type') == 10); + enable("field_fl_props", bUserDefined); +} \ No newline at end of file From 49d903514ed3cd81042ec2e7dc3e39481db911d3 Mon Sep 17 00:00:00 2001 From: Paul Gilman Date: Tue, 12 Apr 2022 12:56:33 -0700 Subject: [PATCH 2/4] Fix custom HTF for MSPT --- deploy/runtime/ui/MSPT Receiver.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/deploy/runtime/ui/MSPT Receiver.txt b/deploy/runtime/ui/MSPT Receiver.txt index cbc598eb08..2a7b005fb0 100644 --- a/deploy/runtime/ui/MSPT Receiver.txt +++ b/deploy/runtime/ui/MSPT Receiver.txt @@ -2898,14 +2898,16 @@ equations{ 'REC_COPY_T_htf_hot_des' } = define() { equations{ 'REC_COPY_T_htf_cold_des' } = define() { return ${T_htf_cold_des}; }; -241 +277 on_load{'Molten Salt Tower Receiver'} = define() { - on_change{"csp.pt.rec.htf_type"}(); + enable_custom_htf(); }; on_change{"csp.pt.rec.htf_type"}=define(){ - + enable_custom_htf(); +}; + +function enable_custom_htf(){ bUserDefined = (value("csp.pt.rec.htf_type") == 2); enable("field_fl_props", bUserDefined); - -}; +} \ No newline at end of file From 1b8e1caa528c578b30dbcbcc9466fafcd54723c5 Mon Sep 17 00:00:00 2001 From: Matthew Boyd Date: Mon, 18 Apr 2022 17:03:53 -0600 Subject: [PATCH 3/4] Fix htf min and max operating temp in trough ui --- deploy/runtime/ui/Physical Trough Solar Field.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/deploy/runtime/ui/Physical Trough Solar Field.txt b/deploy/runtime/ui/Physical Trough Solar Field.txt index d3cfcf9063..43ac9d1725 100644 --- a/deploy/runtime/ui/Physical Trough Solar Field.txt +++ b/deploy/runtime/ui/Physical Trough Solar Field.txt @@ -4709,7 +4709,7 @@ Physical Trough Solar Field 25 Default -7309 +7632 // // ONLY ADD UI INDICATOR, COMBO CONVERTERS, AND // INPUT AGGREGATOR EQUATIONS BELOW! @@ -4781,10 +4781,15 @@ equations{ 'Fluid' } = define() { equations{ '$MIMO$ Physical_Trough_Solar_Field_Equations' } = define() { + // field_htf_min_operating_temp + data.Fluid = ${Fluid}; + + // field_htf_max_operating_temp + // + // field_htf_cp_avg data.T_loop_in_des = ${T_loop_in_des}; data.T_loop_out = ${T_loop_out}; - data.Fluid = ${Fluid}; data.field_fl_props = ${field_fl_props}; // single_loop_aperature @@ -4875,6 +4880,8 @@ equations{ '$MIMO$ Physical_Trough_Solar_Field_Equations' } = define() { success = ssc_eqn("Physical_Trough_Solar_Field_Equations", data); if (!success) { + ${field_htf_min_operating_temp} = -999.; + ${field_htf_max_operating_temp} = -999.; ${field_htf_cp_avg} = -999.; ${single_loop_aperature} = -999.; ${min_inner_diameter} = -999.; @@ -4914,6 +4921,8 @@ equations{ '$MIMO$ Physical_Trough_Solar_Field_Equations' } = define() { ${Type_cpnt} = null; } else { + ${field_htf_min_operating_temp} = data.field_htf_min_operating_temp; + ${field_htf_max_operating_temp} = data.field_htf_max_operating_temp; ${field_htf_cp_avg} = data.field_htf_cp_avg; ${single_loop_aperature} = data.single_loop_aperature; ${min_inner_diameter} = data.min_inner_diameter; From 7668fd258ad04982653cd0b47aab2d7e84f2af09 Mon Sep 17 00:00:00 2001 From: Matthew Boyd Date: Mon, 18 Apr 2022 17:07:52 -0600 Subject: [PATCH 4/4] Fix custom htf button status on initial tower page load --- deploy/runtime/ui/MSPT Receiver.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/runtime/ui/MSPT Receiver.txt b/deploy/runtime/ui/MSPT Receiver.txt index 2a7b005fb0..7927c60493 100644 --- a/deploy/runtime/ui/MSPT Receiver.txt +++ b/deploy/runtime/ui/MSPT Receiver.txt @@ -2898,8 +2898,8 @@ equations{ 'REC_COPY_T_htf_hot_des' } = define() { equations{ 'REC_COPY_T_htf_cold_des' } = define() { return ${T_htf_cold_des}; }; -277 -on_load{'Molten Salt Tower Receiver'} = define() { +264 +on_load{'MSPT Receiver'} = define() { enable_custom_htf(); };