WEC-Sim / WEC-Sim

Wave Energy Converter Simulator (WEC-Sim), an open-source code for simulating wave energy converters.
https://wec-sim.github.io/WEC-Sim
Apache License 2.0
138 stars 158 forks source link

Difficulties attempting to simulate a rotating mass pto.[Theory or Implementation] #1232

Closed NateHixon73 closed 3 months ago

NateHixon73 commented 4 months ago

I am trying to simulate a rotating mass power take off, as pictured below. image I successfully designed and simulated the hydrodynamic hull, and it performed how I expected for the wave range I expect. The problem comes when adding in the second, non-hydrodynamic body to act as the rotating mass portion of the design. When I add the non hydrodynamic body and attach is as a revolving pto (about the yaw axis), the simulation crashes some time in due to a singularity even with no waves. When watching the visual, the two bodies start at rest but quickly start accelerating up and down and eventually bounce in and out of the water. I have attached the folder I am using to run this. Could this be a bug, or am I connecting the two bodies in an incorrect way? Thanks for any help. SPHEREwPTO.zip

I am using WecSim-6.0 on MATLAB 2023a on a windows 10 version 22H2. I used Capytaine v2.0 to generate the files required for BEMIO.

This is the error I get: Error using wecSim Derivative of state 'RM3.Floating_6DOF.CONSTRAINT_Bushing_Joint.Px.v' in block 'RM3/Floating (6DOF)/CONSTRAINT (Bushing Joint)' at time 97.855 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)

dforbush2 commented 4 months ago

Hi @NateHixon73

Thank you for your *zip file. To help us provide more specific advice, can you please edit your issue to include the fields from our issue template, including Matlab version, WEC-Sim version, operating system, etc.? Also a screenshot of your specific error message.

I ask because these degenerate mass issues can sometimes be version issues.

NateHixon73 commented 4 months ago

Done!

dforbush2 commented 4 months ago

Hi @NateHixon73

Looking at your model, everything looks about right structurally, this is how I would model things as well. I would recommend that your constraint(2) is replaced with a PTO, since this will afford you more flexibility when you go to impose control on this degree of freedom

The problem, it appears, is your BEM data. I ran bemio in your provided 'hydro' directory and there are a number of issues

1) Most of your radiation damping coefficients on your float are negative, with one especially large negative spike at 0.5 rad/s in heave that is driving the corresponding impulse response function. Same goes for added mass. 2) You have solved at 19 frequencies from 0.2 rad/s to 2 rad/s. While your discretization (0.1 rad/s) is probably ok, for a body of this size I would recommend you increase this range at least to 10 rad/s. At your highest frequency, you should see your radiation damping coefficients approaching zero and your added mass coefficients approaching a constant.

I'm not a NEMOH expert so the support there I can offer is limited but opening these dat files: 1) you have modeled 562 nodes as degenerate quadrangles. The resulting maximum discretization of ~140 triangular panels is probably insufficient for this geometry. For example, our ellipsoid example in WEC-Sim Applications has >3000 panels. 2) In my experience a consistent sign error in added mass or damping may suggest an improper normal vector orientation: please ensure these are pointing outward into the fluid. 3) There appears to be a contradiction here: I see only 562 nodes in your dat file but your cal file it seems that more were expected?

For NEMOH specific support, I recommend posting on their help forums. I would strongly recommend revising your BEM: without this, even if we get you running without error I wouldn't have much faith in the results.

NateHixon73 commented 3 months ago

I managed to fix the BEM data and now have a (semi) working simulation! Thanks for the help and guiding me through the process of getting useful BEM data.

NateHixon73 commented 3 months ago

My main problem was that I was trying to get BEM data on a hallow hull and that led to the normals pointing inwards. I made the hull solid, which solved the inward facing normal problem.