Skip to content

Conversation

@akeeste
Copy link
Contributor

@akeeste akeeste commented Feb 6, 2025

This PR adds

  • an alternate convolution integral calculation for the radiation force and user defined excitation force when variable hydrodynamics are used. These alternate calculations use an IRF surface, created in pre-processing, for each force. The new functions do not replace the old ones in simulink because they are ~2x slower in the radiation case and significantly slower in the user defined excitation case. See Improve variable hydro radiation force calculation #1394
    • refactor Convolutionintegral_interp.m
    • create convolutionIntegralSurface.m
    • test to compare convolutionIntegralSurface.m to ConvolutionIntegral_interp.m
    • create a radiation IRF surface in the body class when variable hydro is used
    • create an excitation IRF surface in the body class when variable hydro is used
    • update library with variant subsystems for the alternate radiation and excitation IRFs
  • GoTo flags for different signals of interest in variable hydro (and controls): excitation force, total force. Also resolves the need for broken library links in most WEC-Sim applications
  • relocates the mass and inertia utilized during the simulation to body.hydroForce. This prevents user confusion around the mass definition, especially when simulations are stopped prematurely, and will enable future work to define a variable mass

Closes issue #1394.

@akeeste akeeste changed the title Irf surface IRF surfaces for variable hydro Feb 6, 2025
@akeeste akeeste linked an issue Feb 6, 2025 that may be closed by this pull request
@akeeste akeeste added Body Class Body Class (bodyClass.m) Library updates to the WEC-Sim Library labels Feb 6, 2025
@akeeste
Copy link
Contributor Author

akeeste commented Feb 19, 2025

I just need to test this functionality over a variety of cases (variable hydro on/off x radiation IRF and excitation IRF calculations) and it is ready for review

@akeeste akeeste changed the title IRF surfaces for variable hydro Variable hydro improvements Feb 20, 2025
@akeeste
Copy link
Contributor Author

akeeste commented Feb 20, 2025

The most recent commit changed excitationConvolutionIntegralSurface to use a persistent amplitude which in CML testing was actually ~1.5x faster than loading in the entire wave amplitude time history (since its known ahead of time) and indexing the relevant portion

@akeeste akeeste marked this pull request as ready for review February 20, 2025 19:42
@akeeste
Copy link
Contributor Author

akeeste commented Feb 20, 2025

This PR is ready for review. Merging should wait until #1401 is merged and those library changes are brought in

@akeeste
Copy link
Contributor Author

akeeste commented Feb 26, 2025

I created a surface an alternate calculation for the excitation IRF without thinking clearly enough. Unlike the radiation IRF, the excitation IRF is acausal. Since the varying state is generally not known ahead of time, the IRF coefficients are unknown and we can't create an IRF surface that is used during the simulation. This only makes variable hydro incompatible with the the elevationImport wave with user-defined wave excitation.

I'll remove the library and bodyClass changes I made for the excitation IRF surface.

@akeeste akeeste marked this pull request as draft February 27, 2025 15:43
@akeeste
Copy link
Contributor Author

akeeste commented Mar 4, 2025

I removed the excitation IRF and fixed a couple bugs. Once I update the documentation re this feature then the PR will be ready for review

@MShabara MShabara self-assigned this Mar 12, 2025
@akeeste akeeste marked this pull request as ready for review March 12, 2025 21:32
@akeeste
Copy link
Contributor Author

akeeste commented Mar 12, 2025

@MShabara This PR is ready for review. I did finish moving the adjusted mass for use during simulation to body.hydroForce. I updated the summary up top to reflect that.

@jtgrasb jtgrasb self-requested a review March 18, 2025 19:04
@jtgrasb
Copy link
Contributor

jtgrasb commented Mar 18, 2025

Reviewed this PR and everything looks good. I also ran the applications case and new cicTest case to ensure they are working as expected. There's a lot here so a separate review from @MShabara before merging will be good to double check.

@akeeste
Copy link
Contributor Author

akeeste commented Apr 30, 2025

@MShabara between #1461 and #1411 I suggest we just merge whatever is ready first and go from there. The library change in #1461 is very small and easy to recreate in either case. I intend to work on this today before I am out

@akeeste
Copy link
Contributor Author

akeeste commented Apr 30, 2025

@jtgrasb okay the merge actually went pretty smoothly using MATLAB's merge tool. Once the tests pass we can merge this

@MShabara I actually just added the QTFs=2 as an option to both the rigid and flex body masks in the latest commit here. As it's all going into dev, it shouldn't make a difference

@akeeste
Copy link
Contributor Author

akeeste commented Apr 30, 2025

Tests pass and the implementation works on a test case that uses an IRF surface. Merging! Sorry for the delay, I could've gotten this merge done awhile ago but I assumed it would be harder than it was

@akeeste akeeste merged commit 7ded496 into WEC-Sim:dev Apr 30, 2025
10 checks passed
@akeeste akeeste deleted the irf_surface branch April 30, 2025 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Body Class Body Class (bodyClass.m) Library updates to the WEC-Sim Library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve variable hydro radiation force calculation

3 participants