-
Notifications
You must be signed in to change notification settings - Fork 157
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
[BUG] Phase angle of wave excitation loads for offset body, and added mass and radiation damping matrix for multibodies in AQWA #1116
Comments
@hachikoi1 I noticed you are using the older WEC-Sim releases? Does the recent fix address this? I think I add a phase of Let me know if v5.0.1 resolves this? Cheers, |
Hi salhus The current WEC-Sim v5.0.1 does not seem to address the issue I mentioned. The recent fix only applies to the single body case where the COG is located at (0,0,z), but does not consider the multiple body case where an offset body with its COG away from the origin of global coordinate system in the XY plane. Best regards, Tianyuan |
Hi salhus But I still think the phase angle is not right for multibody cases Please let me know your thoughts Best regards, |
@hachikoi1 Thanks for investigating that. I am looking into this with another developer to identify differences between WAMIT/AQWA. Once done, there will be comprehensive documentation and address this issue (hopefully) for good. Cheers, |
@salhus What is the status on this issue? Do we need a bugfix for our upcoming release? |
@akeeste, |
Hi Tianyuan, Apologies for the long radio silence. After extensive code comparisons we may have a resolution. There are two main differences between AQWA and WAMIT that result in phase differences between the two codes. 1. Different sign in the exponential kernel,We have already established that the sign conventions in AQWA and WAMIT are opposite in the comments above, 2. When the first body is not located at the origin of the global frame,AQWA assigns the global frame to the local CG frame of the first body. This was rather puzzling but after extensive tests it has become evident that the AQWA assigns the origin of the global frame at the CG of the first body being analyzed. We would present all our test cases and results summary in the next few weeks. Cheers, |
Note: italicized text below is include as an example and should be updated before submission. If you feel any section is not applicable to your request, please replace with 'N/A' rather than delete a section.
Describe the bug
A clear and concise description of what the perceived bug is.
Dear salhus and dforbush2
I open a new issue here to talk about the Phase angle of wave excitation loads for offset body, and added mass and radiation damping matrix for multibodies. The issue is was originally posed in A designed two-body hinged raft wave energy converter: From experimental study to annual power prediction for the EMEC site using WEC-Sim by Siya.
Let me briefly describe the problem. For an offset body with its COG away from the origin of global coordinate system in the XY plane (this configuration is usually found in multibody cases), the phase angle output by AQWA is defined as the local parameter phase angle. But the phase angle output by WAMIT is defined as the global phase angle, which is equal to the local parameter phase angle + global wave phase angle (global wave phase angle is defined as the phase angle of the local coordinate origin with relative to the global coordinate origin, and is related to the spatial location of the body)
AQWA
![image](https://private-user-images.githubusercontent.com/106663159/265270939-00389944-0ed2-48c1-a1a2-bb956f66b85c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg4NTcwNjksIm5iZiI6MTcxODg1Njc2OSwicGF0aCI6Ii8xMDY2NjMxNTkvMjY1MjcwOTM5LTAwMzg5OTQ0LTBlZDItNDhjMS1hMWEyLWJiOTU2ZjY2Yjg1Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyMFQwNDEyNDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jMWU4MzU0MWQzOThlOTIzNWY0MjQxNTRkOTY3YTgxNGViNzAwMDZhMGViMjZkNGU0ZmI2MGEwZTRhODM1NmNlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.IyIVqSV2hcT8ZaEHM-OP0WHV7R94QVB8v7hlIw_tlD0)
WAMIT
![image](https://private-user-images.githubusercontent.com/106663159/265271066-6fbe5197-301f-4ea1-89c6-c71bd7581f6b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjo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MU0E1M1BRSzRaQSUyRjIwMjQwNjIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyMFQwNDEyNDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zMDUxMDUzMjY0Y2QwOGNhYjk0NzIyMDQxNDJjYTkzZDcwMDAxNTYzZDQ4MjA5YmUwNDY2MWFjNTYwY2FjMTlmJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Rxd86wuYYZZy1DPJOhNemZdwlOw8u5aexFKIHtGw2HI)
Based on previous discussions (#1090 (comment)), for a body with its COG located at the origin of global coordinate system in the XY plane
PhaseAngleWAMIT = -PhaseAngleAQWA
But the definition is not perfect, because it is given based on the premise that the wave phase angle is zero (COGx = COGy = 0). For an offset body, the correct phase angle should be
PhaseAngleWAMIT = -PhaseAngleAQWA - k * [x * cos(beta) + y * sin(beta)]
where PhaseAngleAQWA is the phase angle ouput by AQWA, k is the wave number, x and y are locations of the body, and beta is the wave heading. The corrected code in readAQWA.m is:
The simulation configuration is the same as Figure 1 in #1114 (comment).
The real parts of wave excitation loads in 0 degrees wave heading obtained based on hydro(F).ex_ph(((ind(1)-1) * 6+1):(ind(1) * 6),ind(2),ind(3)) = -tmp2 * pi/180 are
The corrected results in 0 degrees wave heading are
The corrected results in 10 degrees wave heading are
% ======================================
Another issue arises in the added mass and radiation damping matrices
In WAMIT, the hydro.A(1,7,1) is -1.808348000000000e+03, and hydro.A(7,1,1) is -1.811229000000000e+03
In AQWA, the dimensioned hydro.A(1,7,1) * 1025 is -1839700, and hydro.A(7,1,1) * 1025 is -1733900. However, they are different from the results in .AH1 file
![image](https://private-user-images.githubusercontent.com/106663159/265273082-27835ef5-ad08-4064-a1f3-9bfe800df55e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3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WRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.6jFmjKhFEjvneHoIsP_kv9hD-QIvjRsqouP9MFqOVMk)
The corrected code in readAQWA.m is
![image](https://private-user-images.githubusercontent.com/106663159/269852101-d7ad5d15-ebbf-4295-8b9f-a37f4051a21b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg4NTcwNjksIm5iZiI6MTcxODg1Njc2OSwicGF0aCI6Ii8xMDY2NjMxNTkvMjY5ODUyMTAxLWQ3YWQ1ZDE1LWViYmYtNDI5NS04YjlmLWEzN2Y0MDUxYTIxYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjIwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyMFQwNDEyNDlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04YmM5ZmE1YmYwZjI2NDgwNmQ0NWM0ZGNiZDI1NTY2MDk3MWMyMjUxMTA1OTAwYzU5ODliNjM3YmQxY2JhYTU5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Y5aTN0M5wvNcC08ZX0HFzrIgpP8ILmxnA_6oWypHP7E)
I hope these efforts meet with your approval
Best regards,
Tianyuan
WEC-Sim file(s)
If known, please identify the the WEC-Sim files causing the bug or error:
Please upload relevant case files if possible to speed debugging.
To Reproduce
Steps to reproduce the behavior:
State method of running WEC-Sim (command line, from simulink with input file, from simulink with custom parameters)
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem. For example, a screen shot of the exact error message from the MATLAB command line.
Workstation Information (this section MUST BE completed):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: