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
8 changes: 5 additions & 3 deletions .github/workflows/run-tests-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
exclude:
- os: ubuntu-latest
folder: Mooring
- os: ubuntu-latest
folder: OWC
- os: ubuntu-latest
folder: Paraview_Visualization
name: "${{ matrix.folder }} - ${{ matrix.os }} - ${{ matrix.release }}"
Expand All @@ -52,15 +54,15 @@ jobs:
ref: ${{ inputs.base_ref }}
path: './WEC-Sim'
- name: Check out MoorDyn
if: matrix.folder == 'Mooring' || matrix.folder == 'Paraview_Visualization'
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' || matrix.folder == 'Paraview_Visualization'
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
45 changes: 23 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,42 +56,43 @@ $ cat .gitignore
*.vtp
*.zip

# Other
.DS_Store
view_html.sh
*vis-temp*
folder.json
include.json

# MATLAB
**/output/
**/output_previous/
**/slprj/
*build_exception*

# Applications
**/mooring/*.out
!**/mooring/lines.txt
**/vtk/*
savedData*.mat
WECCCOMP/**/SS*.mat
WECCCOMP/**/SS*.fig
!WECCCOMP/WECCCOMP_Nonlinear_Model_Predictive/waveData/*.mat
Passive_Yaw/**/IrrYaw.mat
Passive_Yaw/**/figYawIrr.fig
yaw*.mat

# BEM
# WAMIT
*.1
*.3
*.3fk
*.3sc
*.4
*.h5
*.hst
*.p2f
*.pot

