diff --git a/Controls/Declutching/optimalTimeCalc.m b/Controls/Declutching/optimalTimeCalc.m index 8584c191..66baa166 100644 --- a/Controls/Declutching/optimalTimeCalc.m +++ b/Controls/Declutching/optimalTimeCalc.m @@ -11,7 +11,7 @@ waves.period = 3.5; % Load hydrodynamic data for float from BEM -hydro = readBEMIOH5(body.h5File, 1, body.meanDrift); +hydro = readBEMIOH5(body.h5File{1}, 1, body.meanDrift); % Define wave conditions H = waves.height; diff --git a/Controls/Latching/optimalTimeCalc.m b/Controls/Latching/optimalTimeCalc.m index 7a9356ed..21fd3b8a 100644 --- a/Controls/Latching/optimalTimeCalc.m +++ b/Controls/Latching/optimalTimeCalc.m @@ -11,7 +11,7 @@ waves.period = 9.6664; % Load hydrodynamic data for float from BEM -hydro = readBEMIOH5(body.h5File, 1, body.meanDrift); +hydro = readBEMIOH5(body.h5File{1}, 1, body.meanDrift); % Define wave conditions H = waves.height; diff --git a/Controls/MPC/plotFreqDep.m b/Controls/MPC/plotFreqDep.m index edbd2e6b..281abb9a 100644 --- a/Controls/MPC/plotFreqDep.m +++ b/Controls/MPC/plotFreqDep.m @@ -7,7 +7,7 @@ waves.period = 9.52; % Load hydrodynamic data for float from BEM -hydro = readBEMIOH5(body.h5File, 1, body.meanDrift); +hydro = readBEMIOH5(body.h5File{1}, 1, body.meanDrift); % Define the intrinsic mechanical impedance for the device mass = simu.rho*hydro.properties.volume; diff --git a/Controls/MPC/setupMPC.m b/Controls/MPC/setupMPC.m index f4161c00..f27b5326 100644 --- a/Controls/MPC/setupMPC.m +++ b/Controls/MPC/setupMPC.m @@ -1,7 +1,7 @@ % This method sets up the variables to run model predictive control % Load hydrodynamic data for float from BEM -hydro = readBEMIOH5(body.h5File, 1, body.meanDrift); +hydro = readBEMIOH5(body.h5File{1}, 1, body.meanDrift); disp('setting up MPC') diff --git a/Controls/Passive (P)/optimalGainCalc.m b/Controls/Passive (P)/optimalGainCalc.m index c76a6123..f51f09a5 100644 --- a/Controls/Passive (P)/optimalGainCalc.m +++ b/Controls/Passive (P)/optimalGainCalc.m @@ -11,7 +11,7 @@ waves.period = 9.6664; % One of periods from BEM % Load hydrodynamic data for float from BEM -hydro = readBEMIOH5(body.h5File, 1, body.meanDrift); +hydro = readBEMIOH5(body.h5File{1}, 1, body.meanDrift); % Define wave conditions H = waves.height; diff --git a/Controls/Reactive (PI)/optimalGainCalc.m b/Controls/Reactive (PI)/optimalGainCalc.m index faf00c7e..28bad950 100644 --- a/Controls/Reactive (PI)/optimalGainCalc.m +++ b/Controls/Reactive (PI)/optimalGainCalc.m @@ -9,7 +9,7 @@ waves.period = 9.6664; % Load hydrodynamic data for float from BEM -hydro = readBEMIOH5(body.h5File, 1, body.meanDrift); +hydro = readBEMIOH5(body.h5File{1}, 1, body.meanDrift); % Define wave conditions H = waves.height; diff --git a/MOST/tests/TestMOST.m b/MOST/tests/TestMOST.m index 5016d137..6f19ee13 100644 --- a/MOST/tests/TestMOST.m +++ b/MOST/tests/TestMOST.m @@ -42,13 +42,11 @@ function runBEMIO(testCase) end cd(testCase.testDir) end - function runMOSTIO(testCase) - cd(testCase.mostDataDir); - if isfile(testCase.turbSimName) - fprintf('runMOSTIO skipped, turbSim/*.mat already exists\n'); - else - mostIO - end + function runTurbSim(testCase) + % Only re-run turbSim before testing. The *.mat file is too + % large to commit to the repo. + cd(fullfile(testCase.mostDataDir,'turbSim')); + run_turbsim(); cd(testCase.testDir) end function runConstantTest(testCase) @@ -201,5 +199,13 @@ function turbulent_windSpeed(testCase) fprintf(['Wind speed, Diff = ' ... num2str(max(abs(org-new))) '\n']); end + + function runMOSTIO(testCase) + % Test the pre-processing here so that it does not interfere + % with the precise comparison of results. + cd(testCase.mostDataDir); + mostIO + cd(testCase.testDir) + end end end diff --git a/Mean_Drift/WECSim/userDefinedFunctions.m b/Mean_Drift/WECSim/userDefinedFunctions.m index d3c434a9..596c244e 100644 --- a/Mean_Drift/WECSim/userDefinedFunctions.m +++ b/Mean_Drift/WECSim/userDefinedFunctions.m @@ -1,6 +1,6 @@ inds = find(output.wave.time >= simu.rampTime + waves.period*5); %% -surgeMeanDriftTH = body.hydroForce.fExt.md(1)*waves.amplitude^2; +surgeMeanDriftTH = body.hydroForce.hf1.fExt.md(1)*waves.amplitude^2; surgeMeanDriftWS = mean(output.bodies.forceExcitation(inds,1)); %% close all diff --git a/WECCCOMP/WECCCOMP_Nonlinear_Model_Predictive/wecSimInputFile.m b/WECCCOMP/WECCCOMP_Nonlinear_Model_Predictive/wecSimInputFile.m index 1b35d6fd..572278ad 100644 --- a/WECCCOMP/WECCCOMP_Nonlinear_Model_Predictive/wecSimInputFile.m +++ b/WECCCOMP/WECCCOMP_Nonlinear_Model_Predictive/wecSimInputFile.m @@ -21,7 +21,7 @@ case { 2, 5 }; simu.endTime = 150 + simu.rampTime; case { 3, 6 }; simu.endTime = 200 + simu.rampTime; end - simu.cicEndTime = []; % Convolution Time [s] + simu.cicEndTime = 2; % Convolution Time [s] simu.explorer = 'off'; % Explorer on simu.solver = 'ode8'; % Turn on ode45 simu.domainSize = 5;