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

Ocean Waves waves2amr bug fixes - levelset field and initial read #1450

Merged
merged 7 commits into from
Jan 17, 2025

Conversation

mbkuhn
Copy link
Contributor

@mbkuhn mbkuhn commented Jan 16, 2025

Summary

Fixing 2 bugs. Because the w2a routines only update the ow fields where necessary, the values outside of these areas need to be reasonable. Setting levelset = 0 is bad because gradients can lead to intermediate vof values (between 0 and 1). Also, the modes still need to be read when the waves are not initialized over the entire domain.

Added a regression test that blows up without the first fix and segfaults without the second.

No diffs caused for the existing w2a reg tests because this fixes things that they did not cover.

Pull request type

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Checklist

The following is included:

  • new unit-test(s)
  • new regression test(s)
  • documentation for new capability

This PR was tested by running:

  • the unit tests
    • on GPU
    • on CPU
  • the regression tests
    • on GPU
    • on CPU

Additional background

@@ -339,59 +339,51 @@ struct ReadInputsOp<W2AWaves>
std::to_string(flag));
}

// If init_wave_field is activated and initialization will be done, get
// modes on every processor
if (wdata.init_wave_field && data.sim().time().time_index() == 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this looks like a lot of changes here, but really the only change within ReadInputsOp is removing this conditional. The first part needed to be remove to fix a segfault under certain conditions, and the second part did nothing because time_index always == 0 during the read inputs phase of the algorithm because the current time hasn't been calculated yet.

@mbkuhn mbkuhn requested a review from marchdf January 17, 2025 16:23
@mbkuhn mbkuhn enabled auto-merge (squash) January 17, 2025 16:23
@mbkuhn mbkuhn merged commit 7d5d93a into Exawind:main Jan 17, 2025
15 checks passed
@mbkuhn mbkuhn deleted the ow_w2a_parallel_update branch January 17, 2025 17:04
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.

2 participants