Coupling To AMR-Wind

The simplest form of coupling is one-way, file-based coupling. With this approach, an ERF simulation is run and output files with relevant simulation data are stored at regular time intervals. Once the ERF simulation is complete, an AMR-Wind simulation begins, using the ERF output files as time-dependent boundary conditions or forcing.

1D File-based coupling

The 1D file-based coupling scheme is based on the Time-Height Profile Assimilation Technique proposed by Allaerts et al. In this approach, the time evolution of the vertical profile of the horizontal velocity components and potential temperature at a particular position from the mesoscale simulation is saved, and a forcing term is added to the microscale simulation to indirectly assimilate the mesoscale data at the microscale. The output files generated by ERF are NetCDF files of a format compatible with the AMR-Wind implementation of this form of coupling.

We note that the solution variables in ERF are

\[(\rho, \rho u, \rho v, \rho w, \rho \theta)\]

while those in AMR-Wind are

\[(u, v, w, T, p)\]

We convert the variables from conservative to primitive form prior to saving the output files.

The following parameters control the generation of 1D column output files in ERF. To use this capability, the user must install the NetCDF library and link to it at compile time, which can be done by setting USE_NETCDF = TRUE in the GNUMakefile for ERF.

Parameter

Definition

Acceptable Values

Default

erf.output_1d_column

whether to output for coupling to AMR-Wind

0 or 1

0

erf.column_file_name

prefix for output files

String

“column_data.nc”

erf.column_interval

how often (by level-0 time steps) to output data files

Integer \(> 0\)

-1

erf.column_per

how often (by simulation time) to write output data files

Real \(> 0\)

-1.0

erf.column_loc_x

x-coordinate where vertical profile will be extracted

prob_lo(0) <= x <= prob_hi(0)

0.0

erf.column_loc_y

y-coordinate where vertical profile will be extracted

prob_lo(1) <= y <= prob_hi(1)

0.0

  • You should specify either erf.output_int or erf.output_per, but not both.

2D File-based coupling

For 2D file-based coupling to AMR-Wind, vertical planes are saved from an ERF simulation to define inflow boundary conditions for AMR-Wind. These files are in native-AMReX format and contain the AMReX data structure known as a BndryRegister. These files are specifically meant to be read by AMR-Wind, which is also AMReX-based, or ERF itself.

To generate the boundary data files for each of the four planes, the following (or similar) should be added to the input file:

erf.output_bndry_planes = 1
erf.bndry_output_planes_interval = 2
erf.bndry_output_start_time = 0.0
erf.bndry_output_planes_file = "BndryFiles"
erf.bndry_output_var_names = temperature velocity density
erf.bndry_output_box_lo = 256. 256.
erf.bndry_output_box_hi = 768. 768.

The above inputs will output boundary planes of data at x=xlo, x=xhi, y=ylo and y=yhi, where xlo and ylo are defined by bndry_output_box_lo and xhi and yhi are defined by bndry_output_box_hi. Note that the selected lo and hi values must be interior to the first and last cell centers on the coarse grid (i.e., at least one half cell width from the boundary). Except if the domain is periodic in that direction, any location up to and including the domain boundary may be chosen. In this case the variables that are written are temperature, velocity and density, and they are written every 2 coarse time steps starting at bndry_output_start_time which is 0 in this case.

We also have the functionality in ERF to read in these types of files; for this one would add the following (or similar) line to the inputs file:

erf.input_bndry_planes = 1
erf.bndry_file = "BndryFiles"
erf.bndry_input_var_names = density temperature velocity

When run with these inputs, ERF will read in the time sequence of files contained in the folder BndryFiles, and perform time interpolation as necessary. The only assumption about the times associated with the files is that the start and end times of the current simulation lie in the time period covered by the files in BndryFiles. Within BndryFiles there is an ascii file time.dat which contains the (originating) timesteps and physical times associated with each of the files.

It is assumed at this point that the physical domain of the simulation reading the files is exactly the physical domain specified by bndry_output_box_lo and bndry_output_box_hi when the files were written. If not, ERF will abort with an error message.

We note that the boundary plane data will only be used on faces identified in the inputs file as inflow faces, i.e. if we specific inflow/outflow in the x-direction, and periodic in the y-direction, as below, then only the “xlo” boundary data from BndryFiles will actually be used.

geometry.is_periodic = 0 1 0

xlo.type = "Inflow"
xhi.type = "Outflow"