Skip to content

Commit

Permalink
Update ssc test results for updated trough model.
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorbrown75 committed Dec 8, 2023
1 parent 5ad0963 commit a4d8be5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 25 deletions.
4 changes: 2 additions & 2 deletions test/shared_test/lib_csp_trough_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ NAMESPACE_TEST(csp_trough, TroughLoop, DefaultTest)

trough->on(*time_and_weather, fluid_inlet_state, std::numeric_limits<double>::quiet_NaN(), defocus, trough_outputs, timestep_and_tou);

EXPECT_NEAR(trough_outputs.m_T_salt_hot, 391.17, 391.17 * kErrorToleranceLo);
EXPECT_NEAR(trough_outputs.m_m_dot_salt_tot, 6535292., 6535292. * kErrorToleranceLo);
EXPECT_NEAR(trough_outputs.m_T_salt_hot, 391.15, 391.15 * kErrorToleranceLo);
EXPECT_NEAR(trough_outputs.m_m_dot_salt_tot, 6645818., 6645818. * kErrorToleranceLo);
}

// Test a standard trough loop from a homogenous initial condition to steady-state
Expand Down
8 changes: 4 additions & 4 deletions test/ssc_test/cmod_trough_physical_iph_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ NAMESPACE_TEST(csp_trough, HeatTroughCmod, Default_NoFinancial)
double annual_total_water_use = heat_trough.GetOutput("annual_total_water_use");

//EXPECT_NEAR_FRAC(heat_trough.GetOutput("annual_gross_energy"), 24267285, kErrorToleranceHi);
EXPECT_NEAR_FRAC(heat_trough.GetOutput("annual_energy"), 24135521, kErrorToleranceHi);
EXPECT_NEAR_FRAC(heat_trough.GetOutput("annual_electricity_consumption"), 92570, kErrorToleranceHi);
EXPECT_NEAR_FRAC(heat_trough.GetOutput("annual_thermal_consumption"), 254.46, kErrorToleranceHi);
EXPECT_NEAR_FRAC(heat_trough.GetOutput("annual_tes_freeze_protection"), 254.46, kErrorToleranceHi);
EXPECT_NEAR_FRAC(heat_trough.GetOutput("annual_energy"), 24142307, kErrorToleranceHi);
EXPECT_NEAR_FRAC(heat_trough.GetOutput("annual_electricity_consumption"), 94120, kErrorToleranceHi);
EXPECT_NEAR_FRAC(heat_trough.GetOutput("annual_thermal_consumption"), 217.51, kErrorToleranceHi);
EXPECT_NEAR_FRAC(heat_trough.GetOutput("annual_tes_freeze_protection"), 217.51, kErrorToleranceHi);
EXPECT_NEAR(heat_trough.GetOutput("annual_field_freeze_protection"), 0., kErrorToleranceHi);
EXPECT_NEAR_FRAC(heat_trough.GetOutput("annual_total_water_use"), 176.3, kErrorToleranceHi);

Expand Down
55 changes: 36 additions & 19 deletions test/ssc_test/cmod_trough_physical_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,48 @@ NAMESPACE_TEST(csp_trough, PowerTroughCmod, Default_NoFinancial)
int errors = power_trough.RunModule();
EXPECT_FALSE(errors);
if (!errors) {
EXPECT_NEAR_FRAC(power_trough.GetOutput("annual_energy"), 372167315, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("annual_thermal_consumption"), 941238, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("annual_tes_freeze_protection"), 749193, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("annual_field_freeze_protection"), 192044, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("capacity_factor"), 42.53, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("annual_W_cycle_gross"), 424681858, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("kwh_per_kw"), 3725, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("conversion_factor"), 87.84, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("annual_total_water_use"), 80708, kErrorToleranceHi);

double annual_energy = power_trough.GetOutput("annual_energy");
double annual_thermal_consumption = power_trough.GetOutput("annual_thermal_consumption");
double annual_tes_freeze_protection = power_trough.GetOutput("annual_tes_freeze_protection");
double annual_field_freeze_protection = power_trough.GetOutput("annual_field_freeze_protection");
double capacity_factor = power_trough.GetOutput("capacity_factor");
double annual_W_cycle_gross = power_trough.GetOutput("annual_W_cycle_gross");
double kwh_per_kw = power_trough.GetOutput("kwh_per_kw");
double conversion_factor = power_trough.GetOutput("conversion_factor");
double annual_total_water_use = power_trough.GetOutput("annual_total_water_use");

double time_hr = power_trough.GetOutputSum("time_hr");
double month = power_trough.GetOutputSum("month");
double beam = power_trough.GetOutputSum("beam");
double defocus = power_trough.GetOutputSum("defocus");
double q_dc_tes = power_trough.GetOutputSum("q_dc_tes");
double P_fixed = power_trough.GetOutputSum("P_fixed");
double op_mode_1 = power_trough.GetOutputSum("op_mode_1");
double n_op_modes = power_trough.GetOutputSum("n_op_modes");
double is_rec_su_allowed = power_trough.GetOutputSum("is_rec_su_allowed");

EXPECT_NEAR_FRAC(power_trough.GetOutput("annual_energy"), 377677449, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("annual_thermal_consumption"), 872331, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("annual_tes_freeze_protection"), 692200, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("annual_field_freeze_protection"), 180131, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("capacity_factor"), 43.16, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("annual_W_cycle_gross"), 430999201, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("kwh_per_kw"), 3781, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("conversion_factor"), 87.63, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutput("annual_total_water_use"), 82009, kErrorToleranceHi);

EXPECT_NEAR_FRAC(power_trough.GetOutputSum("time_hr"), 38373180, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutputSum("month"), 57168, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutputSum("beam"), 2687889, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutputSum("defocus"), 8753, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutputSum("q_dc_tes"), 328937, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutputSum("P_fixed"), 5347, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutputSum("op_mode_1"), 52902, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutputSum("n_op_modes"), 9799, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutputSum("is_rec_su_allowed"), 8760, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutputSum("defocus"), 8747, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutputSum("q_dc_tes"), 343833, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutputSum("P_fixed"), 5348, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutputSum("op_mode_1"), 53565, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutputSum("n_op_modes"), 9800, kErrorToleranceHi);
EXPECT_NEAR_FRAC(power_trough.GetOutputSum("is_rec_su_allowed"), 8759, kErrorToleranceHi);
//EXPECT_NEAR_FRAC(power_trough.GetOutputSum("operating_modes_a"), 35458021, kErrorToleranceHi);
}
else
{
int x = 0;
}

//ssc_data_t defaults = singleowner_defaults();
//CmodUnderTest singleowner = CmodUnderTest("singleowner", defaults);
Expand Down

0 comments on commit a4d8be5

Please sign in to comment.