WECSim MoorDyn Coupling

Hi All,

I had a question regarding how WEC-Sim and MoorDyn are coupled to each other in MATLAB to solve governing equations of motion.

At the beginning of each timestep, WEC-Sim sends time t_i, displacement x_i and velocity v_i measurement to MoorDyn, which then calculates a corresponding force, F_i. Is this force F_i then used to solve WECSim’s next step, iteration i+1? In which case, WECSim would be using mooring force from the previous time-step to calculate its next timestep.

Also, regarding Simulink blocks that are setup for this coupling, I am considering a hybrid implementation where WEC-Sim (on Simulink) is coupled to MoorDyn via the C++ code. Do moorDynDisp1, moorDynVel1 represent body forces that are sent to MoorDyn, and moorDynForce1 would thus be the returning body force? To modify this source code, I would send moorDynDisp1 and moorDynVel1 to the C++ code, and change moorDynForce1 to be the C++ output. MoorDyn Caller would be excluded. I just wanted to verify if this was a suggested approach.

Alternatively, I have been taking in body disp,vel information as inputs to the C++code at the beginning of the simulation and using the output C++ mooring force directly into the body’s F_net. Do you know why MoorDyn caller is setup in the way as shown above? I’m not sure if the below approach is missing something. Note the screenshot is a little greyed out.

Thanks, I am happy to provide more information and greatly appreciate any insight!

Best,
Elaine