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

How to run OpenFAST changed from FASTV8 written in Fortran in Windows from scratch? #569

Closed thisismihir closed 3 years ago

thisismihir commented 3 years ago

So, I followed all the steps given in the docs for Installing from pre-requisites like Visual Studio, Intel Fortran Compiler, Git for Windows, Python. But when I did the compiling I received errors. I'm not sure how to do run the entire OpenFASTv8. I'm not quite familiar with Fortran as well. I just want to run the code and do some simulation for wind-mill data considering different modules in OpenFAST.

Please, let me know if you need any more information on what I did in the installation part.

jjonkman commented 3 years ago

Dear @thisismihir,

You haven't stated what errors you are running into when compile OpenFAST, so, I can't comment on that.

And I assume you mean OpenFAST v2.4 (or similar) rather than the older FAST v8.

Regardless, unless you intend to change the source code (which I gather you do not, based on your comment), you do not need to recompile OpenFAST. Instead, precompiled executables (binaries) have been provided for Windows users with each official release (master branch) of OpenFAST--see: https://github.com/OpenFAST/openfast/releases.

Best regards,

thisismihir commented 3 years ago

Thank you for the response @jjonkman Okay got it. So I won't be needing to compile. So let's say I want to run any module from OpenFast 2.4.0 that I've cloned at my end, what would be the steps that I'd following if you could help, please? Would it be directly from a glue-code? If it is through a glue-code, would it work if I directly execute the cpp file, or am I missing out on something? Sorry, this might be naive but since I'm new to this.

jjonkman commented 3 years ago

Dear @thisismihir,

Do you want to run simulations using standalone OpenFAST modules (uncoupled from others), e.g., aerodynamics only (AeroDyn) without aero-elastic coupling? Or do you want to run coupled aero-elastic simulations? The precompiled executables (binaries) are only for the latter. You'll need to compile if you want to run modules standalone.

You do not need an cpp file to run OpenFAST. Instead OpenFAST is running by calling the executable from a Windows command prompt. This is discussed in my post dated Aug 7 in issue #434.

Best regards,

thisismihir commented 3 years ago

Okay. Thank you again for the response @jjonkman So honestly I want to try both. Let's break it down: Part 1: I want to run it in a standalone module format. Let's consider AeroDyn as of now. Should I try building by following the steps that I should be doing given here and then once that is done which part should I be executing.

Part 2: If I want to run coupled aero-elastic simulations i.e. OpenFAST, I should download the precompiled binaries and execute it by the comments you gave in the issue #434 i.e. "To start, it is probably easiest to open up your command window in the directory in which your primary OpenFAST input file (*.fst) is stored. For example, if you have an input file named "Input.fst", which is stored at "C:\FileLocation", you should type:

C:>cd FileLocation C:\FileLocation> OpenFAST_x64.exe Input.fst" Right? So this would help me do that?

jjonkman commented 3 years ago

Dear @thisismihir,

The answer is yes to both.

To compile standalone AeroDyn, a Visual Studio solution (_AeroDynDriver.sln) has been provided. Use that in Step 4 of section 2.2.3.1.2 (instead of FAST.sln). This will compile an executable, which you can use instead of the OpenFAST executable for running standalone AeroDyn.

Best regards,

thisismihir commented 3 years ago

Sure that'd work. @jjonkman Thanks for the response. So when I did the same, I got the following error:

image I clicked on "Build Solution" and I got 2 errors saying:

  1. Error running FAST registry for BEMT
  2. error PRJ0019: A tool returned an error code from "Running Registry for BEMT"

Thank you.

jjonkman commented 3 years ago

The actual error message is shown in the "Output" window. What does it say?

thisismihir commented 3 years ago

This is what I got:

1> Error running FAST Registry for BEMT.
1> 
1>======================================================================
1>Project : error PRJ0019: A tool returned an error code from "Running Registry for BEMT"
1>
1>Build log written to  "file://E:\Digital%20Intent\Wind-mill\OpenFAST\vs-build\AeroDyn\x64\Release\BuildLog.htm"
1>AeroDyn_Driver - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Thanks.

jjonkman commented 3 years ago

I was unaware that there were two VS solution files for the AeroDyn driver. Instead of _AeroDynDriver.sln, you should instead open up _AeroDynDrive-with-registry.sln.

Best regards,

thisismihir commented 3 years ago

