Skip to content

Commit

Permalink
add to trough iph htf to steam hx code
Browse files Browse the repository at this point in the history
  • Loading branch information
tyneises committed Jan 17, 2025
1 parent b543909 commit 50491f2
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 202 deletions.
4 changes: 2 additions & 2 deletions ssc/cmod_csp_heatsink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ class cm_csp_heatsink : public compute_module


// Optimize to find steam mdot
double mdot_ext_calc, tol_solved;
double mdot_ext_calc, tol_solved, T_c_out, x_c_out, hx_min_dT;
int solve_code = m_hx.off_design_target_cold_PH_out(h_ext_hot, mdot_min, mdot_max, P_ext_cold, h_ext_cold,
P_ext_hot, 1.0, h_htf_hot_od, 1.0, mdot_htf_od, od_tol,
q_dot_calc, h_ext_out_calc, h_htf_out_calc, mdot_ext_calc, tol_solved);
q_dot_calc, h_ext_out_calc, h_htf_out_calc, mdot_ext_calc, tol_solved, T_c_out, x_c_out, hx_min_dT);

// Off design Outlet steam properties
prop_error_code = water_PH(P_ext_hot, h_ext_out_calc, &ms_water_props);
Expand Down
49 changes: 39 additions & 10 deletions ssc/cmod_trough_physical_iph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@ static var_info _cm_vtab_trough_physical_iph[] = {
{ SSC_OUTPUT, SSC_NUMBER, "csp_dtr_sca_calc_latitude", "Latitude", "degree", "", "Collector", "?=0", "", "" },
{ SSC_OUTPUT, SSC_MATRIX, "csp_dtr_sca_calc_iams", "IAM at summer solstice", "", "", "Collector", "?=0", "", "" },

{ SSC_OUTPUT, SSC_NUMBER, "m_dot_hs_ext_des", "Heat sink fluid mass flow rate", "kg/s", "", "System Control", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "T_hs_ext_out_des", "Heat sink fluid outlet temperature", "C", "", "System Control", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "hx_min_dT_des", "Heat sink hx min temp difference", "C", "", "System Control", "*", "", "" },


// System Control
{ SSC_OUTPUT, SSC_NUMBER, "bop_design", "BOP parasitics at design", "MWe", "", "System Control", "*", "", "" },
{ SSC_OUTPUT, SSC_NUMBER, "aux_design", "Aux parasitics at design", "MWe", "", "System Control", "*", "", "" },
Expand Down Expand Up @@ -586,11 +591,16 @@ static var_info _cm_vtab_trough_physical_iph[] = {
{ SSC_OUTPUT, SSC_ARRAY, "pipe_loop_P_dsn", "Field piping loop pressure at design", "bar", "", "solar_field", "sim_type=1", "", "" },

// Heat Sink
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_to_heat_sink", "Heat sink thermal power", "MWt", "", "Heat_Sink", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "W_dot_pc_pump", "Heat sink pumping power", "MWe", "", "Heat_Sink", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "m_dot_htf_heat_sink", "Heat sink HTF mass flow", "kg/s", "", "Heat_Sink", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "T_heat_sink_in", "Heat sink HTF inlet temp", "C", "", "Heat_Sink", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "T_heat_sink_out", "Heat sink HTF outlet temp", "C", "", "Heat_Sink", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "q_dot_to_heat_sink", "Heat sink thermal power", "MWt", "", "Heat_Sink", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "W_dot_pc_pump", "Heat sink pumping power", "MWe", "", "Heat_Sink", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "m_dot_htf_heat_sink", "Heat sink HTF mass flow", "kg/s", "", "Heat_Sink", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "T_heat_sink_in", "Heat sink HTF inlet temp", "C", "", "Heat_Sink", "sim_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "T_heat_sink_out", "Heat sink HTF outlet temp", "C", "", "Heat_Sink", "sim_type=1", "", "" },

{ SSC_OUTPUT, SSC_ARRAY, "m_dot_wf_heat_sink", "Heat sink steam mass flow rate", "kg/s", "", "Heat_Sink", "sim_type=1&hs_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "x_out_wf_heat_sink", "Heat sink steam outlet quality", "-", "", "Heat_Sink", "sim_type=1&hs_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "T_out_wf_heat_sink", "Heat sink steam outlet temp", "C", "", "Heat_Sink", "sim_type=1&hs_type=1", "", "" },
{ SSC_OUTPUT, SSC_ARRAY, "hx_min_dT_heat_sink", "Heat sink HX min temp difference", "C", "", "Heat_Sink", "sim_type=1&hs_type=1", "", "" },

// TES
{ SSC_OUTPUT, SSC_ARRAY, "tank_losses", "TES thermal losses", "MWt", "", "TES", "sim_type=1", "", "" },
Expand Down Expand Up @@ -1575,11 +1585,17 @@ class cm_trough_physical_iph : public compute_module
c_heat_sink_phys.ms_params.m_od_tol = as_double("hs_phys_tol"); //[] HX off design tolerance

// Allocate heat sink outputs
c_heat_sink_phys.mc_reported_outputs.assign(C_pc_heat_sink::E_Q_DOT_HEAT_SINK, allocate("q_dot_to_heat_sink", n_steps_fixed), n_steps_fixed);
c_heat_sink_phys.mc_reported_outputs.assign(C_pc_heat_sink::E_W_DOT_PUMPING, allocate("W_dot_pc_pump", n_steps_fixed), n_steps_fixed);
c_heat_sink_phys.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_phys.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_phys.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_phys.mc_reported_outputs.assign(C_pc_heat_sink_physical::E_Q_DOT_HEAT_SINK, allocate("q_dot_to_heat_sink", n_steps_fixed), n_steps_fixed);
c_heat_sink_phys.mc_reported_outputs.assign(C_pc_heat_sink_physical::E_W_DOT_PUMPING, allocate("W_dot_pc_pump", n_steps_fixed), n_steps_fixed);
c_heat_sink_phys.mc_reported_outputs.assign(C_pc_heat_sink_physical::E_M_DOT_HTF, allocate("m_dot_htf_heat_sink", n_steps_fixed), n_steps_fixed);
c_heat_sink_phys.mc_reported_outputs.assign(C_pc_heat_sink_physical::E_T_HTF_IN, allocate("T_heat_sink_in", n_steps_fixed), n_steps_fixed);
c_heat_sink_phys.mc_reported_outputs.assign(C_pc_heat_sink_physical::E_T_HTF_OUT, allocate("T_heat_sink_out", n_steps_fixed), n_steps_fixed);

c_heat_sink_phys.mc_reported_outputs.assign(C_pc_heat_sink_physical::E_M_DOT_EXT, allocate("m_dot_wf_heat_sink", n_steps_fixed), n_steps_fixed);
c_heat_sink_phys.mc_reported_outputs.assign(C_pc_heat_sink_physical::E_X_OUT_EXT, allocate("x_out_wf_heat_sink", n_steps_fixed), n_steps_fixed);
c_heat_sink_phys.mc_reported_outputs.assign(C_pc_heat_sink_physical::E_T_OUT_EXT, allocate("T_out_wf_heat_sink", n_steps_fixed), n_steps_fixed);
c_heat_sink_phys.mc_reported_outputs.assign(C_pc_heat_sink_physical::E_HX_MIN_DT, allocate("hx_min_dT_heat_sink", n_steps_fixed), n_steps_fixed);


c_heat_sink_pointer = &c_heat_sink_phys;
}
Expand Down Expand Up @@ -2138,6 +2154,19 @@ class cm_trough_physical_iph : public compute_module
}

}

