Dear Jason:
Continuing the conversation from the post about the natural frequency of DeepCWind.
I have installed the Intel FORTRAN compiler and Visual C++. I have also installed the binaries and the r-test folder for openfast. I had Python installed already. However, I do not know how to run openfast. I have looked at a few of the discussions in the forum but did not find anything yet that specifically spoke to this. I have the following questions:
- In the r-test folder there are two subfolders, modules and glue-codes. Glue-codes contains the information for the various floaters etc. However, I do not see any Python file. I was of the opinion that python is required to run openfast? Am I missing any files/folders?
- What is the command to run openfast? I suspect that it might be similar to fastv8 so it might be âopenfast [filename.fst]â.
- Also when running openfast is the only requirement to ensure that I am executing from the correct folder similar to fastv8? Again this points back to question 1 about the link to python.
In essence I am trying to run one of the cases.
Thank you.
Regards,
AOAW
Dear Andre,
Here are my answers to your questions:
- Python is not needed to run OpenFAST, but it can be used for scripting and post-processing if you want to use that. For example, there is a Python script in the archive that can be used to automate the process to run of the r-test simulations and compare the results to the baselines generated by NREL. See the OpenFAST documentation here for more information: openfast.readthedocs.io/en/main ⌠_test.html.
- You can run the OpenFAST executable just like you ran the FAST v8 executable on Windows. Your syntax is correct. This is described more in my post dated Aug 7, 2020 in the following issue from the OpenFAST github site: github.com/OpenFAST/openfast/issues/663.
- The OpenFAST executable (and corresponding MAP++ DLL) can be installed in a directory whose path is an environment variable, which would allow it to be placed in a location independent from your OpenFAST input files. Otherwise, you could place the OpenFAST executable in the same directory as the OpenFAST input file.
Best regards,
Hi Jason:
Many thanks. I am up and running.
I have another query though. I could not locate the servodyn .dll files for openfast, DISCON_OC3Hywind.dll etc. I copied DISCON_OC3Hywind_x64.dll for FASTv8 and changed the file name and that worked. This is my query
- Have any changes been made to the original .dll files in FASTvs8 and if so, where can I find the new ones? Otherwise, I will assume it is fine to amend the file names for the others as required.
Thank you.
Regards,
AOAW
Dear Andre,
Precompiled versions of these DISCON DLLs are included in the zip archive with each release, along with the precompiled OpenFAST executables, here: github.com/OpenFAST/openfast/releases. But these are unchanged from FAST v8, so, using the old ones from FAST v8 is fine too. Of course you can also compile them from the source code and compile scripts provided in the OpenFAST github repository.
Best regards,
Thanks Jason.
Yes the OpenFast .dll files were included. I was looking in the wrong folder for them.
Regards,
AOAW
Hi Jason:
I am trying to run a simulation using the runFAST.m function in the matlab toobox, see attached. I have defined the following:
filename={âIEA-15-240-RWT-UMaineSemi1.fstâ,âIEA-15-240-RWT-UMaineSemi.fstâ};
path = âC:\Users\awhite15\openfast\openfast_v2.5.0_binaries\openfast_x64.exeâ
runFAST(filename,path)
However, I get the following error:
[b]The following simulations failed
C:
Error using runCommands (line 40)
2/2 simulations failed
Error in runFAST (line 52)
status = runCommands(commands);[/b]
I am not sure why the simulation has failed. Would be very grateful if you could help me to decipher the source of the error.
Thank you.
Regards,
AOAW
Andre,
It looks like there is a bug in the error message that gets printed, but I think it should say that it couldnât run these 2 commands:
The following simulations failed
C:\Users\awhite15\openfast\openfast_v2.5.0_binaries\openfast_x64.exe IEA-15-240-RWT-UMaineSemi1.fst
C:\Users\awhite15\openfast\openfast_v2.5.0_binaries\openfast_x64.exe IEA-15-240-RWT-UMaineSemi.fst
Error using runCommands (line 40)
2/2 simulations failed'
Does it show that the simulations started? You should see some text in the Matlab command window that indicates if OpenFAST opened or not. If it started, there should be some sort of message that says why it didnât run to completion. If it didnât start and gave an operating system error instead, you should check that the path to the openfast binary is specified correctly.
Hi Bonnie:
I believe that is the same error that I received. The path specified for the binaries is correct.
I attempted to run again and I am getting a different error, which I did not get the first time. See below:
[b]Operator â-â is not supported for operands of type âcellâ.
Error in runFAST (line 23)
dt = time(2)-time(1);[/b]
I am not sure, why this error now occurs. Is it a case that the script in the toolbox was updated? Otherwise, do you know what would have caused this error. I did a Google search but was not successful in finding a fix for it.
Iâm not sure about the exact warning you are getting because my runFAST.m has a comment on line 23, and I donât see any line that says
dt = time(2)-time(1);
However, the error message indicates that the time
variable is a cell data structure, not a numeric array, so it canât subtract the two values. How are you defining the time
variable?
Bonnie:
Thanks for that clarification. I am trying to run the .fst file, so I am not too sure. I imagine the variable would be as defined in that file. Hope I am using the file correctly.
If you can come up with any ideas about why the time variable would not be recognized in .fst file please let me know. However, I will keep trying to see if I can rectify it.
Regards,
AOAW
The .fst file is the input file for the OpenFAST executable (not Matlab). The error you are getting is from Matlab.
Matlab runs a system command to tell the OpenFAST executable to run with the .fst input file, but Matlab itself doesnât know anything about whatâs in that .fst file, unless youâve run some additional Matlab commands to read it. And for what it is worth, the .fst file has a dt
in it, but not an array of times.
It sounds like you have a script that may be reading the OpenFAST output file to get the time variable, but I donât really know what you are running. As I mentioned before, the runFAST.m script that I have from the gitHub repo doesnât have that line in it, so it is likely you are running an edited version of it.
If you need more help, please run the clear all
command in Matlab, and then copy exactly the commands you are running and what Matlab generates.
1 Like
Bonnie:
Noted. I will try and download from GitHub again and see if that solves it.
Thank you.
Regards,
AOAW
Hi,
Iâve added an example on how to use the runFAST
script here:
github.com/OpenFAST/matlab-tool ⌠_example.m.
Emmanuel
Thanks Emmanuel.
I will download the runFAST function again and give it a go.
Regards,
AOAW
Hi Emmanuel:
I tried again but I get the same error. It has to do with another function, runCommands. Not sure why that line in the code is not being executed. See error below:
[b]"Running: C:\Users\awhite15\openfast\r-test\glue-codes\openfast\IEA-15-240-RWT-UMaineSemi\openfast_x64.exe C:\Users\awhite15\openfast\r-test\glue-codes\openfast\IEA-15-240-RWT-UMaineSemi\IEA-15-240-RWT-UMaineSemi.fst
Running: C:\Users\awhite15\openfast\r-test\glue-codes\openfast\IEA-15-240-RWT-UMaineSemi\openfast_x64.exe C:\Users\awhite15\openfast\r-test\glue-codes\openfast\IEA-15-240-RWT-UMaineSemi\IEA-15-240-RWT-UMaineSemi1.fst
The following simulations failed
C:
Error using runCommands (line 40)
2/2 simulations failed
Error in runFAST (line 52)
status = runCommands(commands);"[/b]
Let me know if you have any ideas.
Regards,
AOAW
Hi Andre,
Iâm not quite sure whatâs happening.
Here are some steps you can try to debug. Iâm not sure how familiar you are with command prompts of windows and the âsystemâ function of matlab, but if you are not familiar with the two, I recommend learning a tiny bit about them, and then attempt to debug with some of these options:
- Copy paste the full command
C:\Users\awhite15\openfast\r-test\glue-codes\openfast\IEA-15-240-RWT-UMaineSemi\openfast_x64.exe C:\Users\awhite15\openfast\r-test\glue-codes\openfast\IEA-15-240-RWT-UMaineSemi\IEA-15-240-RWT-UMaineSemi.fst
into a windows command prompt. If this command doesnât work, then it wonât work in matlab. Try with forward and backward slashes just in case (power shell and command prompt act sometimes differently).
-
in matlab, go to the folder IEA-15-240-RWT-UMaineSemi and try to run the command:
system('./openfast_x64.exe IEA-15-240-RWT-UMaineSemi.fst')
. This should work.
-
try again, from a different folder, using relative path (try with forward and backward slashes), and then using the full command with absolute path. See what works.
-
If all of this work, try using runFAST, but put a checkpoint in the script runCommands on line 39, and look at the content of the variables I, status, and sCmd. I find it suspicious that only âC:â is displayed on line 39, the full command should have been displayed.
-
You can also call runFAST from the directory IEA-15-240-RWT-UMaineSemi with one file name and simple paths (not absolute path), something like:
runFAST({'IEA-15-240-RWT-UMaineSemi.fst'}, './openfast_x64.exe')
I hope some of this can help.
Emmanuel
A small update, I now know why only âC:â was displayed. There was a small bug on line 39 of script runCommands. It was fixed by Bonnie in the latest version of the toolbox. But this is not really related to your issue. We need to figure out why the return status of your command is not zero. Following the steps I mentioned will help.
Emmanuel
Thanks Emmanuel.
I believe the first directive you have about running from the command prompt was to test and see if OpenFAST actually runs. It does. That is currently how I run it. However, I wanted to run from MATLAB as I would be able to run more than one simulation at a time.
I have tried the last command that you gave runFAST({âIEA-15-240-RWT-UMaineSemi.fstâ}, â./openfast_x64.exeâ). This initiates but I get the same error. See below.
Running: .\openfast_x64.exe IEA-15-240-RWT-UMaineSemi.fst
The following simulations failed
.\openfast_x64.exe IEA-15-240-RWT-UMaineSemi.fst
Error using runCommands (line 40)
1/1 simulations failed
Error in runFAST (line 52)
status = runCommands(commands);
Not sure why runCommands does not work. If you canât think of anything else that is okay. I have resigned that I will just have to use the ârough and dirty wayâ with the command prompt. That is running a number of simulations simultaneously from the prompt.
Thanks again.
Regards,
AOAW
Emmanuel:
System gave me this error.
system(â./openfast_x64.exe IEA-15-240-RWT-UMaineSemi.fstâ)
â.â is not recognized as an internal or external command,
operable program or batch file.
Regards,
AOAW
Hi Andre
Can you try the system command without the â./â at the beginning?
Make sure matlab is in the right folder where the executable is and the â.fstâ is as well.
This should work, otherwise something is off with the way matlab runs the system calls.
Emmanuel