# Applications
**/mooring/*.out
!**/mooring/lines.txt
**/vtk/*
savedData*.mat
!/Generalized_Body_Modes/hydroData/WAMIT/*
!/Mean_Drift/WAMIT/inputFiles/*
!/Mean_Drift/WAMIT/outputFiles/*
!/OWC/OrificeModel/hydroData/*.h5

# Other
.DS_Store
view_html.sh
*vis-temp*
folder.json
include.json
MOST/**/**/*.mat
MOST/**/**/**/*.mat
WECCCOMP/**/SS*.mat
WECCCOMP/**/SS*.fig
!WECCCOMP/WECCCOMP_Nonlinear_Model_Predictive/waveData/*.mat
Passive_Yaw/**/IrrYaw.mat
Passive_Yaw/**/figYawIrr.fig
yaw*.mat
!MOST/hydroData/VolturnUS15MW_nemoh/Results/QTF/*.dat
9 changes: 7 additions & 2 deletions Body-to-Body_Interactions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

**Author:** Kelley Ruehl

**Version:** WEC-Sim v2.2
**Original Version:** WEC-Sim v2.2

**Geometry:** RM3

Example using [Body-to-Body (B2B)](http://wec-sim.github.io/WEC-Sim/advanced_features.html#body-to-body-interactions) to run WEC-Sim for the [RM3](http://wec-sim.github.io/WEC-Sim/tutorials.html#two-body-point-absorber-rm3) geometry. The scripts run and plot the RM3 model with B2B on/off and with Regular/RegularCIC. Execute the `runB2B.m` script to run this case.
**Description**

Example using [Body-to-Body (B2B)](https://wec-sim.github.io/WEC-Sim/main/user/advanced_features.html#body-to-body-interactions) to run WEC-Sim for the RM3 geometry. The scripts run and plot the RM3 model with B2B on/off and with Regular/RegularCIC. Execute the `runB2B.m` script to run this case.

**Relevant Citation(s)**

Ruehl, K.; Michelen, C.; Yu, Y.; Lawson, M. (2016). Update on WEC-Sim Validation Testing and Code Development. Paper presented at 4th Annual Marine Energy Technology Symposium (METS), Washington D.C., USA.
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
10 changes: 6 additions & 4 deletions Cable/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

**Author:** Dominic Forbush

**Version:** WEC-Sim v4.4

**Geometry:** MBARI-WEC, and open-source WEC from Monterey Bay Aquarium Research Institute.

**Dependency:** N/A
**Original Version:** WEC-Sim v4.4

**Note:** More WEC information can be found: https://link.springer.com/article/10.1007/s40722-021-00197-9
**Description**

Example using WEC-Sim to simulate a [Cable](http://wec-sim.github.io/WEC-Sim/advanced_features.html) connecting two rigid bodies for the MBARI geometry.

**Relevant Citation(s)**

Hamilton, A., Cazenave, F., Forbush, D. et al. The MBARI-WEC: a power source for ocean sensing. J. Ocean Eng. Mar. Energy 7, 189–200 (2021). https://doi.org/10.1007/s40722-021-00197-9
21 changes: 10 additions & 11 deletions Controls/Declutching/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# WEC-Sim Controls Examples
# Declutching Controller

**Author:** Jeff Grasberger (Sandia)
**Author:** Jeff Grasberger

**WEC-Sim Version:** v5.0 (or newer)
**Geometry:** Sphere

**Matlab Version:** 2020b (or newer)
**Original Version:** v5.0

**WEC-Sim Model**
Numerical model for a semi-submerged sphere (diameter = 10 m) with a declutching controller. "wecSim" can be typed into
the command window to run the example with the default setup. "optimalTimeCalc.m" is used to calculate the
optimal declutching time. The "mcrBuildTimes.m" script can be run to set up multiple conditions runs, then
"wecSimMCR" can be typed into the command window to run the different cases with varying declutching times.
**Description**

**Questions?**
* Post all WEC-Sim modeling questions to the [WEC-Sim online forum](https://github.com/WEC-Sim/WEC-Sim/issues).
Numerical model for a semi-submerged sphere (diameter = 10 m) with a declutching controller. `wecSim` can be typed into the command window to run the example with the default setup. `optimalTimeCalc.m` is used to calculate the optimal declutching time. The `mcrBuildTimes.m` script can be run to set up multiple conditions runs, then `wecSimMCR` can be typed into the command window to run the different cases with varying declutching times.

**Relevant Citation(s)**

Leon, J.; Grasberger, J.; Forbush, D.; Sirigu, M.; Ancellin, M.; Tom, N.; Keester, A.; Ruehl, K.; Ogden, D.; Husain, S. (2024). Advanced Features and Recent Developments in the WEC-Sim Open-Source Design Tool . Paper presented at Pan American Marine Energy Conference (PAMEC 2024), Barranquilla, Colombia.
21 changes: 10 additions & 11 deletions Controls/Latching/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# WEC-Sim Controls Examples
# Latching Controller

**Author:** Jeff Grasberger (Sandia)
**Author:** Jeff Grasberger

**WEC-Sim Version:** v5.0 (or newer)
**Geometry:** Sphere

**Matlab Version:** 2020b (or newer)
**Original Version:** v5.0

**WEC-Sim Model**
Numerical model for a semi-submerged sphere (diameter = 10 m) with a latching controller. "wecSim" can be typed into
the command window to run the example with the default setup. "optimalTimeCalc.m" is used to calculate the
optimal latching time. The "mcrBuildTimes.m" script can be run to set up multiple conditions runs, then
"wecSimMCR" can be typed into the command window to run the different cases with varying latching times.
**Description**

**Questions?**
* Post all WEC-Sim modeling questions to the [WEC-Sim online forum](https://github.com/WEC-Sim/WEC-Sim/issues).
Numerical model for a semi-submerged sphere (diameter = 10 m) with a latching controller. `wecSim` can be typed into the command window to run the example with the default setup. `optimalTimeCalc.m` is used to calculate the optimal latching time. The `mcrBuildTimes.m` script can be run to set up multiple conditions runs, then `wecSimMCR` can be typed into the command window to run the different cases with varying latching times.

**Relevant Citation(s)**

Leon, J.; Grasberger, J.; Forbush, D.; Sirigu, M.; Ancellin, M.; Tom, N.; Keester, A.; Ruehl, K.; Ogden, D.; Husain, S. (2024). Advanced Features and Recent Developments in the WEC-Sim Open-Source Design Tool . Paper presented at Pan American Marine Energy Conference (PAMEC 2024), Barranquilla, Colombia.
40 changes: 18 additions & 22 deletions Controls/MPC/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
# WEC-Sim Controls Examples
# Model Predictive Controller (MPC)

**Author:** Jeff Grasberger (Sandia)
**Author:** Ratanak So and Jeff Grasberger

**WEC-Sim Version:** v5.0 (or newer)
**Geometry:** Sphere

**Matlab Version:** 2020b (or newer)
**Original Version:** v5.0

**Dependencies:**

Optimization Toolbox --> for quadprog command
System Identification Toolbox --> for ssdata, tfest, tfdata commands
Statistics and Machine Learning Toolbox --> for regress command
Control System Toolbox --> for frd command
Symbolic Math Toolbox --> for subs command

**Description:**
Numerical model for a semi-submerged sphere (diameter = 10 m) with a model predictive controller (MPC).
"wecSim" can be typed into the command window to run the example with the default setup.
"plotFreqDep.m" solves for and plots the frequency dependent coefficients,
which are stored in "coeff.mat". "setupMPC.m" sets the controller up using "makePlantModel.m"
and "makePredictiveModel.m" and is called by the input file when "wecSim"
is run from the command window. "fexcPrediction.m" and "mpcFcn.m" predict the excitation forces
and solve the quadratic programming problem, respectively, and are both called by "sphereMPC.slx"
during the simulation. The model predictive controller parameters can be changed in the input file.

**Questions?**
* Post all WEC-Sim modeling questions to the [WEC-Sim online forum](https://github.com/WEC-Sim/WEC-Sim/issues).
* Control System Toolbox
* Optimization Toolbox
* Statistics and Machine Learning Toolbox

**Description**

Numerical model for a semi-submerged sphere (diameter = 10 m) with a model predictive controller (MPC). `wecSim` can be typed into the command window to run the example with the default setup. `plotFreqDep.m` solves for and plots the frequency dependent coefficients, which are stored in `coeff.mat`. `setupMPC.m` sets the controller up using `makePlantModel.m` and `makePredictiveModel.m` and is called by the input file when `wecSim` is run from the command window. `fexcPrediction.m` and `mpcFcn.m` predict the excitation forces and solve the quadratic programming problem, respectively, and are both called by `sphereMPC.slx` during the simulation. The model predictive controller parameters can be changed in the input file.

**Relevant Citation(s)**

Leon, J.; Grasberger, J.; Forbush, D.; Sirigu, M.; Ancellin, M.; Tom, N.; Keester, A.; Ruehl, K.; Ogden, D.; Husain, S. (2024). Advanced Features and Recent Developments in the WEC-Sim Open-Source Design Tool . Paper presented at Pan American Marine Energy Conference (PAMEC 2024), Barranquilla, Colombia.

R. So, M. Starrett, K. Ruehl and T. K. A. Brekken, "Development of control-Sim: Control strategies for power take-off integrated wave energy converter," 2017 IEEE Power & Energy Society General Meeting, Chicago, IL, USA, 2017, pp. 1-5, doi: 10.1109/PESGM.2017.8274314. keywords: {Force;Damping;Cost function;Springs;Sea state;Laboratories;wave energy;optimization;power take off;model predictive control},

Binary file modified Controls/MPC/sphereMPC.slx
Binary file not shown.
22 changes: 10 additions & 12 deletions Controls/Passive (P)/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# WEC-Sim Controls Examples
# Passive Controller

**Author:** Jeff Grasberger (Sandia)
**Author:** Jeff Grasberger

**WEC-Sim Version:** v5.0 (or newer)
**Geometry:** Sphere

**Matlab Version:** 2020b (or newer)
**Original Version:** v5.0

**WEC-Sim Model**
Numerical model for a semi-submerged sphere (diameter = 10 m) with a passive controller.
"wecSim" can be typed into the command window to run the example with the default setup. "optimalGainCalc.m"
is used to calculate the optimal proportional gain. The "mcrBuildGains.m" script can be run to set up
multiple conditions runs, then "wecSimMCR" can be typed into the command window to run the different
cases with varying proportional gain values.
**Description**

**Questions?**
* Post all WEC-Sim modeling questions to the [WEC-Sim online forum](https://github.com/WEC-Sim/WEC-Sim/issues).
Numerical model for a semi-submerged sphere (diameter = 10 m) with a passive controller. `wecSim` can be typed into the command window to run the example with the default setup. `optimalGainCalc.m` is used to calculate the optimal proportional gain. The `mcrBuildGains.m` script can be run to set up multiple conditions runs, then `wecSimMCR` can be typed into the command window to run the different cases with varying proportional gain values.

**Relevant Citation(s)**

Leon, J.; Grasberger, J.; Forbush, D.; Sirigu, M.; Ancellin, M.; Tom, N.; Keester, A.; Ruehl, K.; Ogden, D.; Husain, S. (2024). Advanced Features and Recent Developments in the WEC-Sim Open-Source Design Tool . Paper presented at Pan American Marine Energy Conference (PAMEC 2024), Barranquilla, Colombia.
14 changes: 14 additions & 0 deletions Controls/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Controls

**Author:** Jeff Grasberger and Ratanak So

**Description**

Examples using WEC-Sim with controls

* Declutching - control with optimal declutching time
* Latching - control with optimal latching time
* MPC - model predictive controller (MPC)
* Passive (P) - control with optimal proportional gain
* Reactive (PI) - control with optimal proportional and integral gains
* Reactive with PTO - reactive controller and simple direct drive power take-off (PTO)
22 changes: 10 additions & 12 deletions Controls/Reactive (PI)/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# WEC-Sim Controls Examples
# Reactive Controller

**Author:** Jeff Grasberger (Sandia)
**Author:** Jeff Grasberger

**WEC-Sim Version:** v5.0 (or newer)
**Geometry:** Sphere

**Matlab Version:** 2020b (or newer)
**Original Version:** v5.0

**WEC-Sim Model**
Numerical model for a semi-submerged sphere (diameter = 10 m) with a reactive controller.
"wecSim" can be typed into the command window to run the example with the default setup. "optimalGainCalc.m"
is used to calculate the optimal proportional and integral gains. The "mcrBuildGains.m" script can be run to set up
multiple conditions runs, then "wecSimMCR" can be typed into the command window to run the different
cases with varying proportional and integral gain values.
**Description**

**Questions?**
* Post all WEC-Sim modeling questions to the [WEC-Sim online forum](https://github.com/WEC-Sim/WEC-Sim/issues).
Numerical model for a semi-submerged sphere (diameter = 10 m) with a reactive controller. `wecSim` can be typed into the command window to run the example with the default setup. `optimalGainCalc.m` is used to calculate the optimal proportional and integral gains. The `mcrBuildGains.m` script can be run to set up multiple conditions runs, then `wecSimMCR` can be typed into the command window to run the different cases with varying proportional and integral gain values.

**Relevant Citation(s)**

Leon, J.; Grasberger, J.; Forbush, D.; Sirigu, M.; Ancellin, M.; Tom, N.; Keester, A.; Ruehl, K.; Ogden, D.; Husain, S. (2024). Advanced Features and Recent Developments in the WEC-Sim Open-Source Design Tool . Paper presented at Pan American Marine Energy Conference (PAMEC 2024), Barranquilla, Colombia.
24 changes: 10 additions & 14 deletions Controls/ReactiveWithPTO/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
# WEC-Sim Controls Examples
# Reactive Controller with Direct Drive Power Take-Off

**Author:** Jeff Grasberger (Sandia)
**Author:** Jeff Grasberger

**WEC-Sim Version:** v5.0 (or newer)
**Geometry:** Sphere

**Matlab Version:** 2020b (or newer)
**Original Version:** v5.0

**WEC-Sim Model**
Numerical model for a semi-submerged sphere (diameter = 10 m) with a reactive controller and
simple direct drive power take-off. This example demonstrates the different controller gains required
for electrical power maximization when compared to mechanical power maximization. "wecSim" can be
typed into the command window to run the example with the default setup. The
"mcrBuildGains.m" script can be run to set up multiple conditions runs, then "wecSimMCR" can be
typed into the command window to run the different cases with varying proportional and integral
gain values.
**Description**

**Questions?**
* Post all WEC-Sim modeling questions to the [WEC-Sim online forum](https://github.com/WEC-Sim/WEC-Sim/issues).
Numerical model for a semi-submerged sphere (diameter = 10 m) with a reactive controller and simple direct drive power take-off. This example demonstrates the different controller gains required for electrical power maximization when compared to mechanical power maximization. `wecSim` can be typed into the command window to run the example with the default setup. The `mcrBuildGains.m` script can be run to set up multiple conditions runs, then `wecSimMCR` can be typed into the command window to run the different cases with varying proportional and integral gain values.

**Relevant Citation(s)**

Leon, J.; Grasberger, J.; Forbush, D.; Sirigu, M.; Ancellin, M.; Tom, N.; Keester, A.; Ruehl, K.; Ogden, D.; Husain, S. (2024). Advanced Features and Recent Developments in the WEC-Sim Open-Source Design Tool . Paper presented at Pan American Marine Energy Conference (PAMEC 2024), Barranquilla, Colombia.
Binary file modified Desalination/OSWEC_RO.slx
Binary file not shown.
Loading
Loading