Openfast: Need a Script to Convert from FAST v8.16 to OpenFAST v1.0 Input Files

Created on 27 Oct 2017  ·  12Comments  ·  Source: OpenFAST/openfast

Historically, NREL's supported a MATLAB toolbox (https://github.com/OpenFAST/matlab-toolbox) that could be used to convert FAST input files from one version to another to aid users in upgrading their models when upgrading FAST versions. However, this toolbox has not yet been updated (or an equivalent script provided in its place) to support converting input files from FAST v8.16 to OpenFAST v1.0 format. The format of OpenFAST v1.0 is not too different from that of FAST v8.16 (without only one minor change to the FAST primary input file and several additions to the AeroDyn primary input file), but these differences will grow over time, so, the script must be continually updated along with OpenFAST.

Moreover, all of the sample OpenFAST inputs files in the regression tests still include version numbers based on the old module-specific numbering convention. Now that the version numbering convention has changed in OpenFAST, the version numbers in the example input files should be updated accordingly.

Help wanted Enhancement

All 12 comments

Hi
I am pretty new to OpenFAST.
I downloaded the source code and compiled it on windows using parallel studio and visual studio. I followed the methods and questions asked here and there and managed to get the S-Function and I have these files now and I can run the S-Function on test files successfully.
The model I am working on is a Simulink model that works with FAST (v8.16.00a-bjj, 27-Jul-2016). I read this topic and tried to work with the different conversion tools with no success. I was hoping if you can guide me better on how to proceed with the conversion, please?

Hi @arminzaribaf,

@bjonkman uploaded an update to the old MATLAB-based conversion scripts supported with FAST v8 above, but these scripts are not available for each version of OpenFAST (hence why this issue is still open).

Regardless, the input file changes with each version of OpenFAST (starting from FAST v8.16) are well documented here: https://openfast.readthedocs.io/en/master/source/user/api_change.html.

Best regards,

@arminzaribaf, you should be able to use https://github.com/OpenFAST/matlab-toolbox/blob/master/ConvertFASTversions/ConvertFAST8_16to17.m to convert from FAST 8.16 to the current (master?) version of OpenFAST.

If you want to convert to the latest dev version of OpenFAST, I'd recommend using the files in my fork: https://github.com/bjonkman/matlab-toolbox/blob/master/ConvertFASTversions/ConvertFAST8_16to17.m

When I update the r-test input files for a new version of OpenFAST, I run this script that calls the ConvertFAST8_16to17.m script: https://github.com/OpenFAST/r-test/blob/master/updateInputFiles.m

I thank you both for the really fast response :-)

@jjonkman Thanks for that link, I've been going through documentation many times, and every time something new I learn.

@bjonkman Since I'm using the latest dev version I used your fork and I converted successfully (?) after a few trial and error, I guess, here is the result I get and I get a few warnings which might be affecting the next step:
WARNING: ExctnMod not found in the HD data structure. Default value listed below (from template file, ..\matlab\TemplateFiles\HydroDyn.dat) will be used instead:
1

WARNING: BldGagNd not found in the FAST data structure. Default value listed below (from template file, ..\matlab\TemplateFiles\ElastoDyn_Primary.dat) will be used instead:
2 3

GetFASTPar:: Parameter RefHt_Uni not found.
Parameter RefHt_Uni not found; adding it to data structure.
Parameter RefHt_Hawc not found; adding it to data structure.
Parameter PLExp_Hawc not found; adding it to data structure.
Parameter Filename_BTS not found; adding it to data structure.
WARNING: PropagationDir not found in the FAST data structure. Default value listed below (from template file, ..\matlab\TemplateFiles\InflowWind.dat) will be used instead:
0

WARNING: VFlowAng not found in the FAST data structure. Default value listed below (from template file, ..\matlab\TemplateFiles\InflowWind.dat) will be used instead:
0

WARNING: multiple occurrences of RefHt in the FAST data structure.
WARNING: multiple occurrences of PLExp in the FAST data structure.
WARNING: multiple occurrences of FileName in the FAST data structure.
WARNING: InitPosition(x) not found in the FAST data structure. Default value listed below (from template file, ..\matlab\TemplateFiles\InflowWind.dat) will be used instead:
0

WARNING: CalcSteady not found in the FAST data structure. Default value listed below (from template file, ..\matlab\TemplateFiles\OpenFAST.fst) will be used instead:
False
WARNING: TrimCase not found in the FAST data structure. Default value listed below (from template file, ..\matlab\TemplateFiles\OpenFAST.fst) will be used instead:
3

WARNING: TrimTol not found in the FAST data structure. Default value listed below (from template file, ..\matlab\TemplateFiles\OpenFAST.fst) will be used instead:
1.0000e-03

