-
Notifications
You must be signed in to change notification settings - Fork 72
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
Mismatch between Nemoh and Capytaine when computing potential in domain #191
Comments
Yes, that should be the way to do it. Could you share a bit more about what you tried? How different are the results? |
The test case is an Heaving cylinder with radius 5m and draft 10m (supporting file/Cylinder.dat) The "correct" potential at the inscribing cylinder can be found in the supporting file. I m using this fork of Nemoh (https://github.com/DTOcean/NEMOH) to estimate the potential. Running the python script issue_191.py it is possible to see that for the low frequency (0.1rad/s) there is a good agreement between Nemoh and Capytaine, but at the frequency 2.0rad/s, both radiation and diffraction results differ significantly. If you need more information or additional test please let me know. |
Interesting, thank you. I can reproduce the discrepancy, but I've no idea where it could come from. @H0R5E Since the only commit differing between mainline Nemoh and https://github.com/DTOcean/NEMOH is yours: can you confirm that the change is only meant to add a new output format but does not change the way the potential is computed internally? |
@mancellin the work on the cylinder potential was done originally by Cameron McNat and verified against WAMIT, the fork on the DTOcean is just there for installation purposes, so there should be no modification to the Fortram files. |
@ffrancesco, is that you, Francesco? It's fair to say that the DTOcean version isn't vanilla NEMOH. There is an additional cylinder added in the computation (for calculation of interactions between devices). I think this is a relevant reference. |
@H0R5E yes it is Francesco (AAU). Yes, the version of Nemoh is a relatively old branch of Nemoh, in which the major modification to the code (in term of solver) can be found at line 117 of the SUBROUTINE SOLVE_BVP (SOLVE_BEM.f90) Cylindrical surface computation what I wanted to say is that the branch DTOcean/NEMOH is the same copy of the code that has been verified against WAMIT. @mancellin I can try to see if I can find some of the old WAMIT verification and post it here. Can that be helpful? |
So, there is one more output format, but the result itself should be the same as in the reference stable version of Nemoh. You can look for the WAMIT verification results, but whatever it says, an inconstancy of Capytaine with NEMOH is already a bug that deserves some investigation. |
@mancellin if there is a way I can help out please let me know. |
@ffrancesco Could you run the Nemoh/Capytaine comparison with some other meshes and parameters, to see if it affects the issue? For instance, what about infinite depth? |
@mancellin I cannot really run Nemoh with infinity water depth and estimate the potential on the outer cylinder, since the outer cylinder is automatically meshed and it requires the water depth to be finite. I run a case with 500m water depth and then compared with Capytaine with inf water depth. I also run a case with smaller outer cylinder (5.5m) and a case with a larger outer cylinder (10m). Additionally, I run a case with a surging cylinder. The low frequency solutions seem correct, but the high frequency solutions seem to differ significantly from Nemoh. |
Other outputs seem to match between Nemoh and Capytaine. However the match seems better at low frequency (3 or 4 significant digits) than high frequencies (2 significant digits). Maybe this small mismatch is blowing up when computing the potential far from the body... |
@mancellin i ll try to estimate the potential at the mesh of the original body and see if there is already any error there. Cos if the original potential is slightly off at the mesh moving it out will not help. I ll should be able to add the material later today. |
@mancellin I ve run the Heaving cylinder case again, and compared the potential at the body mesh. |
Thank you for this. for i in range(len(problems)):
...
print(problems[i])
def norm(x):
return np.sum(np.abs(x))
print(norm(PHI_faces.real - phi_faces.real)/norm(PHI_faces.real))
print(norm(PHI_faces.imag - phi_faces.imag)/norm(PHI_faces.imag)) But I'm confused because the mismatch seems higher for low frequencies there.
|
I was wondering if the discrepancy could come from floating point precision (Nemoh is single precision whereas Capytaine uses double precision by default). |
@mancellin, can it be a difference associated with the solver? |
@ffrancesco The latest version of Capytaine uses a direct solver by default, so that's probably what you've already been using. |
@nhu-vnguyen Do you think you could look for an analytical solution for this problem (potential away from a floating vertical cylinder) and compare it with the same computation in Capytaine? It would help us figure out what is going on. |
@mancellin yes, I have a few references on this problem. I can take a look at this and build a case for comparison. |
I m trying to estimate the velocity potential at a point different then the body mesh, using the get_potential_on_mesh function of the BEMSolver class. During the solution of the problem I enforce the keep_details=True so I can reuse the sources.
I compared the results with Nemoh and WAMIT, but the results are not similar.
Did I interpreted the function correctly by assuming that it can be used to estimate the velocity potential at a different location than the body mesh?
The text was updated successfully, but these errors were encountered: