Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions .github/workflows/run-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ jobs:
ref: ${{ inputs.base_ref }}
path: './WEC-Sim'
- name: Check out MoorDyn
if: matrix.folder == 'Mooring' || matrix.folder == 'OWC'
if: matrix.folder == 'Mooring'
uses: actions/checkout@v4
with:
repository: WEC-Sim/MoorDyn
path: './MoorDyn'
- name: Copy MoorDyn Files
if: matrix.folder == 'Mooring' || matrix.folder == 'OWC'
if: matrix.folder == 'Mooring'
run: |
cp * ../WEC-Sim/source/functions/moorDyn
ls ../WEC-Sim/source/functions/moorDyn
Expand Down
Binary file removed OWC/FloatingOWC_W2W/FloatingOWC_W2W/OWC_rigid.slx
Binary file not shown.
7 changes: 5 additions & 2 deletions OWC/FloatingOWC_W2W/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ representation of their dynamic behavior. Additionally, the model accounts for t

An optimal control strategy is implemented to maximize turbine efficiency by dynamically adjusting system parameters based on operating speed.

**Relevant Citation(s)**
Shabara, Mohamed A., et al. "Optimal Control of Floating Oscillating Water Column Wave Energy Converters." 2025 American Control Conference (ACC), IEEE, 2025.
This model is based on the research detailed in:

Shabara, Mohamed A., et al. "Optimal Control of Floating Oscillating Water Column Wave Energy Converters." The 9th IEEE Conference on Control Technology and Applications (CCTA) 2025.

**Acknowledgment:** This material is based upon work supported by the U.S.Department of Energy’s Office of Energy Efficiency and Renewable Energy under the Water Power Technologies Office Award Number DE-EE0008895
2 changes: 1 addition & 1 deletion OWC/FloatingOWC_W2W/userDefinedFunctions.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
];

% Load the STL file
stlData = stlread('../../_Common_Input_Files/Floating_OWC/geometry/Sparbuoy_Floater.stl'); % Replace with the path to your STL file
stlData = stlread('./geometry/Sparbuoy_Floater.stl'); % Replace with the path to your STL file

vertices = stlData.Points; % Extract vertices and faces from the STL data
vertices(:,3) = vertices(:,3) + body(1, 1).centerGravity(3);
Expand Down
23 changes: 12 additions & 11 deletions OWC/FloatingOWC_W2W/wecSimInputFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
simu.dt = 0.01; % Simulation time-step [s]

%% Wave Information
% % noWaveCIC, no waves with radiation wecSimCIC
% noWaveCIC, no waves with radiation wecSimCIC
% waves = waveClass('noWaveCIC'); % Initialize Wave Class and Specify Type

% % Regular Waves
% Regular Waves
waves = waveClass('regular'); % Initialize Wave Class and Specify Type
waves.height = 4.5; % Wave Height [m]
waves.period = 11.2; % Wave Period [s]
Expand Down Expand Up @@ -62,17 +62,20 @@

%% Body Data
% Floater
body(1) = bodyClass('../../_Common_Input_Files/Floating_OWC/hydroData/floatingOWC.h5');
body(1).geometryFile = '../../_Common_Input_Files/Floating_OWC/geometry/Sparbuoy_Floater.stl'; % Location of Geomtry File
body(1) = bodyClass('./hydroData/floatingOWC.h5');
body(1).geometryFile = './geometry/Sparbuoy_Floater.stl'; % Location of Geomtry File
body(1).mass = 'equilibrium'; % Body Mass. The 'equilibrium' Option Sets it to the Displaced Water Weight.
body(1).inertia = 1.0e+09*[1.5310 1.5310 0.1118]; % Moment of Inertia [kg*m^2]
% body(1).quadDrag.cd = [1.25, 1.25, 1.25, 1.25, 1.25 , 0.1];
% body(1).quadDrag.area = [250, 250, 201, 250, 250, 100];

% Spar/Plate
body(2) = bodyClass('../../_Common_Input_Files/Floating_OWC/hydroData/floatingOWC.h5');
body(2).geometryFile = '../../_Common_Input_Files/Floating_OWC/geometry/Sparbuoy_OWC.stl';
body(2).mass = 'equilibrium';
waterColumnMass = 4493450;
waterColumnHeight = 50.69;

body(2) = bodyClass('./hydroData/floatingOWC.h5');
body(2).geometryFile = './geometry/Sparbuoy_OWC.stl';
body(2).mass = waterColumnMass;



Expand Down Expand Up @@ -126,10 +129,8 @@
airChamber(1).Ae = (pi / 4) * airChamber(1).owcDiameter^2; % Air chamber area - Circular in this model
airChamber(1).rho_air = 1.25;
airChamber(1).Vo = airChamber(1).Ae * airChamber(1).airChamberHeight; % Inital Volume of the air chamber
% airChamber(1).mass = 4493450;
airChamber(1).Mass = pi * (airChamber(1).owcDiameter^2)/4 * airChamber(1).airChamberHeight * 1025;
Izz = 0.5* airChamber(1).Mass * (airChamber(1).owcDiameter/2)^2;
Ixx = airChamber(1).Mass * (3 * (airChamber(1).owcDiameter/2)^2 + airChamber(1).airChamberHeight^2) /12;
Izz = 0.5* waterColumnMass * (airChamber(1).owcDiameter/2)^2;
Ixx = waterColumnMass * (3 * (airChamber(1).owcDiameter/2)^2 + waterColumnHeight^2) /12;

body(2).inertia = [Ixx Ixx Izz];

Expand Down
Binary file removed OWC/OrificeModel/GBM1.slx
Binary file not shown.
Binary file added OWC/OrificeModel/OWC_GBM.slx
Binary file not shown.
13 changes: 8 additions & 5 deletions OWC/OrificeModel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@

**Geometry:** Cylinder Moonpool, WAMIT Test 17 geometry

**Dependencies:**
**Dependencies:** Signal Processing Toolbox

* Control System Toolbox

**Description:**
Run bemio to generate the H5 file in ./OrificeModel/hydroData, it is recommended to:
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.

OWC example modeling an orifice for a floating body cylindrical OWC. Body has a broken link to couple the GBM mode representing the heaving free surface to the rigid body heave mode. Intended to demonstrate ways user can modify library blocks to meet OWC modeling needs.

Run `wecSimMCR` for orifice area study in `mcrOrifice.mat` which will work with the `userDefinedFunctions.m`
Run wecSimMCR for orifice area study in mcrOrifice.mat which will work with the
userDefinedFunctions.m
21 changes: 1 addition & 20 deletions OWC/TestOWC.m → OWC/OrificeModel/TestOWC.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
properties
OriginalDefault
testDir
h5DirOrifice = 'OrificeModel/hydroData'
h5DirOrifice = 'hydroData'
h5NameOrifice = 'test17a.h5'
h5DirFloating = '../_Common_Input_Files/Floating_OWC/hydroData'
h5NameFloating = 'floatingOWC.h5'
end

methods (Access = 'public')
Expand Down Expand Up @@ -34,15 +32,6 @@ function runBemioOrifice(testCase)
end
cd(testCase.testDir)
end
function runBemioFloating(testCase)
cd(testCase.h5DirFloating);
if isfile(testCase.h5NameFloating)
fprintf('runBemio skipped, *.h5 already exists\n')
else
bemio
end
cd(testCase.testDir)
end
end

methods(TestMethodTeardown)
Expand All @@ -61,14 +50,6 @@ function checkVisibilityRestored(testCase)

methods(Test)
function testOWCOrifice(testCase)
cd('OrificeModel')
wecSim
end
function testOWCFloating(testCase)
assumeEqual(testCase, exist("MoorDyn_caller", "file"), 2, ...
"MoorDyn is not installed");

cd('FloatingOWC_W2W')
wecSim
end
end
Expand Down
30 changes: 21 additions & 9 deletions OWC/OrificeModel/hydroData/bemio.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
% Triton OWC - WAMIT GBM simulation
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);
%% OWC - WAMIT GBM simulation

%% 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]);

