Skip to content

Conversation

@salhus
Copy link
Contributor

@salhus salhus commented Aug 7, 2023

WAMIT/WEC-Sim and AQWA use different conventions to write the wave potential.
Here is the WEC-Sim convention,

image

and here is the AQWA convetion,
image

The difference in conventions means a negative sign is needed to convert the phase from AQWA to WEC-Sim conventions. However, while previously addressing this issue in #855 an additional phase of pi was being added.

This was wrong.

After revisiting the PR in issue #1090 it has become clear to me that an additional phase of pi is not needed for non-heave modes. The wrong phase was being added because sample AQWA cases in the WEC-Sim repository had 3 wave headings [-180, 0 , 180], instead of the corresponding WAMIT example that only had 0.

I would like to thank @DeminLiLi @hachikoi1 in helping me identify the issue.

The other issues and threads that are relevant are listed here, so that future referees of those threads are referred to here. #865 #846

@salhus salhus requested review from dav-og and nathanmtom August 7, 2023 23:26
@salhus salhus mentioned this pull request Aug 8, 2023
@kmruehl kmruehl added BEM/BEMIO related to BEMIO or BEM hydro data Bug bug in WEC-Sim source, high priority labels Aug 9, 2023
@kmruehl kmruehl removed the request for review from dav-og August 9, 2023 14:42
Copy link

@nathanmtom nathanmtom left a comment

Choose a reason for hiding this comment

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

@salhus As you mentioned, this is a very minor fix and is consistent with how the readNEMOH.m and BEMrosetta handle the phase angle for BEM solvers that use the -\omega*t form for the time dependency. I approve this PR under the condition that you confirm if this should be pulled into 'Dev' or 'Master.' Once confirmed, and adjusted as needed, I will merge.

@salhus salhus changed the base branch from dev to master August 9, 2023 23:51
@salhus salhus changed the base branch from master to dev August 9, 2023 23:51
@salhus
Copy link
Contributor Author

salhus commented Aug 9, 2023

@nathanmtom
Hi Nathan,
Thanks for the quick follow-up. I think this should go in master, as my branch worked off of dev and will have conflicts with master. I think it will be easier for this to go to dev for now, and then the merge to dev will be streamlined (given we will be doing it within 6-8 weeks).

Cheers,
Sal

@kmruehl
Copy link
Collaborator

kmruehl commented Aug 10, 2023

@salhus since this is a bug, it should go into master sooner rather than later. I can help resolve the merge conflicts.

@kmruehl
Copy link
Collaborator

kmruehl commented Aug 10, 2023

@salhus I just updated your fork to be current with master, and then added your bugfix in commit e2c6d24. Please revise this PR to merge into WEC-Sim:master, and then we go ahead and merge it.

@salhus salhus changed the base branch from dev to master August 10, 2023 15:03
@kmruehl kmruehl merged commit 8db4dcc into WEC-Sim:master Aug 10, 2023
kmruehl added a commit that referenced this pull request Aug 10, 2023
* Revert "fix non-linear hydro (#910)" (#1016)

This reverts commit 118f156.

* Updating MoorDyn to resolve the MoorDyn crashing MATLAB session. (#1012)

When MoorDyn is used in WEC-Sim design, it is called as an external DLL executable library, and it runs on a separate console.exe under MATLAB's main process, with its separate process-ID(PID) in the windows task manager. The issue is related to the following scenarios on the Windows platform:
1>> if the lines data text file has an error in it.
2>> MoorDyn fails to converge.
3>> MoorDyn is launched, but the model has some other error.
Under such a scenario, MATLAB fails to terminate the MoorDyn Console and hangs instead, and either crash immediately or crashes if we press the close button on the MoorDyn console window. Either way, there seems to be no way the MATLAB session can recover from MoorDyn failure without crashing. It becomes a major issue if we are trying to tune mooring lines and want to try different lines configurations and stiffnesses, etc., to find an optimal mooring system because some configurations will not work, which will keep crashing MATLAB sessions during the test and trial.
The goal is for MoorDyn's failure not to crash the MATLAB session but instead MoorDyn dll execution to close and the MoorDyn console to close. I've found a solution to that.
For scenarios 1 and 2, the following Fix#01 seems to work on the Windows platform. And to cover scenario 3, an additional Fix#02 is needed.
Fix#01
In the MoorDyn block's 'InitFcn' call, making the following suggested changes check for MoorDyn Initialization failure and terminates the MoorDyn.dll console without crashing the MATLAB Session.
Fix#02
Suppose the MoorDyn console has been launched, but there is an error in the Simulink model. In that case, MATLAB throws an error and terminates the Simulink execution without terminating the MoorDyn console window. A try-catch statement in the wecsim file can address this issue. If a Simulink model error occurs, we can print the error and terminate the MoorDyn Console process.

* Update docs on master (#1031)

* updates_docs_on_master

* incorporating_kelleys_minor_edits

* save mooring library to R2020b

* Add missing bibtex file

* Use master branch of matlabdomain

Fixes function parsing error

* Fix DD PTO Output order (#1095)

* resolves issue #1090 readAQWA bug (#1096)

* resolving failed tests

* Set 'CacheFolder' to '' (#1100)

---------

Co-authored-by: dforbush2 <dforbus@sandia.gov>
Co-authored-by: Dr. Ali Haider (Alix) <71473429+AlixHaider@users.noreply.github.com>
Co-authored-by: Sal <84348506+salhus@users.noreply.github.com>
Co-authored-by: akeeste <akeeste@sandia.gov>
Co-authored-by: jtgrasb <87095491+jtgrasb@users.noreply.github.com>
Co-authored-by: Mathew Topper <damm_horse@yahoo.co.uk>
Co-authored-by: Salman Husain <shusain@nrel.gov>
@salhus salhus deleted the Remove-the-extra-pi-phase-in-readAQWA branch October 4, 2023 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BEM/BEMIO related to BEMIO or BEM hydro data Bug bug in WEC-Sim source, high priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants