From 79cec51505230278b653477bd6e3982e36cc6085 Mon Sep 17 00:00:00 2001 From: tyneises Date: Fri, 1 Sep 2023 10:48:21 -0500 Subject: [PATCH] switch to shared_ptr, uncomment code, remove test returns --- ssc/cmod_sco2_csp_system.cpp | 8 -------- ssc/csp_common.cpp | 9 --------- tcs/sco2_pc_csp_int.cpp | 6 ++---- tcs/sco2_pc_csp_int.h | 2 +- test/ssc_test/cmod_sco2_csp_system_test.cpp | 6 +++--- 5 files changed, 6 insertions(+), 25 deletions(-) diff --git a/ssc/cmod_sco2_csp_system.cpp b/ssc/cmod_sco2_csp_system.cpp index 3de835c6f..778079b5a 100644 --- a/ssc/cmod_sco2_csp_system.cpp +++ b/ssc/cmod_sco2_csp_system.cpp @@ -340,14 +340,6 @@ class cm_sco2_csp_system : public compute_module if (sco2_des_err != 0) return; - - - return; - - - - - double m_dot_htf_design = c_sco2_cycle.get_phx_des_par()->m_m_dot_hot_des; //[kg/s] bool is_rc = c_sco2_cycle.get_design_solved()->ms_rc_cycle_solved.m_is_rc; diff --git a/ssc/csp_common.cpp b/ssc/csp_common.cpp index 2dc266d84..d1f4f1958 100644 --- a/ssc/csp_common.cpp +++ b/ssc/csp_common.cpp @@ -1245,15 +1245,6 @@ int sco2_design_cmod_common(compute_module *cm, C_sco2_phx_air_cooler & c_sco2_c throw exec_error("sco2_csp_system", csp_exception.m_error_message); } - - - - return -1; - - - - - // If all calls were successful, log to SSC any messages from sco2_recomp_csp while (c_sco2_cycle.mc_messages.get_message(&out_type, &out_msg)) { diff --git a/tcs/sco2_pc_csp_int.cpp b/tcs/sco2_pc_csp_int.cpp index 6d1fddf66..5e840da7b 100644 --- a/tcs/sco2_pc_csp_int.cpp +++ b/tcs/sco2_pc_csp_int.cpp @@ -106,7 +106,7 @@ void C_sco2_phx_air_cooler::design_core() if (ms_des_par.m_cycle_config == 2) { - std::unique_ptr c_pc_cycle = std::unique_ptr(new C_PartialCooling_Cycle( + std::shared_ptr c_pc_cycle = std::unique_ptr(new C_PartialCooling_Cycle( turbo_gen_motor_config, eta_generator, T_mc_in, @@ -128,7 +128,7 @@ void C_sco2_phx_air_cooler::design_core() } else { - std::unique_ptr c_rc_cycle = std::unique_ptr(new C_RecompCycle( + std::shared_ptr c_rc_cycle = std::unique_ptr(new C_RecompCycle( turbo_gen_motor_config, eta_generator, T_mc_in, @@ -147,8 +147,6 @@ void C_sco2_phx_air_cooler::design_core() s_cycle_config = "recompression"; mpc_sco2_cycle = std::move(c_rc_cycle); - - return; } // Set min temp diff --git a/tcs/sco2_pc_csp_int.h b/tcs/sco2_pc_csp_int.h index 45d4d008a..c08d27684 100644 --- a/tcs/sco2_pc_csp_int.h +++ b/tcs/sco2_pc_csp_int.h @@ -359,7 +359,7 @@ class C_sco2_phx_air_cooler private: - std::unique_ptr mpc_sco2_cycle; + std::shared_ptr mpc_sco2_cycle; C_HX_co2_to_htf mc_phx; diff --git a/test/ssc_test/cmod_sco2_csp_system_test.cpp b/test/ssc_test/cmod_sco2_csp_system_test.cpp index 2a9d9547f..7357d4372 100644 --- a/test/ssc_test/cmod_sco2_csp_system_test.cpp +++ b/test/ssc_test/cmod_sco2_csp_system_test.cpp @@ -116,9 +116,9 @@ NAMESPACE_TEST(sco2_tests, SCO2Cycle, Parametrics) //bool errors = false; - //EXPECT_FALSE(errors); + EXPECT_FALSE(errors); - /* + if (!errors) { EXPECT_NEAR_FRAC(sco2.GetOutput("T_htf_cold_des"), 529.6897, kErrorToleranceLo); EXPECT_NEAR_FRAC(sco2.GetOutput("eta_thermal_calc"), 0.5071197, kErrorToleranceLo); @@ -137,5 +137,5 @@ NAMESPACE_TEST(sco2_tests, SCO2Cycle, Parametrics) EXPECT_FLOATS_NEARLY_EQ(sco2.GetOutputVector("W_dot_net_less_cooling_od"), W_dot_net_less_cooling_od_exp, kErrorToleranceLo*W_dot_net_less_cooling_od_exp[0]); } - */ + }