// Heat sink
double m_dot_hs_ext_des, T_hs_ext_out_des, hx_min_dT_des;
m_dot_hs_ext_des = T_hs_ext_out_des = hx_min_dT_des = std::numeric_limits<double>::quiet_NaN();
if (hs_type == 1) {
m_dot_hs_ext_des = c_heat_sink_phys.get_m_dot_ext_des(); //[kg/s]
T_hs_ext_out_des = c_heat_sink_phys.get_T_ext_out_des(); //[C]
hx_min_dT_des = c_heat_sink_phys.get_hx_min_dT_des(); //[C]
}

assign("m_dot_hs_ext_des", m_dot_hs_ext_des);
assign("T_hs_ext_out_des", T_hs_ext_out_des);
assign("hx_min_dT_des", hx_min_dT_des);
}

// Calculate Costs and assign outputs
Expand Down
2 changes: 1 addition & 1 deletion tcs/csp_solver_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,7 @@ void C_csp_solver::C_CR_OFF__PC_TARGET__TES_DC__AUX_OFF::check_system_limits(C_c
}
else if ((q_dot_pc_solved - q_dot_pc_on_dispatch_target) / q_dot_pc_on_dispatch_target < -limit_comp_tol)
{
if (m_dot_pc_solved < m_dot_pc_max)
if (m_dot_pc_solved / m_dot_pc_max < 1.0 - limit_comp_tol)
{ // TES cannot provide enough thermal power - step down to next operating mode

m_is_mode_available = false;
Expand Down
Loading

0 comments on commit 50491f2

Please sign in to comment.