Skip to content

Conversation

@dav-og
Copy link
Contributor

@dav-og dav-og commented Feb 23, 2022

hat tip to @crobarcro for originally implementing this improvement in RenewNet

trapz function used in B(w) cosine transformation now applied to whole arrays rather than iteratively within the k'th loop (ie over IRF time)

initial tests with RM3 show 60% reduction in RIRF computation time

hat tip to @crobarcro for originally implementing this improvement in RenewNet

trapz function used in B(w) cosine transformation now applied to whole arrays rather than iteratively within the k'th loop (ie over IRF time)

initial tests with RM3 show 60% reduction in RIRF computation time
@dav-og dav-og requested a review from akeeste February 23, 2022 12:36
Copy link
Contributor

@akeeste akeeste left a comment

Choose a reason for hiding this comment

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

@dav-og

This is a nice improvement to IRF function and speeds up BEMIO a lot! I confirmed that the IRF is identical to the previous function, and in my speed tests with the WAMIT sphere saw a decrease in run time of ~70-80%.

I looked to see if there was a way to remove the DOF for loops as well, but it becomes too complicated. There is a lot of reshaping and permuting necessary to make that work and in a preliminary set-up did not improve the runtime further.

I also improved the added mass calculation by changing the frequency loop (lines 59-61) to a single line: ra_Ainf_temp = ra_A' + (1./hydro.w).*trapz(t,ra_K.*sin(hydro.w.*t.'));. This took off another 5% of the runtime for non-WAMIT codes.

Let's update the excitation IRF too in this PR

@akeeste akeeste added the BEM/BEMIO related to BEMIO or BEM hydro data label Feb 24, 2022
@kmruehl kmruehl added the Feature new feature request label Feb 24, 2022
testing with RM3 shows 80% reduction in excitation IRF computation times
h/t @reos-rcrozier
Copy link
Contributor

@akeeste akeeste left a comment

Choose a reason for hiding this comment

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

@dav-og I checked the new excitation IRF function, it is loads faster too (7-8x). There is one accuracy issue, excitationIRF line 39 needs dot multiplication, see my in line comment. My other two are just minor clean up. Looks great! Let's merge once these last few items are updated.

Copy link
Contributor Author

@dav-og dav-og left a comment

Choose a reason for hiding this comment

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

cheers Adam!

@dav-og dav-og merged commit b0f071c into WEC-Sim:dev Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BEM/BEMIO related to BEMIO or BEM hydro data Feature new feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants