Skip to content

Commit

Permalink
switch to shared_ptr, uncomment code, remove test returns
Browse files Browse the repository at this point in the history
  • Loading branch information
tyneises committed Sep 1, 2023
1 parent 0e6ce3c commit 79cec51
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 25 deletions.
8 changes: 0 additions & 8 deletions ssc/cmod_sco2_csp_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 0 additions & 9 deletions ssc/csp_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
6 changes: 2 additions & 4 deletions tcs/sco2_pc_csp_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void C_sco2_phx_air_cooler::design_core()

if (ms_des_par.m_cycle_config == 2)
{
std::unique_ptr<C_PartialCooling_Cycle> c_pc_cycle = std::unique_ptr<C_PartialCooling_Cycle>(new C_PartialCooling_Cycle(
std::shared_ptr<C_PartialCooling_Cycle> c_pc_cycle = std::unique_ptr<C_PartialCooling_Cycle>(new C_PartialCooling_Cycle(
turbo_gen_motor_config,
eta_generator,
T_mc_in,
Expand All @@ -128,7 +128,7 @@ void C_sco2_phx_air_cooler::design_core()
}
else
{
std::unique_ptr<C_RecompCycle> c_rc_cycle = std::unique_ptr<C_RecompCycle>(new C_RecompCycle(
std::shared_ptr<C_RecompCycle> c_rc_cycle = std::unique_ptr<C_RecompCycle>(new C_RecompCycle(
turbo_gen_motor_config,
eta_generator,
T_mc_in,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tcs/sco2_pc_csp_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ class C_sco2_phx_air_cooler

private:

std::unique_ptr<C_sco2_cycle_core> mpc_sco2_cycle;
std::shared_ptr<C_sco2_cycle_core> mpc_sco2_cycle;

C_HX_co2_to_htf mc_phx;

Expand Down
6 changes: 3 additions & 3 deletions test/ssc_test/cmod_sco2_csp_system_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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]);

}
*/

}

0 comments on commit 79cec51

Please sign in to comment.