Thanks for the answer. I tried Building the _AeroDynDrive-with-registry.sln file. image I got almost 757 errors. Mostly it consisted of "A kind type error" for different flags and also NWTC library. Do I have to change any path or include any files or anything while I'm doing Building this?

Thanks

thisismihir commented 3 years ago

Hello @jjonkman While I was trying to run the second part i.e. coupled aero-elastic simulations, the Input.fst file is not present in the repository, so do I have to create a file as such, or do we have any example input files in the repository?

thisismihir commented 3 years ago

Hey @jjonkman Tried solving the errors I got last-time and the build was successful this time without any errors. image It looks like this. What would be the steps after this for creating input files or even the next steps for simulation?

Also, now that the Aerodyn module is built. How can I use my custom data to simulate on the same model?

jjonkman commented 3 years ago

Dear @thisismihir,

I'm glad you got the standalone AeroDyn driver to compile!

Sample models of OpenFAST are not provided in the OpenFAST repository. But they are provided in the associated r-test repository--see: https://github.com/OpenFAST/r-test.

Unfortunately, per issue #178, the standalone AeroDyn driver regression tests from FAST v8.16 have not yet been migrated to the OpenFAST r-test. However, you can find a sample standalone AeroDyn driver input file here: https://openfast.readthedocs.io/en/master/source/user/aerodyn/appendix.html#aerodyn-input-files. Running the standalone AeroDyn driver is similar to running OpenFAST, except that the standalone AeroDyn executable is used in place of the OpenFAST executable and the AeroDyn driver input file is used in place of the OpenFAST primary (*.fst) file.

Best regards,

thisismihir commented 3 years ago

Thanks for the response. @jjonkman So here my executable file that was created for AeroDyn was _AeroDyn_Driverx64.exe and the input file is the example driver file that is downloaded from the link you provided i.e. _ad_driverexample.inp file. Hence, I executed AeroDyn_Driver_x64.exe ad_driver_example.inp

But I got an error saying:

Running AeroDyn.
Init_AeroDyn:AD_Init:ReadInputFiles:Blade1:ReadBladeInputs:OpenFInpFile:The input file,
".\Test01_UAE_AeroDyn_blade.dat", was not found.

So is there any chance I can get hold of this .dat file?

jjonkman commented 3 years ago

Dear @thisismihir,

You should set AD_InputFile in the AeroDyn driver input file to whichever AeroDyn primary input file you want to run standalone. Do you already have a specific AeroDyn model you want to run? If so, use that. If not, there are several sets of AeroDyn input files in the OpenFAST r-test.

Best regards,

thisismihir commented 3 years ago

Dear @jjonkman The driver input file already contains the primary input file set in AD_InputFile. image I think the problem is with the primary file since it contains these .dat files path in the Rotor/Blade properties section which it cannot find. Since there are multiple .dat files is there any section where I should be downloading these files? image

jjonkman commented 3 years ago

Dear @thisismihir,

