Generating OpenFAST inflow from Open FOAM

Dear Jason,

I want to generate inflow for OpenFAST using OpenFOAM, but there are several aspects I don’t fully understand. First, how can I cut a section in OpenFOAM to extract the external inflow for OpenFAST? Second, after successfully extracting the external inflow, if I set CompInflow=2 in OpenFAST, do I need to replace the inflow file in the *.fst input file section?

Best regards,
Dereje

Dear @Dereje.Haile,

Can you clarify your use case? Do you want to run OpenFAST as a preprocessing step to generate inflow (e.g., to characterize inflow for a given atmospheric stability or flow over terrain) for OpenFAST? Or do you want to run OpenFAST coupled to OpenFOAM through an actuator-line method, e.g., using SOWFA?

The CompInflow = 2 option of OpenFAST is for the latter, but for the former, CompInflow = 1 should be used and you should format your OpenFOAM output in a form InflowWind can understand, e.g., TurbSim format.

Best regards,

Dear Jason,

Thank you for your prompt reply.

Yes, I want to run OpenFOAM as a preprocessing step to generate inflow for a given atmospheric stability for OpenFAST. However, I didn’t understand well the way to extract that from desired section of OpenFOAM.

Best regards,
Dereje

Dear @Dereje.Haile,

You’ll want to export time series of wind velocities at points across a vertical (Y,Z) sampling plan from OpenFOAM. You should then write this data to a format InflowWind can read, such as the TurbSim binary (.bts) format or HAWC format.

I’ve not used these myself, but I believe there are python scripts available in the WindTools repository that already support this: windtools/windtools/inflow at main · NREL/windtools · GitHub.

Best regards,

1 Like

Thank you very much.

There are three Python codes included: general, OpenFAST, and synthetic. However, I am not sure which of them can generate the .bts format. If anyone knows, please help.
Best regards
Dereje

Dear @Dereje.Haile,

Looking briefly through these scripts, I see routine write_binary_from_netcdf() in openfast.py that will write a HAWC-formatted binary file based on netcdf output from OpenFOAM, but I don’t see an equivalent writer for TurbSim’s bts format. I do, however, see a reader for TurbSim bts format via routine _readBTS() in synthetic.py. So, with a bit of recoding, I’m sure a bts writer could also be coded. That said, this may not be necessary because InflowWind can read HAWC-formatted binary inflow files.

Best regards,

1 Like

Dear Jason,

Thank you so much for your guidance. I followed your post on converting VTK format to HAWC format. I read about the number of grids in this post [OC3 turbulence model(Mann model) - #4 by Jason.Jonkman] and set them accordingly. However, I could not run the simulation successfully. The simulation error is shown as follows.

Best regards,

 False         Echo           - Echo input data to <RootName>.ech (flag)
          5   WindType       - switch for wind file type (1=steady; 2=uniform; 3=binary TurbSim FF; 4=binary Bladed-style FF; 5=HAWC format; 6=User defined; 7=native Bladed FF)
          0   PropagationDir - Direction of wind propagation (meteorological rotation from aligned with X (positive rotates towards -Y) -- degrees) (not used for native Bladed format WindType=7)
          0   VFlowAng       - Upflow angle (degrees) (not used for native Bladed format WindType=7)
      False   VelInterpCubic - Use cubic interpolation for velocity in time (false=linear, true=cubic) [Used with WindType=2,3,4,5,7]
          1   NWindVel       - Number of points to output the wind velocity    (0 to 9)
          0   WindVxiList    - List of coordinates in the inertial X direction (m)
          0   WindVyiList    - List of coordinates in the inertial Y direction (m)
         90   WindVziList    - List of coordinates in the inertial Z direction (m)
 ================== Parameters for HAWC-format binary files  [Only used with WindType = 5] =====================
"../5MW_Baseline/Wind/hawc_inflow_11.4u.bin"    FileName_u     - name of the file containing the u-component fluctuating wind (.bin)
"../5MW_Baseline/Wind/hawc_inflow_11.4v.bin"    FileName_v     - name of the file containing the v-component fluctuating wind (.bin)
"../5MW_Baseline/Wind/hawc_inflow_11.4w.bin"    FileName_w     - name of the file containing the w-component fluctuating wind (.bin)
         8192   nx             - number of grids in the x direction (in the 3 files above) (-)
         32   ny             - number of grids in the y direction (in the 3 files above) (-)
         32   nz             - number of grids in the z direction (in the 3 files above) (-)
         0.974121   dx             - distance (in meters) between points in the x direction    (m)
          4.6875   dy             - distance (in meters) between points in the y direction    (m)
          4.6875   dz             - distance (in meters) between points in the z direction    (m)
         90   RefHt_Hawc     - reference height; the height (in meters) of the vertical center of the grid (m)
  -------------   Mean wind profile parameters (added to HAWC-format files)   ---------------------------------
         11.4   URef           - Mean u-component wind speed at the reference height (m/s)
          2   WindProfile    - Wind profile type (0=constant;1=logarithmic,2=power law)
        0.2   PLExp_Hawc     - Power law exponent (-) (used for PL wind profile type only)
       0.03   Z0             - Surface roughness length (m) (used for LG wind profile type only)
          0   XOffset         - Initial offset in +x direction (shift of wind box)

Dear @Dereje.Haile,

Well, the error message implies that there is a formatting problem within your HAWC-formatted binary wind data file, but I don’t personally know enough about this to comment. I would double check how you are writing out this binary data in comparison to how InflowWind is reading in the data.

Best regards.

Thank you for your quick response. I appreciate the guidance, and I will double check the binary wind data generation process.

Best regards,