%% 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);
5 changes: 5 additions & 0 deletions OWC/OrificeModel/hydroData/config.wam
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
! generic configuration file: config.wam
RAMGBMAX=8
NCPU=1
USERID_PATH=\wamitv7 (directory for *.exe, *.dll, and userid.wam)

Binary file added OWC/OrificeModel/hydroData/deSpike.mat
Binary file not shown.
5 changes: 5 additions & 0 deletions OWC/OrificeModel/hydroData/fnames.wam
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test17a.cfg
test17a.frc
test17a.gdf
test17a.pot
test17a.wam
14 changes: 14 additions & 0 deletions OWC/OrificeModel/hydroData/test17a.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
! TEST17A.CFG file, cylinder with moonpool, free lid
ipltdat=5
ilowgdf=5
ILOWHI=1
IALTFRC=2
ISOLVE=1
PANEL_SIZE = 0.2 (use default .spl parameters)
IPERIN=3 (input wavenumber)
IPEROUT=3 (output wavenumber)
ILOG=1
NUMHDR=1
IGENMDS=17
NEWMDS = 1
idelfiles=0 over-rides the config.wam setting to re-use test17.p2f in test17b
16 changes: 16 additions & 0 deletions OWC/OrificeModel/hydroData/test17a.frc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
TEST17a moonpool with generalized modes for free surface - no damping
1 0 2 0 0 0 0 0 0
1.
0. 0. 0.
1 imass (mass matrix of body)
0.589 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.589 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.589 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.147 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.147 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.147 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0
0 idamp
0 istif
0
0
6 changes: 6 additions & 0 deletions OWC/OrificeModel/hydroData/test17a.gdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TEST17a cylinder with moonpool -- undamped patch on free surface
1. 9.80665 ULEN GRAV
1 1 ISX ISY
4 -7 NPATCH IGDEF
1 NLINES
0.5 1.0 0.25 radius, draft, moonpool radius
3 changes: 0 additions & 3 deletions OWC/OrificeModel/hydroData/test17a.h5

This file was deleted.

65 changes: 65 additions & 0 deletions OWC/OrificeModel/hydroData/test17a.hst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
WAMIT -- Force Output File -- test17a.hst 23-Sep-2022 09:38:09
1 1 0.000000E+00
1 2 0.000000E+00
1 3 0.000000E+00
1 4 0.000000E+00
1 5 0.000000E+00
1 6 0.000000E+00
1 7 0.000000E+00
1 8 0.000000E+00
2 1 0.000000E+00
2 2 0.000000E+00
2 3 0.000000E+00
2 4 0.000000E+00
2 5 0.000000E+00
2 6 0.000000E+00
2 7 0.000000E+00
2 8 0.000000E+00
3 1 0.000000E+00
3 2 0.000000E+00
3 3 7.853981E-01
3 4 0.000000E+00
3 5 0.000000E+00
3 6 0.000000E+00
3 7 1.963496E-01
3 8 0.000000E+00
4 1 0.000000E+00
4 2 0.000000E+00
4 3 0.000000E+00
4 4 -2.454370E-01
4 5 0.000000E+00
4 6 0.000000E+00
4 7 0.000000E+00
4 8 0.000000E+00
5 1 0.000000E+00
5 2 0.000000E+00
5 3 0.000000E+00
5 4 0.000000E+00
5 5 -2.454370E-01
5 6 0.000000E+00
5 7 0.000000E+00
5 8 -3.067962E-03
6 1 0.000000E+00
6 2 0.000000E+00
6 3 0.000000E+00
6 4 0.000000E+00
6 5 0.000000E+00
6 6 0.000000E+00
6 7 0.000000E+00
6 8 0.000000E+00
7 1 0.000000E+00
7 2 0.000000E+00
7 3 1.963496E-01
7 4 0.000000E+00
7 5 0.000000E+00
7 6 0.000000E+00
7 7 1.963496E-01
7 8 0.000000E+00
8 1 0.000000E+00
8 2 0.000000E+00
8 3 0.000000E+00
8 4 0.000000E+00
8 5 -3.067962E-03
8 6 0.000000E+00
8 7 0.000000E+00
8 8 3.067962E-03
62 changes: 62 additions & 0 deletions OWC/OrificeModel/hydroData/test17a.mmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
WAMIT -- Force Output File -- test17a.mmx 20-Mar-2025 11:49:06

