-
Notifications
You must be signed in to change notification settings - Fork 81
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
base: master
Are you sure you want to change the base?
ADM Turbine Level Search #1266
Conversation
VectorFieldType* coordinates_; | ||
VectorFieldType* actuatorSource_; | ||
ScalarFieldType* dualNodalVolume_; | ||
functor innerLoopFunctor_; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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< |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment below
… check before evaluating exponentials
for (int actPtInd = 0; actPtInd < actBulk_.pointCentroid_.extent(0); actPtInd ++){ | ||
innerLoopFunctor_(actPtInd, nodeCoords, sourceTerm, dual_vol, scvIp[nIp]); | ||
} | ||
} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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