Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADM Turbine Level Search #1266

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Conversation

gyalla
Copy link

@gyalla gyalla commented Jun 13, 2024

Hi Phil,

The question is regarding the line
auto points = pointCentroid_.template view<ActuatorFixedMemSpace>();
in ActuatorBulk.C and why it does not work when replacing pointCentroid_ with hubLocations_ as in
auto points = hubLocations_.template view<ActuatorFixedMemSpace>();

Best,
Gopal

src/aero/actuator/ActuatorBulkFAST.C Outdated Show resolved Hide resolved
src/aero/actuator/ActuatorBulkFAST.C Outdated Show resolved Hide resolved
src/aero/actuator/ActuatorExecutorsFASTNgp.C Outdated Show resolved Hide resolved
include/aero/actuator/ActuatorBulk.h Outdated Show resolved Hide resolved
VectorFieldType* coordinates_;
VectorFieldType* actuatorSource_;
ScalarFieldType* dualNodalVolume_;
functor innerLoopFunctor_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const size_t innerLoopExtent_;
Add this here for populating on construction

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment below

{
actBulk_.coarseSearchElemIds_.sync_host();
actBulk_.coarseSearchPointIds_.sync_host();
innerLoopFunctor_.preloop();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

innerLoopExtent = actBulk.singlePointCoarseSearch ? 1 : /*actuatorBulk points extent*/;
Then add in the inner loop inside the turbine

ActuatorBulkFAST,
ActFastComputeThrustInnerLoop>;

using ActFastSpreadForceWhProjectionTurbineSearch = GenericLoopOverCoarseTurbineSearchResults<
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this function in amr-wind there is a distance check that is done prior to computing the exponentials. In nalu-wind we used the search to filter this, but we probably want to add in the distance check here since we will now have the entire box surrounding the turbine.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment below

for (int actPtInd = 0; actPtInd < actBulk_.pointCentroid_.extent(0); actPtInd ++){
innerLoopFunctor_(actPtInd, nodeCoords, sourceTerm, dual_vol, scvIp[nIp]);
}
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the innerLoopExtent_ idea will work because if singlePointCoarseSearch_=true, the inner functor requires the pointId associated with the index passed as an argument to the generic loop functor. However, if singlePointCoarseSearch_= false, then we need to loop over all actuator points. Is this simple if-else statement appropriate?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think this is an appropriate use case for if-else.

//auto epsilonRadius =
// Kokkos::subview(actBulk_.searchRadius_.view_host(), pointId, Kokkos::ALL);
auto epsilonRadius = actBulk_.searchRadius_.h_view(pointId);
if (std::sqrt(distance[0]*distance[0] + distance[1]*distance[1] + distance[2]*distance[2]) < epsilonRadius) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a check based on the distance from the actuator point to the element centroid before evaluating the exponential, which uses the predefined values in searchRadius_. I think this check is only needed if singlePointCoarseSearch_=false, right? If so, I can add another conditional to the if statement

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't make a difference. The search radius is epsilon for the old case. I think profiling is the only way to know if this would slow the old case down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants