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
687 stars 457 forks source link

Bug when try to get plots compiling Tests with Matlab. #1591

Closed reike95 closed 1 year ago

reike95 commented 1 year ago

Bug description Hello all, I'm Carlos and I'm currently working on end-of-Master's project about offshore platforms. I need to obtain plots from different tests but I have several problems to do it. When I execute the Test 01 with the script called Run_Test01_SIG I can obtain outputs (.out), but if I try to obtain plots with the function PlotFASToutput, on the last line of the first script I get an error.

When I run OpenFast with Matlab all is ok until try to take plots using the function Plotfastoutput fom "matlabtoolbox".

To Reproduce

Steps to reproduce the behavior:

  1. Compile with Matlab

  2. Run 'Test 01' case with single precision

  3. Open 'Test01.SFunc.out' output

  4. See the error

_Reading from the file C:\Users\Carlos\source\openfast\reg_tests\r-test\glue-codes\openfast\5MW_ITIBarge_DLL_WTurb_WavesIrr\5MW_ITIBarge_DLL_WTurb_WavesIrr.SFunc.out with heading: "Description from the FAST input file: FAST Certification Test #22: NREL 5.0 MW Baseline Wind Turbine with ITI Barge Configuration, for use in offshore analysis". ReadFASTtext::Error -1 reading from file, "C:\Users\Carlos\source\openfast\reg_tests\r-test\glue-codes\openfast\5MW_ITIBarge_DLL_WTurb_WavesIrr\windows-intel/5MW_ITIBarge_DLL_WTurb_WavesIrr.SFunc.out" Index in position 2 exceeds array bounds.

Error in PlotFASToutput (line 175) outData{iFile,1} = data{iFile}(:,TimeIndex);

Error in Run_Test01_SIG (line 39) PlotFASToutput({[ OpenFASTRoot '5MW_ITIBarge_DLL_WTurb_WavesIrr.SFunc.out'],[ OpenFASTRoot 'windows-intel/5MW_ITIBarge_DLL_WTurbWavesIrr.SFunc.out']},{'SFunc','exe'});

This test is other, but the error is the same.

Expected behavior I expected take plots from simulations.

Screenshots, if applicable https://drive.google.com/file/d/10cipiwR85wLFJCMfNSdS0Vy06P13ccnX/view?usp=drive_link

OpenFAST Version

Command Window from Matlab ``` ************************************************************************************************** OpenFAST Copyright (C) National Renewable Energy Laboratory Copyright (C) Envision Energy USA LTD This program is licensed under Apache License Version 2.0 and comes with ABSOLUTELY NO WARRANTY. See the "LICENSE" file distributed with this software for details. ************************************************************************************************** OpenFAST-v3.4.1-319-g700e8a73-dirty Compile Info: - Compiler: Intel(R) Fortran Compiler 2021 - Architecture: 64 bit - Precision: single - OpenMP: No - Date: May 10 2023 - Time: 14:58:48 Execution Info: - Date: 05/28/2023 - Time: 23:16:35+0200 OpenFAST input file heading: FAST Certification Test #22: NREL 5.0 MW Baseline Wind Turbine with ITI Barge Configuration, for use in offshore analysis Running ElastoDyn. Nodal outputs section of ElastoDyn input file not found or improperly formatted. Running AeroDyn14. WARNING: AeroDyn 14 is deprecated and will be removed in a future release. Running InflowWind. Reading a 31x31 grid (145 m wide, 17.5 m to 162.5 m above ground) with a characteristic wind speed of 12 m/s. This full-field file was generated by TurbSim (from OpenFAST-v3.0.0-98-g7bde6b54) on 14-Sep-2021 at 11:49:55. Processed 1442 time steps of 20-Hz grid-field data (72.05 seconds). Running HydroDyn. Generating incident wave kinematics and current time history. Reading in WAMIT output with root name "C:\Users\Carlos\source\openfast\reg_tests\r-test\glue-codes\openfast\5MW_ITIBarge_DLL_WTurb_Wave sIrr\../5MW_Baseline/HydroData/Barge". Computing radiation impulse response functions and wave diffraction forces. Using SS_Radiation Module, with 30 of 30 radiation states Running ServoDyn. Running ServoDyn Interface for Bladed Controllers (using Intel Visual Fortran for Windows/Matlab). Using legacy Bladed DLL interface. FAST_InitializeAll:SrvD_Init:ValidatePrimaryData:Yaw angle and rate are not commanded from Simulink model. ValidatePrimaryData:Pitch angles are not commanded from Simulink model. ValidatePrimaryData:HSS brake is not commanded from Simulink model. ValidatePrimaryData:Airfoil control is not commanded from Simulink model. ValidatePrimaryData:Cable control is not commanded from Simulink model. Time: 0 of 20 seconds. Time: 10 of 20 seconds. Estimated final completion at 23:16:43. Time: 20 of 20 seconds. Estimated final completion at 23:16:41. OpenFAST completed. Reading from the file C:\Users\Carlos\source\openfast\reg_tests\r-test\glue-codes\openfast\5MW_ITIBarge_DLL_WTurb_WavesIrr\5MW_ITIBarge_DLL_WTurb_WavesIrr.SFunc.out with heading: "Description from the FAST input file: FAST Certification Test #22: NREL 5.0 MW Baseline Wind Turbine with ITI Barge Configuration, for use in offshore analysis". ReadFASTtext::Error -1 reading from file, "C:\Users\Carlos\source\openfast\reg_tests\r-test\glue-codes\openfast\5MW_ITIBarge_DLL_WTurb_WavesIrr\windows-intel/5MW_ITIBarge_DLL_WTurb_WavesIrr.SFunc.out" Index in position 2 exceeds array bounds. Error in PlotFASToutput (line 175) outData{iFile,1} = data{iFile}(:,TimeIndex); Error in Run_Test01_SIG (line 39) PlotFASToutput({[ OpenFASTRoot '5MW_ITIBarge_DLL_WTurb_WavesIrr.SFunc.out'],[ OpenFASTRoot 'windows-intel/5MW_ITIBarge_DLL_WTurb_WavesIrr.SFunc.out']},{'SFunc','exe'}); >>
bjonkman commented 1 year ago

It looks like you are trying to compare your output file with a another file that doesn't exist. The r-test doesn't store results from the S-Function, so you'll have to edit the name of the which file you are comparing with.

To just plot your current results use: PlotFASToutput({[ OpenFASTRoot '5MW_ITIBarge_DLL_WTurb_WavesIrr.SFunc.out']},{'SFunc'});

If you want to compare with another file, replace the second file name in the command you were running: PlotFASToutput({[ OpenFASTRoot '5MW_ITIBarge_DLL_WTurb_WavesIrr.SFunc.out'],[ OpenFASTRoot '5MW_ITIBarge_DLL_WTurb_WavesIrr.out']},{'SFunc','exe'}); Note that the latest r-test no longer contains a windows-intel directory, so make sure the baseline file exists before trying to compare with it.

reike95 commented 1 year ago

I going to try it. Thank you so much!

On Tue, 30 May 2023 at 17:32, Andy Platt @.***> wrote:

Closed #1591 https://github.com/OpenFAST/openfast/issues/1591 as completed.

— Reply to this email directly, view it on GitHub https://github.com/OpenFAST/openfast/issues/1591#event-9380003637, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5W5D75GTSTXVSPC46TYAOLXIYHJPANCNFSM6AAAAAAYSCRF6Y . You are receiving this because you authored the thread.Message ID: @.***>