FloatingArrayDesign / MoorDyn

a lumped-mass mooring line model intended for coupling with floating structure codes
https://moordyn.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
72 stars 40 forks source link

moordyn.SaveState does not work in python #259

Open ewoudVL13 opened 3 days ago

ewoudVL13 commented 3 days ago

Hello, tried to run the python program in the "theory and troubleshooting" paragraph of the moordyn.reatherdocs.

The moordyn.SaveState command (line 9 and 16) does not exist in the current python moordyn. I tried just using the moordyn.Save but this gives errors later: NaN for node position 1.

Also tried to just simulate a line with fixed end points and a current effecting it but can't get it going. Any ideas? The input files for the line and current are ok I think but it seems like it does not simulate the line.

RyanDavies19 commented 3 days ago

Hi @ewoudVL13, thanks for pointing out more typos with the docs example. I opened an issue for us to go and update all our examples to the current API.

As for the errors you are seeing, have you tried a simpler case, like this example: https://moordyn.readthedocs.io/en/latest/drivers.html#python

The Nan you are getting before save state makes me suspect that your configuration is unstable during the initialization. Can you share your input file? The simulation can become unstable for a number of reasons, the most common are too large of a time step and too small of a line discretization.

ewoudVL13 commented 3 days ago

Chain fixed ends program.txt chain.txt current_profile.txt These are my input files. Got it running with the following program. Any remarks? Happy to learn more.

RyanDavies19 commented 3 days ago

@ewoudVL13,

You have a vertical line in 320m of water that is 380m long, I suspect that is causing the issue. Additionally, a 20m/s current is extremely fast and is likely causing issues as well.

MoorDyn might be able to handle this if you add 1 ICgenDynamic to your options list, change your CdScaleIC to 1.0, and reduce your dtm time step. However this is a pretty extreme case.

RyanDavies19 commented 3 days ago

@ewoudVL13,

Glad you got it running, thanks for sharing the driver script. When / if you change to having a coupled point your x and xd lists are going to need to have values for the coupled DOF. Also, if you add FAIRTEN1 to the output list (below the options section), moordyn will write the fairlead tensions to an output file for you rather than needing to print them to the console. See here for more info about outputs: https://moordyn.readthedocs.io/en/latest/inputs.html#id5