Page 1 of 1

Sending RtAeroPwr via ServoDyn to Bladed-Style DLL Controller

Posted: Mon May 13, 2019 10:15 am
by Paul.Schünemann
Dear all,

In order to develop and test a controller for a variable speed, stall controlled wind turbine, I need the current rotor aerodynamic power RtAeroPwr at each time step being available in a Bladed-Style DLL controller. I am using OpenFAST v2.1.0. and followed the instructions for passing parameters from one module to another given by Bonnie in these posts:

With this help I was able to compile a modified OpenFAST version without errors. However, once I try to run my modified OpenFAST version I get the following error message:
FAST_InitializeAll:Error allocating AD%Input and AD%InputTimes.
forrtl: severe (157): Program Exception - access violation

All my changes to the source code are summarized in the attached document.

Does someone know where this error might come from?
In my investigations I found that this error is triggerd in line 439 of FAST_Subs.f90 (subroutine FAST_InitializeAll), but that doesn't really help me.
I would be deeply grateful for any help.

Best regards,

Re: Sending RtAeroPwr via ServoDyn to Bladed-Style DLL Controller

Posted: Mon May 13, 2019 2:34 pm
by Bonnie.Jonkman
Hi, Paul.

I don't see anything in your code that would be problematic. I suspect that the code isn't linking with the new compiled version of the FAST_types.f90 files, which is what causes the access violations. (I have had this problem before, myself. I am not sure if this is a Visual Studio problem or if there is something wrong in the way the FAST project files are set up.)

Any time you change the Registry input files in FAST, I would suggest "cleaning" the FAST project file (highlight the "FAST" project, right click, select "project only->Clean Only FAST"), and then building again. You can also just do a "clean" or "rebuild" of the entire solution, but it takes a while to build everything.

Re: Sending RtAeroPwr via ServoDyn to Bladed-Style DLL Controller

Posted: Thu Jun 13, 2019 2:13 am
by Paul.Schünemann
Hi Bonnie,

Thank you very much for your helpful answer. The missing link of the code with the new FAST_types.f90 files was one problem in my version that I would not have found by myself. So, thanks for giving the hint on testing this.

Additionally, I had one other mistake at one call of my modified SrvD_InputSolve routine. After solving this issue my modified OpenFAST version now is compiling without errors and running as expected. Thanks again for helping me in achiving this.

For those trying similar things, I have attached an updated version of the document summarizing all changes to the code, which I have made for my final version.

Best regards,
Paul Schünemann

P.S.: For anyone new to modifying the OpenFAST source code, I really recommend to use the debug mode, i.e. selecting Debug or Debug_Double in the Solution Configuration when working with MS Visual Studio. With this, compiling will take a while, but afterwards if you have a bug in your code and run your compiled OpenFAST version in command window, you will get useful information where to find the bug in the command window.