Skip to content

FIX: compute LiquidMotor.propellant_I_33 from tank geometry (fixes #1191) - #1192

Closed
zjk199506 wants to merge 1 commit into
RocketPy-Team:developfrom
zjk199506:fix/propellant-I33
Closed

FIX: compute LiquidMotor.propellant_I_33 from tank geometry (fixes #1191)#1192
zjk199506 wants to merge 1 commit into
RocketPy-Team:developfrom
zjk199506:fix/propellant-I33

Conversation

@zjk199506

Copy link
Copy Markdown

Summary

Fixes #1191.

LiquidMotor.propellant_I_33 was hard-coded to return 0, silently dropping the propellant roll inertia from the 6-DOF dynamics. Vehicle-scale tanks carry 10^2-10^4 kgm^2 of roll inertia (e.g. a 3267 kg LOX column in a r=0.7 m cylinder carries 1/2 m r^2 ~= 800 kgm^2), so roll-channel analyses (roll control sizing, roll resonance, spin dynamics) were off by the full propellant contribution.

Implementation

For each positioned tank, the roll inertia of the liquid and gas columns is integrated from the tank geometry, mirroring the existing liquid_inertia/gas_inertia patterns:

roll_volume = (geometry.area * geometry.radius**2).integral_function(geometry.bottom)
liquid_column = roll_volume @ tank.liquid_height
gas_column = roll_volume @ tank.gas_height - liquid_column
I_33 += tank.liquid_density * liquid_column / 2
I_33 += tank.gas_density * gas_column / 2

No parallel-axis term is required: the roll-axis component is invariant under axial translation.

This also exposes public liquid_density / gas_density properties on Tank (previously only available as private attributes), which LiquidMotor now uses.

Validation

Closed-form cross-check on a draining cylindrical tank (r=0.7 m, h=2.0 m, LOX 1141 kg/m^3, 93% fill, constant outflow to half drain):

Time Closed form 1/2 m r^2 propellant_I_33
t=0 800.515 kg*m^2 (liquid 800.417 + gas 0.098) 800.515
t=burn (half drain) 400.306 kg*m^2 400.306

The cylinder closed form 1/2 m r^2 holds for both the liquid and the gas column, and the implementation matches it to all displayed digits (regression test pins both anchors, plus monotonic decrease while draining).

A companion notebook with the evidence chain (including a two-tank vehicle case: 1045.77 kg*m^2 at t=0) is linked in #1191.

Testing

  • New: test_propellant_I_33_cylindrical_closed_form, test_propellant_I_33_empty_tank_is_zero (also covers the new density properties)
  • tests/unit/motors + tests/integration/motors: 122 passed
  • Full tests/unit suite: 2164 passed, 7 failed / 11 skipped - the 7 failures (test_sensitivity, environment_analysis) reproduce on a clean develop checkout and are caused by optional dependencies (e.g. SALib) missing from my local env, unrelated to this change
  • black clean on all touched files

propellant_I_33 was hard-coded to return 0, silently dropping the
propellant roll inertia from the 6-DOF dynamics. Compute it per
positioned tank as the roll inertia of the liquid and gas columns:
I_33 = rho/2 * int(area * r^2) dh from the tank bottom up to the
fluid surface height. No parallel-axis term is needed (roll-axis
component is invariant under axial translation).

Also expose public liquid_density / gas_density properties on Tank,
previously only available as private attributes.

Fixes #1191
@zjk199506
zjk199506 requested a review from a team as a code owner September 5, 2026 07:25
@zjk199506 zjk199506 closed this by deleting the head repository Sep 5, 2026
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.

2 participants