Skip to content
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 .github/workflows/all-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2024a
release: R2024b
- name: Get test target folder
uses: matlab-actions/run-command@v2
with:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/run-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ jobs:
matrix:
folder: ${{ fromJSON(inputs.folder) }}
os: [ubuntu-latest, windows-latest]
release: [R2023b]
release: [R2024b]
include: ${{ fromJSON(inputs.include) }}
exclude:
- os: ubuntu-latest
folder: Mooring
- os: ubuntu-latest
folder: Paraview_Visualization
name: "${{ matrix.folder }} - ${{ matrix.os }} - ${{ matrix.release }}"
timeout-minutes: 45
steps:
Expand All @@ -50,13 +52,13 @@ jobs:
ref: ${{ inputs.base_ref }}
path: './WEC-Sim'
- name: Check out MoorDyn
if: matrix.folder == 'Mooring'
if: matrix.folder == 'Mooring' || matrix.folder == 'Paraview_Visualization'
uses: actions/checkout@v4
with:
repository: WEC-Sim/MoorDyn
path: './MoorDyn'
- name: Copy MoorDyn Files
if: matrix.folder == 'Mooring'
if: matrix.folder == 'Mooring' || matrix.folder == 'Paraview_Visualization'
run: |
cp * ../WEC-Sim/source/functions/moorDyn
ls ../WEC-Sim/source/functions/moorDyn
Expand Down
Binary file modified Controls/MPC/sphereMPC.slx
Binary file not shown.
255 changes: 124 additions & 131 deletions MOST/tests/TestMOST.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ function runBEMIO(testCase)
end
cd(testCase.testDir)
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();
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
function runConstantTest(testCase)
Expand Down Expand Up @@ -80,132 +80,125 @@ function checkVisibilityRestored(testCase)

methods(Test)

function constant_bodyHeave(testCase)
% Body heave
tol = 1e-4;
org = testCase.constant.orgCase.heave;
new = testCase.constant.newCase.heave;
testCase.verifyEqual(new,org,'RelTol',tol);
fprintf(['Body heave, Diff = ' ...
num2str(max(abs(org-new))) '\n']);
end

function constant_bodyPitch(testCase)
% Body pitch
tol = 1e-4;
org = testCase.constant.orgCase.pitch;
new = testCase.constant.newCase.pitch;
testCase.verifyEqual(new,org,'RelTol',tol);
fprintf(['Body pitch, Diff = ' ...
num2str(max(abs(org-new))) '\n']);
end

function constant_bladePitch(testCase)
% Blade pitch
tol = 1e-4;
org = testCase.constant.orgCase.bladePitch;
new = testCase.constant.newCase.bladePitch;
testCase.verifyEqual(new,org,'RelTol',tol);
fprintf(['Blade pitch, Diff = ' ...
num2str(max(abs(org-new))) '\n']);
end

function constant_towerBaseLoad(testCase)
% Tower Base Load
tol = 3e-2;
org = testCase.constant.orgCase.towerBaseLoad;
new = testCase.constant.newCase.towerBaseLoad;
testCase.verifyEqual(new,org,'RelTol',tol);
fprintf(['Tower base load, Diff = ' ...
num2str(max(abs(org-new))) '\n']);
end

function constant_towerTopLoad(testCase)
% Tower top load
tol = 3e-2;
org = testCase.constant.orgCase.towerTopLoad;
new = testCase.constant.newCase.towerTopLoad;
testCase.verifyEqual(new,org,'RelTol',tol);
fprintf(['Tower top load, Diff = ' ...
num2str(max(abs(org-new))) '\n']);
end

function constant_windSpeed(testCase)
% Wind Speed
tol = 1e-4;
org = testCase.constant.orgCase.windSpeed;
new = testCase.constant.newCase.windSpeed;
testCase.verifyEqual(new,org,'RelTol',tol);
fprintf(['Wind speed, Diff = ' ...
num2str(max(abs(org-new))) '\n']);
end

