diff --git a/source/functions/initializeWecSim.m b/source/functions/initializeWecSim.m
index 7a72b8400..1388fd497 100644
--- a/source/functions/initializeWecSim.m
+++ b/source/functions/initializeWecSim.m
@@ -161,7 +161,7 @@
dragBodLogic = zeros(length(body(1,:)),1);
for ii = 1:length(body(1,:))
body(ii).setNumber(ii);
- body(ii).checkInputs(simu.explorer, simu.stateSpace, simu.FIR);
+ body(ii).checkInputs(simu.explorer, simu.stateSpace, simu.FIR, waves.typeNum);
if body(ii).nonHydro==0
if numNonHydroBodies > 0 || numDragBodies > 0
error('All hydro bodies must be specified before any drag or non-hydro bodies.')
diff --git a/source/functions/moorDyn/README.md b/source/functions/moorDyn/README.md
index 545680e62..f69c2d914 100644
--- a/source/functions/moorDyn/README.md
+++ b/source/functions/moorDyn/README.md
@@ -29,7 +29,7 @@ along with MoorDyn. If not, see .
---------------------- More Information -------------------------
-More information about MoorDyn is now available at -- including the User's Guide, source code, and examples.
+More information about MoorDyn is now available at [moordyn.readthedocs.io](https://moordyn.readthedocs.io/en/latest/) -- including the User's Guide, source code, and examples.
For information about MoorDyn's formulation and some validation
results, see M. Hall and A. Goupee, ìValidation of a lumped-mass
diff --git a/source/lib/WEC-Sim/WECSim_Lib_Body_Elements.slx b/source/lib/WEC-Sim/WECSim_Lib_Body_Elements.slx
index 91fc5d0ab..1749a6156 100644
Binary files a/source/lib/WEC-Sim/WECSim_Lib_Body_Elements.slx and b/source/lib/WEC-Sim/WECSim_Lib_Body_Elements.slx differ
diff --git a/source/objects/bodyClass.m b/source/objects/bodyClass.m
index 250e6c671..499c6a1e4 100644
--- a/source/objects/bodyClass.m
+++ b/source/objects/bodyClass.m
@@ -46,7 +46,7 @@
'angle', 0) % (`structure`) Defines the initial displacement of the body. ``displacement`` (`1x3 float vector`) is defined as the initial displacement of the body center of gravity (COG) [m] in the following format [x y z], Default = [``0 0 0``]. ``axis`` (`1x3 float vector`) is defined as the axis of rotation in the following format [x y z], Default = [``0 1 0``]. ``angle`` (`float`) is defined as the initial angular displacement of the body COG [rad], Default = ``0``.
largeXYDisplacement (1,1) struct = struct(... %
'option', 0) %
- linearDamping (6,6,:) {mustBeNumeric} = zeros(6) % (`6x6 float matrix`) Defines linear damping coefficient matrix. Create a 3D matrix (6x6xn) for variable hydrodynamics. Default = ``zeros(6)``.
+ linearDamping {mustBeNumeric} = zeros(6) % (`6x6 float matrix`) Defines linear damping coefficient matrix. Create a 3D matrix (6x6xn) for variable hydrodynamics. Default = ``zeros(6)``.
mass (1,:) = [] % (`float`) Translational inertia or mass [kg]. Defined by the user or specify 'equilibrium' to set the mass equal to the fluid density times displaced volume. Default = ``[]``.
meanDrift (1,1) {mustBeInteger} = 0 % (`integer`) Flag for mean drift force, Options: 0 (no), 1 (yes, from control surface) or 2 (yes, from momentum conservation). Default = ``0``.
morisonElement (1,1) struct = struct(... % (`structure`) Defines the Morison Element properties connected to the body.
@@ -132,7 +132,7 @@
end
- function checkInputs(obj, explorer, stateSpace, FIR)
+ function checkInputs(obj, explorer, stateSpace, FIR, typeNum)
% This method checks WEC-Sim user inputs for each body and generates error messages if parameters are not properly defined for the bodyClass
% Check struct inputs:
@@ -302,6 +302,9 @@ function checkInputs(obj, explorer, stateSpace, FIR)
if FIR == 1
error('The FIR filter radiation force method is not compatible with variable hydrodynamics.');
end
+ if typeNum >= 30
+ error('The user defined wave excitation force is not compatible with variable hydrodynamics.');
+ end
end
elseif obj.nonHydro>0
% This method checks WEC-Sim user inputs for each drag or non-hydro
@@ -354,6 +357,9 @@ function loadHydroData(obj, hydroData, iH)
obj.dofEnd = hydroData.properties.dofEnd;
obj.gbmDOF = obj.dof-6;
end
+ if obj.dof > 6 && obj.variableHydro.option == 1
+ error('Variable hydro is not compatible with Generalized body modes.');
+ end
end
function nonHydroForcePre(obj,rho)
@@ -403,13 +409,18 @@ function hydroForcePre(obj, waves, simu, iH)
% obj.linearDamping = [obj.linearDamping zeros(1,obj.dof-length(obj.linearDamping))];
tmp0 = obj.linearDamping;
tmp1 = size(obj.linearDamping);
- obj.linearDamping = zeros(obj.dof, obj.dof, tmp1(3));
- obj.linearDamping(1:tmp1(1),1:tmp1(2),:) = tmp0;
+ if ndims(tmp0) > 2
+ obj.linearDamping = zeros(obj.dof, obj.dof, tmp1(3));
+ obj.linearDamping(1:tmp1(1),1:tmp1(2),:) = tmp0;
+ else
+ obj.linearDamping = zeros(obj.dof);
+ obj.linearDamping(1:tmp1(1),1:tmp1(2)) = tmp0;
+ end
for i = 1:length(obj.quadDrag)
tmp0 = obj.quadDrag(i).drag;
tmp1 = size(obj.quadDrag(i).drag);
- obj.quadDrag(i).drag = zeros (obj.dof);
+ obj.quadDrag(i).drag = zeros(obj.dof);
obj.quadDrag(i).drag(1:tmp1(1),1:tmp1(2)) = tmp0;
obj.quadDrag(i).cd = [obj.quadDrag(i).cd zeros(1,obj.dof-length(obj.quadDrag(i).cd))];