diff --git a/ssc/cmod_fresnel_physical_iph.cpp b/ssc/cmod_fresnel_physical_iph.cpp index 1e3364f12..dacf31b90 100644 --- a/ssc/cmod_fresnel_physical_iph.cpp +++ b/ssc/cmod_fresnel_physical_iph.cpp @@ -922,7 +922,7 @@ 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_csp_power_cycle* c_heat_sink_pointer = nullptr; C_pc_heat_sink c_heat_sink; // Ideal heat sink @@ -963,6 +963,11 @@ class cm_fresnel_physical_iph : public compute_module throw exec_error("fresnel_physical_iph", "hs_type != 0; other heat sink models are not currently supported"); } + if (c_heat_sink_pointer == nullptr) + { + throw exec_error("fresnel_physical_iph", "Heat sink pointer not assigned"); + } + // Electricity pricing schedule int csp_financial_model = as_integer("csp_financial_model"); C_timeseries_schedule_inputs elec_pricing_schedule; diff --git a/ssc/cmod_mspt_iph.cpp b/ssc/cmod_mspt_iph.cpp index 1bd84c8d3..c6fef576f 100644 --- a/ssc/cmod_mspt_iph.cpp +++ b/ssc/cmod_mspt_iph.cpp @@ -1219,7 +1219,7 @@ class cm_mspt_iph : public compute_module // *********************************************** int hs_type = as_integer("hs_type"); - C_csp_power_cycle* c_heat_sink_pointer; + C_csp_power_cycle* c_heat_sink_pointer = nullptr; C_pc_heat_sink c_heat_sink; size_t n_f_turbine1 = 0; @@ -1256,7 +1256,10 @@ class cm_mspt_iph : public compute_module { throw exec_error("mspt_iph", "hs_type != 0; other heat sink models are not currently supported"); } - + if (c_heat_sink_pointer == nullptr) + { + throw exec_error("mspt_iph", "Heat sink pointer not assigned"); + } //// ********************************************************* //// ********************************************************* diff --git a/ssc/cmod_trough_physical_iph.cpp b/ssc/cmod_trough_physical_iph.cpp index 3dedba31f..63ec126ff 100644 --- a/ssc/cmod_trough_physical_iph.cpp +++ b/ssc/cmod_trough_physical_iph.cpp @@ -1502,7 +1502,7 @@ class cm_trough_physical_iph : public compute_module // Heat Sink int hs_type = as_integer("hs_type"); - C_csp_power_cycle* c_heat_sink_pointer; + C_csp_power_cycle* c_heat_sink_pointer = nullptr; C_pc_heat_sink c_heat_sink; // Ideal heat sink @@ -1544,6 +1544,11 @@ class cm_trough_physical_iph : public compute_module throw exec_error("trough_physical_iph", "hs_type != 0; other heat sink models are not currently supported"); } + if (c_heat_sink_pointer == nullptr) + { + throw exec_error("trough_physical_iph", "Heat sink pointer not assigned"); + } + // Electricity pricing schedule C_timeseries_schedule_inputs elec_pricing_schedule;