WARNING: TrimGain not found in the FAST data structure. Default value listed below (from template file, ..\matlab\TemplateFiles\OpenFAST.fst) will be used instead:
0.0100

WARNING: Twr_Kdmp not found in the FAST data structure. Default value listed below (from template file, ..\matlab\TemplateFiles\OpenFAST.fst) will be used instead:
0

WARNING: Bld_Kdmp not found in the FAST data structure. Default value listed below (from template file, ..\matlab\TemplateFiles\OpenFAST.fst) will be used instead:
0

5 files are created in the new directory(fst, ED, Hydro, Inflow, and Servo.) I substitute these with the ones in the main directory and I get this error in simulation:
OpenFAST-v2.4.0-dirty
Compile Info:

  • Compiler: Intel(R) Fortran Compiler 1910
  • Architecture: 64 bit
  • Precision: single
  • Date: Nov 06 2020
  • Time: 13:21:51
    Execution Info:
  • Date: 12/10/2020
  • Time: 20:17:50+0100

Running ElastoDyn.
Nodal outputs section of ElastoDyn input file not found or improperly formatted.
Running AeroDyn14.
Running InflowWind.

OpenFAST completed.

Error reported by S-function 'FAST_SFunc' in 'Model05/System/S-Function':
FAST_InitializeAll:InflowWind_Init:InflowWind_ReadInput:Invalid numerical input for file
".\v05InflowFile.dat" occurred while trying to read HWindSpeed.

In Inflow type 2 wind is used with an input file, I checked the format and it seems to be okay comparing it with "ECD_00PR.wnd" in r-test. and here is the parameter section in InFlowFile
================== Parameters for Uniform wind file [used only for WindType = 2] ============================
"16d0.wnd" FileName - Filename of time series data for uniform wind field. (-)
129 RefHt_Uni - Reference height for horizontal wind speed (m)
135.88 RefLength - Reference length for linear horizontal and vertical sheer (-)

@arminzaribaf, It looks like it's unable to read a numeric value on line 13 (HWindSpeed). Even though this value is ignored by InflowWind with the wind type you specified, it still needs to contain a number. Can you confirm that this line is set properly?

Also, it says you are using a modified version of OpenFAST v2.4.0, but if you were actually using the latest dev branch, I would expect it to have some commit numbers following that version (and before the "-dirty"). So, I would guess that you likely have an extra line in your InflowWind input file (e.g., remove line 7 that contains VFlowAng which is new in the dev branch).

If you do upgrade to the latest OpenFAST dev branch, you may also have issues with variable names in the InflowWind input files. A very recent change now requires the parameters in the InflowWind file to be named in specific ways, but it looks like those parameters didn't get updated in the matlab-toolbox conversion files (or the OpenFAST documentation, either).

@bjonkman Amazing, line 7 was the problem. HWindSpeed was set and before posting tried removing and retyping the number to make sure it's a number.
After that I ran into another problem with Hydro file and after checking it there was no enter at the end so end was stuck to \r\n. I think it has to do with the conversion where I had to choose which syntax should run based on OS.
I cloned and compiled around a month ago so maybe that's why it's not the latest version. When I upgrade I'll keep it in mind.
Thanks so much for your help.

I am just reporting what I changed after updating and compiling to the latest build (OpenFAST-v2.4.0-111-g4b5559fb-dirty)

I added back line 7 to InflowWind input ( VFlowAng ),
on line 17 changed FileName to FileName_Uni,
and it expected SumPrint on line 51 so I removed "==OUTPUT==" line and it worked without a problem, giving the same results.
I only got a new warning:

FAST_InitializeAll: IfW_Init:IfW_UniformWind_Init: Could not read upflow column in uniform wind
files. Assuming upflow is 0.

Hi @armin-zbf,

The UniformWind file now supports an upflow angle (column 9). See here for an example.
Documentation on InflowWind can be found here: https://openfast.readthedocs.io/en/dev/source/user/inflowwind/index.html

Cheers!

@armin-zbf
Hi
I am also very new to OpenFAST and I am also new to source code.
I downloaded the source code and compiled it on windows using parallel studio and visual studio. BUT I have some questions.
1.my binaries are downloaded,Where should i put it

  1. Does Math libraries have to install it? What to do?
    3.and many more ......
    This may waste your time, but I still hope you can give me some suggestions, even foolish installation steps.

thank you!~~

2020-12-24
The problem has been solved~~~

Hi @haojunjie0429
Sorry for the late reply, it's holiday season.

  1. If you compiled successfully then you don't need the downloaded binaries, everything you need is in the build\bin folder.
  2. If you're using windows you don't need the math libraries.
  3. Don't worry, spend some time with some examples and you'll get it all, and here on GitHub there are many kind developers :-)

@armin-zbf Thank you. Have a nice holiday

Was this page helpful?
0 / 5 - 0 ratings