YingyiLiu/HAMS

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

Closed this issue · 10 comments

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,

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

  • the time dependency $e^{-i \omega t}$ in HAMS and $e^{i \omega t}$ in WAMIT,
  • the incoming waves potential reads
    $$-i \frac{g}{\omega} e^{k z} e^{i k (x \cos \beta + y \sin \beta)}$$
    in HAMS and
    $$i \frac{g}{\omega} e^{k z} e^{- i k (x \cos \beta + y \sin \beta)}$$
    in WAMIT.

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

REL=REAL(EXFC(MD))/(RHO*G*AMP)
IMG=IMAG(EXFC(MD))/(RHO*G*AMP)
MOD=ABS(EXFC(MD))/(RHO*G*AMP) !SQRT(REL**2+MDMG**2)
NREL=-IMG
NIMG= REL
PHS(MD)=ATAN2D(NIMG,NREL)
WRITE(20+MD,1010) WK,W1,REAL(EXFC(MD)),IMAG(EXFC(MD))
IF (ABS(TP+1.D0).GT.1.E-6.AND.ABS(TP).GT.1.E-6) THEN
WRITE(62,1030) OUFR,BETA*180.0D0/PI,MD,MOD,PHS(MD),NREL,NIMG
ENDIF
if you want to try out yourself.

Actually, it seems that commit f5c594d already meant to fix this.

Thank you, samueltwain and mancellin. I made the incorrect commit f5c594d 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.

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,

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.

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,

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] (BEMRosetta/BEMRosetta#19) including code and example files to BEMRosetta developer, though this code is not elegant. Hope izabala123 can implement it in BEMRosetta.
Regards,

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.

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?

@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