Skip to content

ENH: Implement only_radial_burn feature for SolidMotor and HybridMotor classes#850

Closed
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-da35134d-c211-4600-a14e-99f0de32abd0
Closed

ENH: Implement only_radial_burn feature for SolidMotor and HybridMotor classes#850
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-da35134d-c211-4600-a14e-99f0de32abd0

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 21, 2025

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:

  • End-burning grains
  • Axially inhibited BATES grains
  • Certain hybrid motor solid fuel configurations

The existing RocketPy implementation always assumed both radial and axial burning, limiting simulation accuracy for these motor types.

Implementation

SolidMotor Changes

  • Added only_radial_burn parameter (default: False for backward compatibility)
  • Modified evaluate_geometry() differential equations:
    • When only_radial_burn=True: grain height remains constant (derivative = 0)
    • When only_radial_burn=False: existing behavior with both radial and axial burning
  • Updated burn_area() method to calculate surface area based on burning mode:
    • Radial only: 2π × inner_radius × height × grain_number
    • Total burning: Radial area + end faces area
  • Enhanced serialization methods (to_dict/from_dict) to preserve the setting

HybridMotor Changes

  • Added configurable only_radial_burn parameter that propagates to the internal SolidMotor
  • Updated constructor and documentation to support the new parameter

Physics Validation

The implementation correctly handles the physics:

  • Radial-only burning: Faster inner radius progression due to smaller surface area
  • Mass conservation: Proper volume change calculations for each burning mode
  • Burn area ratios: Radial-only area is typically 40-60% of total burn area

Example Usage

from rocketpy import SolidMotor

# Traditional motor (burns radially and axially)
motor_traditional = SolidMotor(
    thrust_source="motor.eng",
    # ... other parameters ...
    only_radial_burn=False  # default
)

# Axially inhibited motor (burns only radially)  
motor_inhibited = SolidMotor(
    thrust_source="motor.eng", 
    # ... other parameters ...
    only_radial_burn=True
)

# Compare burn areas
print(f"Traditional burn area: {motor_traditional.burn_area(0):.3f} m²")
print(f"Inhibited burn area: {motor_inhibited.burn_area(0):.3f} m²")

Testing

  • Added comprehensive unit tests for both SolidMotor and HybridMotor
  • Created integration tests for the new functionality
  • Verified burn area calculations and differential equation behavior
  • All existing tests pass (backward compatibility maintained)

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.

Copilot AI and others added 2 commits September 21, 2025 00:56
…r classes

Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com>
Co-authored-by: Gui-FernandesBR <63590233+Gui-FernandesBR@users.noreply.github.com>
Copilot AI changed the title [WIP] Please help me telling me what is needed to finish and close PR ENH: Enable only radial burning #815 ENH: Implement only_radial_burn feature for SolidMotor and HybridMotor classes Sep 21, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Closed in LibDev Roadmap Sep 21, 2025
@Gui-FernandesBR Gui-FernandesBR deleted the copilot/fix-da35134d-c211-4600-a14e-99f0de32abd0 branch December 4, 2025 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Closed

Development

Successfully merging this pull request may close these issues.

ENH: Enable only radial burning

2 participants