Skip to content

Conversation

@akeeste
Copy link
Contributor

@akeeste akeeste commented Aug 22, 2025

This PR fixes the current direction in the Morison Element functions. A current direction of 0 should indicate flow in the +X direction. In each Morison Element function, the current velocity was being incorrectly combined with the body velocity instead of with the orbital velocity. This PR fixes that.

As a side note, those functions (along with the rest of the excitation functions) could use some serious refactoring, simplification, and clarity in the future.

@akeeste akeeste added the Bug bug in WEC-Sim source, high priority label Aug 22, 2025
@akeeste
Copy link
Contributor Author

akeeste commented Aug 22, 2025

For example using the WEC-Sim_Applications\Free_Decay\1m-ME case as is but with the following wave and current settings:

waves = waveClass('irregular');
waves.height = 1;
waves.period = 6;
waves.spectrumType = 'JS';
waves.current.depth = 50;
waves.current.direction = 0;
waves.current.option = 1;
waves.current.speed = 1;

We see the following surge response for body 1:
image

Copy link
Contributor

@MShabara MShabara left a comment

Choose a reason for hiding this comment

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

@akeeste Thank you for catching this bug.
I agree, these functions could use some vectorization to be computationally efficient, and easier to follow.

@MShabara MShabara merged commit eddcfd2 into WEC-Sim:dev Aug 23, 2025
10 checks passed
@akeeste akeeste deleted the current_bugfix branch August 25, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug bug in WEC-Sim source, high priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected negative X surge motion with positive X current in MOST/WEC-Sim (Morison Option 1 & 2)

2 participants