.. _wind_farm_example: Wind Farm --------- This case is a large-eddy simulation of a wind farm under neutral stability conditions. The simulation requires 3 steps: 1) running a precursor atmospheric boundary layer simulation, 2) sampling the data from the boundaries, and 3) running the wind farm simulation with inflow/outflow boundary conditions. This examples guides the user through all these steps. Case 1: Precursor simulation ========================================= This example follows the same procedure as :ref:`abl_neutral_example`. The only difference is that now, the boundary data is sampled. 1. Load the appropriate Nalu environment. This requires loading the libraries and Python environment as described in :ref:`examples_environment`. For users on Peregrine the function defined in :ref:`peregrine_environment` should suffice:: nalu_env 2. Go to the directory where the case is:: cd nalu-wind/examples/wind_farm/case1/ 3. Modify the ``setup.yaml`` file to include all the necessary simulation parameters. 4. Run the executable and provide the ``setup.yaml`` file as input:: ../../nalu_input_fileX -s setup.yaml 5. Generate the mesh:: ../abl_mesh -i case_1_precursor_preprocess.yaml 6. Generate the initial condition:: ../nalu_preprocess -i case_1_precursor_preprocess.yaml 7. Run the nalu executable:: mpirun -np 8 ../naluX -i case_1_precursor_simulation.yaml In this example 8 processors are used, but any number of processors could be used. Target 50K elements per core for choosing number of MPI cores. Case 2: Sampling boundary data ============================== Now, a simulation for sampling the boundary data is performed. This is the same as the previous simulation, but with 2 changes: 1) Data sampling from the boundary conditions. 2) Different time interval 1. Load the appropriate Nalu environment. This requires loading the libraries and Python environment as described in :ref:`examples_environment`. For users on Peregrine the function defined in :ref:`peregrine_environment` should suffice:: nalu_env 2. Go to the directory where the case is:: cd nalu-wind/examples/wind_farm/case2 3. Modify the ``setup.yaml`` file to include all the necessary simulation parameters. 4. Run the executable and provide the ``case_2_setup_abl_precursor_boundary_data.yaml`` file as input:: ../../nalu_input_fileX -s setup.yaml 5. Generate the boundary data to sample:: ../nalu_preprocess -i case_2_boundary_data_preprocess.yaml 6. Run the nalu executable:: mpirun -np 8 ../naluX -i case_2_abl_precursor_boundary_data.yaml In this example 8 processors are used, but any number of processors could be used. Target 50K elements per core for choosing number of MPI cores. Case 3: Wind farm simulation ============================ The last part is the wind farm simulation. In this example, the simulation is run using the same resolution as the precursor. However, it is possible to perform local refinement near the turbines. Full instructions are provided in `wind-utils `_. 1. Load the appropriate Nalu environment. This requires loading the libraries and Python environment as described in :ref:`examples_environment`. For users on Peregrine the function defined in :ref:`peregrine_environment` should suffice:: nalu_env 2. Go to the directory where the case is:: cd nalu-wind/examples/wind_farm/case3 3. Modify the ``setup.yaml`` file to include all the necessary simulation parameters. 4. Run the executable and provide the ``setup.yaml`` file as input:: ../../nalu_input_fileX -s setup.yaml 5. Run the nalu executable:: mpirun -np 8 ../naluX -i case_3_wind_farm.yaml In this example 8 processors are used, but any number of processors could be used. Target 50K elements per core for choosing number of MPI cores. Post-processing =============== The data generated by this example can be post-processed using the same scripts provided in :ref:`abl_neutral_example` and :ref:`alm_example`.