From 71a0b4b3b668463c78c6cd443c138bedacb36685 Mon Sep 17 00:00:00 2001 From: Taylor Brown <60201147+taylorbrown75@users.noreply.github.com> Date: Fri, 22 Nov 2024 16:06:31 -0700 Subject: [PATCH] Add physical heat sink variables to IPH MSLF cmod. --- ssc/cmod_fresnel_physical_iph.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/ssc/cmod_fresnel_physical_iph.cpp b/ssc/cmod_fresnel_physical_iph.cpp index 07d721520..1e3364f12 100644 --- a/ssc/cmod_fresnel_physical_iph.cpp +++ b/ssc/cmod_fresnel_physical_iph.cpp @@ -153,7 +153,17 @@ static var_info _cm_vtab_fresnel_physical_iph[] = { // Heat Sink - {SSC_INPUT, SSC_NUMBER, "pb_pump_coef", "Pumping power to move 1kg of HTF through PB loop", "kW/kg", "", "Heat Sink", "*", "", ""}, + { SSC_INPUT, SSC_NUMBER, "pb_pump_coef", "Pumping power to move 1kg of HTF through PB loop", "kW/kg", "", "Heat Sink", "*", "", "" }, + + { SSC_INPUT, SSC_NUMBER, "hs_type", "0: ideal model, 1: physical steam model", "", "", "Heat Sink", "?=0", "", "" }, + { SSC_INPUT, SSC_NUMBER, "hs_phys_N_sub", "Number physical heat sink HX nodes", "", "", "Heat Sink", "hs_type=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "hs_phys_tol", "Physical heat sink solve tolerance", "", "", "Heat Sink", "hs_type=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "hs_phys_f_mdot_steam_min", "Min steam mdot fraction for physical heat sink", "", "", "Heat Sink", "hs_type=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "hs_phys_f_mdot_steam_max", "Max steam mdot fraction for physical heat sink", "", "", "Heat Sink", "hs_type=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "hs_phys_T_steam_cold_des", "Steam inlet temperature for physical heat sink", "C", "", "Heat Sink", "hs_type=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "hs_phys_P_steam_hot_des", "Steam outlet (and inlet) pressure for physical heat sink", "bar", "", "Heat Sink", "hs_type=1", "", "" }, + { SSC_INPUT, SSC_NUMBER, "hs_phys_Q_steam_hot_des", "Steam outlet quality for physical heat sink", "", "", "Heat Sink", "hs_type=1", "", "" }, + // TES @@ -911,7 +921,12 @@ class cm_fresnel_physical_iph : public compute_module } // Heat Sink + int hs_type = as_integer("hs_type"); + C_csp_power_cycle* c_heat_sink_pointer; C_pc_heat_sink c_heat_sink; + + // Ideal heat sink + if (hs_type == 0) { //size_t n_f_turbine1 = 0; //ssc_number_t* p_f_turbine1 = as_array("f_turb_tou_periods", &n_f_turbine1); // heat sink, not turbine @@ -940,6 +955,12 @@ class cm_fresnel_physical_iph : public compute_module c_heat_sink.mc_reported_outputs.assign(C_pc_heat_sink::E_M_DOT_HTF, allocate("m_dot_htf_heat_sink", n_steps_fixed), n_steps_fixed); c_heat_sink.mc_reported_outputs.assign(C_pc_heat_sink::E_T_HTF_IN, allocate("T_heat_sink_in", n_steps_fixed), n_steps_fixed); c_heat_sink.mc_reported_outputs.assign(C_pc_heat_sink::E_T_HTF_OUT, allocate("T_heat_sink_out", n_steps_fixed), n_steps_fixed); + + c_heat_sink_pointer = &c_heat_sink; + } + else + { + throw exec_error("fresnel_physical_iph", "hs_type != 0; other heat sink models are not currently supported"); } // Electricity pricing schedule @@ -1087,7 +1108,7 @@ class cm_fresnel_physical_iph : public compute_module // Instantiate Solver C_csp_solver csp_solver(weather_reader, c_fresnel, - c_heat_sink, + *c_heat_sink_pointer, storage, tou, dispatch,