Skip to main content

3D atmospheric mesh generator for urban CFD and digital wind tunnels

Project description

airmesh

airmesh is a Python package that generates 3D wind-tunnel or wind-domain meshes using pybmesh.
It provides a simple, high-level API (Airmesh) that wraps your internal mesh generators (WindTunnel, WindDomainPolygon) and exports meshes directly to OpenFOAM format.


Features

  • Simple high-level interface to build wind-tunnel domains\

  • Two mesh generation modes: classical
    Uses the WindTunnel model: a digital wind tunnel made of two parts
    (central fixed core + rotating outer domain).

    advanced
    Uses WindDomainPolygon: a single-block polygonal wind tunnel,
    designed to remain consistent for all wind directions.

  • Supports refinement levels, core region settings, domain extrusion, multiple wind directions, etc.

  • Direct export to OpenFOAM:

    mesh.write(path=".")
    
  • Built on top of pybmesh, scikit-spatial, and gmsh


Installation

pip install airmesh

or when developing locally:

pip install -e .

Usage Example

from airmesh import Airmesh

mesh = Airmesh(
    D=1200,         # diameter of area of interest
    hc=150,         # max height
    hd=600,         # domain height
    dx=2,           # element size in core
    Lc=400,         # core length
    nwdir=16,       # number of wind directions
    vt=[0, 0, 0],   # translation vector
    refLvls=[2, 2], # refinement schedule: two levels, each coarsening by a factor of 2
    optc=0,         # 0=diamond, 1=square, 2=circle
    optm=1,         # 0=simple extrude, 1=advanced
    type="classical",
)

mesh.compute()
mesh.write(path="output/")

This will generate the OpenFOAM blockMeshDict and mesh files inside:

output/Mesh/

Project Layout

airmesh/
    src/airmesh/
        api.py
        blockmesh.py
        fmesh.py
        ...

Requirements

Installed automatically:

  • pybmesh

License

MIT License
Copyright © 2024

Project details


Download files

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

Source Distribution

airmesh-0.1.0.tar.gz (38.8 kB view details)

Uploaded Source

File details

Details for the file airmesh-0.1.0.tar.gz.

File metadata

  • Download URL: airmesh-0.1.0.tar.gz
  • Upload date:
  • Size: 38.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for airmesh-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d1b48a9ec98007da5433fbd7239fd009f5e4373e66d193f005b6b0a12b939448
MD5 28ca77c80474b482b41650d7496cedf3
BLAKE2b-256 18bbe5bc4e801e523a00f68fa7da3641c3ebbf760eabc22f36c033460812e0bf

See more details on using hashes here.

Supported by

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