Skip to content

refactor!: give the solver a propeller model instead of a coefficient table - #21

Merged
karakayahuseyin merged 2 commits into
mainfrom
feat/propeller-model-interface
Nov 18, 2026
Merged

karakayahuseyin merged 2 commits into
mainfrom
feat/propeller-model-interface

Conversation

@karakayahuseyin

Copy link
Copy Markdown
Contributor

Summary

The solver read thrust and power coefficients straight from a PropellerEntry, so a propeller could only be an APC table. This PR puts an interface between the two, as groundwork for a blade-element propeller model. Solver results do not change.

  • PropellerModel (protocol): diameter_m, max_advance_ratio, and thrust_torque(rho, airspeed_mps, rpm).
  • TablePropeller: the model for tabulated coefficients. It wraps a PropellerEntry and holds the diameter that PropellerSpec carried.
  • Solver, bus solver, OpenMDAO component: take one propeller argument. The solver derives the advance ratio and the reported ct/cp from the model's thrust and torque.
  • Package rename: pythrust.propellers → pythrust.propeller.

Breaking changes

  • solve_operating_point() and PropulsionUnit take propeller=TablePropeller(entry) in place of propeller=PropellerSpec(...) and prop_entry=entry.
  • PropellerSpec is removed. For a diameter other than the table's, use TablePropeller(entry, diameter_m=...).
  • PropulsionSolver._estimate_j_max is now TablePropeller.max_advance_ratio.
  • Import from pythrust.propeller instead of pythrust.propellers.

PropulsionComponent keeps its prop_entry option.

Verification

  • The first commit records the solver's output before the refactor: 17 operating points and one bus case, covering static and forward flight, table and diameter limits, current limits, the second-order motor and the rate-map battery. After the refactor the largest relative deviation from those values is 3.7e-16.
  • 150 tests pass locally.
  • rate_map_battery_mission.py and select_motor_from_database.py printed byte-identical output before and after the solver change.
  • Not run: mkdocs build --strict (mkdocs is not installed in the local environment). The docs changes are edits to code samples and one new section in api_reference.md.

Notes

  • max_advance_ratio serves the solver's RPM search rather than describing the propeller. It is kept here so that behavior stays unchanged, and should be revisited when the blade-element model is added.
  • The data directory pythrust/data/propellers/ and tests/test_propellers.py keep their names.
  • No version bump in this PR.

🤖 Generated with Claude Code

karakayahuseyin and others added 2 commits November 18, 2026 23:37
Record the operating points the solver returns for 17 cases and one bus
at 489e7ab: static and forward flight, table and diameter limits, current
limits, the second-order motor and the rate-map battery. The values pin
behavior so the refactor can be shown to leave results unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… table

The solver read thrust and power coefficients straight from a
PropellerEntry, so a propeller could only be an APC table. It now takes a
PropellerModel: a diameter, the advance ratio its RPM search starts at,
and thrust and torque at a density, airspeed and RPM. TablePropeller is
the model for tabulated coefficients and holds the diameter that
PropellerSpec carried, so a propeller is one argument instead of two.

The solver derives the advance ratio and the coefficients it reports from
the model's thrust and torque. Results match the golden values to
rounding error.

The package pythrust.propellers is renamed pythrust.propeller.

BREAKING CHANGE: solve_operating_point() and PropulsionUnit take
propeller=TablePropeller(entry) in place of propeller=PropellerSpec(...)
and prop_entry=entry. PropellerSpec is removed; pass a diameter other
than the table's as TablePropeller(entry, diameter_m=...).
PropulsionSolver._estimate_j_max is now TablePropeller.max_advance_ratio.
Import from pythrust.propeller instead of pythrust.propellers.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@karakayahuseyin
karakayahuseyin merged commit 1fc8dc0 into main Nov 18, 2026
4 checks passed
@karakayahuseyin
karakayahuseyin deleted the feat/propeller-model-interface branch November 18, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant