From b8b0088d770601103286a8b036636ff43f0fd4e0 Mon Sep 17 00:00:00 2001 From: acotten Date: Tue, 16 Jun 2020 14:36:32 +0100 Subject: [PATCH 1/3] no message --- Examples/Wamit_1bod_6dof_3.m | 6 +++--- Examples/Wamit_1bod_6dof_4.m | 4 ++-- HydroComp/PowerMatrix.m | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Examples/Wamit_1bod_6dof_3.m b/Examples/Wamit_1bod_6dof_3.m index 0d1d9cb..90f2770 100644 --- a/Examples/Wamit_1bod_6dof_3.m +++ b/Examples/Wamit_1bod_6dof_3.m @@ -118,7 +118,7 @@ if ismember(1,wam_run.DriftOption) wam_run.AutoCSF = true; % Decide whether to use user-input control surface (false) % or to use the automatic creation feature of WAMIT (true). - wam_run.BoxCSF = true; % Use cylinder or quadrilateral-based box shapes control surface (true - box, false - cylinder) + wam_run.BoxCSF = false; % Use cylinder or quadrilateral-based box shapes control surface (true - box, false - cylinder) end end @@ -169,9 +169,9 @@ subplot(3,2,i) hold on for j = 1:size(driftForces,2) - plot(driftForces(j).T,abs(driftForces(j).meanDriftForces(:,i))) + plot(2*pi./driftForces(j).T(23:end),abs(driftForces(j).meanDriftForces(23:end,i)),'-') end - xlabel('Wave period / s') + xlabel('Wave frequency / rad/s') ylabel('Force/Moment') title(dofsTitle{i}) end diff --git a/Examples/Wamit_1bod_6dof_4.m b/Examples/Wamit_1bod_6dof_4.m index ce4cc3b..40a1756 100644 --- a/Examples/Wamit_1bod_6dof_4.m +++ b/Examples/Wamit_1bod_6dof_4.m @@ -209,8 +209,8 @@ for i = 1:6 subplot(3,2,i) hold on - for j = 1:size(driftForces,2) - plot(2*pi./driftForces(j).T(22:end),abs(driftForces(j).meanDriftForces(22:end,i)),'-') + for j = 1:size(driftForces,2)-1 + plot(2*pi./driftForces(j).T(57:437),abs(driftForces(j).meanDriftForces(57:437,i)),'-') end xlabel('Wave frequency / rad/s') ylabel('Force/Moment') diff --git a/HydroComp/PowerMatrix.m b/HydroComp/PowerMatrix.m index 01c7ce2..495c147 100644 --- a/HydroComp/PowerMatrix.m +++ b/HydroComp/PowerMatrix.m @@ -98,7 +98,7 @@ end function [val] = get.Hs(pmat) - % the signifincant wave heights used + % the significant wave heights used val = pmat.hs; end From dbd17dbe64f530caded7a99b90de76efb191328d Mon Sep 17 00:00:00 2001 From: acotten Date: Wed, 24 Jun 2020 14:24:48 +0100 Subject: [PATCH 2/3] Misc alteration to WriteRAOs fn. --- BEM/Wamit/WamitRunCondition.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BEM/Wamit/WamitRunCondition.m b/BEM/Wamit/WamitRunCondition.m index 4c20e67..74a2157 100644 --- a/BEM/Wamit/WamitRunCondition.m +++ b/BEM/Wamit/WamitRunCondition.m @@ -1282,6 +1282,8 @@ function WriteRAOs(run) error('WamitRunCondition:writeRAOs:motionIndicesDoNotMatch',['The mode indices from the original .4 file do ' ... 'not match those given in the motionRAOs structure.']); end +% mode_indices = mode_indices(mode_indices<=12); % DoFs 1-12 as numbered by wamit will always refer to the two hulls, + % any additional indices will refer to damping plates. % Now, open and write the RAO file to be read in by WAMIT filename = [run.folder '\' run.runName '.rao']; @@ -1293,7 +1295,7 @@ function WriteRAOs(run) % print RAOs for i = 1:length(run.t) for j = 1:length(run.beta) - for k = 1:size(run.motionRAOs,3) + for k = 1:length(mode_indices) fprintf(fileID, '%8.4f\t%8.4f\t%i\t%8.6e\t%8.6e\n', ... run.t(i),run.beta(j)*180/pi,mode_indices(k),... abs(run.motionRAOs(i,j,k)),angle(run.motionRAOs(i,j,k))*180/pi); From 5ca3425a2ad7d585c5e8a1a7fad15717c5ce263f Mon Sep 17 00:00:00 2001 From: acotten Date: Thu, 25 Jun 2020 17:24:37 +0100 Subject: [PATCH 3/3] Lowered precision of coordinates, to avoid errors from surface panels because of different precision in .POT file. --- BEM/Wamit/Wamit_translateScaleCsfsHi.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BEM/Wamit/Wamit_translateScaleCsfsHi.m b/BEM/Wamit/Wamit_translateScaleCsfsHi.m index 0b0dfc5..df7ad50 100644 --- a/BEM/Wamit/Wamit_translateScaleCsfsHi.m +++ b/BEM/Wamit/Wamit_translateScaleCsfsHi.m @@ -138,7 +138,7 @@ Nv = size(verts{m}{n}, 1); for ii = 1:Nv for i = 1:3 - fprintf(fid, ' %11.7f', scale*(verts{m}{n}(ii,i)) + delta(i)); + fprintf(fid, ' %11.4f', scale*(verts{m}{n}(ii,i)) + delta(i)); % The precision here was reduced to sidestep an error where wamit thought the panels were above the free surface end fprintf(fid, '\n'); end