Hi All,
I am trying to simulate the OC3 spar in WEC-SIM with the MoorDyn-C, and my code and model :
%% Body Data
body(1) = bodyClass(bodyFile);
body(1).geometryFile = 'geometry/Spar_OC3_mm.stl';
body(1).mass = 7.46633E+06; % 7.46633E+06
body(1).inertia = [4229230000 4229230000 164230000];
B_linear = zeros(6);
B_linear(1,1) = 1.0e5; % Surge
B_linear(2,2) = 1.0e5; % Sway
B_linear(3,3) = 1.3e5; % Heave
B_linear(6,6) = 1.3e7; % Yaw
body(1).linearDamping = B_linear;
%% PTO and Constraint Parameters
% Floating (6DOF) Joint
constraint(1) = constraintClass('Constraint1');
constraint(1).location = [0 0 0];
%% Mooring
% Moordyn
mooring(1) = mooringClass('mooring'); % Initialize mooringClass
mooring(1).moorDyn = 1;
mooring(1).moorDynLines = 3; % Specify number of lines
mooring(1).moorDynNodes = [20 20 20]; % Specify number of nodes per line
mooring(1).location = [0.0 0.0 -70.0];
mooring(1).moorDynInputFile = 'Mooring/lines_v2.txt'; % Specify MoorDyn input file path"
and the “lines_v2.txt” is
--------------------- MoorDyn Input File ------------------------------------
Mooring system for OC3-Hywind
----------------------- LINE TYPES ------------------------------------------
Name Diam MassDen EA BA/-zeta EI Cd Ca CdAx CaAx
(-) (m) (kg/m) (N) (N-s/-) (-) (-) (-) (-) (-)
main 0.09 77.7066 384.243E6 -0.8 0.0 1.6 1.0 0.1 0.0
---------------------- POINTS --------------------------------
ID Attachment X Y Z M V CdA CA
(-) (-) (m) (m) (m) (kg) (m^3) (m^2) (-)
1 fixed 853.87 0.0 -320.0 0 0 0 0
2 fixed -426.94 739.47 -320.0 0 0 0 0
3 fixed -426.94 -739.47 -320.0 0 0 0 0
4 vessel 5.2 0.0 -70.0 0 0 0 0
5 vessel -2.6 4.5 -70.0 0 0 0 0
6 vessel -2.6 -4.5 -70.0 0 0 0 0
---------------------- LINES --------------------------------------
ID LineType AttachA AttachB UnstrLen NumSegs Outputs
(-) (-) (-) (-) (m) (-) (-)
1 main 1 4 902.2 20 tp
2 main 2 5 902.2 20 tp
3 main 3 6 902.2 20 tp
---------------------- SOLVER OPTIONS ---------------------------------------
2 writeLog Write a log file
rk4 tscheme 2nd order Runge-Kutta
0.0001 dtM time step to use in mooring integration (s)
3.0e6 kBot bottom stiffness (Pa/m)
3.0e5 cBot bottom damping (Pa-s/m)
1025.0 WtrDnsty water density (kg/m^3)
320 WtrDpth water depth (m)
20.0 dtIC time interval for analyzing convergence during IC gen (s)
100.0 TmaxIC max time for ic gen (s)
3.0 CdScaleIC factor by which to scale drag coefficients during dynamic relaxation (-)
0.0001 threshIC threshold for IC convergence (-)
1 disableOutTime
------------------------ OUTPUTS --------------------------------------------
FairTen1
FairTen2
FairTen3
AnchTen1
AnchTen2
AnchTen3
------------------------- need this line --------------------------------------
But, every time I ran the Simulink, the mooring line initialization would give the wrong coordinates of coupled points 4, 5, and 6. Then, if I run the simulation, MATLAB crashed and gave the following crash report. But when I try the same “lines_v2.txt” in Python like @Ryan.Davies suggested, there are no errors.
Does anyone know how I could troubleshoot this? Any help is appreciated. Thanks in advance!
Best,
Chaozhi Qiu