Skip to content

Commit

Permalink
Merge pull request #32 from kmruehl/me_test
Browse files Browse the repository at this point in the history
Updating the Morison Element Test
  • Loading branch information
nathanmtom authored May 17, 2023
2 parents 2195e6c + 5291926 commit e45ca73
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ jobs:
Free_Decay,
Generalized_Body_Modes,
Mooring,
Morison_Element,
Multiple_Condition_Runs,
Nonhydro_Body,
Nonlinear_Hydro,
Paraview_Visualization,
Passive_Yaw,
PTO-Sim,
Traditional_Morison_Element,
Wave_Markers,
WECCCOMP,
Write_Custom_h5]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ jobs:
Free_Decay,
Generalized_Body_Modes,
Mooring,
Morison_Element,
Multiple_Condition_Runs,
Nonhydro_Body,
Nonlinear_Hydro,
Paraview_Visualization,
Passive_Yaw,
PTO-Sim,
Traditional_Morison_Element,
Wave_Markers,
WECCCOMP,
Write_Custom_h5]
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
classdef TestTraditionalME < matlab.unittest.TestCase
classdef TestMorisonElement < matlab.unittest.TestCase

properties
OriginalDefault
Expand All @@ -9,7 +9,7 @@
end

methods (Access = 'public')
function obj = TestTraditionalME
function obj = TestMorisonElement
obj.testDir = fileparts(mfilename('fullpath'));
end
end
Expand Down Expand Up @@ -50,13 +50,13 @@ function checkVisibilityRestored(testCase)
end

methods(Test)
function testTraditionalME(testCase)
function testMorisonElement(testCase)
cd('morisonElement')
wecSim
cd(testCase.testDir)
end
function testHydroBody(testCase)
cd('hydroBody')
function testMonopile(testCase)
cd('monopile')
wecSim
cd(testCase.testDir)
end
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
% Traditional Morison Element case - hydro body

%% Simulation Data
simu = simulationClass(); % Initialize Simulation Class
simu.simMechanicsFile = 'monopile.slx'; % Specify Simulink Model File
simu = simulationClass(); % Initialize Simulation Class
simu.simMechanicsFile = 'monopile.slx'; % Specify Simulink Model File
simu.explorer = 'off';
simu.solver = 'ode4';
simu.rho = 1025;
simu.cicEndTime = 30;
simu.rampTime = 100; % Wave Ramp Time [s] 200
simu.endTime = 400; % Simulation End Time [s] 400
simu.rampTime = 100; % Wave Ramp Time [s] 200
simu.endTime = 400; % Simulation End Time [s] 400
simu.dt = 0.01;
simu.stateSpace = 1;

Expand All @@ -18,31 +18,33 @@
% waves = waveClass('noWaveCIC');
% waves.period = 5;

% Regular Wave
waves = waveClass('regular');
waves.height = 2.0;
waves.period = 5.0;
% % Regular Wave
% waves = waveClass('regular');
% waves.height = 2.0;
% waves.period = 5.0;

% % Irregular Waves
% waves = waveClass('irregular'); % Initialize Wave Class and Specify Type
% waves.height = 2.0; % Significant Wave Height [m]
% waves.period = 5.0; % Peak Period [s]
% waves.spectrumType = 'PM'; % Specify Spectrum Type
% waves.phaseSeed = 5;
waves = waveClass('irregular'); % Initialize Wave Class and Specify Type
waves.height = 2.0; % Significant Wave Height [m]
waves.period = 5.0; % Peak Period [s]
waves.spectrumType = 'PM'; % Specify Spectrum Type
waves.phaseSeed = 5; % Set Random Phase Seed
% Wave directionality was not included in BEM run
% waves.direction = [0,30,90]; % Wave Directionality [deg]
% waves.spread = [0.1,0.2,0.7]; % Wave Directional Spreading [%}

% waves.bem.range = [0 10]; % Not necessary to define wave frequency range without an .h5 / hydro body
% waves.waterDepth = 30; % Not necessary to define water depth without an .h5 / hydro body
% waves.bem.range = [0 10]; % Not necessary to define wave frequency range with an .h5 / hydro body
% waves.waterDepth = 30; % Not necessary to define water depth with an .h5 / hydro body

