Skip to content

Commit

Permalink
Fix some unittests (#1341)
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf authored Jan 14, 2025
1 parent 302872b commit 5db7851
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/aero/actuator/ActuatorExecutorsFASTNgp.C
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ ActuatorLineFastNGP::operator()()
actBulk_.parallel_sum_source_term(stkBulk_);

if (actBulk_.openFast_.isDebug()) {
;
actBulk_.output_torque_info(stkBulk_);
}
}
Expand Down
18 changes: 10 additions & 8 deletions src/aero/actuator/ActuatorFunctorsSimple.C
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ ActSimpleComputeRelativeVelocity(
auto relVelocity = helper.get_local_view(actBulk.relativeVelocity_);
auto alpha = helper.get_local_view(actBulk.alpha_);
auto offset = helper.get_local_view(actBulk.turbIdOffset_);
auto twistTableV = helper.get_local_view(actMeta.twistTableDv_);
auto p1ZeroAlphaDirV = helper.get_local_view(actMeta.p1ZeroAlphaDir_);
auto chordNormalDirV = helper.get_local_view(actMeta.chordNormalDir_);
auto spanDirV = helper.get_local_view(actMeta.spanDir_);

const int turbId = actBulk.localTurbineId_;

Expand All @@ -191,14 +195,12 @@ ActSimpleComputeRelativeVelocity(
Kokkos::parallel_for(
"compute relative velocities", actBulk.local_range_policy(),
ACTUATOR_LAMBDA(int index) {
auto twistTable = Kokkos::subview(
helper.get_local_view(actMeta.twistTableDv_), turbId, Kokkos::ALL);
auto p1ZeroAlphaDir = Kokkos::subview(
helper.get_local_view(actMeta.p1ZeroAlphaDir_), turbId, Kokkos::ALL);
auto chordNormalDir = Kokkos::subview(
helper.get_local_view(actMeta.chordNormalDir_), turbId, Kokkos::ALL);
auto spanDir = Kokkos::subview(
helper.get_local_view(actMeta.spanDir_), turbId, Kokkos::ALL);
auto twistTable = Kokkos::subview(twistTableV, turbId, Kokkos::ALL);
auto p1ZeroAlphaDir =
Kokkos::subview(p1ZeroAlphaDirV, turbId, Kokkos::ALL);
auto chordNormalDir =
Kokkos::subview(chordNormalDirV, turbId, Kokkos::ALL);
auto spanDir = Kokkos::subview(spanDirV, turbId, Kokkos::ALL);
const int i = index - offset(turbId);

auto vel = Kokkos::subview(velocity, index, Kokkos::ALL);
Expand Down
10 changes: 5 additions & 5 deletions unit_tests/actuator/UnitTestActuatorBulkFAST.C
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ protected:
TEST_F(ActuatorBulkFastTests, initializeActuatorBulk)
{
std::vector<std::string> modInputs(fastParseParams_);
modInputs[4] = " dt_fast: 0.005\n";
modInputs[5] = " t_max: 0.29\n";
modInputs[4] = " dt_fast: 0.00625\n";
modInputs[5] = " t_max: 0.3625\n";
const YAML::Node y_node = actuator_unit::create_yaml_node(modInputs);
auto actMetaFast = actuator_FAST_parse(y_node, actMeta_);

Expand All @@ -61,8 +61,8 @@ TEST_F(ActuatorBulkFastTests, initializeActuatorBulk)
#ifdef NALU_USES_OPENFAST_FSI
ASSERT_EQ(fi.restartFreq, 1);
#endif
ASSERT_EQ(fi.dtFAST, 0.005);
ASSERT_EQ(fi.tMax, 0.29);
ASSERT_EQ(fi.dtFAST, 0.00625);
ASSERT_EQ(fi.tMax, 0.3625);

ASSERT_EQ(fi.globTurbineData[0].FASTInputFileName, "nrel5mw.fst");
ASSERT_EQ(fi.globTurbineData[0].FASTRestartFileName, "blah");
Expand All @@ -74,7 +74,7 @@ TEST_F(ActuatorBulkFastTests, initializeActuatorBulk)
ASSERT_EQ(fi.globTurbineData[0].nacelle_cd, 1.0);

try {
ActuatorBulkFAST actBulk(actMetaFast, 0.29);
ActuatorBulkFAST actBulk(actMetaFast, 0.3625);
EXPECT_EQ(actBulk.tStepRatio_, 58);
EXPECT_FALSE(actBulk.openFast_.isDebug());
} catch (std::exception const& err) {
Expand Down
1 change: 0 additions & 1 deletion unit_tests/aero/UnitTestPt2Line.C
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ test_projectPt2Line_relative(
auto w1 = lEnd - lStart;
auto w2 = pt - lStart;
auto angle = utils::degrees(vs::angle(w1, w2));
std::cerr << "ANGLE: " << angle << std::endl;
EXPECT_TRUE(checker(result));
}

Expand Down

0 comments on commit 5db7851

Please sign in to comment.