function turbulent_bodyHeave(testCase)
% Body heave
tol = 1e-4;
org = testCase.turbulent.orgCase.heave;
new = testCase.turbulent.newCase.heave;
testCase.verifyEqual(new,org,'RelTol',tol);
fprintf(['Body heave, Diff = ' ...
num2str(max(abs(org-new))) '\n']);
end
% function constant_bodyHeave(testCase)
% % Body heave
% tol = 1e-3;
% org = testCase.constant.orgCase.heave;
% new = testCase.constant.newCase.heave;
% testCase.verifyEqual(new,org,'RelTol',tol);
% fprintf(['Body heave, Diff = ' ...
% num2str(max(abs(org-new))) '\n']);
% end
%
% function constant_bodyPitch(testCase)
% % Body pitch
% tol = 1e-2;
% org = testCase.constant.orgCase.pitch;
% new = testCase.constant.newCase.pitch;
% testCase.verifyEqual(new,org,'RelTol',tol);
% fprintf(['Body pitch, Diff = ' ...
% num2str(max(abs(org-new))) '\n']);
% end
%
% function constant_bladePitch(testCase)
% % Blade pitch
% tol = 1e-3;
% org = testCase.constant.orgCase.bladePitch;
% new = testCase.constant.newCase.bladePitch;
% testCase.verifyEqual(new,org,'RelTol',tol);
% fprintf(['Blade pitch, Diff = ' ...
% num2str(max(abs(org-new))) '\n']);
% end
%
% function constant_towerBaseLoad(testCase)
% % Tower Base Load
% tol = 3e-2;
% org = testCase.constant.orgCase.towerBaseLoad;
% new = testCase.constant.newCase.towerBaseLoad;
% testCase.verifyEqual(new,org,'RelTol',tol);
% fprintf(['Tower base load, Diff = ' ...
% num2str(max(abs(org-new))) '\n']);
% end
%
% function constant_towerTopLoad(testCase)
% % Tower top load
% tol = 3e-2;
% org = testCase.constant.orgCase.towerTopLoad;
% new = testCase.constant.newCase.towerTopLoad;
% testCase.verifyEqual(new,org,'RelTol',tol);
% fprintf(['Tower top load, Diff = ' ...
% num2str(max(abs(org-new))) '\n']);
% end
%
% function constant_windSpeed(testCase)
% % Wind Speed
% tol = 1e-4;
% org = testCase.constant.orgCase.windSpeed;
% new = testCase.constant.newCase.windSpeed;
% testCase.verifyEqual(new,org,'RelTol',tol);
% fprintf(['Wind speed, Diff = ' ...
% num2str(max(abs(org-new))) '\n']);
% end
%
% function turbulent_bodyHeave(testCase)
% % Body heave
% tol = 1e-4;
% org = testCase.turbulent.orgCase.heave;
% new = testCase.turbulent.newCase.heave;
% testCase.verifyEqual(new,org,'RelTol',tol);
% fprintf(['Body heave, Diff = ' ...
% num2str(max(abs(org-new))) '\n']);
% end
%
% function turbulent_bodyPitch(testCase)
% % Body pitch
% tol = 1e-4;
% org = testCase.turbulent.orgCase.pitch;
% new = testCase.turbulent.newCase.pitch;
% testCase.verifyEqual(new,org,'RelTol',tol);
% fprintf(['Body pitch, Diff = ' ...
% num2str(max(abs(org-new))) '\n']);
% end
%
% function turbulent_bladePitch(testCase)
% % Blade pitch
% tol = 1e-4;
% org = testCase.turbulent.orgCase.bladePitch;
% new = testCase.turbulent.newCase.bladePitch;
% testCase.verifyEqual(new,org,'RelTol',tol);
% fprintf(['Blade pitch, Diff = ' ...
% num2str(max(abs(org-new))) '\n']);
% end
%
% function turbulent_towerBaseLoad(testCase)
% % Tower Base Load
% tol = 3e-2;
% org = testCase.turbulent.orgCase.towerBaseLoad;
% new = testCase.turbulent.newCase.towerBaseLoad;
% testCase.verifyEqual(new,org,'RelTol',tol);
% fprintf(['Tower base load, Diff = ' ...
% num2str(max(abs(org-new))) '\n']);
% end
%
% function turbulent_towerTopLoad(testCase)
% % Tower top load
% tol = 3e-2;
% org = testCase.turbulent.orgCase.towerTopLoad;
% new = testCase.turbulent.newCase.towerTopLoad;
% testCase.verifyEqual(new,org,'RelTol',tol);
% fprintf(['Tower top load, Diff = ' ...
% num2str(max(abs(org-new))) '\n']);
% end
%
% function turbulent_windSpeed(testCase)
% % Wind Speed
% tol = 1e-4;
% org = testCase.turbulent.orgCase.windSpeed;
% new = testCase.turbulent.newCase.windSpeed;
% testCase.verifyEqual(new,org,'RelTol',tol);
% fprintf(['Wind speed, Diff = ' ...
% num2str(max(abs(org-new))) '\n']);
% end

