Skip to content

Input file schema

Input file example

#
#             Mann.rs Turbulence Input File
#
# Defines parameters for generating synthetic turbulence
# fields using the Mann model. This example generates
# three turbulence boxes with different spectral scaling
# and random seeds, all sharing the same stencil params.

[stencil_spec]
L = 30.0    # Length scale (m), size of large eddies
gamma = 3.9 # Anisotropy, elongation of structures
Lx = 200.0  # Domain length in x (m)
Ly = 200.0  # Domain length in y (m)
Lz = 8192.0 # Domain length in z (m)
Nx = 8192   # Grid points in x
Ny = 32     # Grid points in y
Nz = 32     # Grid points in z
# sinc_thres = 3.0  # Threshold for Mann sinc
# correction at low frequencies (default = 3.0)

# Periodicity flags: control whether the turbulence
# box is periodic in each direction. Setting false
# can cut cost ~half. Defaults: y,z = aperiodic.
# aperiodic_x = false
# aperiodic_y = true
# aperiodic_z = true

# Turbulence boxes:
# Each defines a turbulence realization with its own
# scaling and seed. Add as many as needed.
[[turbulence_boxes]]
ae = 0.1   # Spectral scaling factor (αε^{2/3})
seed = 42  # Random seed
output = "output1.npz"  # Output filename
# format = "npz"   # 'npz', 'netCDF', or 'HAWC2'
# u_offset = 0.0   # Velocity offset in u
# y_offset = 0.0   # Spatial offset in y
# z_offset = 0.0   # Spatial offset in z

[[turbulence_boxes]]
ae = 0.2
seed = 123
output = "output2.npz"

[[turbulence_boxes]]
ae = 0.3
seed = 234
output = "output3.nc"
format = "netCDF"

# Constraints: omit [constraint_spec] for an
# unconstrained box. See example_constrained.toml
# for constrained turbulence input files.
# [constraint_spec]
# spectral_compression_target = 0.8
# corr_thres = 0.0001
# constraints = [
#   { x = 10, y = 10, z = 10, u = 0.3 },
#   { x = 20, y = 20, z = 20, u = 0.3 },
# ]

Stencil

mannrs.Stencil.StencilSpec pydantic-model

Bases: BaseModel

Base stencil template. Can be constrained via constrain.

Fields:

L pydantic-field

L: float

Length scale (m), characterizes the size of energy-containing eddies

Lx pydantic-field

Lx: float

Domain length in x-direction (m)

Ly pydantic-field

Ly: float

Domain length in y-direction (m)

Lz pydantic-field

Lz: float

Domain length in z-direction (m)

Nx pydantic-field

Nx: int

Number of grid points in x-direction

Ny pydantic-field

Ny: int

Number of grid points in y-direction

Nz pydantic-field

Nz: int

Number of grid points in z-direction

aperiodic_x pydantic-field

aperiodic_x: bool = False

sets aperiodicity in the x-direction. Turning off aperiodicity (false) can reduce computational cost by approximately half.

aperiodic_y pydantic-field

aperiodic_y: bool = True

sets aperiodicity in the y-direction. Turning off aperiodicity (false) can reduce computational cost by approximately half.

aperiodic_z pydantic-field

aperiodic_z: bool = True

sets aperiodicity in the z-direction. Turning off aperiodicity (false) can reduce computational cost by approximately half.

gamma pydantic-field

gamma: float

Anisotropy parameter [-]

sinc_thres pydantic-field

sinc_thres: float = 3.0

Threshold for applying the Mann sinc correction to low-frequency modes.

mannrs.Stencil.ConstraintSpec pydantic-model

Bases: BaseModel

Specification for velocity constraints and related parameters.

Fields:

constraints pydantic-field

constraints: list[Constraint]

List of velocity constraints at certain positions in 3D space.

corr_thres pydantic-field

corr_thres: float = 0.0001

Threshold for sparsifying the constraint correlation matrix.

spectral_compression_target pydantic-field

spectral_compression_target: float = 0.8

Desired compression ratio for the constraint impulse response.

mannrs.Stencil.Constraint pydantic-model

Bases: BaseModel

A velocity constraint at a specific point in space.

Fields:

  • x (float)
  • y (float)
  • z (float)
  • u (float)

u pydantic-field

u: float

Desired streamwise (x-direction) velocity at the constraint point (m/s).

x pydantic-field

x: float

X-coordinate of the constraint point (m).

y pydantic-field

y: float

Y-coordinate of the constraint point (m).

z pydantic-field

z: float

Z-coordinate of the constraint point (m).

mannrs.Stencil.TurbulenceSpec pydantic-model

Bases: BaseModel

Parameters for generating and saving a turbulence wind field realization.

Fields:

ae pydantic-field

ae: float

Turbulence intensity scaling factor.

format pydantic-field

format: Literal['npz', 'netCDF', 'HAWC2'] = 'npz'

Output file format.

output pydantic-field

output: Path

Output file path for saving the wind field.

seed pydantic-field

seed: int

Random seed for reproducibility.

u_offset pydantic-field

u_offset: float = 0.0

Velocity offset added to the u velocity component.

y_offset pydantic-field

y_offset: float = 0.0

Spatial offset added to the y axis (e.g. to center the box at zero.)

z_offset pydantic-field

z_offset: float = 0.0

Spatial offset added to the z axis.