YingyiLiu / HAMS

An open-source computer program for the analysis of wave diffraction and radiation of three-dimensional floating or submerged structures
Apache License 2.0
100 stars 50 forks source link

imaginary part of excitation force in HAMS Wamit_format is opposite to that in Wamit #26

Closed Ran-Tu closed 1 year ago

Ran-Tu commented 1 year ago

Dear developer,

Description: I modeled spar foundation in HAMS, and ouptput these results in Wamit_format. Then I compared the results with Wamit results. Those Wamit results are obtained from OpenFAST Baseline. The added mass, added damping and real part of excitation force can match well for both of HAMS and Wamit. But as for the imaginary part of excitation force, I found that HAMS is opposite to Wamit. Please see below figure (postprocessed in BEMRosetta):

image

Possible Reason: Possible reason might be that HAMS assumes the incident wave is $e^{-jwt}$, while Wamit assumes the incident wave is $e^{jwt}$. But I have not conducted a theoretical derivation.

Dear developer, is there a plan to modify the source code of HAMS a bit to make the Wamit_format output match Wamit results in terms of the imaginary part of excitation force?

Regards,

mancellin commented 1 year ago

I believe there are actually two differences in convention between WAMIT and HAMS:

The two together lead to the difference in excitation force that you observe.

I don't have time to test it right now, but I believe the lines to change in the code to fix the WAMIT files are around https://github.com/YingyiLiu/HAMS/blob/9eb1369c089602900ccaefa47be4adf721e64301/SourceCode/PotentWavForce.f90#L111-L121 if you want to try out yourself.

mancellin commented 1 year ago

Actually, it seems that commit https://github.com/YingyiLiu/HAMS/commit/f5c594dc25cf1ce1d5321b464e5cd2a171e0496e already meant to fix this.

YingyiLiu commented 1 year ago

Thank you, samueltwain and mancellin. I made the incorrect commit https://github.com/YingyiLiu/HAMS/commit/f5c594dc25cf1ce1d5321b464e5cd2a171e0496e based on a Wamit result file sent from a user asking me to do validation on the imaginary part. I was actually misled by that Wamit file (probably generated by a very old Wamit version). I have recorrected it now via validation against the most recent Wamit v7.4. You may also find a discussion here: https://forums.nrel.gov/t/the-format-of-wamit-file-used-in-hydrodyn/4574. Hope that solves the issue.

Ran-Tu commented 1 year ago

Thansk you, @YingyiLiu and @mancellin . Now the HAMS results match well Wamit results.

I was exactly the person who posted the message in the NREL forum. Sorry for my previously incorrect user name in github. It was registered several years ago. And I had not used the github account util I posted this issue. Now I have changed the user name in github to be compatible with the user name in NREL forum.

Just for your information. I found the HywindSpar mesh is smaller than that described in OC3 documentation. Therefore, I created the new OC3 mesh (triangle mesh) attached below. Most of the results adopting below mesh can match well Wamit results from OpenFAST baseline. Excitation forces in several wave directions are different, but these different values in HAMS are small enough (I assume that Wamit made a cutoff to those values).
OC3.zip

For users who do not know how to create HAMS mesh, please allow me to share my meshing experience. I totally adopted open-source software in the whole process of meshing.

  1. First, I used Salome to create the geometric surface and meshed the surface with triangle elements.
  2. Then, I output these elements to stl file in Salome.
  3. After that, I import stl file to BEMRosetta. BEMRosetta has the ability to convert stl file to HAMS mesh file and obtain the hydrostatic restore matrix.
  4. Finally, HAMS mesh file and hydrostatic restore matrix from BEMRosetta can be used in HAMS.

There is a limitation for above approach. I found BEMRosetta can not read any mesh files from Salome except stl file. And when Salome output stl file, only triangle elements are allowed. I am still finding how to use Salome quadrilateral mesh in HAMS.

Regards,

YingyiLiu commented 1 year ago

Thanks for sharing, @Ran-Tu. The information is valuable to other users, I think. Here are two supplements following your post.

HAMS does not require the hydrostatic restoring matrix be normalised, but Wamit do. HAMS uses dimensional hydrostatic matrices actually.

Trangular elements are more accurate in approximating a geometry, but also increase computational burden. I think @izabala123 can perhaps help you in their further development of BEMRosetta given appropriate agenda.

Ran-Tu commented 1 year ago

HAMS does not require the hydrostatic restoring matrix be normalised, but Wamit do. HAMS uses dimensional hydrostatic matrices actually.

Sorry for my mistake. I have checked the BEMRosetta and HAMS as for the hydrostatic restore matrices. They are indeed dimensional. I re-edited my above post to remove the incorrect description. BEMRosetta's hydrostatic restore matrices can directly be used in HAMS. Only the Wamit_format output will normalize the hydrostatic restore matrices.

Regards,

Ran-Tu commented 1 year ago

Dear @YingyiLiu , Just for your information. Today I have programmed a fortran code which can convert Salome mesh dat file to HAMS pnl file (for both triangle elements and quadrilateral elements). I have tested this code for OC3 spar foundation and results from HAMS using quadrilateral elements can match well Wamit results.

I have submitted an [issue] (https://github.com/BEMRosetta/BEMRosetta/issues/19) including code and example files to BEMRosetta developer, though this code is not elegant. Hope izabala123 can implement it in BEMRosetta. Regards,

YingyiLiu commented 1 year ago

Thanks for sharing. It is useful to other users working on Salome. @izabala123 is perhaps coding with C++, but I believe your work will be helpful to his development.

vaibhavraghavan commented 3 weeks ago

Hi, as a continuation of this issue, I see that when the RAOs are calculated with using the added mass, radiation damping and excitation for in HAMS, they are quite different from WAMIT. I think this is because in the added mass and radiation damping as obtained from HAMS are the same as WAMIT (considering the dimensionalization of course), however for the excitation force, a+ib = -d-ic, where a+ib is the excitation for in WAMIT and c+id is the excitation force in HAMS. What can I do about this?

mancellin commented 1 week ago

@vaibhavraghavan It is most likely a matter of conventions. Although it is not directly about HAMS, this page might help: https://capytaine.github.io/stable/user_manual/conventions.html