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

[BUG] Phase angle of wave excitation loads for offset body, and added mass and radiation damping matrix for multibodies in AQWA #1116

Open
hachikoi1 opened this issue Sep 3, 2023 · 7 comments · May be fixed by #1253
Assignees
Labels
AQWA BEM/BEMIO related to BEMIO or BEM hydro data Bug bug in WEC-Sim source, high priority

Comments

@hachikoi1
Copy link

hachikoi1 commented Sep 3, 2023

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

WAMIT
image
image

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:

image

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

image

The corrected results in 0 degrees wave heading are

image

The corrected results in 10 degrees wave heading are

image

% ======================================
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

image
image
image

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
image
image

The corrected code in readAQWA.m is
image

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:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

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.

@salhus
Copy link
Contributor

salhus commented Sep 6, 2023

@hachikoi1
Hi Tianyuan,

I noticed you are using the older WEC-Sim releases? Does the recent fix address this? I think I add a phase of $\pi$ instead of just negative sign. I should have thought about the wave-heading argument when trying to convince questions about wave-directions.

Let me know if v5.0.1 resolves this?

Cheers,
sal

@hachikoi1
Copy link
Author

hachikoi1 commented Sep 6, 2023

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

@kmruehl kmruehl added BEM/BEMIO related to BEMIO or BEM hydro data AQWA labels Sep 6, 2023
@hachikoi1
Copy link
Author

Hi salhus
Perhaps I made a mistake in the treatment of added mass and radiation damping. In WEC-Sim, the cross coupling of boty-to-body case always place the accelerations of BODY 1 at A (1:6), and place the accelerations of BODY 2 at A (7:12), and so on.
image
Therefore, the added mass (1,2,wave frequency) in AQWA .AH1 file should be placed to (7:12,1:6) of added mass matrix during the time-domain caculations, and added mass matrix (7:12,1:6) would multiply with A (1:6). The results of added mass matrix (7:12,1:6) * A (1:6) represent the effects of the radiation wave caused by the motions of the first body on the second body.
From this point, the conversion of radiation coefficient in Bemio has no problem.

But I still think the phase angle is not right for multibody cases

Please let me know your thoughts

Best regards,
Tianyuan

@salhus
Copy link
Contributor

salhus commented Sep 28, 2023

@hachikoi1
Hi Tianyuan,

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,
Sal

@akeeste
Copy link
Contributor

akeeste commented Oct 17, 2023

@salhus What is the status on this issue? Do we need a bugfix for our upcoming release?

@salhus
Copy link
Contributor

salhus commented Oct 17, 2023

@akeeste,
I havent been able to get to this yet. This part of the work identified for the current FY.

@salhus
Copy link
Contributor

salhus commented Mar 20, 2024

@hachikoi1

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,
sal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AQWA BEM/BEMIO related to BEMIO or BEM hydro data Bug bug in WEC-Sim source, high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants