Skip to content

Add OSWEC PTO damping optimization application - #116

Draft
basaucier wants to merge 3 commits into
WEC-Sim:devfrom
basaucier:feature/oswec-damping-optimization
Draft

basaucier wants to merge 3 commits into
WEC-Sim:devfrom
basaucier:feature/oswec-damping-optimization

Conversation

@basaucier

@basaucier basaucier commented Aug 26, 2026 •

Copy link
Copy Markdown

Summary

This draft PR adds an OSWEC PTO damping optimization application workflow.

The application connects buoy-derived wave resource characterization to WEC-Sim MCR package in order to estimate an optimal constant passive PTO damping value for the OSWEC case.

@akeeste akeeste left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @basaucier! Some preliminary review comments included here. A few on some typical minor cleanup items and some on the workflow itself.

I recommend committing the various cluster results created in MHKiT for users. They should have the ipynb so that they can recreate results, but provide the precomputed clustered conditions as .mat files here ensures that this WEC-Sim workflow can be rerun easily without MHKiT.

Otherwise on the set-up files--these seem quite capable but first instinct is to pair them down a lot. They are quite long, which is mostly an issue for future understanding and maintenance by a broader team. Let's walk through the content in each and figure out what we need to keep

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove file in favor of those in the _Common_Input_Files_ directory

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove file in favor of those in the _Common_Input_Files_ directory

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove file in favor of those in the _Common_Input_Files_ directory

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove file in favor of those in the _Common_Input_Files_ directory

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove file in favor of those in the _Common_Input_Files_ directory

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest breaking up this notebook into a few section to make it easier to review, document, and rerun. Please also add a section like the last cell of PacWave notebook. This energy comparison between each set of clustered resource and that of the real conditions is what will guide the modeler on the number of clusters to use

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convert to a function to avoid requiring the clc and clear calls up front.
This workflow seems to run fine, but there are some changes we can make to increase the usability by the typical WEC-Sim user:

I suggest using WEC-Sim's built in batch capabilities ("MCR"). In this way, you can have one input file that takes in pto(1).damping value and a wave condition case file simu.mcrMatFile. Then calling wecSimMCR will run all wave conditions with that damping. That also allows you to break out the batch simulation for a single PTO damping into it's own function.

Then the top level workflow can either iterate through those batch cases using a grid search. Or use a function of the form: average_power = wec_sim_batch_run(pto_damping) with a more complex optimization method.

See one of the MHKiT WEC-Sim examples for how the wave condition file can be formatted to pull directly into WEC-Sim.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove plots or wrap in an if statement that checks whether this is a single simulation or a batch simulation (typically whether the variable 'mcr' is present or not)

Comment on lines +80 to +84
cache_folders = { ...
'slprj', ...
'work', ...
'codegen' ...
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will these folder allow the model to rerun more quickly? They should not affect results over batch runs to my knowledge

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see readmes in other applications for an example format. This information is good, there are just a few other fields that we typically add

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants