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

PlaneSampler skipping normal unless offsets is specified #1132

Closed
rthedin opened this issue Jul 11, 2024 · 8 comments · Fixed by #1137
Closed

PlaneSampler skipping normal unless offsets is specified #1132

rthedin opened this issue Jul 11, 2024 · 8 comments · Fixed by #1137
Assignees
Labels
bug:amr-wind Something isn't working

Comments

@rthedin
Copy link

rthedin commented Jul 11, 2024

When using the PlaneSampler, the normal (the same as axis3) does not get populated unless offsets is specified:

if (noffsets > 0) {
pp.getarr("normal", m_normal);

Without offsets, axis3 is 0, 0, 0, regardless of the value of normal in the input file.

@rthedin rthedin added the bug:amr-wind Something isn't working label Jul 11, 2024
@rybchuk
Copy link
Contributor

rybchuk commented Jul 12, 2024

I thought this was intentional. normal comes up when you have offsets to specify the direction of the offset, but you don't need that for the single plane.

@marchdf
Copy link
Contributor

marchdf commented Jul 12, 2024

I think (?) that this is a classic case of a thing being used somewhere else where it shouldn't be/bad naming/bad reuse. normal as @rybchuk says is really for specifying the direction along which to add offset planes. It is not technically the "normal" of the plane, that would be given by the cross product of axis1 and axis2.

axis3 in the netcdf output uses assuming it was set. But it's not the normal of the plane. It indicates the direction along which the offset planes were done.

This is confusing. But I am not sure what the correct fix is because this is all user facing options. Rename "normal" in the input file and break a bunch of user input files (maybe with a grace period with warnings supplied)? Rename axis3 in the netcdf output to something more descriptive? axis3 -> offset_extrusion_direction ? And then break some postprocessing scripts?

Or did I just get all this wrong and something else is going on...

@marchdf
Copy link
Contributor

marchdf commented Jul 12, 2024

I hesitate to make axis3 = axis1 x axis2 if normal is not set because that's kinda changing the definition of "axis3" depending on the offset inputs...

@marchdf
Copy link
Contributor

marchdf commented Jul 12, 2024

Maybe this picture helps the discussion? Or shows where I am wrong.

Screenshot 2024-07-12 at 2 01 42 PM

@rthedin
Copy link
Author

rthedin commented Jul 12, 2024

I figured there was a chance this was all intentional. You got my point correctly, Marc. Your picture is consistent with what is currently happening. I got used to set normal regardless of offsets and not having normal broke my post-processing scripts for someone else. I personally think a different name like the one you suggested would be best, but I see the problem of renaming and breaking people's processing scripts. I defer the choice of renaming or not renaming to you guys. Thanks for the clarification!

@lawrenceccheung
Copy link
Contributor

lawrenceccheung commented Jul 13, 2024

Yes, I believe the sample plane inputs were intentionally set up this way. We set it up so it used the same vectors that are in Nalu-Wind's plane_specifications, and the intent was to allow the situation that @marchdf sketched. Unfortunately normal is a poor choice of words, Nalu-Wind uses the offset_vector terminology:

      - name: sliceData/p_hub
        corner_coordinates: [0, 0, 90]
        edge1_vector: [5120, 0, 0]
        edge2_vector: [0, 5120, 0]
        edge1_numPoints: 513
        edge2_numPoints: 513
        offset_vector:   [0, 0, 1]
        offset_spacings: [0, 20, 40]

@marchdf
Copy link
Contributor

marchdf commented Jul 15, 2024

I don't like messing with the users but I am worried this is going to come up again. See #1137

@marchdf marchdf self-assigned this Jul 15, 2024
@marchdf
Copy link
Contributor

marchdf commented Jul 15, 2024

I am closing this because the PR won't be merged until the next release but will be addressed. Please reopen if not.

@marchdf marchdf closed this as completed Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:amr-wind Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants