Skip to content

Commit

Permalink
Adding generic turbine search functor
Browse files Browse the repository at this point in the history
  • Loading branch information
gyalla committed Jun 24, 2024
1 parent 50d3a70 commit 787677d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
15 changes: 7 additions & 8 deletions include/aero/actuator/ActuatorFunctorsFAST.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,13 @@ using ActFastSpreadForceWhProjection = GenericLoopOverCoarseSearchResults<
ActuatorBulkFAST,
ActFastSpreadForceWhProjInnerLoop>;

//TODO: Is there a better way to do this
/* using ActFastComputeThrust = GenericLoopOverCoarseTurbineSearchResults< */
/* ActuatorBulkFAST, */
/* ActFastComputeThrustInnerLoop>; */

/* using ActFastSpreadForceWhProjection = GenericLoopOverCoarseTurbineSearchResults< */
/* ActuatorBulkFAST, */
/* ActFastSpreadForceWhProjInnerLoop>; */
using ActFastComputeThrustTurbineSearch = GenericLoopOverCoarseTurbineSearchResults<
ActuatorBulkFAST,
ActFastComputeThrustInnerLoop>;

using ActFastSpreadForceWhProjectionTurbineSearch = GenericLoopOverCoarseTurbineSearchResults<
ActuatorBulkFAST,
ActFastSpreadForceWhProjInnerLoop>;

} /* namespace nalu */
} /* namespace sierra */
Expand Down
5 changes: 3 additions & 2 deletions include/aero/actuator/ActuatorGenericTurbineSearchFunctor.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,12 @@ struct GenericLoopOverCoarseTurbineSearchResults
// during functor construction i.e. ActuatorBulk, flags, ActuatorMeta,
// etc.
//
//loop over actuator points. Don't need to change innerLoopFunctors
for (int actPtInd = 0; actPtInd < actBulk_.pointCentroids_.size(); actPtInd ++){
// loop over actuator points. Don't need to change innerLoopFunctors
for (int actPtInd = 0; actPtInd < actBulk_.pointCentroid_.extent(0); actPtInd ++){
innerLoopFunctor_(actPtInd, nodeCoords, sourceTerm, dual_vol, scvIp[nIp]);
}
}
}

ActuatorBulk& actBulk_;
stk::mesh::BulkData& stkBulk_;
Expand Down
22 changes: 9 additions & 13 deletions src/aero/actuator/ActuatorExecutorsFASTNgp.C
Original file line number Diff line number Diff line change
Expand Up @@ -28,43 +28,41 @@ ActuatorLineFastNGP::operator()()
//Zero the (body-force) actuator source term
actBulk_.zero_source_terms(stkBulk_);

//Range for Kokkos parallel-for -- set range policy to only operating over points owned by local fast turbine
//set range policy to only operating over points owned by local fast turbine
auto fastRangePolicy = actBulk_.local_range_policy();

//Interpolate velocity to actuator points. This happens before fine search? Is this from previous timestep
//Interpolate velocity to actuator points.
RunInterpActuatorVel(actBulk_, stkBulk_);

// Add FLLC correction to velocity field. Is this term treated explicitly? Also seems like it’s from previous step
// Add FLLC correction to velocity field.
apply_fllc(actBulk_);

//assign velocity data to a point and turbine ID from openfast?
Kokkos::parallel_for(
"assignFastVelActuatorNgpFAST", fastRangePolicy,
ActFastAssignVel(actBulk_));

// get relative velocity from openFAST
ActFastCacheRelativeVelocities(actBulk_);

// Compute filtered lifting line correction and store in fllc(I,j)
// Compute filtered lifting line correction
compute_fllc();

// Send interpolated velocities at actuator points to openFAST
actBulk_.interpolate_velocities_to_fast();

// Get actuator point centroids (from openfast or from basis-functions?). Again, this after the interpolation step?
// Get actuator point centroids
RunActFastUpdatePoints(actBulk_);

// Execute fine and coarse search given point centroids (see next slides)
actBulk_.stk_search(actMeta_, stkBulk_); // this is the fine and coarse searching.
// Execute fine and coarse search given point centroids
actBulk_.stk_search(actMeta_, stkBulk_);

// call openfast and step
actBulk_.step_fast();

// compute the force from openfast at actuator points
RunActFastComputeForce(actBulk_);

// Loop over all coarse points, the spread the force to.
// Does this perform the loop over coarse search for each point centroid?
// Loop over all coarse points
const int localSizeCoarseSearch =
actBulk_.coarseSearchElemIds_.view_host().extent_int(0);

Expand All @@ -80,7 +78,6 @@ ActuatorLineFastNGP::operator()()
ActFastSpreadForceWhProjection(actBulk_, stkBulk_));
}

// sum up force contributions
actBulk_.parallel_sum_source_term(stkBulk_);

if (actBulk_.openFast_.isDebug()) {
Expand Down Expand Up @@ -141,7 +138,7 @@ ActuatorDiskFastNGP::operator()()
const int localSizeCoarseSearch =
actBulk_.coarseSearchElemIds_.view_host().extent_int(0);

if (actMeta_.turbineLevelSearch) {
if (actMeta_.turbineLevelSearch_) {
Kokkos::parallel_for(
"spreadForcesActuatorNgpFAST", HostRangePolicy(0, localSizeCoarseSearch),
SpreadActuatorForceTurbineSearch(actBulk_, stkBulk_));
Expand All @@ -152,7 +149,6 @@ ActuatorDiskFastNGP::operator()()
SpreadActuatorForce(actBulk_, stkBulk_));
}


actBulk_.parallel_sum_source_term(stkBulk_);

if (actBulk_.openFast_.isDebug()) {
Expand Down

0 comments on commit 787677d

Please sign in to comment.