How nlrwindsystems/weis works
1. What this repo is
WEIS is a Python-based co-design framework for wind turbines, especially floating offshore turbines. The core architecture is not a single application, but a set of coordinated subsystems that turn YAML-defined design/analysis inputs into simulations, load cases, optimizations, and visualizations.
2. Primary boundary: orchestration vs. solvers
The main runtime boundary is between WEIS orchestration code and external solvers/tools. WEIS coordinates:
- OpenFAST for aeroelastic time-domain simulation
- ROSCO for control tuning and controller generation
- RAFT for frequency-domain floating-system analysis
- WISDEM for turbine design/cost-related models
- TurbSim / IEC wind models for inflow and DLC wind generation
- pyOptSparse and custom optimizers for design loops
- pCrunch-style postprocessing for loads/output handling
3. Input and schema layer
The weis/inputs package defines the input contract via YAML schemas and validation. These schemas describe:
- geometry
- modeling options
- analysis options
- OpenFAST-related inputs
This layer is the main boundary for user configuration and is mirrored in the docs/inputs schema documentation and the many example YAML files.
4. Workflow orchestration
The weis/glue_code package is the central integration layer. It parses input files, loads model options, coordinates tool setup, and dispatches work to the simulation and optimization subsystems. Files like runWEIS.py, glue_code.py, and the gc_* modules are the place where the end-to-end workflow is assembled.
5. Aeroelastic simulation subsystem
The weis/aeroelasticse package wraps OpenFAST execution. It handles:
- case generation
- FAST input preparation
- batch execution
- linearization handling
- OpenMDAO/OpenFAST integration
- IEC/coherent gust helpers
This subsystem is responsible for turning a turbine model plus load cases into simulation outputs and linearizations.
6. Control subsystem
The weis/control package handles controller-related logic. It includes:
- ROSCO tuning and controller input generation
- linear model handling
- multi-blade coordinate utilities
- tuned mass damper support
- distributed aerodynamic control tooling
In the example models, this subsystem feeds controller files back into OpenFAST/ServoDyn inputs.
7. Frequency-domain and hydrodynamic modeling
The weis/frequency and weis/ss_fitting packages support floating-system dynamics in the frequency domain. RAFT-based analysis provides efficient low-order response modeling, while state-space fitting tools convert hydrodynamic data into reduced models. This is a separate analysis path from time-domain OpenFAST, but it plugs into the same design workflow.
8. Design load cases and wind field generation
The weis/dlc_driver package generates design load case runs and associated wind/turbulence inputs. It is the subsystem that expands a high-level analysis request into many simulation jobs, including IEC-style wind conditions and turbulence realizations. These generated jobs then flow into the OpenFAST execution layer.
9. Optimization and multifidelity search
Optimization is split across two main areas:
- weis/multifidelity: trust-region and multifidelity methods
- nsga2_weis: a custom NSGA-II implementation integrated with optimization drivers
This layer manages iterative design updates across aero, structural, control, and floating-system variables, using responses from simulation/frequency-domain tools as objective/constraint inputs.
10. Postprocessing and visualization
The weis/visualization package and its Dash app server provide interactive inspection of inputs, geometry, optimization outputs, and OpenFAST/WISDEM results. Separate plotting utilities support offline result review. This is downstream-only: it consumes generated output files and does not participate in the core optimization loop.
11. Examples as architecture documentation
The examples directory is effectively a map of supported workflows: setup of OpenFAST models, simulation of custom models, model generation for DLCs, controller design, RAFT-based design, parametric studies, preprocessing, and staged model-creation workflows. These examples show the intended data flow: YAML inputs → driver script → WEIS orchestration → external tools → results/postprocessing.
12. Non-core but relevant infrastructure
CI and docs are well developed, but they support the architecture rather than define it. The presence of .github/workflows, docs/, and environment.yml indicates the repo is designed for reproducible scientific workflows, tested Python packaging, and documented input/output contracts. The share/ and Kestrel-related scripts indicate HPC batch execution support as an operational boundary.
Main entry points: glue_code.py Glue code · gc_RunTools.py Tool setup · aeroelasticse OpenFAST wrapper · multifidelity Trust region
Components 20
Core workflow
Input parsing, orchestration, and end-to-end runtime coordination.
- WEIS entry · Top-level command and package entry point for WEIS runs.
weis/main.py - Run WEIS · Primary runner that assembles the full co-design workflow.
weis/glue_code/runWEIS.py - Glue code · Central workflow assembly for loading inputs, wiring tools, and dispatching analyses.
weis/glue_code/glue_code.py - Input schemas · YAML schema definitions and validation for geometry, modeling, analysis, and OpenFAST inputs.
weis/inputs - Load inputs · Helpers for reading and normalizing user configuration into runtime structures.
weis/glue_code/gc_LoadInputs.py - Tool setup · Coordinates setup and execution of external solvers and shared runtime utilities.
weis/glue_code/gc_RunTools.py
Analysis engines
Time-domain, frequency-domain, wind/load-case, and control subsystems.
- ROSCO inputs · Builds controller-specific inputs and tuning data for turbine simulations.
weis/glue_code/gc_ROSCOInputs.py - OpenFAST wrapper · OpenFAST execution, case generation, linearization, and batch wrappers.
weis/aeroelasticse - DLC driver · Expands analysis requests into design load case jobs and wind/turbulence inputs.
weis/dlc_driver - Control · ROSCO tuning, linear models, MBC utilities, distributed control, and TMD support.
weis/control - Frequency analysis · Frequency-domain floating-system analysis path built around RAFT-style modeling.
weis/frequency/raft_wrapper.py - State-space fit · State-space fitting and inverse-frequency tools for reduced hydrodynamic models.
weis/ss_fitting
Optimization
Search methods and specialized optimization drivers.
- Trust region · Trust-region and multifidelity search methods used in design loops.
weis/multifidelity - NSGA-II · Custom NSGA-II algorithm and OpenMDAO-oriented driver integration.
nsga2_weis
Outputs
Visualization and downstream inspection tools.
- Visualization · Interactive Dash app and plotting utilities for inputs, geometry, optimization, and outputs.
weis/visualization
Examples
Workflow examples and reference setups.
- Examples · Reference workflows showing supported input-to-result pipelines.
examples - DLC runs · Example pipeline for generating and simulating design load cases.
examples/02_generate_openfast_model_for_dlcs - Design loops · Examples for coupled design with OpenFAST, controller tuning, and floating-system design.
examples/03_design_with_openfast - RAFT design · Examples for frequency-domain floating-system analysis and optimization.
examples/04_frequency_domain_analysis_design - Model stages · Staged model-building workflow covering aero-structural, controller, floating, and DLC setup.
examples/11_model_creation_process
Connections 25
- WEIS entry → Run WEIS: starts · CLI/package entry launches the main workflow runner.
- Run WEIS → Glue code: orchestrates · The runner delegates to the central glue layer.
- Glue code → Input schemas: validates · Workflow begins with schema-backed input loading and validation.
- Glue code → Load inputs: parses · Glue code reads and normalizes user configuration.
- Glue code → Tool setup: dispatches · Glue code hands execution to subsystem/tool setup.
- Glue code → ROSCO inputs: prepares · Controller-related inputs are derived during workflow assembly.
- Tool setup → OpenFAST wrapper: runs · Simulation jobs are executed through the OpenFAST wrapper layer.
- Tool setup → DLC driver: expands · Load-case generation is used to create simulation batches.
- Tool setup → Control: configures · Controller tuning and model utilities support the runtime setup.
- Tool setup → Frequency analysis: analyzes · Frequency-domain analysis is invoked as an alternate analysis path.
- Tool setup → State-space fit: reduces · Hydrodynamic data can be reduced to state-space representations.
- Control → OpenFAST wrapper: feeds · Controller outputs are consumed by OpenFAST/ServoDyn inputs.
- DLC driver → OpenFAST wrapper: generates cases · DLC jobs flow into OpenFAST execution.
- Frequency analysis → Trust region: supports · Frequency-domain responses can participate in design optimization.
- OpenFAST wrapper → Trust region: returns responses · Simulation outputs provide objective and constraint data.
- OpenFAST wrapper → NSGA-II: returns responses · Time-domain results can drive multiobjective search.
- Trust region → Glue code: iterates · Multifidelity search updates the coupled design workflow.
- NSGA-II → Glue code: iterates · NSGA-II-based optimization loops back through the orchestration layer.
- Visualization → OpenFAST wrapper: inspects · Visualization consumes OpenFAST outputs and derived results.
- Visualization → Trust region: inspects · Visualization also reviews optimization histories and outputs.
- Examples → Glue code: demonstrates · Examples show how drivers invoke the workflow layer.
- DLC runs → DLC driver: shows · DLC examples demonstrate load-case expansion and execution.
- Design loops → Control: shows · Design examples demonstrate control-aware co-design.
- RAFT design → Frequency analysis: shows · Frequency-domain examples demonstrate RAFT-based design.
- Model stages → Glue code: shows · Staged model creation examples demonstrate the orchestration boundary.