From eb421a1334202d57b9ff1e5a9f74fc9ae996bfb0 Mon Sep 17 00:00:00 2001 From: tyneises Date: Tue, 3 Dec 2024 11:25:34 -0600 Subject: [PATCH] change variable for udpc mode from bool to int --- ssc/cmod_etes_electric_resistance.cpp | 2 +- ssc/cmod_fresnel_physical.cpp | 4 +++- ssc/cmod_tcsmolten_salt.cpp | 6 +++--- ssc/cmod_trough_physical.cpp | 2 ++ tcs/csp_solver_pc_Rankine_indirect_224.h | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ssc/cmod_etes_electric_resistance.cpp b/ssc/cmod_etes_electric_resistance.cpp index ce7f1327d..cb4e77418 100644 --- a/ssc/cmod_etes_electric_resistance.cpp +++ b/ssc/cmod_etes_electric_resistance.cpp @@ -547,7 +547,7 @@ class cm_etes_electric_resistance : public compute_module // User-Defined Cycle Parameters pc->m_W_dot_cooling_des = as_double("ud_f_W_dot_cool_des") / 100.0 * as_double("P_ref"); //[MWe] pc->m_m_dot_water_des = as_double("ud_m_dot_water_cool_des"); //[kg/s] - pc->m_is_udpc_sco2_regr = as_boolean("ud_is_sco2_regr"); //[-] + pc->m_is_udpc_sco2_regr = as_integer("ud_is_sco2_regr"); //[-] // User-Defined Cycle Off-Design Tables pc->mc_combined_ind = as_matrix("ud_ind_od"); diff --git a/ssc/cmod_fresnel_physical.cpp b/ssc/cmod_fresnel_physical.cpp index dcad18053..5660019ea 100644 --- a/ssc/cmod_fresnel_physical.cpp +++ b/ssc/cmod_fresnel_physical.cpp @@ -180,8 +180,9 @@ static var_info _cm_vtab_fresnel_physical[] = { // User Defined cycle - { SSC_INPUT, SSC_NUMBER, "ud_f_W_dot_cool_des", "Percent of user-defined power cycle design gross output consumed by cooling", "%", "", "user_defined_PC", "pc_config=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "ud_f_W_dot_cool_des", "Percent of user-defined power cycle design gross output consumed by cooling", "%", "", "user_defined_PC", "pc_config=1", "", "" }, { SSC_INPUT, SSC_NUMBER, "ud_m_dot_water_cool_des", "Mass flow rate of water required at user-defined power cycle design point", "kg/s", "", "user_defined_PC", "pc_config=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "ud_is_sco2_regr", "0: (default) simple max htf mass flow correction; 1: sco2 heuristic regression; 2: no correction","", "", "user_defined_PC", "?=0", "", "" }, { SSC_INPUT, SSC_MATRIX, "ud_ind_od", "Off design user-defined power cycle performance as function of T_htf, m_dot_htf [ND], and T_amb", "", "", "user_defined_PC", "pc_config=1", "", "" }, // TES @@ -902,6 +903,7 @@ class cm_fresnel_physical : public compute_module // User-Defined Cycle Parameters pc->m_W_dot_cooling_des = as_double("ud_f_W_dot_cool_des") / 100.0 * as_double("P_ref"); //[MWe] pc->m_m_dot_water_des = as_double("ud_m_dot_water_cool_des"); //[kg/s] + pc->m_is_udpc_sco2_regr = as_integer("ud_is_sco2_regr"); // User-Defined Cycle Off-Design Tables pc->mc_combined_ind = as_matrix("ud_ind_od"); diff --git a/ssc/cmod_tcsmolten_salt.cpp b/ssc/cmod_tcsmolten_salt.cpp index 9a877606a..f9b4ecbb1 100644 --- a/ssc/cmod_tcsmolten_salt.cpp +++ b/ssc/cmod_tcsmolten_salt.cpp @@ -298,9 +298,9 @@ static var_info _cm_vtab_tcsmolten_salt[] = { // User Defined cycle { SSC_INPUT, SSC_NUMBER, "ud_f_W_dot_cool_des", "Percent of user-defined power cycle design gross output consumed by cooling", "%", "", "User Defined Power Cycle", "pc_config=1", "", ""}, { SSC_INPUT, SSC_NUMBER, "ud_m_dot_water_cool_des", "Mass flow rate of water required at user-defined power cycle design point", "kg/s", "", "User Defined Power Cycle", "pc_config=1", "", ""}, - { SSC_INPUT, SSC_NUMBER, "ud_is_sco2_regr", "False: default, base udpc interpolation, True: use sco2 heuristic regression", "", "", "User Defined Power Cycle", "?=0", "", ""}, + { SSC_INPUT, SSC_NUMBER, "ud_is_sco2_regr", "0: (default) simple max htf mass flow correction; 1: sco2 heuristic regression; 2: no correction", "", "", "User Defined Power Cycle", "?=0", "", ""}, { SSC_INPUT, SSC_MATRIX, "ud_ind_od", "Off design user-defined power cycle performance as function of T_htf, m_dot_htf [ND], and T_amb", "", "", "User Defined Power Cycle", "pc_config=1", "", ""}, - { SSC_INPUT, SSC_NUMBER, "use_net_cycle_output_as_capacity", "False: default, use net calculation including system parasitic, True: for UDPC only, set as cycle output less cooling power", "", "", "User Defined Power Cycle", "?=0", "", "SIMULATION_PARAMETER" }, + { SSC_INPUT, SSC_NUMBER, "use_net_cycle_output_as_capacity", "False: default, use net calculation including system parasitic, True: for UDPC only, set as cycle output less cooling power", "", "", "User Defined Power Cycle", "?=0", "", "SIMULATION_PARAMETER" }, // Aux and Balance of Plant { SSC_INPUT, SSC_NUMBER, "pb_fixed_par", "Fixed parasitic load - runs at all times", "MWe/MWcap", "", "System Control", "*", "", "" }, @@ -1582,7 +1582,7 @@ class cm_tcsmolten_salt : public compute_module // User-Defined Cycle Parameters pc->m_W_dot_cooling_des = as_double("ud_f_W_dot_cool_des") / 100.0*as_double("P_ref"); //[MWe] pc->m_m_dot_water_des = as_double("ud_m_dot_water_cool_des"); //[kg/s] - pc->m_is_udpc_sco2_regr = as_boolean("ud_is_sco2_regr"); //[-] + pc->m_is_udpc_sco2_regr = as_integer("ud_is_sco2_regr"); //[-] // User-Defined Cycle Off-Design Tables pc->mc_combined_ind = as_matrix("ud_ind_od"); diff --git a/ssc/cmod_trough_physical.cpp b/ssc/cmod_trough_physical.cpp index 408036d75..0098c704c 100644 --- a/ssc/cmod_trough_physical.cpp +++ b/ssc/cmod_trough_physical.cpp @@ -199,6 +199,7 @@ static var_info _cm_vtab_trough_physical[] = { // UDPC parameters { SSC_INPUT, SSC_NUMBER, "ud_f_W_dot_cool_des", "Percent of user-defined power cycle design gross output consumed by cooling", "%", "", "powerblock", "pc_config=1", "", "" }, { SSC_INPUT, SSC_NUMBER, "ud_m_dot_water_cool_des", "Mass flow rate of water required at user-defined power cycle design point", "kg/s", "", "powerblock", "pc_config=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "ud_is_sco2_regr", "0: (default) simple max htf mass flow correction; 1: sco2 heuristic regression; 2: no correction","", "", "powerblock", "?=0", "", "" }, { SSC_INPUT, SSC_MATRIX, "ud_ind_od", "Off design user-defined power cycle performance as function of T_htf, m_dot_htf [ND], and T_amb", "", "", "powerblock", "pc_config=1", "", "" }, // General TES Parameters @@ -1356,6 +1357,7 @@ class cm_trough_physical : public compute_module // User-Defined Cycle Parameters pc->m_W_dot_cooling_des = as_double("ud_f_W_dot_cool_des") / 100.0 * as_double("P_ref"); //[MWe] pc->m_m_dot_water_des = as_double("ud_m_dot_water_cool_des"); //[kg/s] + pc->m_is_udpc_sco2_regr = as_integer("ud_is_sco2_regr"); // User-Defined Cycle Off-Design Tables pc->mc_combined_ind = as_matrix("ud_ind_od"); diff --git a/tcs/csp_solver_pc_Rankine_indirect_224.h b/tcs/csp_solver_pc_Rankine_indirect_224.h index 95d76327e..06f549873 100644 --- a/tcs/csp_solver_pc_Rankine_indirect_224.h +++ b/tcs/csp_solver_pc_Rankine_indirect_224.h @@ -265,7 +265,7 @@ class C_pc_Rankine_indirect_224 : public C_csp_power_cycle // Steam Rankine or User-Defined bool m_is_user_defined_pc; //[-] True: user-defined power cycle, False: Built-in Rankine Cycle model - bool m_is_udpc_sco2_regr; //[-] False: default, base udpc interpolation, True: use sco2 heuristic regression + int m_is_udpc_sco2_regr; //[-] False: default, base udpc interpolation, True: use sco2 heuristic regression // Parameters that have different SSCINPUT names for Rankine Cycle and User Defined Cycle double m_dT_cw_ref; //[C] design temp difference between cooling water inlet/outlet @@ -302,7 +302,7 @@ class C_pc_Rankine_indirect_224 : public C_csp_power_cycle // Initialize parameters for user-defined power cycle m_is_user_defined_pc = false; - m_is_udpc_sco2_regr = false; + m_is_udpc_sco2_regr = C_ud_power_cycle::SIMPLE_HEURISTIC; m_W_dot_cooling_des = m_m_dot_water_des = std::numeric_limits::quiet_NaN();