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
6 changes: 3 additions & 3 deletions .github/workflows/run-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ jobs:
ref: ${{ inputs.base_ref }}
path: './WEC-Sim'
- name: Check out MoorDyn
if: matrix.folder == 'Mooring'
if: matrix.folder == 'Mooring' || matrix.folder == 'OWC' || 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 == 'OWC' || matrix.folder == 'Paraview_Visualization'
run: |
cp * ../WEC-Sim/source/functions/moorDyn
cp -r * ../WEC-Sim/source/functions/moorDyn
ls ../WEC-Sim/source/functions/moorDyn
shell: bash
working-directory: './MoorDyn'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/wec-sim-dev-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Test WEC-Sim dev branch
on:
workflow_dispatch: {}
repository_dispatch:
types:
- wecsim-dev
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/wec-sim-main-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Test WEC-Sim main branch
on:
workflow_dispatch: {}
repository_dispatch:
types:
- wecsim-main
Expand Down
6 changes: 6 additions & 0 deletions Body-to-Body_Interactions/TestB2B.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,32 @@ function checkVisibilityRestored(testCase)
function testB2B_Case1(testCase)
cd('B2B_Case1')
wecSim
close_system('RM3',0)
end
function testB2B_Case2(testCase)
cd('B2B_Case2')
wecSim
close_system('RM3',0)
end
function testB2B_Case3(testCase)
cd('B2B_Case3')
wecSim
close_system('RM3',0)
end
function testB2B_Case4(testCase)
cd('B2B_Case4')
wecSim
close_system('RM3',0)
end
function testB2B_Case5(testCase)
cd('B2B_Case5')
wecSim
close_system('RM3',0)
end
function testB2B_Case6(testCase)
cd('B2B_Case6')
wecSim
close_system('RM3',0)
end
end
end
Binary file modified Desalination/OSWEC_RO.slx
Binary file not shown.
5 changes: 5 additions & 0 deletions Free_Decay/TestFreeDecay.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,31 @@ function checkVisibilityRestored(testCase)
function testFree_Decay_0m(testCase)
cd('0m')
wecSim
close_system('sphere',0)
cd(testCase.testDir)
end
function testFree_Decay_1m(testCase)
cd('1m')
wecSim
close_system('sphere',0)
cd(testCase.testDir)
end
function testFree_Decay_1m_ME(testCase)
cd('1m-ME')
wecSim
close_system('sphere',0)
cd(testCase.testDir)
end
function testFree_Decay_3m(testCase)
cd('3m')
wecSim
close_system('sphere',0)
cd(testCase.testDir)
end
function testFree_Decay_5m(testCase)
cd('5m')
wecSim
close_system('sphere',0)
cd(testCase.testDir)
end
end
Expand Down
6 changes: 3 additions & 3 deletions Mooring/MoorDyn/wecSimInputFile.m
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
%% Simulation Data
simu = simulationClass();
simu.simMechanicsFile = 'RM3MoorDyn.slx'; % WEC-Sim Model File
simu.mode = 'accelerator';
simu.mode = 'accelerator';
simu.explorer = 'off';
simu.rampTime = 40;
simu.rampTime = 40;
simu.endTime = 400;
simu.dt = 0.01;
simu.dt = 0.01;
simu.cicDt = 0.05;

