Skip to content

Commit

Permalink
change variable for udpc mode from bool to int
Browse files Browse the repository at this point in the history
  • Loading branch information
tyneises committed Dec 3, 2024
1 parent 0256953 commit eb421a1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ssc/cmod_etes_electric_resistance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 3 additions & 1 deletion ssc/cmod_fresnel_physical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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");
Expand Down
6 changes: 3 additions & 3 deletions ssc/cmod_tcsmolten_salt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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", "*", "", "" },
Expand Down Expand Up @@ -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");
Expand Down
2 changes: 2 additions & 0 deletions ssc/cmod_trough_physical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions tcs/csp_solver_pc_Rankine_indirect_224.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<double>::quiet_NaN();

Expand Down

0 comments on commit eb421a1

Please sign in to comment.