OpenFAST / openfast

Main repository for the NREL-supported OpenFAST whole-turbine and FAST.Farm wind farm simulation codes.
http://openfast.readthedocs.io
Apache License 2.0
680 stars 456 forks source link

forrtl: severe (157): Program Exception - access violation Using Lidar simulator with OpenFAST v3.5 #1690

Closed mehdyG closed 11 months ago

mehdyG commented 1 year ago

Hello all,

I am trying to run the OpenFAST v3.5 using lidar simulator, but I could not find any sample input file as a source. Is there any sample test regarding how to complete Lidar data in inflowWind file and run it or documentation for it? Thanks a lot in advance for your helps.

I used the following LidarParameter for running it with compiled OpenFAST exe (32 bit version) file, in Matlab:

================== LIDAR Parameters =========================================================================== 1 SensorType - Switch for lidar configuration (0 = None, 1 = Single Point Beam(s), 2 = Continuous, 3 = Pulsed) 0 NumPulseGate - Number of lidar measurement gates (used when SensorType = 3) 30 PulseSpacing - Distance between range gates (m) (used when SensorType = 3) 1 NumBeam - Number of lidar measurement beams (0-5)(used when SensorType = 1) -90.0 FocalDistanceX - Focal distance co-ordinates of the lidar beam in the x direction (relative to hub height) (only first coordinate used for SensorType 2 and 3) (m) 0 FocalDistanceY - Focal distance co-ordinates of the lidar beam in the y direction (relative to hub height) (only first coordinate used for SensorType 2 and 3) (m) 0 FocalDistanceZ - Focal distance co-ordinates of the lidar beam in the z direction (relative to hub height) (only first coordinate used for SensorType 2 and 3) (m) 0.0 0.0 0.0 RotorApexOffsetPos - Offset of the lidar from hub height (m) 25 URefLid - Reference average wind speed for the lidar[m/s] 0.25 MeasurementInterval - Time between each measurement [s] False LidRadialVel - TRUE => return radial component, FALSE => return 'x' direction estimate 1 ConsiderHubMotion - Flag whether to consider the hub motion's impact on Lidar measurements ====================== OUTPUT ==================================================

The Matlab command is:

dos( 'fastexefile.exe FastInputFile.fst' );

And output is:

OpenFAST-v3.5.1 Compile Info:

OpenFAST input file heading: Wind Turbine

Running ElastoDyn. Nodal outputs section of ElastoDyn input file not found or improperly formatted. Running AeroDyn. AD15 Nodal Outputs: Nodal output section of AeroDyn input file not found or improperly formatted. Skipping nodal outputs. Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0. (node 1, blade 1) Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0. (node 2, blade 1) Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0. (node 1, blade 2) Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0. (node 2, blade 2) Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0. (node 1, blade 3) Warning: Turning off Unsteady Aerodynamics because C_nalpha is 0. (node 2, blade 3) Running InflowWind.

Reading a 51x51 grid (80 m wide, 40 m to 120 m above ground) with a characteristic wind speed of 25 m/s.

Processed 2400 time steps of 4-Hz full-field data (period of 600 seconds). Running ServoDyn. Running ServoDyn Interface for Bladed Controllers (using Intel Visual Fortran for Windows). Using legacy Bladed DLL interface. forrtl: severe (157): Program Exception - access violation Image PC Routine Line Source
openfast_Win32_v3 02075B7F Unknown Unknown Unknown openfast_Win32_v3 02074079 Unknown Unknown Unknown openfast_Win32_v3 0206D6A1 Unknown Unknown Unknown openfast_Win32_v3 019F3F1F Unknown Unknown Unknown openfast_Win32_v3 016A9E96 Unknown Unknown Unknown openfast_Win32_v3 00E2E52F Unknown Unknown Unknown openfast_Win32_v3 00E32F06 Unknown Unknown Unknown openfast_Win32_v3 028F406F Unknown Unknown Unknown

deslaughter commented 1 year ago

@mehdyG there were a couple of issues with the Lidar functionality in version 3.5.0 as noted in #1606 and resolved in #1620. Please use the rc-3.5.1 branch for Lidar until version 3.5.1 is released. Unfortunately examples of how to use the lidar functionality were not provided by the contributor, nor were regression tests developed. The lidar functionality will be moved to a separate module in a future release and proper documentation will be added.

Guiiem commented 12 months ago

Hello! I am not sure I understand your comment @deslaughter. Should it be fixed with the current rc-3.5.1 branch? Or will it be fixed for the official 3.5.1 release? I am trying with the rc-3.5.1 branch now, compiled with VS for x64, and I still get this issue. Thanks a lot :)!

andrew-platt commented 12 months ago

@Guiiem, could you attach a copy of your InflowWind input file? This may be a different issue than what we noted in #1606.

Guiiem commented 12 months ago

@andrew-platt here you have it (in .txt extension because it does not let me attach a .dat): IEA-3.4-130-RWT_InflowFile.dat.txt

I have tried with different combination of parameters for the Lidar block but I always get the same error. The simulation only runs if I set SensorType = 0.

andrew-platt commented 12 months ago

Hi @Guiiem. I tried your input file and wasn't able to reproduce this issue. I was using the latest rc-3.5.1 branch (git hash 0b5fe6728) using the gcc 10 compiler on a Mac (Intel processor). I ran the test using the 5MW_Land_DLL_WTurb test case with the wind and Lidar settings from your InflowWind input file.

Looking at the error message, I'm wondering if it might actually be an issue with ServoDyn or the controller given where the fault occurs. Which controller are you using with this model?

Guiiem commented 12 months ago

Hi @andrew-platt! I tested the same test case and it also runs for me :D. It surprised me because I had also tried with the NREL5MW turbine with very similar inputs and it didn't work. So I checked the differences and noticed that the SumPrint option in ServoDyn was different. By setting SumPrint to False I obtained the same issue. Maybe you are able to reproduce the error changing this setting?

Setting SumPrint in ServoDyn to True in my original case also fixed the issue, and the simulation was able to run with ROSCO 2.8.0. I hope this helps, let me know if it would be useful if I share something else :)

andrew-platt commented 12 months ago

Hi @Guiiem. Thanks for the info! I can reproduce this issue with SumPrint set to false in the SerovDyn input file.

There is an array that isn't getting allocated in this case, but is getting accessed anyhow. I will get this fixed and into the rc-3.5.1 branch shortly.

Thanks for reporting this and running a few tests!

Summary for anyone finding this bug later this is due to the SumPrint flag in ServoDyn getting set to false. As a workaround, set this flag to true. This is indirectly related to the Lidar functionality in InflowWind -- ServoDyn is attempting to write out information about the lidar signals, but there is no summary file to write to. There is a minor logic error in ServoDyn causing this.

andrew-platt commented 11 months ago

Fixed in #1805

mehdyG commented 11 months ago

Hello all,

Thanks for your answers and solutions, unfortunately I do not have the chance to work on it now, but very happy that it is fixed now.