%% Wave Information
Expand Down
2 changes: 2 additions & 0 deletions Mooring/TestMooring.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ function testMoorDyn(testCase)
"MoorDyn is not installed");
cd MoorDyn
wecSim
close_system('RM3MoorDyn',0)
cd(testCase.testDir)
end
function testMooringMatrix(testCase)
cd MooringMatrix
wecSim
close_system('RM3MooringMatrix',0)
cd(testCase.testDir)
end
end
Expand Down
2 changes: 2 additions & 0 deletions Morison_Element/TestMorisonElement.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ function checkVisibilityRestored(testCase)
function testMorisonElement(testCase)
cd('morisonElement')
wecSim
close_system('monopile',0)
cd(testCase.testDir)
end
function testMonopile(testCase)
cd('monopile')
wecSim
close_system('monopile',0)
cd(testCase.testDir)
end
end
Expand Down
4 changes: 4 additions & 0 deletions Multiple_Condition_Runs/TestMultipleConditionRuns.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,22 @@ function checkVisibilityRestored(testCase)
function testRM3_MCROPT1(testCase)
cd RM3_MCROPT1
wecSimMCR
close_system('RM3',0)
end
function testRM3_MCROPT2(testCase)
cd RM3_MCROPT2
wecSimMCR
close_system('RM3',0)
end
function testRM3_MCROPT3(testCase)
cd RM3_MCROPT3
wecSimMCR
close_system('RM3',0)
end
function testRM3_MCROPT3_SeaState(testCase)
cd RM3_MCROPT3_SeaState
wecSimMCR
close_system('RM3',0)
end
end
end
4 changes: 4 additions & 0 deletions Nonlinear_Hydro/TestNonlinearHydro.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,22 @@ function checkVisibilityRestored(testCase)
function testNonlinear_Hydro_ode4_Regular(testCase)
cd(fullfile('ode4', 'Regular'))
wecSim
close_system('ellipsoid',0)
end
function testNonlinear_Hydro_ode4_RegularCIC(testCase)
cd(fullfile('ode4', 'RegularCIC'))
wecSim
close_system('ellipsoid',0)
end
function testNonlinear_Hydro_ode45_Regular(testCase)
cd(fullfile('ode45', 'Regular'))
wecSim
close_system('ellipsoid',0)
end
function testNonlinear_Hydro_ode45_RegularCIC(testCase)
cd(fullfile('ode45', 'RegularCIC'))
wecSim
close_system('ellipsoid',0)
end
end
end
61 changes: 41 additions & 20 deletions OWC/OrificeModel/hydroData/bemio.m
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
%% OWC - WAMIT GBM simulation
%% Define the despiking structure
despike = struct();
despike.negThresh = 1e-3; % the threshold below which negative damping will be removed
despike.N = 5; % will loop the despiking procedure N time before filtering
despike.appFilt = 1; % boolean, 1 to apply low pass filter after despiking

%% Run BEMIO for WAMIT Run and despike the hydro data
% 1) load deSpike.mat, to create structure depSpike in workspace.
% 2) call >> outHydro=badBemioFix_fcn({'test17a.out'},'WAMIT',deSpike,[1,1;3,3;5,5;7,7])
% This will despike the resonance associated with the OWC moonpool and generate an h5
% file with the _clean suffix.

load deSpike.mat
outHydro = badBemioFix_fcn({'test17a.out'},'WAMIT',deSpike,[1,1;3,3;5,5;7,7]);
writeBEMIOH5(outHydro);

%% Run BEMIO for WAMIT Run

% hydro = struct();
% hydro = readWAMIT(hydro,'test17a.out',[]);
% hydro = radiationIRF(hydro,20,[],[],[],11);
% hydro = radiationIRFSS(hydro,20,[]);
% hydro = excitationIRF(hydro,20,[],[],[],11);
% hydro.plotDofs = [1,1;3,3;5,5;7,7];
% writeBEMIOH5(hydro);
% plotBEMIO(hydro);
% thresholds: applied to 'Threshold' argument of findpeaks
despike.B.Threshold = 2e-4; % damping
despike.A.Threshold = 1e-3; % added mass
despike.ExRe.Threshold = 1e-3; % real part excitation
despike.ExIm.Threshold = 1e-3; % imag part excitation

% minimum peak prominence, applied to 'MinPeakProminence' argument of findpeaks
despike.B.Prominence = 2e-4;
despike.A.Prominence = 1e-3;
despike.ExRe.Prominence = 1e-3;
despike.ExIm.Prominence = 1e-3;

% minimum peak distance, applied to 'MinPeakDistance' argument of findpeaks
despike.A.MinPeakDistance = 3;
despike.B.MinPeakDistance = 3;
despike.ExRe.MinPeakDistance = 3;
despike.ExIm.MinPeakDistance = 3;

