Skip to main content

No project description provided

Project description

DOI

Mann.rs

A Mann turbulence generator for Python written in Rust. Mannrs can generate 3D coherent turbulence boxes for wind turbine simulations. The numerical innovations used in this package are described in Liew, J., Riva, R., & Göçmen, T. (2023) Efficient Mann turbulence generation for offshore wind farms with applications in fatigue load surrogate modelling. The underlying Mann turbulence model is originially described in Mann, J. (1998). Wind field simulation.

Features include:

  • Parallelized computations: Just set parallel=True
  • Memory efficient: Can generate extremely high resolution turbulence.
  • Blazing fast: Thanks to the stencil method and the Rust backend.
  • Arbitrary box sizing: Box discretization is not limited to powers of 2.

Usage

Mannrs separates the process of generating turbulence into two steps: stencil generation and turbulence generation. The stencil is a 5D matrix containing the spectral tensors needed to generate turbulence for a given set of parameters. A stencil can be reused to generate multiple random instances of turbulence. Implementations are provided in Python and Rust.

Python

import mannrs

params = {
    "L": 30.0,
    "gamma": 3.2,
    "Lx": 6000,
    "Ly": 200,
    "Lz": 200,
    "Nx": 8192,
    "Ny": 64,
    "Nz": 64,
}
ae = 0.2
seed = 1234

stencil = mannrs.Stencil(**params)
U, V, W = stencil.turbulence(ae, seed)

Rust

use mannrs::Stencil;

let (L, gamma) = (30.0, 3.2);
let (Lx, Ly, Lz) = (6000.0, 200.0, 200.0);
let (Nx, Ny, Nz) = (8192, 64, 64);
let ae = 0.2;
let seed = 1234;

let stencil = Stencil::from_params(L, gamma, Lx, Ly, Lz, Nx, Ny, Nz);
let (U, V, W) = stencil.turbulence(ae, seed);

Installation

Installation for both Python and Rust versions requires the Rust compiler to be installed (see here for installation instructions).

Python (Linux and MacOS only)

Clone this repository and pip install:

git clone git@github.com:jaimeliew1/Mann.rs.git
cd Mann.rs
pip install .

Rust

cargo install --git https://github.com/jaimeliew1/Mann.rs mannrs

Contributions

If you have suggestions or issues with Mann.rs, feel free to contact me at jaimeliew1@gmail.com. Pull requests are welcome.

Citation

If you want to cite Mann.rs, please use this citation:

Jaime Liew. (2022). jaimeliew1/Mann.rs: Publish Mann.rs (v1.0.0). Zenodo. https://doi.org/10.5281/zenodo.7254149

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

mannrs-1.2.0-cp312-none-win32.whl (367.4 kB view hashes)

Uploaded CPython 3.12 Windows x86

mannrs-1.2.0-cp312-cp312-manylinux_2_34_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.34+ x86-64

mannrs-1.2.0-cp312-cp312-macosx_10_12_x86_64.whl (696.8 kB view hashes)

Uploaded CPython 3.12 macOS 10.12+ x86-64

mannrs-1.2.0-cp311-none-win32.whl (368.1 kB view hashes)

Uploaded CPython 3.11 Windows x86

mannrs-1.2.0-cp311-cp311-manylinux_2_34_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.34+ x86-64

mannrs-1.2.0-cp311-cp311-macosx_10_12_x86_64.whl (699.5 kB view hashes)

Uploaded CPython 3.11 macOS 10.12+ x86-64

mannrs-1.2.0-cp310-none-win32.whl (367.9 kB view hashes)

Uploaded CPython 3.10 Windows x86

mannrs-1.2.0-cp310-cp310-manylinux_2_34_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.34+ x86-64

mannrs-1.2.0-cp310-cp310-macosx_10_12_x86_64.whl (699.1 kB view hashes)

Uploaded CPython 3.10 macOS 10.12+ x86-64

mannrs-1.2.0-cp39-none-win32.whl (367.9 kB view hashes)

Uploaded CPython 3.9 Windows x86

mannrs-1.2.0-cp39-cp39-manylinux_2_34_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.34+ x86-64

mannrs-1.2.0-cp39-cp39-macosx_10_12_x86_64.whl (699.5 kB view hashes)

Uploaded CPython 3.9 macOS 10.12+ x86-64

mannrs-1.2.0-cp38-none-win32.whl (368.2 kB view hashes)

Uploaded CPython 3.8 Windows x86

mannrs-1.2.0-cp38-cp38-manylinux_2_34_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.34+ x86-64

mannrs-1.2.0-cp38-cp38-macosx_10_12_x86_64.whl (699.7 kB view hashes)

Uploaded CPython 3.8 macOS 10.12+ x86-64

mannrs-1.2.0-cp37-none-win32.whl (368.6 kB view hashes)

Uploaded CPython 3.7 Windows x86

mannrs-1.2.0-cp37-cp37m-manylinux_2_34_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.34+ x86-64

mannrs-1.2.0-cp37-cp37m-macosx_10_12_x86_64.whl (700.6 kB view hashes)

Uploaded CPython 3.7m macOS 10.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page