Wec-Sim/Mooring Model Issue

Hi All,

I am trying to run a WEC-Sim model with MoorDyn with a water depth of 3.7m. This is specified in the point section, with the anchor at 3.7m, and water depth of 3.7m as well. Attached is the lines.txt. This is also specified in Wec-Sim.

However, when running the model, I keep getting that the node 0 position is [0,0,0], when it seems like it should be the anchor point at [0,0,-3.7]. Weirdly, the node 25 position is at [0,0,-0.1] (which is the correct specified coupling location with Body1).


Does anyone know how I could troubleshoot this? Or if this is a MoorDyn initialization issue or perhaps something to do with the way I set it up in WEC-Sim? Any help is appreciated, thanks!

Best,
Elaine

Hi @Elaine.Liu,

I ran that input file on MoorDyn-C and saw nans as well, but with node 0 at the correct depth:

I reduced the MoorDyn internal timestep to 0.000001 and was able to get the simulation to run (though it was slower than realtime). I was also able to get it to run with a 0.00001 timestep, the Rk4 time integration scheme, and only 10 segments. I would suggest playing with a smaller segment count, a shorter internal timestep, and other integration schemes to see what you can get to run the fastest. A quick way to check this without running an entire WECSim simulation would be to run a simple loop with the body fixed in place. The following python code should work for your single coupled body:

import moordyn
import numpy as np

# Create the MoorDyn system from the input file
system = moordyn.Create("<file name>")

# You can get the initial positions and velocities from the system itself using the MoorDyn-C API
body = moordyn.GetBody(system, 1)
state = moordyn.GetBodyState(body) # tuple with (x, xd)

x = np.array(state[0]) # x, y, z, roll, pitch, yaw 
xd = np.array(state[1]) # xdot, ydot, zdot, roll_dot, pitch_dot, yaw_dot 

# Setup the initial condition
moordyn.Init(system, x, xd)

# Set the simulation time
t, dt = 0.0, 0.5

# Run the simulation for five timesteps
for i in range(5):
    f = moordyn.Step(system, x, xd, t, dt)
    t += dt
    x += xd * dt # update the position 

# Alright, time to finish!
moordyn.Close(system)

Hi Ryan,
Thanks for the help! This worked now!

Best,
Elaine

1 Like