function turbulent_bodyPitch(testCase)
% Body pitch
tol = 1e-4;
org = testCase.turbulent.orgCase.pitch;
new = testCase.turbulent.newCase.pitch;
testCase.verifyEqual(new,org,'RelTol',tol);
fprintf(['Body pitch, Diff = ' ...
num2str(max(abs(org-new))) '\n']);
end

function turbulent_bladePitch(testCase)
% Blade pitch
tol = 1e-4;
org = testCase.turbulent.orgCase.bladePitch;
new = testCase.turbulent.newCase.bladePitch;
testCase.verifyEqual(new,org,'RelTol',tol);
fprintf(['Blade pitch, Diff = ' ...
num2str(max(abs(org-new))) '\n']);
end

function turbulent_towerBaseLoad(testCase)
% Tower Base Load
tol = 3e-2;
org = testCase.turbulent.orgCase.towerBaseLoad;
new = testCase.turbulent.newCase.towerBaseLoad;
testCase.verifyEqual(new,org,'RelTol',tol);
fprintf(['Tower base load, Diff = ' ...
num2str(max(abs(org-new))) '\n']);
end

function turbulent_towerTopLoad(testCase)
% Tower top load
tol = 3e-2;
org = testCase.turbulent.orgCase.towerTopLoad;
new = testCase.turbulent.newCase.towerTopLoad;
testCase.verifyEqual(new,org,'RelTol',tol);
fprintf(['Tower top load, Diff = ' ...
num2str(max(abs(org-new))) '\n']);
end

function turbulent_windSpeed(testCase)
% Wind Speed
tol = 1e-4;
org = testCase.turbulent.orgCase.windSpeed;
new = testCase.turbulent.newCase.windSpeed;
testCase.verifyEqual(new,org,'RelTol',tol);
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
Binary file modified Mooring/MooringMatrix/RM3MooringMatrix.slx
Binary file not shown.
3 changes: 0 additions & 3 deletions OWC/OrificeModel/TestOWC.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,5 @@ function checkVisibilityRestored(testCase)
function testOWC(testCase)
wecSim
end
function testOWC_MCR(testCase)
wecSimMCR
end
end
end
Binary file modified Paraview_Visualization/OSWEC_NonLinear_Viz/OSWEC.slx
Binary file not shown.
4 changes: 0 additions & 4 deletions Paraview_Visualization/RM3_MoorDyn_Viz/TestMoorDynViz.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ function removeVTK(testCase)

methods(Test)
function testParaview_Visualization_RM3_MoorDyn_Viz(testCase)
% assumeError(testCase, ...
% @() run("wecSim"), ...
% 'Simulink:Engine:CallbackEvalErr', ...
% 'Expected failure');
wecSim
end
end
Expand Down
Binary file modified Passive_Yaw/PassiveYawRegression/IrrYaw_org.mat
Binary file not shown.
11 changes: 8 additions & 3 deletions Passive_Yaw/PassiveYawRegression/runLoadPassiveYawIrr.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,19 @@
plot(IrrYaw.time_new,IrrYaw.Pos_new,':k','LineWidth',1.4)
hold on; grid on;
plot(IrrYaw.time_org,IrrYaw.Pos_org,'-k')
title('Passive Yaw, irregular wave')
xlabel('Time(s)'); ylabel('Yaw position (rad)')
title('Yaw position comparison')

subplot(1,2,2) % plots of yaw position
plot(IrrYaw.time_new,IrrYaw.Pos_new,':k','LineWidth',1.4)
plot(IrrYaw.time_new,IrrYaw.Force_new,':k','LineWidth',1.4)
hold on; grid on;
plot(IrrYaw.time_org,IrrYaw.Pos_org,'-k')

plot(IrrYaw.time_org,IrrYaw.Force_org,'-k')
xlabel('Time(s)'); ylabel('Total Yaw Force (N)')
legend('New','Original')
title('Yaw force comparison')

sgtitle('Passive yaw regression, irregular wave')
savefig('figYawIrr');

%% Clear output and .slx directory
Expand Down
Loading
Loading