Home

Awesome

WEC-Sim_Applications

main build status dev build status

This repository contains applications of the WEC-Sim code, including tutorials by the WEC-Sim team as well as user-shared examples.

To contribute an example follow these guidelines:

Testing Applications

Tests are provided for the applications using the MATLAB unit testing framework.

Individual test files are typically found at the same level as a hydroData directory, with a file name like Test<Something>.m. These test files may test multiple application cases that use the same hydrodynamic data.

For the latest release of WEC-Sim_Applications, or the main branch, it is assumed that the latest release or main branch of WEC-Sim is installed. For tests containing the name "MoorDyn", it is also necessary to install the MoorDyn module into WEC-Sim. The tests in the Desalination folder require the Simscape Fluids toolbox.

Assuming that the WEC-Sim_Applications source code is located at some path \path\to\WEC-Sim_Applications, then to test the Body-to-Body Interaction application cases, the following commands can be given in the MATLAB interface:

>> cd \path\to\WEC-Sim_Applications\Body-to-Body_Interactions
>> runtests("TestB2B.m")
...

Alternatively, the TestB2B.m file can be opened in the MATLAB editor and then the tests can be run by selecting the Run Tests action in the EDITOR ribbon.

A shortcut for running all the tests in the repository is provided at the root level with the wecSimAppTest.m function. This function can be run from the root directory, as follows:

>> cd \path\to\WEC-Sim_Applications
>> wecSimAppTest
...

Alternatively, the function can also be used to run tests in a particular directory. For instance, run the tests in the End_Stops directory as follows:

>> wecSimAppTest End_Stops
...