% the b and a inputs to MATLAB's filtfilt(b,a,x) function
despike.Filter.b = 0.02008336556421123561544384017452102853 .* [1 2 1];
despike.Filter.a = [1 -1.561018075800718163392843962355982512236 0.641351538057563175243558362126350402832];

%% Read and clean WAMIT results
hydro = struct();
hydro = readWAMIT(hydro,'test17a.out',[]);
hydro = cleanBEM(hydro,despike);
hydro.file = 'test17a_clean';

hydro = radiationIRF(hydro,20,[],[],[],11);
hydro = radiationIRFSS(hydro,20,[]);
hydro = excitationIRF(hydro,20,[],[],[],11);

hydro.plotDofs = [1,1;3,3;5,5;7,7];
% plotBEMIO(hydro);

writeBEMIOH5(hydro);
Binary file removed OWC/OrificeModel/hydroData/deSpike.mat
Binary file not shown.
2 changes: 2 additions & 0 deletions OWC/TestOWC.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ function checkVisibilityRestored(testCase)
function testOWCOrifice(testCase)
cd('OrificeModel')
wecSim
close_system('OWC_rigid',0)
end

function testOWCFloating(testCase)
assumeEqual(testCase, exist("MoorDyn_caller", "file"), 2, ...
"MoorDyn is not installed");
cd('FloatingOWC')
wecSim
close_system('OWC_GBM',0)
end
end
end
Binary file modified Passive_Yaw/PassiveYawRegression/IrrYaw_org.mat
Binary file not shown.
8 changes: 4 additions & 4 deletions Passive_Yaw/PassiveYawRegression/runLoadPassiveYawIrr.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@
save('IrrYaw','IrrYaw')

%% Plot Old vs. New Comparison
figure(1); % plots of yaw position
figure(); % plots of yaw position
subplot(1,2,1)
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)')
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')
savefig('figYawIrr');
savefig('figYawIrr');

%% Clear output and .slx directory
try
Expand Down
2 changes: 2 additions & 0 deletions Passive_Yaw/TestPassiveYaw.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ function checkVisibilityRestored(testCase)
function testPassiveYawOFF(testCase)
cd('PassiveYawOFF')
wecSim
close_system('OSWEC',0)
end
function testPassiveYawON(testCase)
cd('PassiveYawON')
wecSim
close_system('OSWEC',0)
end
end
end
2 changes: 2 additions & 0 deletions Passive_Yaw/TestPassiveYawRegression.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function runYawIrrTest(testCase)
cd(fullfile(testCase.testDir, ...
'PassiveYawRegression'))
runLoadPassiveYawIrr;
close_system('OSWEC',0)
testCase.IrrYaw = load('IrrYaw.mat').("IrrYaw");
cd(fullfile(testCase.testDir));
end
end

Expand Down
2 changes: 2 additions & 0 deletions RM3_PTO_Extension/TestRM3PTOExtension.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ function checkVisibilityRestored(testCase)
function testRM3_PTO_Extension_float(testCase)
cd('float')
wecSim
close_system('RM3',0)
cd(testCase.testDir)
end
function testRM3_PTO_Extension_spar(testCase)
cd('spar')
wecSim
close_system('RM3',0)
cd(testCase.testDir)
end
end
Expand Down
2 changes: 2 additions & 0 deletions Variable_Hydro/TestVariableHydro.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ function checkVisibilityRestored(testCase)
function testPY(testCase)
cd('Passive_Yaw')
runCases
close_system('OSWEC',0)
end
function testVM(testCase)
cd('Variable_Mass')
wecSim
close_system('OSWEC',0)
end
end

Expand Down
Binary file modified Variable_Hydro/Variable_Mass/sphereVarMass.slx
Binary file not shown.
2 changes: 2 additions & 0 deletions WECCCOMP/TestWECCCOMP.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ function checkVisibilityRestored(testCase)
function testWECCCOMP_Fault(testCase)
cd('WECCCOMP_Fault_Implementation')
wecSim
close_system('WaveStar',0)
end
function testWECCCOMP_MPC(testCase)
cd('WECCCOMP_Nonlinear_Model_Predictive')
wecSim
close_system('WaveStar',0)
end
end
end
Loading