ENH: Implement only_radial_burn feature for SolidMotor and HybridMotor classes #850
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements the
only_radial_burn
feature requested in issue #801, allowing users to simulate solid rocket motors with axially inhibited grains that burn only radially (cylindrical inner surface) rather than both radially and axially.Motivation
In real rocket motors, grains can be axially inhibited to prevent burning from the top and bottom faces, forcing propellant consumption to occur only through the cylindrical inner surface. This is common in:
The existing RocketPy implementation always assumed both radial and axial burning, limiting simulation accuracy for these motor types.
Implementation
SolidMotor Changes
only_radial_burn
parameter (default:False
for backward compatibility)evaluate_geometry()
differential equations:only_radial_burn=True
: grain height remains constant (derivative = 0)only_radial_burn=False
: existing behavior with both radial and axial burningburn_area()
method to calculate surface area based on burning mode:2π × inner_radius × height × grain_number
to_dict
/from_dict
) to preserve the settingHybridMotor Changes
only_radial_burn
parameter that propagates to the internal SolidMotorPhysics Validation
The implementation correctly handles the physics:
Example Usage
Testing
Breaking Changes
None - the feature is opt-in with
only_radial_burn=False
as the default.Closes #801
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.