Skip to content

Conversation

@jleonqu
Copy link
Contributor

@jleonqu jleonqu commented Jul 25, 2025

There is an issue when comparing the results between WEC-Sim v4.0 and v6.1.2 for the OSWEC under irregular waves with wave directional spreading. The comparison is shown in the figure below:

image

The next step to determine the main reason for the difference in results is to compare the results for regular waves.

@jleonqu jleonqu requested review from MShabara, jtgrasb and kmruehl July 25, 2025 18:19
@kmruehl kmruehl added Wave Class Wave Classs (waveClass.m) Tests/CI related WEC-Sim tests or Continuous Integration labels Jul 25, 2025
@kmruehl
Copy link
Collaborator

kmruehl commented Jul 25, 2025

Thanks @jleonqu, these results are interesting. The magnitude of response appears to be similar for both version, but the phase is different. Did we change the way we handle phase seed between these versions?

@jleonqu
Copy link
Contributor Author

jleonqu commented Jul 25, 2025

Yes, we changed how the phase seed is handled. In v4.0, rng(obj.phaseSeed) was used, which is not reproducible in parallel runs because each worker has an independent RNG stream. The new implementation uses RandStream('Threefry') with substreams to ensure deterministic and reproducible wave profiles across both serial (wecSim) and parallel (wecSimPCT) simulations. The issue was identified in #1329 and it was solved in PR #1467

@jleonqu
Copy link
Contributor Author

jleonqu commented Jul 25, 2025

We have confirmed that the way the phase seed is handled in both versions is not the cause of the differences in results. Another possible reason could be how the wave spreading is handled. @jtgrasb will continue working on this PR.

@jtgrasb
Copy link
Contributor

jtgrasb commented Jul 28, 2025

@jleonqu Thank you for creating the PR. I verified that the updates seem to be due to differences in the the phase seed is handled in v4.0 and the current version. PR #1467 updated the phase generation so that it is consistent for both serial and parallel simulation runs. I verified that this is the only difference by implementing this change in v4.0 and running the OSWEC case in both irregular and irregular spread cases:

image image

I've updated the org results to use v4.0 with the updated phase and this should be ready to merge once the tests pass.

@kmruehl
Copy link
Collaborator

kmruehl commented Jul 28, 2025

Wonderful news, thanks @jtgrasb!

@jtgrasb
Copy link
Contributor

jtgrasb commented Jul 29, 2025

After the tests failed and more investigation, there seems to be a small difference between the irregular wave results in v4.0 and main/dev. The difference mainly occurs at the extents of motion. This difference is not observed for regular or regularCIC waves, but it is observed for both the RM3 and OSWEC. Below shows the difference for the RM3 response in irregular waves. I am still looking into the cause of these differences.

image

@kmruehl
Copy link
Collaborator

kmruehl commented Jul 29, 2025

@jtgrasb thanks for the update. Is the difference in all DOFs?

@jtgrasb
Copy link
Contributor

jtgrasb commented Jul 30, 2025

The difference is observed in all dofs. I narrowed it down to a difference in the wave spectrum creation. Below shows the same wave spectrum created in dev vs. v4.0:
image

The reason for the difference is PR #365 which changes the A_PM term of for the Pierson-Moskowitz spectrum creation:
image

By adjusting the phase seeding method and the A_PM term calculation in v4.0 to the updated version's methods, I am able to achieve matching between v4.0 and the current versions:
image

Merging this PR once the tests pass.

@jtgrasb jtgrasb merged commit 40fb6a4 into WEC-Sim:dev Jul 30, 2025
10 checks passed
@kmruehl
Copy link
Collaborator

kmruehl commented Aug 4, 2025

Thank you @jtgrasb!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tests/CI related WEC-Sim tests or Continuous Integration Wave Class Wave Classs (waveClass.m)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants