Introduction

A collection of examples for running large-eddy simulations of wind plant aerodynamics is available under nalu-wind/examples/. A setup.yaml file is included with all cases. This file has the most revelant parameters that can be modified for each case of interest.

A set of Python utilities is included with the examples. These utilities are meant to simplify the process of generating input files for running Nalu and plot results form the simulations.

Each case has a default collection of template input files in ./template_input_files. The executable nalu_input_fileX will take the input files and modify them according to the inputs set in setup.yaml and generate new and ready to use input files.

Instructions to compile Nalu are provided in Building Nalu-Wind. The wind-utils repository needs to be compiled to have a access to all the pre-processing utilities used in the example cases. The wind-utils repository can be downloaded as a submodule by running this command inside the nalu-wind/ repository:

git submodule init && git submodule update

Now, wind-utils can be compiled with Nalu by enabling the compilation flag:

-DENABLE_WIND_UTILS=ON

during CMake configure phase. Subsequent make install will install all wind-utils executables along side naluX under the same installation prefix.

The general instructions to run each case

  1. Modify the simulation parameters in the setup.yaml file.

  2. Execute the nalu_input_fileX script with the setup.yaml file as an input.

  3. Generate the mesh using abl_mesh from nalu wind utils.

  4. Generate the initial condition using nalu_preprocess.

  5. Run the simulation using naluX.

Setting up the environment

In order to use the Python utilities to create the input files and post-process some of the data, a proper environment needs to be set. The user can add these libraries to their Python environment, or use conda to create the environment needed. Instruction to install conda can be found here.

The new environment can be created through conda using:

conda create -n nalu_python -c conda-forge python=3.6 numpy ruamel.yaml netCDF4 matplotlib scipy pandas

This new environment will allow the execution of nalu_input_fileX. The environment is saved in THE USER system, so it needs to be created only once. After that, it just needs to be activated.

Now, to use the environment run:

source activate nalu_python

The nalu_input_fileX script

This code is an executable which takes as an input a set-up file. The executable will read in the set-up file, and create a new nalu input file based on the parameters specified. Excuting the code with the -h flag will provide the necessary information:

./nalu_input_fileX -h

The setup.yaml file

This file includes the inputs to be modified for a case. This example is for a Neutral Atmospheric Boundary Layer simulation.

################################################################################
#     This is the input file for an ABL Simulation.
#     All the parameters in this file will be used to create Nalu inputs.
################################################################################

##########################################################################
# These are the example input files and the files which will be generated.
##########################################################################
# The old input files which will be modified
template_input: template_input_files/ablNeutralEdge.yaml
template_preprocess: template_input_files/nalu_preprocess.yaml

# The name of the new input files
new_input: abl_simulation.yaml
new_preprocess: abl_preprocess.yaml

# Establish if the simulation is a restart or not (yes/no)
restart: no

######################################
# Wind speed and temperature profiles
######################################
# Wind speed at specified height [m/s].
U0Mag:                8.0
# Wind direction [deg]. A direction of 270 deg means the wind is coming from the
#     west, which is from left to right.
#
#                      N 0deg
#                       |
#                       |
#                       |
#             W 270deg --- E 90deg
#                       |
#                       |
#                       |
#                      S 180deg
#
wind_dir:                  270.0
# Height at which to drive mean wind to U0Mag/dir [m].
wind_height:           90.0
# Temperature values [K] at each height [m] for initial condition
temperature_heights: [    0, 650.0, 750.0, 1000.0 ]
temperature_values:  [300.0, 300.0, 308.0,  308.75]

######################
# Material properties
######################
# Density [kg/m^3]
density:              1.
# Kinematic viscosity [m^2/s].
nu:                   1.0E-5
# Reference potential temperature [K].
TRef:                 300.0
# Latitude on the Earth of the site [deg].
latitude:             41.3

##############
# Bottom wall
##############
# Wall-normal component of temperature flux at wall.
# A negative value is flux into domain [K-m/s].
qwall:               0.
# Surface roughness (m).
z0:                   0.15

################
# Time controls
################
# Time-step [s]
time_step: 0.5
# Total number of time to run [s]
total_run_time: 20000
# Check for CFL  condition

########
#  Mesh
########
# Here are the mesh properties
mesh:
  # Generate the mesh or read from an input file (yes/no)
  generate: yes
  # The name of the mesh file
  # If the mesh is generated the preprocessor will generate a mesh
  # If not the code will read in this mesh
  mesh_file: mesh_abl.exo
  # The domain bounds [m]
  domain_bounds_x: [0.0, 5000.0]
  domain_bounds_y: [0.0, 5000.0]
  domain_bounds_z: [0.0, 1000.0]

  # The number of grid points in the x, y, z coordinates
  # Change this variable
  number_of_cells: [500, 500, 100]

#########
# Output
#########
# How often to write output [s]
# This is time-steps in nalu input
output_frequency: 10000
# Output file name. It will create the directory
# Change .e
output_data_base_name: output/abl_5km_5km_1km_neutral.exo

# These are the plane averaged statistics
boundary_layer_statistics:
  # The file to write output (netcdf)
  stats_output_file: abl_statistics.nc
  # How often sample the statistics
  time_hist_output_frequency: 1

##################################
# Add restart capability
# Default to write last time-step
##################################

##################################################
# Upper wall boundary condition
# This is an optional flag
# If not specified, the gradient will be computed 
#     based on the initial condition
#     at the top of the domain
##################################################
# Potential temperature gradient above the strong inversion (K/m).
# Compute this form the last points
# TGradUpper:           0.003