Skip to content

Commit

Permalink
Bad bemio fcn fix and spread fix (WEC-Sim#1289)
Browse files Browse the repository at this point in the history
* adding bemio cleanup function

* impedance block drafts

* readWAMIT fix

* cleanup, fix plot dofs for function

* remove impedance blocks and function

* write cleaned file to new name

* drafts of IEC wave direction implementation, still need changes to slx and bodyClass

* fix to WEC-Sim#1288 and WEC-Sim#1287

---------

Co-authored-by: akeeste <[email protected]>
  • Loading branch information
dforbush2 and akeeste authored Aug 9, 2024
1 parent 84e7ac0 commit 7d25250
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions source/functions/BEMIO/badBemioFix_fcn.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,13 @@

%% rad and mass fixes
[row,col,~] = size(hydro.B);
% parse negative radiation damping
% parse negative radiation damping along diagonal
for k = 1:row
for kk = 1:col
bPks(k,kk) = max(squeeze(hydro.B(k,kk,:)));
p1Idx = find(abs(hydro.B(k,kk,:)) > deSpike.negThresh * bPks(k,kk));
p2Idx = find(hydro.B(k,kk,:) < 0);
pIdx = intersect(p1Idx,p2Idx);
hydro.B(k,kk,pIdx) = 0;
end
bPks(k,k) = max(squeeze(hydro.B(k,k,:)));
p1Idx = find(abs(hydro.B(k,k,:)) > deSpike.negThresh * bPks(k,k));
p2Idx = find(hydro.B(k,k,:) < 0);
pIdx = intersect(p1Idx,p2Idx);
hydro.B(k,k,pIdx) = 0;
end

for k = 1:row
Expand Down
2 changes: 1 addition & 1 deletion source/functions/simulink/model/irregExcF.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
B1= sin(bsxfun(@plus,A1,phaseRand(:,ii)));
B11 = sin(bsxfun(@plus,w*time,phaseRand(:,ii)));
C0 = bsxfun(@times,A*spread(ii),dw);
C1 = sqrt(bsxfun(@times,A*spread(ii),dw));
C1 = sqrt(bsxfun(@times,A*spread(ii).^2,dw));
D0 =bsxfun(@times,squeeze(fExtMD(ii,:,:)),C0);
D1 =bsxfun(@times,squeeze(fExtRE(ii,:,:)),C1);
D11 = bsxfun(@times,squeeze(fExtIM(ii,:,:)),C1);
Expand Down
2 changes: 1 addition & 1 deletion source/functions/simulink/model/irregnLYaw.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
B1= sin(bsxfun(@plus,A1,phaseRandint));
B11 = sin(bsxfun(@plus,w*time,phaseRandint));
C0 = bsxfun(@times,A*WaveSpreadint,dw);
C1 = sqrt(bsxfun(@times,A*WaveSpreadint,dw));
C1 = sqrt(bsxfun(@times,A*WaveSpreadint.^2,dw));
D0 =bsxfun(@times,fExtMDint,C0);
D1 =bsxfun(@times,fExtREint,C1);
D11 = bsxfun(@times,fExtIMint,C1);
Expand Down

0 comments on commit 7d25250

Please sign in to comment.