-
Notifications
You must be signed in to change notification settings - Fork 184
Bug fix: responseClass reading the MoorDyn Lines.out file too early, resolves #811 #814
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
|
@akeeste, how did you diagnose this? Is there any risk that you will crash MoorDyn by forcing the library to close too early? Would it maybe be better to poll in a loop, i.e. while 1
if ~libisloaded('Lines')
break
end
endIn this way you wouldn't risk stopping MoorDyn prematurely. You could put a maximum wait time on it to avoid an infinite loop. |
|
@H0R5E I tried a similar loop to give MoorDyn time to finish writing output, but without success. I found that this is really a WEC-Sim order of operations issue, rather than a WEC-Sim/MoorDyn racing issue. No matter how much time is given, the Lines.out file is not complete until WEC-Sim calls the MoorDyn function This started occurring in the last couple of releases because we moved the WEC-Sim post-processing Previously our post-processing order of operations was something like:
But right now our post-processing order of operations is:
So our main post-processing is running before we actually close MoorDyn, which completes the Lines.out files. I had moved This way MoorDyn will always close properly if Simulink crashes or stop unexpectedly, but it will not try to use the DLL if Adam |
|
OK, Adam, makes sense. I am curious as to why the order of post-processing is as it is - would it not be sensible to post-process in the last step? Also, is there any way to build a test to catch this if it happens again? |
|
@H0R5E I agree, it would be better to run @kmruehl I think this should come into our larger discussion on the utility vs maintenance of Run From Simulink And on the test -- hopefully one of our MoorDyn application tests can catch this. I'll think on this |
|
Is this PR ready for a merge? I think we have a similar issue going on with wecSimPCT #782 |
|
@H0R5E are there any other changes you recommend here before we merge? |
|
No @akeeste, go ahead. |
This PR fixes the issue described in #811 and #674. The problem is that the WEC-Sim post-processing is being called before the MoorDyn
Lineslibrary closing function is being called. This updates the stop and close callbacks of the MoorDyn block, and adds a check topostProcessto ensure that MoorDyn is closed before the Lines.out file is read.Adam