Unhandled exception in libdiscon.dll when debugging FAST

Hi,
I am trying to debug “IEA-15-240-RWT-UMaineSemi” model in FAST project in Visual Studio [Windows 10, Intel One API compiler]. In Debug mode at the first time step, I am getting an unhandled exception from the “CALL DLL_Legacy_Subroutine”. This occurs in debug mode only.

c

Can you please suggest how to overcome this error ?

Thank you,
Ashok

Ashok,

It’s likely that there’s something wrong inside the controller that’s resulting in a division by zero. I’m pretty sure that the Debug build has floating point exceptions enabled; whereas the Release build does not. Which controller are you using?

Thanks,
Derek

Thanks for your reply @Derek.Slaughter .
I am using the Rosco controller that ships with the example. libdiscon.dll.
I have not changed anything manually.

Hi,

It’s hard to know what the issue is from the information provided. Have you compiled ROSCO in debug mode, too?

Are you running a standard case, where we can reproduce your issue outside of this debug configuration?

We try to be pretty careful about potential divide-by-zero errors, so it’s possible the message is misleading.

Best, Dan

The avcMSG should have a helpful error message in it. What is the value of aviFAIL?

The error seems to be on that line 255. Is it possible that this compiler/debug set up is trying to divide that aviFAIL by 0? What if you replace \= with .ne.?

Hi @Daniel.Zalkind ,
I am running the example from here [IEA-15-240-RWT/OpenFAST/IEA-15-240-RWT-UMaineSemi at master · IEAWindTask37/IEA-15-240-RWT · GitHub].
I have downloaded the corresponding .dll file from rosco [Tags · NREL/ROSCO · GitHub].

After building in Debug mode ROSCO 2.9.1 [released Apr 11 2024] - this is where the error occurs
In Functions.f90. I am working with OpenFAST 3.5.3 [released on Apr 12 2024]

Another interesting observation is that it debugs without any errors with 5MW model and the discon.dll that ships with the FAST source code.

Ashok,

WE_Vw looks like it’s the estimated wind speed, though @Daniel.Zalkind will know more about it. For the divide by zero to occur, this must be going to zero or be initialized to zero. There could be a version incompatibility, as it looks like IEA-15-240-RWT/OpenFAST/IEA-15-240-RWT-UMaineSemi/IEA-15-240-RWT-UMaineSemi_DISCON.IN at master · IEAWindTask37/IEA-15-240-RWT · GitHub was updated last week to use ROSCO v2.9.4; I’m not sure how backwards compatible the ROSCO input files are, but using the same version should remove one possible source of errors.

When running with the 5MW controller does the turbine seem to be behaving normally, ie producing power, stable rotor speed and blade pitch?

Thanks,
Derek

Thanks for your insight @Derek.Slaughter.
There is a slight abnormality in Generator Torque as linked in the below discussion. After that dicussion, I have updated the interfaces also to 3.5.3, but still the transient response shows same heavy fluctuations.
GenTq behavior for 5MW turbine - FAST 3.5.3 coupling.

Could this be related to version incompatibility ? Actually I found it hard to map the compatible versions for Rosco, OpenFAST releases and the corresponding examples release. Right now we go by the dates of corresponding releases and believe that they must be compatible. However it would be really helpful if a table is maintained regarding the compatible versions in the documentation at-least from FAST 3.0.0.

Thanks,
Ashok.

Ashok,

For version incompatibility, I was referring to the ROSCO input files and the version of ROSCO that you’re using. All ROSCO versions should be compatible with all versions of OpenFAST because the controller interface doesn’t typically change.

Have you looked at the ROSCO debug file and looked at the logic to see what’s causing the oscillations?

Thanks,
Derek

Hi All,

There shouldn’t be an issue with backwards compatibility in ROSCO. The v2.9.4 inputs should work with all v2.9 libraries.

Are you starting the simulation at 0 m/s? That’s the only way I could envision this happening, and that is a bug that we should fix.

Have you changed anything in this example? IEA-15-240-RWT/OpenFAST/IEA-15-240-RWT-UMaineSemi at master · IEAWindTask37/IEA-15-240-RWT · GitHub. It’s tested regularly, so I’m guessing we would have caught it there.

Best, Dan

Hi @Daniel.Zalkind ,
Thanks for your reply.
Yes you are correct ! I am applying a ramp load 0 → 3 mps.
So I changed the InflowWind file accordingly.
Should I tune the controller accordingly ? How to do that ?
But why it is running without errors in release mode ?

Thank you,
Ashok

Hi @Derek.Slaughter ,

Since 5MW model doesn’t use a DISON.IN file - I am not sure how to get the .dbg file from the controller. Please let me know if there is a way. As for the logic - I am sorry, I don’t have much background in control systems logic.

Thank you,
Ashok

Hi @Ashok.Jammi,

To generate a debug (.dbg) output from the NREL 5-MW baseline controller DISCON, you can set PC_DbgOut = TRUE in the source code and recompile the dynamic library.

Best regards,

Thanks for that @Jason.Jonkman

Hi @Daniel.Zalkind ,
When running with original InflowWind file → 20mps steady wind, I am not seeing this error.
Fine, for now my issue is solved. Thank you.
But I really want to know how to debug for ramp loading.
For the case that I am simulating this is the wind ramp up

Regards,
Ashok

Hi Ashok,

You could start the simulation at 0.0001 m/s and it should work.

Otherwise, you could use ROSCO v2.9.5, which just released to fix this issue.

Thank you for bringing it to our attention.

Best, Dan

Hi @Daniel.Zalkind ,
It’s working when I start at 0.0001 m/s. Thanks.
Will upgrade to ROSCO v2.9.5 soon.

Regards,
Ashok