Skip to content

Commit

Permalink
fixed variable ingestion of ct curve in wind cmod and updated thrust …
Browse files Browse the repository at this point in the history
…curve test
  • Loading branch information
janinefreeman committed Apr 11, 2024
1 parent aa4f910 commit 4d77818
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ssc/cmod_windpower.cpp
Expand Up @@ -305,10 +305,10 @@ void cm_windpower::exec()
// get optional thrust curve for wind turbine
if (is_assigned("wind_turbine_ct_curve"))
{
size_t* ctCurveLength = 0;
ssc_number_t* ctc = as_array("wind_turbine_ct_curve", ctCurveLength);
std::vector<double> ct_curve(*ctCurveLength);
for (size_t i = 0; i < *ctCurveLength; i++)
size_t ctCurveLength = 0;
ssc_number_t* ctc = as_array("wind_turbine_ct_curve", &ctCurveLength);
std::vector<double> ct_curve(ctCurveLength);
for (size_t i = 0; i < ctCurveLength; i++)
ct_curve[i] = ctc[i];
wt.setCtCurve(ct_curve);
}
Expand Down
4 changes: 2 additions & 2 deletions test/ssc_test/cmod_windpower_test.cpp
Expand Up @@ -212,8 +212,8 @@ TEST_F(CMWindPowerIntegration, CtCurve_cmod_windpower)

ssc_number_t difference = wakeLoss2 - wakeLoss1;
EXPECT_NEAR(wakeLoss1, 4.148, 0.01) << "Wake Loss 1";
EXPECT_NEAR(wakeLoss2, 10.0, 0.5) << "Wake Loss 2";
EXPECT_NEAR(difference, 10.0, 0.5) << "Difference";
EXPECT_NEAR(wakeLoss2, 5.562, 0.5) << "Wake Loss 2";
EXPECT_NEAR(difference, 1.413, 0.5) << "Difference";
}

/// Using Interpolated Subhourly Wind Data
Expand Down

0 comments on commit 4d77818

Please sign in to comment.