Model Configuration

ABL.ModelType
Model(resolution, domain, processes)

Set up a model with full control over the parameters.

A simulation is usually configured in a short Julia script that is then run with julia --project simulation.jl or mpiexec -n NPROC julia --project simulation.jl (cf. Parallel Processing with MPI). For more on project environments and dependencies, see Installation.

A simulation script loads the package (using ChannelFlow) and contains the two commands to set up and run a simulation. In a first step, a channel flow is set up as described in Flow Setup. This creates the initial flow field as well as the data structures necessary to compute all terms of the governing equations. In a second step, the development of this flow over a certain time period is simulated as described in Flow Simulation. During the simulation, flow data can be collected in the form of snapshots of the velocity field an different flow statistics.

Alternatively, you can also specify the parameters of a simulation in a TOML configuration file, as described in Simulation Configuration File.

Flow Setup

The functions prepare_open_channel and prepare_closed_channel are used to set up a standard channel flow using non-dimensional parameters. For more control over the setup, you can directly construct a ChannelFlowProblem as described in Advanced Flow Setup.

Missing docstring.

Missing docstring for prepare_channel. Check Documenter's build log for details.

Flow Simulation

Once a flow is set up, it can be advanced in time with the integrate! function.

Missing docstring.

Missing docstring for integrate!. Check Documenter's build log for details.

ABL.ODEMethods.SSPRK22Type
SSPRK22()

Two-stage second-order strong-stability-preserving Runge-Kutta time integration.

ABL.ODEMethods.SSPRK33Type
SSPRK33()

Three-stage third-order strong-stability-preserving Runge-Kutta time integration.

Parallel Processing with MPI

For parallel processing, the domain can be split vertically into sections that are handled by different MPI processes. This only requires running MPI.Init() before setting up a flow, and the domain will be distributed amongst the available MPI processes. It is recommended that the vertical grid size is an exact multiple of the number of processes, and the number of processes should not exceed the vertical grid size.

To run a parallel simulation, you can use a command like mpiexec -n 256 julia --project simulation.jl.

Warning

The package MPI.jl used for MPI operations does not use the system’s MPI libraries by default. When running on an HPC cluster, you probably want to use the provided system libraries, and you should always ensure that the mpiexec binary matches the MPI library. For more on this, refer to the documentation of MPI.jl.

Warning

Julia’s package precompilation mechanism does not interact well with MPI and there can be issues if several MPI processes try to precompile a package at the same time. To avoid issues, precompilation should be run by a single Julia process before running a parallel simulation, or precompilation should be deactivated completely by passing --compiled-modules=no to the julia command. More information can be found in the documentation of MPI.jl.

Variable Grid Spacing

By default, an equidistant staggered grid is used in vertical direction. For direct numerical simulation, it is often preferable to have a smaller grid spacing at the wall and a larger spacing in the free-flow region. The grid transformation can be specified with the grid_mapping option of the prepare_*_channel function, where currently the only supported option is SinusoidalMapping. For more control over the grid transform, refer to the domain option of ChannelFlowProblem.

ABL.Domains.SinusoidalMappingType
SinusoidalMapping(η, variant = :auto)

Define a transformed vertical coordinate with a mapping in the form of

$x_3 = \frac{sin(ζ η π/2)}{sin(η π/2)}$

appropriately rescaled such that it maps the range $0≤ζ≤1$ to the $x_3$-range of the Domain.

The parameter $0<η<1$ controls the strength of the grid stretching, where values close to $0$ result in a more equidistant spacing and values close to $1$ result in a higher density of grid points close to the wall(s). The value $η=1$ is not allowed since it produces a vanishing derivative of the mapping function at the wall.

The variant defines at which of the boundaries the coordinates are refined and can be set to :below, :above, :symmetric (both boundaries refined), or :auto (refined for boundaries that produce a boundary-layer).

Large-Eddy Simulation

If the grid spacing is not fine enough to resolve all relevant scales of motion, a subgrid-scale model is required to add the missing contributions from unresolved motions to the non-linear advection term. This can be specified with the sgs_model option of the prepare_*_channel function, where currently the only supported option is StaticSmagorinskyModel.

Missing docstring.

Missing docstring for StaticSmagorinskyModel. Check Documenter's build log for details.

Simulation Configuration File

Instead of passing simulation parameters as function arguments, they can be provided in a TOML configuration file. This can be helpful when running a series of simulations, since different configuration files can easily be generated programmatically.

Note

The configuration file interface is a bit less flexible since it does not support arbitrary Julia syntax.

Missing docstring.

Missing docstring for run_simulation. Check Documenter's build log for details.

Compat

This functionality is not yet implemented!

Advanced Flow Setup

To construct the full set of flow configurations that are supported, the ChannelFlowProblem can be constructed directly.

Note

The recommended usage is to create a wrapper function that takes the non-dimensional parameters of the problem of interest and sets up the ChannelFlowProblem accordingly.

Missing docstring.

Missing docstring for DiscretizedABL. Check Documenter's build log for details.