Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve bugs #66

Merged
merged 5 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Controls/Declutching/optimalTimeCalc.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Controls/Latching/optimalTimeCalc.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Controls/MPC/plotFreqDep.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Controls/MPC/setupMPC.m
Original file line number Diff line number Diff line change
@@ -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')

Expand Down
2 changes: 1 addition & 1 deletion Controls/Passive (P)/optimalGainCalc.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Controls/Reactive (PI)/optimalGainCalc.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
20 changes: 13 additions & 7 deletions MOST/tests/TestMOST.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion Mean_Drift/WECSim/userDefinedFunctions.m
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading