Skip to content

Commit

Permalink
Enable multiple wave trains with and add full directional wave block …
Browse files Browse the repository at this point in the history
…to flex body (WEC-Sim#1384)

* Add full directional wave block to flex body excitation

* adding waveCallBack mask function to flex body

* Update flex body to work with multiple wave trains and full directional waves

* Revert extra changes

---------

Co-authored-by: Forbush <[email protected]>
  • Loading branch information
jtgrasb and dforbush2 authored Dec 17, 2024
1 parent b21f68b commit 08630dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/functions/simulink/model/irregExcFullDirF.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
A1=repmat(A1,1,nBins);
A = repmat(A,1,nBins);
%initialize outputs
Fext = zeros(1,6);
Fext = zeros(1,size(dofGRD,1));
relYawLast=zeros(M,N);
coeffsLastMD=zeros(N,M,6); % dirBins, freq, dof
coeffsLastRE=zeros(N,M,6);
coeffsLastIM=zeros(N,M,6);
coeffsLastMD=zeros(N,M,size(dofGRD,1)); % dirBins, freq, dof
coeffsLastRE=zeros(N,M,size(dofGRD,1));
coeffsLastIM=zeros(N,M,size(dofGRD,1));

relYaw = dirBins-(Disp(6)*180/pi); % relative yaw angle, size = dirBins = [length(w) nBins]

Expand All @@ -28,7 +28,7 @@
I=1:length(relYaw(1,:));
end

relYawGRD = zeros([6 size(relYaw.')]);
relYawGRD = zeros([size(dofGRD,1) size(relYaw.')]);
for k=1:6
relYawGRD(k,:,:) = relYaw.';
end
Expand Down Expand Up @@ -96,7 +96,7 @@
B11 = sin(bsxfun(@plus,w*time,phaseRand(:,:,1)));
C0 = bsxfun(@times,A.*spreadBins,dw);
C1 = sqrt(bsxfun(@times,A.*spreadBins.^2,dw));
for k=1:6
for k=1:size(dofGRD,1)
D0 =bsxfun(@times,fExtMDint(:,:,k).',C0);
D1 =bsxfun(@times,fExtREint(:,:,k).',C1);
D11 = bsxfun(@times,fExtIMint(:,:,k).',C1);
Expand Down
Binary file modified source/lib/WEC-Sim/WECSim_Lib_Body_Elements.slx
Binary file not shown.

0 comments on commit 08630dd

Please sign in to comment.