test_mass_depletion
- test_mass_depletion.test_depletionTorqueFollowsTankMounting()[source]
A rotated, offset, depleting tank must spin a resting hub up about r_TB_B x dcm_TB^T k3.
- test_mass_depletion.test_depletionTorqueUsesCurrentMassFlowRate()[source]
A ramping leak must drive the depletion torque from the current mass-flow rate, not the previous integrator substep’s, so an offset emptying tank under a time-varying flow reaches a hub rate the stale substep rate would miss.
- test_mass_depletion.test_leakyTank(sloshMass)[source]
A leaking tank sheds mDot*t from the vehicle, whatever share of it fuel slosh carries.
- test_mass_depletion.test_massDepletionTest(show_plots, thrusterConstructor)[source]
Module Unit Test
- test_mass_depletion.test_tankModelOutlivesPythonReference(tankModelConstructor)[source]
Regression test for issue #282.
The tank model is created in Python and handed to the FuelTank via setTankModel(). Because the model is now held by a std::shared_ptr, dropping the only Python reference must NOT free the underlying C++ object: the tank co-owns it. Before the shared_ptr conversion the C++ member was a raw pointer, so this sequence left a dangling pointer (undefined behaviour). Here we drop the Python reference (del + gc.collect()) before the simulation runs and assert the model still drives correct, finite depletion results.