openfast icon indicating copy to clipboard operation
openfast copied to clipboard

Fairlead Tension Output

Open WS991106 opened this issue 1 year ago • 2 comments

Dear @jjonkman ,

Running the simulation will show the tension in the command line, but I would like to know how to output the Fairlead tension out with a scope inside Simulink, because I don't find a string about the tension in OutlistParameters.xlsx. I'm trying to output it out, but it reports an error. 1716292427006

1716292059404

WS991106 avatar May 21 '24 11:05 WS991106

Dear @WS991106,

FairTen1 is an output of MoorDyn if you've selected it in the OUTPUTS section of the MoorDyn input file.

The MoorDyn outputs are not documented in the OutListParameters.xlsx spreadsheet, but are documented in the online MoorDyn documentation: https://moordyn.readthedocs.io/en/latest/inputs.html#the-v2-input-file.

Best regards,

jjonkman avatar May 21 '24 14:05 jjonkman

Dear @jjonkman ,

If I want to output the Fairlead tension inside simulink to a scope, do I need to modify the source code? If I need to modify it, what part of it should I modify? Is there any information to introduce it?

Best regards,

WS991106 avatar May 22 '24 05:05 WS991106

Dear @WS991106,

You don't need to change the source code for that. You should be able to extract FairTen1 (or any other OpenFAST output) from OutData via strmatch() and then send that signal to a scope.

Best regards,

jjonkman avatar May 22 '24 20:05 jjonkman

Dear @jjonkman, 1716785448749

I tried what you said, but I still get the error as below, I don't know what the problem is.

WS991106 avatar May 27 '24 04:05 WS991106

Dear @WS991106,

I'm not sure what this error says in English. Regardless, is FairTen1 included in the OutData array?

Best regards,

jjonkman avatar May 27 '24 08:05 jjonkman

Dear @jjonkman ,

Thank you very much for your help, my problem has been solved by changing the string all caps to FAIRTEN1 and it won't report an error!

Best regards,

WS991106 avatar Jun 04 '24 05:06 WS991106

@WS991106 -- I'm glad you solved the problem.

@RyanDavies19 @andrew-platt -- Sounds like a simple issue to fix in MoorDyn by making use a call to Conv2UC().

Best regards,

jjonkman avatar Jun 04 '24 07:06 jjonkman

@jjonkman @andrew-platt I added a comment to the documentation to address this. For now I think its best to leave it as is, so that users who have scripts set up already don't have to make changes

RyanDavies19 avatar Jun 05 '24 18:06 RyanDavies19

@RyanDavies19 -- I'm not sure what scripts you are referring to, but using Conv2UC() would simply open up the possibility for users to select MoorDyn output FAIRTEN1 using any combination of upper or lower case letters, e.g., FairTen1. This is how most other output parameters of other OpenFAST modules work and provides user some flexibility.

jjonkman avatar Jun 05 '24 18:06 jjonkman

@jjonkman from the MoorDyn input file side, the output channels are not case sensitive. Users could give fairten1 and it would be correctly read. MoorDyn uses Conv2UC() before processing the output channel name and assigning it to the output parameter structure as all caps, so that the output file has headers in caps.

I discussed this with Matt and the idea is that any users who have set up their own scripts to process moordyn output files will have done so based on the all caps method, so in order to not break that convention its better to leave it as is. My understanding of the OutList variable is that it contains a list of all the output channels as written by MoorDyn, so I'm not sure if there is a way to allow for searching while still having the MoorDyn output file headers be caps.

RyanDavies19 avatar Jun 05 '24 18:06 RyanDavies19

I'm not sure we're all talking about the same issue here. I don't know how MoorDyn deals with the case of channel output names, so I won't comment on that. However, the issue here is likely that the output channel from MoorDyn (possibly using whatever case the user entered in the input file) does not have the same case as the Simulink block is expecting. The best fix is to change the Simulink block to ignore case:

The Simulink model should change u(strmatch('FairTen1',OutList)) to u(strcmpi('FairTen1',OutList)). Matlab documentation also says strmatch() should not be used anymore, so this fixes both issues.

bjonkman avatar Jun 05 '24 20:06 bjonkman

Thanks for clarifying, @bjonkman. That makes sense. I'll go ahead and close this issue.

jjonkman avatar Jun 05 '24 21:06 jjonkman

Updated the Simulink example cases with PR #2254.

andrew-platt avatar Jun 05 '24 22:06 andrew-platt