Initialize Fluent With WRF Data

Fluent is a computational fluid dynamics program that is commonly used by engineers to model the flow of water or air over or through objects. It would normally be used as part of the design process for anything from miniature water nozzles to large aircraft. We stepped up the size a bit so that we are modeling wind flowing over sections of terrain that are several kilometers on a side. I can not claim a lot of expertise with Fluent. I mostly learned by trying different techniques to make Fluent part of an automated process of wind forecasting. Alan Russell at Boise State University found a way to import high resolution terrain height data to build a mesh for Fluent. He also did all the experimenting on how to set up a reasonable case file. My part was merely to extract data from WRF, feed that data into Fluent for individual runs, and then to extract the results from Fluent as part of a forecast. Fluent is generally set up and run by picking options off a menu which displays screens into which data is entered or options are selected. But Fluent also has the ability to read text commands, from the screen or from files, to perform the same functions. We needed to use the text commands so the Fluent runs could be part of an automated forecasting operation.

The main data needed from WRF for Fluent were wind speeds. Alan specified points along the edges of the Fluent domain. I converted these to latitude/longitude and put both sets of specifications into a different file for each mesh. Using the latitude/longitude points, I extract data from WRF along each of the Fluent boundaries (at multiple heights) and determine which boundaries to use as inflow and which to use as outflow. For the inflow boundaries, a specially formatted file is created with the U, V, and W wind components as input as a "profile" into Fluent. Additionally, TKE and epsilon from WRF is included in the profile. Then the text commands are generated to tell Fluent which sides to use for which kind of flow, to read in the profile for the boundary sides, and to set various other run parameters (pressure, density, temperature, heat flux, etc) using data from WRF. The specifications that do not change from one run to the next can be saved in the case file. The command file also tells Fluent to initialize for a run and start "iterating" toward a solution. Fluent solves the air flow for a single instant in time. Since the meshes that we use have well over a million cells, it takes quite a bit of processing, even using multiple processors.

When it is done iterating, the generated commands tell Fluent to output the wind speeds at different locations and at different heights. The locations are at each wind turbine and at the sodar we use for verification. These output points are defined as "rakes" in Fluent and the output is a text file. Of course, I wrote a program to read the rake output and save the results in other formats.

I was surprised at how well Fluent "scales." Doubling the number of processors pretty much halves the run time. Most programs do not scale as well because the communication time between processors usually cuts into the advantage that additional processors could provide. I believe that speaks well of the folks who wrote the Fluent program. Additionally, Fluent automatically detects and takes advantage of hyperthreading. Hyperthreading is a feature in some Intel processors that allow a single processor or core to act almost like two. With Fluent it does act like two, which also speaks well of their programmers.

One problem we found with using Fluent has to do with slightly different wind directions at different heights. For instance, when the wind is mainly from the South, wind from one height might be slightly from the Southeast but slightly from the Southwest at a different height. That means that wind is both slightly in flowing and slightly out flowing on both the East and West sides of the mesh, depending on height. Treatment of the top boundary is also difficult because of vertical wind velocities.

Of course, the results that Fluent provides can not be more accurate than the coarser forecast provided by WRF. Fluent just distributes that forecast more accurately over the higher resolution mesh. Fluent does include bouyancy effects from heat flux and uses surface roughness to simulate terrain effectes so "distribute" is not a fair characterization of what it does, but obviously, the data from Fluent will be inaccurate to the extent that the data given to it is inaccurate.