How wisdem/raft works
Project type and purpose
• RAFT is a domain-specific Python library/tool for frequency-domain analysis of floating wind turbines.
• It exposes both a CLI (runRAFT.py, example scripts) and a programmatic API (raft/ package).
• It integrates aerodynamic (CCBlade), hydrodynamic (pyHAMS), and mooring (MoorPy) sub-models to compute system response amplitudes.
File structure
Top-level directories and roles:
• raft/ → core Python modules (models, solvers, helpers)
• examples/ → usage scripts and sample YAML inputs
• designs/ → canonical YAML design files for different floating platforms
• tests/ → unit and integration tests
• docs/ → Sphinx documentation source
• .github/workflows/ → CI (testing, publishing)
• environment*.yml → Conda environments for development
• setup.py / pyproject.toml → package metadata & build
Extract architecture hints from README
• Core components: aerodynamics (CCBlade), mooring (MoorPy), optional hydrodynamics (pyHAMS).
• Input: YAML design files → parsed into Python objects.
• Workflow: user runs runRAFT.py or imports omdao_raft.py → assemble buildings blocks → solve frequency-domain equations → generate outputs.
Main components & interactions (to include
a. Entry Points
– CLI / Scripts: example-*.py, runRAFT.py
– Library API: omdao_raft.py, raft_fowt.py
b. I/O Layer
– YAML Parser (reads designs/, examples/) → Python configuration objects
– Results Writer (WAMIT_format directories, pickle, plots)
c. Core Computation
– raft_model.py: assembles system matrices
– raft_member.py & raft_rotor.py: platform and rotor definitions
– parametersweep.py: batch analysis over parameter sets
– helpers.py & member2pnl.py: geometry & mesh conversion
d. External Sub-models
– Aerodynamics: CCBlade (imported modules)
– Mooring: MoorPy API
– Hydrodynamics: pyHAMS wrapper (optional)
e. Solver
– Frequency-domain solver (inside raft_model or runRAFT)
– GitHub Actions: CI_RAFT.yml, Publish_RAFT.yml
– tests/: pytest suite
– docs/: Sphinx build
Relationships and data flow
– User (CLI or API) → I/O Layer parses YAML → Core Computation sets up model → External Sub-models are invoked → Solver computes responses → I/O Layer writes outputs → User inspects results
– Tests and CI trigger on code changes but are orthogonal to runtime flow
Architectural patterns & design principles
– Modular design: each physical domain (aero, hydro, mooring) lives in its own component
– Plugin-style external integration: optional imports (pyHAMS) guarded by availability
– Data-driven configuration: YAML at the heart of extensibility
– Clear separation of concerns: I/O, model assembly, solution, visualization