Again, complete sets of AeroDyn input files for several wind turbines are available in the OpenFAST r-test repository. These include the airfoil data files for the UAE Phase VI rotor (https://github.com/OpenFAST/r-test/tree/master/glue-codes/openfast/UAE_VI/Airfoils) and the AeroDyn blade data file for this turbine as well (https://github.com/OpenFAST/r-test/blob/master/glue-codes/openfast/UAE_VI/UAE_Ames_AeroDyn_blade.dat).

Best regards,

thisismihir commented 3 years ago

Hello @jjonkman, So, is there a particular file path where the .dat file should be stored, since it doesn't consider the .dat file being in the same folder, or do I have to clone the entire r-test repository inside the build\bin path where my executable files are present?

jjonkman commented 3 years ago

Dear @thisismihir,

Normally you'd set up an environment variable so that the directory where you executable is stored is in the search path, such that you can call the executable from any directory. Alternatively, you could just copy the executable to the directory where your primary input file (AeroDyn driver file for standalone AeroDyn or OpenFAST primary (*.fst) for OpenFAST) is stored. The locations of the other input files are set within the primary input file.

Best regards,

thisismihir commented 3 years ago

Dear @jjonkman, It worked for me. I've replaced the required "_Test01_UAE_AeroDynblade.dat" file with "_UAE_Ames_AeroDynblade.dat" and it worked. Just to confirm, this is how it looks right. image

Can you help me understand the data that is being provided like AeroDyn generally focuses on the aerodynamic loads on both the blades and towers? What are the input parameters that are being fed into the executable model? Like the BlSpn, BlCrvAC, BlSwpAC, etc. What does that stand for? And the output files provided me different variables again like B1N1VDisx, B1N1VDisy, B1N1VDisz, etc. Can you help me understand it better so that I can create the input files as such, please?

jjonkman commented 3 years ago

Dear @thisismihir,

I'd glad you got the AeroDyn standalone driver working.

Your questions are well answered by the AeroDyn documentation available on readthedocs--see: https://openfast.readthedocs.io/en/master/source/user/aerodyn/index.html.

Best regards,

thisismihir commented 3 years ago

Dear @jjonkman, Thanks to you. I went through it, there are few questions related to it. Firstly, in the AeroDyn Driver Input File section, it is mentioned that input is generated by OpenFAST. So I didn't quite understand how the data would be generated by OpenFAST. Can you walk me through that, please? For that, which input file would I have to provide with the _openfastx64.exe executable file as we did for Aerodyn?

Also, I wanted to understand if I can simulate the Aerodyn output? If yes, can you help with that too, please?

thisisrahul966 commented 3 years ago

This conversation is very helpful. Thank you both. Can anyone please help me with the steps to understand the flow of OpenFAST like the modules required for a farm-windmill and modules used for such a purpose using OpenFAST?

bjonkman commented 3 years ago

I suggest that you both start by going through @jjonkman's presentations from previous modeling workshops, and that you also read the full OpenFAST documentation on readthedocs.

As for the "data generated by OpenFAST" for the AeroDyn driver: when you run AeroDyn with OpenFAST, the turbine configuration (hub height, number of blades, cone, tilt, etc.), wind speed, etc. are defined in other modules, and OpenFAST will give AeroDyn those values. When you run the AeroDyn driver outside of the full OpenFAST executable, you need to supply those data in the AeroDyn driver input file.

thisismihir commented 3 years ago

Thanks for the presentations @bjonkman While I was going through these pdfs, I find them mostly related to on-shore wind-mills. I mostly wanted to understand a wind-farm because I cannot use Hydrodyn module for the wind-farm windmills right? I wanted to understand from that perspective.

thisisrahul966 commented 3 years ago

While going through the presentations, I came across a Overview of the module. Just wanted to confirm it with you, @bjonkman image As much I understand, this is for an off-shore wind-mill and executing Servo-Dyn Module through FAST and Hydrodyn-Aerodyn module combination, right? Now, in the similar context I want to do the simulation mode of operation for an overall level of off-shore wind-mill let's consider UAE_IV model. If I try executing FAST module by providing input .fst file to it, which all modules would it include? Just wanted to understand the gist of it in a nutshell.

If possible can we have a zoom call with any of the team members as well please?

bjonkman commented 3 years ago

@thisisrahul966,

The slide you are showing is actually for an older version of FAST (likely v7), so you may want to start with some of the newer presentations on OpenFAST instead. OpenFAST simulates both onshore and offshore wind turbines. Anything you learn about simulating onshore turbines should apply to offshore, but offshore adds a lot more complexity.

You can probably answer a lot of your questions by opening the input files that you are asking about, reading the descriptions of the inputs in those files, and looking at the documentation. We don't have the resources for personal tutorials on OpenFAST.

thisisrahul966 commented 3 years ago

Okay, so at least can you guide me with the modules to include while executing OpenFAST and the simulations related to the wind-farm windmills specifically, please? @bjonkman

jjonkman commented 3 years ago

Dear @thisisrahul966,

A land-based wind turbine OpenFAST model would normally have the ElastoDyn (for structural dynamics), AeroDyn (for aerodynamics), ServoDyn (for controls), and InflowWind (for ambient wind inflow) modules enabled.

Best regards,

thisismihir commented 3 years ago

Hey Jason, I guess for a better understanding, I wanted to execute stand-alone modules like ElastoDyn, ServoDyn, and InflowWind. Can I use the files in the r-test repository as input for these modules? Also, they don't have a solution file as we had for AeroDyn, so I am not sure if we can build using the .f90 files in each module. What could be the way to executing them in an uncoupled format?

Regards, Mihir

jjonkman commented 3 years ago

Dear Mihir,

An extensive driver program has been written for InflowWind (moduules/inflowwind/src/InflowWindDriver.f90). I'm not sure why a Visual Studio solution for compiling the InflowWind driver is not included in the current OpenFAST master repository, but I see that one has been added to the recent InflowWind pull request: https://github.com/OpenFAST/openfast/pull/578. While the r-test has InflowWind input files, the standalone driver-level tests from the FAST v8 CertTest have not yet been ported to OpenFAST, per issue https://github.com/OpenFAST/openfast/issues/181.

A very simple driver program (without a driver input file) has been written for ServoDyn (_modules/servodyn/src/ServoDynDriver.f90), but again I'm not sure why a Visual Studio solution for compiling the ServoDyn driver is not included in the OpenFAST repository. And I'm not aware that standalone driver-level tests were ever created for ServoDyn.

I don't believe a standalone driver was ever developed for ElastoDyn.

It would be good to better support drivers for ServoDyn and ElastoDyn in the OpenFAST repository and r-test.

Best regards,

thisismihir commented 3 years ago

Hello Jason,

So does it mean I cannot execute ServoDyn, ElastoDyn, and InflowWind as a stand-alone? It will always be a coupled module in order to execute them or is there a way to execute the driver files without the executable file?

Regards

jjonkman commented 3 years ago

You can run InflowWind and ServoDyn in standalone mode, but you'll first need to compile the standalone drivers. To run ElastoDyn in standalone mode, a driver could would need to be written.

Best regards,

ai-aspirant commented 3 years ago

Hello Jason, So just to confirm for compiling, I'll have to do that via Intel Parallel Studio, right? Or is there a way via Visual Studio, because I cannot see a compile option in it.

Regards

jjonkman commented 3 years ago

NREL has now provided a Visual Studio solution for the InflowWind driver in pull request #578, but NREL has not yet provided a Visual Studio solution for the ServoDyn driver. However, you should be able to create a Visual Studio solution for the ServoDyn driver by using one of the existing Visual Studio solutions available for other drivers as an example.

Best regards,

thisismihir commented 3 years ago

@ai-aspirant Thank you for taking it forward. Hi, @jjonkman I'm not sure I quite understand you there.

thisismihir commented 3 years ago

Hi Jason, However, just like Out Parameters, do we have an excel file for input parameters as well?

Regards, Mihir

jjonkman commented 3 years ago

Hi Mihir,

NREL has not provided an Excel file for input parameters. The input parameters are summarized in the various input files and more detail is provided in the documentation.

Best regards,

thisismihir commented 3 years ago

Hi Jason, Yes. However, in the AeroDyn module, the example inputs that we provide considers multiple airfoil files like _cylinder.dat, Mod_S809_129.dat, Mod_S809185.dat, etc. All these files have similar Alpha, Cl, Cd, Cm values. But vary a little with flag inputs. So are these different airfoils values or similar airfoil with just multiple Post Stall at various values? Why are these necessary? I mean I do understand the importance of the data files but this being my base data file for AeroDyn, are these all necessary, if it is what unique role does it play? I couldn't find this in the documentation.

Thank you. Regards,

jjonkman commented 3 years ago

hi @thisismihir,

The aerodynamic calculations of AeroDyn are dependent on the airfoil data. Each airfoil data file contains unique airfoil data (lift, drag, pitching moment as a function of angle of attack, as well as unsteady airfoil aerodynamic parameters). Generally you'd use different airfoil data files for each unique airfoil. And even the same airfoil can have different aerodynamic characteristics at different radial stations when the airfoil is used in a rotor blade, due to three-dimensional rotational augmentation effects.

Best regards,

thisismihir commented 3 years ago

Hi, @jjonkman, So, all these different values of coefficients for different airfoils, what exactly do they mean, or is it like a simulation exercise at different coefficients to understand the aerodynamic load?

Regards,

jjonkman commented 3 years ago

Hi @thisismihir,

Your question is too basic, and not one I am willing to answer. Please be aware that OpenFAST is meant for those with wind turbine modeling and design expertise. NREL does not have the resources to provided unlimited support for free and open-source tools.

I'm not sure why you have the need to run OpenFAST, but please do your own study to come up to speed on wind turbine modeling and design and use this forum only for software-related questions.

Best regards,

thisismihir commented 3 years ago

Sure. Thank you for all this help. @jjonkman