%% Body Data
% Monopile - diameter 10m, height 30m
body(1) = bodyClass('../hydroData/monopile.h5');
body(1).geometryFile = '../geometry/monopile.stl';
% body(1).name = 'monopile'; % Hydro body name defined by h5 file
body(1).nonHydro = 0; % Hydro body
% body(1).name = 'monopile'; % Hydro body name defined by h5 file
body(1).nonHydro = 0; % Hydro body
body(1).mass = 'equilibrium'; % 1044536
body(1).inertia = [1.25 1.25 0.15]*1e9;
% body(1).centerGravity = [0 0 -15]; % Hydro body cg defined by h5 file
% body(1).centerBuoyancy = [0 0 -15]; % Hydro body centerBuoyancy defined by h5 file
% body(1).centerGravity = [0 0 -15]; % Hydro body cg defined by h5 file
% body(1).centerBuoyancy = [0 0 -15]; % Hydro body centerBuoyancy defined by h5 file
% body(1).volume = pi*10^2*30; % Hydro body volume defined by h5 file

% Morison Element Implementation not used for comparison with hydro body
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
% Traditional Morison Element case - no WEC-Sim hydro bodies

%% Simulation Data
simu = simulationClass(); % Initialize Simulation Class
simu.simMechanicsFile = 'monopile.slx'; % Specify Simulink Model File
simu = simulationClass(); % Initialize Simulation Class
simu.simMechanicsFile = 'monopile.slx'; % Specify Simulink Model File
simu.explorer = 'off';
simu.solver = 'ode4';
simu.rho = 1025;
simu.cicEndTime = 30;
simu.rampTime = 100; % Wave Ramp Time [s] 200
simu.endTime = 400; % Simulation End Time [s] 400
simu.rampTime = 100; % Wave Ramp Time [s] 200
simu.endTime = 400; % Simulation End Time [s] 400
simu.dt = 0.01;
simu.stateSpace = 1;

Expand All @@ -18,17 +18,19 @@
% waves = waveClass('noWaveCIC');
% waves.period = 5;

% Regular Wave
waves = waveClass('regular');
waves.height = 2.0;
waves.period = 5.0;
% % Regular Wave
% waves = waveClass('regular');
% waves.height = 2.0;
% waves.period = 5.0;

% % Irregular Waves
% waves = waveClass('irregular'); % Initialize Wave Class and Specify Type
% waves.height = 2.0; % Significant Wave Height [m]
% waves.period = 5.0; % Peak Period [s]
% waves.spectrumType = 'PM'; % Specify Spectrum Type
% waves.phaseSeed = 5;
% Irregular Waves
waves = waveClass('irregular'); % Initialize Wave Class and Specify Type
waves.height = 2.0; % Significant Wave Height [m]
waves.period = 5.0; % Peak Period [s]
waves.spectrumType = 'PM'; % Specify Spectrum Type
waves.phaseSeed = 5; % Set Random Phase Seed
waves.direction = [0,30,90]; % Wave Directionality [deg]
waves.spread = [0.1,0.2,0.7]; % Wave Directional Spreading [%}

waves.bem.range = [0 10]; % Must define wave frequency range without an .h5 / hydro body
waves.waterDepth = 30; % Must define water depth without an .h5 / hydro body
Expand All @@ -38,7 +40,7 @@
body(1) = bodyClass(''); % no h5 file required for drag body
body(1).geometryFile = '../geometry/monopile.stl';
body(1).name = 'monopile';
body(1).nonHydro = 2; % Drag body
body(1).nonHydro = 2; % Drag body
body(1).mass = 'equilibrium'; % 1044536
body(1).inertia = [1.25 1.25 0.15]*1e9;
body(1).centerGravity = [0 0 -15];
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
% Example running traditional Morison Element vs hydrodynamic body
% comparison

casedir = {"morisonElement","hydroBody"};
casedir = {"morisonElement","monpile"};

for ii = 1:length(casedir)
cd(casedir{ii})
wecSimFcn
cd ..
end

plotTraditionalME

plotMorisonElement

0 comments on commit e45ca73

Please sign in to comment.