Gravity: 9.80665 Length scale: 1.00000

NBODY = 1 IALTFRC = 2

WAMIT Ouputs for body N = 1 IALTFRCN = 2
Volumes (VOLX,VOLY,VOLZ): 0.589049 0.589049 0.589049
Center of Buoyancy (Xb,Yb,Zb): 0.000000 0.000000 -0.499999
Center of Gravity: (Xg,Yg,Zg) 0.000000 0.000000 0.000000

External force matrices:
I J MASS(I,J) DAMP(I,C) STIF(I,J)
1 1 5.890000E-01 0.000000E+00 0.000000E+00
1 2 0.000000E+00 0.000000E+00 0.000000E+00
1 3 0.000000E+00 0.000000E+00 0.000000E+00
1 4 0.000000E+00 0.000000E+00 0.000000E+00
1 5 0.000000E+00 0.000000E+00 0.000000E+00
1 6 0.000000E+00 0.000000E+00 0.000000E+00
1 7 0.000000E+00 0.000000E+00 0.000000E+00
2 1 0.000000E+00 0.000000E+00 0.000000E+00
2 2 5.890000E-01 0.000000E+00 0.000000E+00
2 3 0.000000E+00 0.000000E+00 0.000000E+00
2 4 0.000000E+00 0.000000E+00 0.000000E+00
2 5 0.000000E+00 0.000000E+00 0.000000E+00
2 6 0.000000E+00 0.000000E+00 0.000000E+00
2 7 0.000000E+00 0.000000E+00 0.000000E+00
3 1 0.000000E+00 0.000000E+00 0.000000E+00
3 2 0.000000E+00 0.000000E+00 0.000000E+00
3 3 5.890000E-01 0.000000E+00 0.000000E+00
3 4 0.000000E+00 0.000000E+00 0.000000E+00
3 5 0.000000E+00 0.000000E+00 0.000000E+00
3 6 0.000000E+00 0.000000E+00 0.000000E+00
3 7 0.000000E+00 0.000000E+00 0.000000E+00
4 1 0.000000E+00 0.000000E+00 0.000000E+00
4 2 0.000000E+00 0.000000E+00 0.000000E+00
4 3 0.000000E+00 0.000000E+00 0.000000E+00
4 4 1.470000E-01 0.000000E+00 0.000000E+00
4 5 0.000000E+00 0.000000E+00 0.000000E+00
4 6 0.000000E+00 0.000000E+00 0.000000E+00
4 7 0.000000E+00 0.000000E+00 0.000000E+00
5 1 0.000000E+00 0.000000E+00 0.000000E+00
5 2 0.000000E+00 0.000000E+00 0.000000E+00
5 3 0.000000E+00 0.000000E+00 0.000000E+00
5 4 0.000000E+00 0.000000E+00 0.000000E+00
5 5 1.470000E-01 0.000000E+00 0.000000E+00
5 6 0.000000E+00 0.000000E+00 0.000000E+00
5 7 0.000000E+00 0.000000E+00 0.000000E+00
6 1 0.000000E+00 0.000000E+00 0.000000E+00
6 2 0.000000E+00 0.000000E+00 0.000000E+00
6 3 0.000000E+00 0.000000E+00 0.000000E+00
6 4 0.000000E+00 0.000000E+00 0.000000E+00
6 5 0.000000E+00 0.000000E+00 0.000000E+00
6 6 1.470000E-01 0.000000E+00 0.000000E+00
6 7 0.000000E+00 0.000000E+00 0.000000E+00
7 1 0.000000E+00 0.000000E+00 0.000000E+00
7 2 0.000000E+00 0.000000E+00 0.000000E+00
7 3 0.000000E+00 0.000000E+00 0.000000E+00
7 4 0.000000E+00 0.000000E+00 0.000000E+00
7 5 0.000000E+00 0.000000E+00 0.000000E+00
7 6 0.000000E+00 0.000000E+00 0.000000E+00
7 7 0.000000E+00 0.000000E+00 0.000000E+00
Loading