capytaine / capytaine

Python BEM solver for linear potential flow, based on Nemoh.
https://capytaine.github.io
GNU General Public License v3.0
156 stars 73 forks source link

double counting diffraction when calculating perturbed free surface #292

Closed oliviavitale35 closed 1 year ago

oliviavitale35 commented 1 year ago

hello!

i am trying to find the effects of different WEC arrays on the free surface elevation. when calculating the the perturbed free surface, i was following the cookbook example "Animated free surface elevation." i am a little confused by the "adding incoming waves section":

Add incoming waves

diffraction_elevation_at_faces = diffraction_elevation_at_faces + free_surface.incoming_waves(diffraction_result)

it seems the free surface is being calculated as a function of the diffraction result, but aren't we already accounting for the diffraction result in diffraction_elevation_at_faces? let me know.

thank you!

mancellin commented 1 year ago

free_surface.incoming_waves(diffraction_result) is the elevation of the incoming undisturbed Airy waves. The syntax is indeed confusing: only the frequency and the wave direction from the diffraction_result object are actually used, and not the solution of the BEM problem. The solution of the BEM diffraction problem is in diffraction_elevation_at_faces.

oliviavitale35 commented 1 year ago

great, that makes sense. thank you!