-
Notifications
You must be signed in to change notification settings - Fork 184
Converting WEC-Sim Library to referenced subsystems #688
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
|
I got an error when running the GBM case with the library. Error using wecSim (line 44) It seems that the 'wecSimStopFunction.m' does not exist in dev. --Yi-Hsiang |
|
@kmruehl Also, I completed a preliminary study on how the referenced subsystems affect the accelerator mode speed. I ran 30 OSWEC cases total (5 for each of the 3 modes in dev and this PR). The referenced subsystems seem to slow things down by approximately 20%. Maybe it is worthwhile to switch back to the non-backwards compatible change using the Open Callback? Can we use the WECSim_Lib.slx/Library Properties/Forwarding Table to maintain backwards compatibility? It looks like this table has been used for changes in the past. |
@yuyihsiang this issue should be resolved with 29f2af6 can you try GBM again? It is fine now. |
@akeeste I've also been trying to debug the referenced subsystems issues in 2020a with no luck. It looks like there is a bug that was resolved in 2020b. The referenced subsystem feature was added in 2019b but not fully functional until 2020b. |
Good to know, thanks for looking into this.
I'll convert these files from referenced subsystems to sub-libraries with a forwarding table:
But the sub-libraries did not fully resolve the library issues because they cannot be used for the linked library blocks between Rigid Bodies (Hydro, Non-Hydro and Drag) and Flex body:
I think the solution will have to be a combination of sub-libraries and referenced libraries, which hopefully will not reduce speed by 20%, but TBD |
|
@akeeste and @yuyihsiang this is ready for another review. Also, all tests are passing, even R2020a: https://github.com/WEC-Sim/WEC-Sim/pull/688/checks |
|
WEC-Sim tests are passing, but the WEC-Sim_Applications B2B tests fail Failed to evaluate mask initialization commands.
Error using wecSim (line 44)
Block 'RM3/Spar//Plate/Hydrodynamic Body/B2B Subsystem/B2B Subsystem/B2B/CrossCoupling'
is inside a Subsystem Reference block 'RM3/Spar//Plate/Hydrodynamic Body/B2B Subsystem'.
Incorrect to modify contents of a Subsystem Reference block using callback code.refer to forum discussion about this issue. |
akeeste
left a comment
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.
@kmruehl I think this is a great improvement to our workflow and will be very helpful in merging many library PRs at once. I'm glad you found a way to make it backwards compatible; that was my main concern with the previous method.
My only suggestion is to add a few more Referenced subsystems for items that can be linked together:
- Create
StructureorMotion Sensorsubsystem to replace the following:WECSim_Lib_Body/Rigid Body/Hydrodynamic Body/StructureWECSim_Lib_Body/Rigid Body/Non-Hydro Body/StructureWECSim_Lib_Body/Flex Body/Structure
- Create
Wave Diffraction and Excitation Force Calculationsubsystem to replace the following:WECSim_Lib_Body/Rigid Body/Hydrodynamic Body/Wave Diffraction and Excitation Force CalculationWECSim_Lib_Body/Flex Body/Wave Diffraction and Excitation Force Calculation
- Add
Net_Buoyancy_Forcesubsystem to replace:WECSim_Lib_Body/Flex Body/Hydrostatic Restoring Force Calculation/Hydrostatic Restoring Force Calculation/Linear and Nonlinear Restoring Force Variant Subsystem/Linear Hydrostatic Restoring Force /Net Buoyancy Force
I think these three items will cover any old links and prevent code duplication in the library.
|
This PR is partially covered by #712 to include sub-libraries for the following blocks:
|
|
This PR is partially covered by #714 to include sub-library for the following block:
|
584e126 to
ee02bb5
Compare
This PR builds on #667 with a different approach using referenced subsystems.
Updates include:
To Do: