-
Notifications
You must be signed in to change notification settings - Fork 184
Implement an FIR filter to calculate radiation forces #1071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @salhus!
There's a couple remaining items to fine tune this capability:
- Update Line 3 in the
FIR Filter Matrixmask to include body-to-body interactions. You might need to usebody.totalinstead oflength(body)because the highest level body block already definesbodyasbody(1),body(2), etc - Add a short line of documentation in the comment at
WECSim_Lib_Body_Elements/Rigid Body/Hydrodynamic Body/Wave Radiation Forces Calculation/SS CI and Constant-Damping-CoeVariant Subsystemto state what flag will turn on the FIR option, e.g. "If another wave type and simu.FIR == 1, use the FIR filter calculation" - Add advanced feature documentation
- Add a WEC-Sim Application that compares the various radiation damping calculations. This will ensure this functionality is tested and would be a nice way to highlight the differences to users.
| @@ -1,25 +1,25 @@ | |||
| %Example of user input MATLAB file for post processing | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert to original version upon completion
| @@ -1,20 +1,21 @@ | |||
| %% Simulation Data | |||
| simu = simulationClass(); % Initialize Simulation Class | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert to original version upon completion
|
Hi Adam @akeeste , In terms of development, I think this is done. The tests are passing. cheers, |
|
Hi @salhus Thanks for those updates. I added a few more changes that I described above into PR salhus/WEC-Sim#11. Please review and merge that PR into your branch. I updated the rate transition blocks to specify use of
Note that non-hydro bodies can't be used with B2B if they're included in the h5 file, but that is a larger issue already present in WEC-Sim. I also don't think this will work with B2B and GBM, but that is a niche case that can't be tested easily and I'm unsure if GBM+B2B is currently supported or not. |
Updates for FIR filter
|
@akeeste So just to confirm with you the work is done, and I am moving on the documentation now. Cheers, |
|
@salhus Thanks for developing this feature as it provides an alternative to the primary CIC option and highlights how we can leverage automatic generation to auto build. After completing my initial review, I believe you have responded to @akeeste requests expect for documentation and developing an applications to compare the three different approaches to the convolution integral calculation. We also should be adding a test case to ensure this feature is not broken in the future. I do need to run the WEC-Sim Applications Test with this branch to see if there are any further bugs to fix. In terms of next steps the priority is documentation. Secondary is the applications and test case which can be added as a project board item and addressed in the next fiscal year. I'll be reviewing the N Waves PR next and if I have time I will try to assist with the applications and test case development. |
|
@nathanmtom Thanks for reviewing the PR. I think I should be able to wrap-up the documentation by Monday. I have a PR on the applications repository for N-Wave PR and will add another PR that corresponds to this FIR PR tonight. |
docs/user/advanced_features.rst
Outdated
| +------------------------------------------------+-------------------------------------------+ | ||
| | *Radiation Force Calculation Approach* | *Time (s)* | | ||
| +------------------------------------------------+-------------------------------------------+ | ||
| | No Convolution | 3.699 s | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@salhus Minor comment: can we call No Convolution "Constant Coefficients" as this is what the block is called in the Wave Radiation Forces Calculation Block.
Second when I run the simulation I get slightly different times, so I wanted to request we report normalized times. So No Convolution would be 1 and all other times would be referenced to that. I think there will be confusion if these numbers are not reproduced by users unfortunately there is a lot of factors impacting the final values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the docs.
- done
docs/user/advanced_features.rst
Outdated
| .. _user-advanced-features-time-step: | ||
| FIR Filters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@salhus Minor comment can we spell out FIR and say "Finite Impulse Response (FIR)". Also on line 218 below write out fully the first time and then use FIR for the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
- done.
|
Thanks for updating the documentation @salhus. I have some minor requests on the documentation that I would appreciate you incorporating. Also if you can respond to @akeeste comments about reverting two files back to the original we should be ready for merging by end of this week. I'll respond with feedback on the applications case in that PR. |
editorial changes
|
@nathanmtom , |
|
@nathanmtom |

This follows from #585
This PR implements an FIR filter to calculate the radiation forces. The user needs to set a flag simu.FIR = 1 to enable this implementation.
This PR uses automatic code generation to FIR filter blocks for each mode (both diagonal and off-diagonal terms) and works with body-2-body interactions enabled.
I have modified a line of code in the RM3 example that has the simu.FIR flag for easier review.
The PR still needs documentation.