Skip to content

wr1/b3mc

Repository files navigation

b3mc — Modular Blade Design and Meshing Toolkit

CI codecov

A Python toolkit for the structural design, meshing, and analysis of wind turbine blades.

Overview

b3mc is organised as a set of composable submodules, each responsible for one stage of the blade design workflow:

b3_yml   →  b3_geo  →  b3_msh  →  b3_drp  →  b3_2d / b3_fea
                                               b3_bem (aerodynamics)
Package Role
b3_yml Reference datasets (blade configs, airfoils, polars)
b3_geo Blade geometry — planform interpolation, airfoil placement, lofting
b3_msh 2D and 3D meshing — web intersections, panel remeshing, quad surface meshes
b3_drp Ply draping — assign laminates to meshes based on geometric conditions
b3_2d Cross-section analysis — project line meshes to 2D via cgfoil, export to ANBA4
b3_fea FEA export — write CalculiX (CCX) input decks
b3_bem BEM aerodynamics — rotor performance via CCBlade
b3_state Incremental execution — skip steps whose inputs haven't changed
b3_mat Composite materials — CLT homogenization of ply stacks to orthotropic properties
cgfoil General-purpose line-to-2D mesher (CGAL CDT)

Installation

Requires Python 3.10–3.13. Uses uv.

uv pip install -e .

Optional: BEM analysis

b3_bem depends on CCBlade, which requires a Fortran compiler and Meson:

# Install gfortran + meson/ninja, then:
uv pip install -e ".[bem]"

Optional: Cross-section analysis (ANBA4)

b3_2d cross-section solving runs inside a Docker container with FEniCS + ANBA4:

bash setup_docker.sh

Quickstart

from b3_yml import prepare_dataset

# Copy a reference blade dataset to a working directory
yml_path = prepare_dataset("blade_test", target_dir="my_blade/")

Run the full 2D workflow from the CLI:

b3m run my_blade/blade_test.yml

Workflow

Geometry

b3_geo interpolates the planform and places airfoil cross-sections along the span, producing lofted 3D line meshes (.vtp).

Meshing

b3_msh computes web–airfoil intersections, inserts hard points at each intersection, and remeshes panels with specified element sizes. Both 2D (per-section line meshes) and 3D (quadrilateral surface meshes) outputs are supported.

Supported web types:

Type Description
plane Flat shear web defined by origin and normal
line Web defined by a point and direction
trailing_edge Full chord from leading to trailing edge
ribbon Offset-varying web referenced to a plane web (intersection pending)

Composites

b3_mat provides models for isotropic, orthotropic and composite materials. Composites (type: composite) specify ply stacks (material, angle, thickness) and are homogenized via Classical Laminate Theory (CLT) into effective orthotropic properties for ANBA/FEA.

Ply Draping

b3_drp loops over plies defined in the YAML laminates section and evaluates each ply's presence and thickness on each mesh cell, writing per-ply VTK arrays.

Cross-section Analysis

b3_2d loads draped 2D line meshes, projects them into filled cross-sections using cgfoil, and exports to ANBA4 (via Docker) or VTK.

BEM

b3_bem wraps CCBlade for rotor performance analysis. Control optimisation across four wind speed regimes (low / mid / upper / rated) is supported.

Visualisations

Blade geometry (3D surface mesh)

3D blade

Cross-sections (cgfoil 2D meshes)

2D sections

Generated by docs/generate_viz.py. Re-run after the blade workflow to refresh.

GUI

b3-gui is a PySide6 desktop application for interactively editing blade YAML files.

# Open with a specific config file
b3-gui path/to/blade.yml

# Or open the file dialog on launch
b3-gui
Tab Contents
Planform Interactive spline charts for chord, thickness, twist, dx, dy — drag control points to edit, Space to add/delete
BEM Scalar aerodynamic parameters and polar table
Loads Import loads from BEM output, apply safety factors
Design → Structure Shear web definitions
Design → Laminates Datum taper definitions and ply stack
Design → Materials Material database properties

Use File → Open YAML / Save YAML to load and write back to disk. Changes are written in-place preserving YAML comments.

Versions dock

A persistent dock on the right side provides git-backed save points for the blade design. The YAML directory is tracked as a git repository; a .gitignore is written automatically to exclude pipeline output directories and VTK files.

  • Type a label in the text box and press Save to commit the current state (YAML is written to disk first)
  • The log shows all saved versions with date and label
  • Double-click any entry to restore the design to that state — the YAML is reloaded automatically
  • Toggle the dock via View → Versions

Screenshots

Planform Design
Planform tab Design tab
BEM Loads
BEM tab Loads tab

Regenerate with python docs/screenshot_gui.py.

Testing

uv run pytest

Tests that require optional dependencies (CCBlade, CGAL) are skipped automatically when those packages are not installed.

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Contributors

Languages