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

[Hotfix][Core] Fix 2D discontinuous distance orientation #12681

Merged

Conversation

rubenzorrilla
Copy link
Member

📝 Description
This PR fixes the discontinuous distance orientation in 2D so to make it consistent with the expected 3D behavior, that is to say, the positive distance side is the side the structure normal is pointing to. Note that the modification in the distance algorithm is consistent with the way we use to calculate the normal in 2D simplex geometries (2-node line).

@@ -682,8 +682,8 @@ namespace Kratos
const Element::GeometryType &rGeometry,
array_1d<double,3> &rIntObjNormal)
{
rIntObjNormal[0] = rGeometry[0].Y() - rGeometry[1].Y();
Copy link
Member

Choose a reason for hiding this comment

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

:)

loumalouomega
loumalouomega previously approved these changes Sep 18, 2024
Copy link
Member

@loumalouomega loumalouomega left a comment

Choose a reason for hiding this comment

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

2 lines of code, probably 6 h of debugging

@rubenzorrilla
Copy link
Member Author

About the FSI tests, I prefer to deactivate as it will be upgraded in #12673.

@Marco1410 @marcnunezc I required to update the results of the embedded wake tests.

Note: @Marco1410, we need to upgrade the implementation of the CompressiblePotentialFlow application tests. Right now it is a bit intricate...

@rubenzorrilla rubenzorrilla requested a review from a team as a code owner September 19, 2024 10:47
@marcnunezc
Copy link
Contributor

marcnunezc commented Sep 19, 2024

About the FSI tests, I prefer to deactivate as it will be upgraded in #12673.

@Marco1410 @marcnunezc I required to update the results of the embedded wake tests.

Note: @Marco1410, we need to upgrade the implementation of the CompressiblePotentialFlow application tests. Right now it is a bit intricate...

Hi! If only the orientation is changing, I would expect no change in the test results. I would like to understand what is causing the change in the result. Something is not robust enough (probably the logic on the intersection of geometry and wake).

I dont want to block your PR, would you agree on bringing back the previous test results and skip the test or mark it as Expected Failure until I find the issue?

@rubenzorrilla
Copy link
Member Author

About the FSI tests, I prefer to deactivate as it will be upgraded in #12673.
@Marco1410 @marcnunezc I required to update the results of the embedded wake tests.
Note: @Marco1410, we need to upgrade the implementation of the CompressiblePotentialFlow application tests. Right now it is a bit intricate...

Hi! If only the orientation is changing, I would expect no change in the test results. I would like to understand what is causing the change in the result. Something is not robust enough (probably the logic on the intersection of geometry and wake).

I dont want to block your PR, would you agree on bringing back the previous test results and skip the test or mark it as Expected Failure until I find the issue?

Makes perfect sense. I'll have a quick look to it. If I manage to find the issue I'd try to fix it and revert the test results. If not, I'll mark them as expected failure.

@rubenzorrilla
Copy link
Member Author

@marcnunezc I think missed one change in the embedded wake definition process (basically to flip it in order to keep the same values). Please confirm that what I done is correct.

@marcnunezc
Copy link
Contributor

@marcnunezc I think missed one change in the embedded wake definition process (basically to flip it in order to keep the same values). Please confirm that what I done is correct.

So are you getting the original test results with this change?

@rubenzorrilla
Copy link
Member Author

rubenzorrilla commented Sep 20, 2024

@marcnunezc I think missed one change in the embedded wake definition process (basically to flip it in order to keep the same values). Please confirm that what I done is correct.

So are you getting the original test results with this change?

Mainly yes. But there are some slight changes, about which I'm not 100% sure if they can be expected or not.

Edit: I reverted the changes in the json files to ease the tracking of the changes.

@marcnunezc
Copy link
Contributor

marcnunezc commented Sep 20, 2024

@marcnunezc I think missed one change in the embedded wake definition process (basically to flip it in order to keep the same values). Please confirm that what I done is correct.

So are you getting the original test results with this change?

Mainly yes. But there are some slight changes, about which I'm not 100% sure if they can be expected or not.

Edit: I reverted the changes in the json files to ease the tracking of the changes.

I have an alternative solution to the problem in #12690 using the orientation of the wake to decide the sign of the distance values. With this approach, no changes are required in this PR after changing the orientation of the discontinuous process.

@rubenzorrilla
Copy link
Member Author

@marcnunezc I think missed one change in the embedded wake definition process (basically to flip it in order to keep the same values). Please confirm that what I done is correct.

So are you getting the original test results with this change?

Mainly yes. But there are some slight changes, about which I'm not 100% sure if they can be expected or not.
Edit: I reverted the changes in the json files to ease the tracking of the changes.

I have an alternative solution to the problem in #12690 using the orientation of the wake to decide the sign of the distance values. With this approach, no changes are required in this PR after changing the orientation of the discontinuous process.

Fine for me. Whatever you consider is surely the best option in this case. 👍 .

@rubenzorrilla
Copy link
Member Author

Should be ready now @loumalouomega @marcnunezc .

@rubenzorrilla rubenzorrilla merged commit 0e6dd1b into master Sep 25, 2024
9 of 11 checks passed
@rubenzorrilla rubenzorrilla deleted the core/correct-2d-discontinuous-distance-orientation branch September 25, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants