Skip to content

ENH: Enable only radial burning #815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

caioessouza
Copy link
Contributor

@caioessouza caioessouza commented May 9, 2025

Pull request type

  • Code changes (bugfix, features)

Checklist

  • Lint (black rocketpy/ tests/) has passed locally
  • All tests (pytest tests -m slow --runslow) have passed locally
  • CHANGELOG.md has been updated (if relevant)

Current behavior

Rocketpy SolidMotor class simulates the grain regression either radially and axially by default.

This PR is related to the following issue:
ENH: Enable only radial burning #801

New behavior

Now it's possible to the user to change from the default behavior to a only radial regression by setting the new "only_radial_burning" optional parameter as True in the SolidMotor class.

Breaking change

  • No

Additional information

Here is an example of the comparison between the default burning and the only radial one applied to the getting_started.ipynb simulation. The pytest tests haven't passed locally because of a windows problem.

GRAFICO1NOVO
GRAFICO2NOVO
GRAFICO3NOVO

only_radial_burn optional parameter added and used in the functions related to the grain regression as a conditon to change the applied equations.

Still need to update the comment section, the CHANGELOG and maybe the dict related functions, but not sure about the last one yet.
The new parameter of the SolidMotor class was removed from super, since it's not on the Motor class. The dict functions were updated to take this new parameter into acount. Also the comments about the SolidMotor class parameters were updated.

Still need to do some tests running the code to be sure everything is ok, then I can open the PR.
Corrected some minor code erros, like calling evaluate geometry before defining self.only_radial_burn. Also had to change the grain_height_derivative to zero in the case of only radial burn, it was leading to some physical incoherences, because the grain was still burning axially. The last tests to evaluate the physical behaviour went pretty well, so I'll open the PR.
@caioessouza caioessouza requested a review from a team as a code owner May 9, 2025 23:40
Copy link

codecov bot commented May 16, 2025

Codecov Report

Attention: Patch coverage is 29.16667% with 17 lines in your changes missing coverage. Please review.

Project coverage is 80.08%. Comparing base (4df0b38) to head (95970b9).
Report is 20 commits behind head on develop.

Files with missing lines Patch % Lines
rocketpy/motors/solid_motor.py 29.16% 17 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #815      +/-   ##
===========================================
+ Coverage    79.11%   80.08%   +0.96%     
===========================================
  Files           96       98       +2     
  Lines        11575    12042     +467     
===========================================
+ Hits          9158     9644     +486     
+ Misses        2417     2398      -19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@MateusStano MateusStano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we missing something in the HybridMotor class here? If we want to define a a HybridMotor with only radial burning garin how would we do that currently?

@Gui-FernandesBR
Copy link
Member

Are we missing something in the HybridMotor class here? If we want to define a a HybridMotor with only radial burning garin how would we do that currently?

I recommend modifyng the hybrid class in another PR, it's easier to reivew it.

@@ -314,6 +315,11 @@ class Function. Thrust units are Newtons.
"nozzle_to_combustion_chamber".
reference_pressure : int, float, optional
Atmospheric pressure in Pa at which the thrust data was recorded.
only_radial_burn : boolean, optional
If True, inhibits the grain from burning axially, only computing
radial burn. Otherwise, if False, allows the grain to also burn
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant

Suggested change
radial burn. Otherwise, if False, allows the grain to also burn
radial burn. Otherwise, allows the grain to also burn

or

Suggested change
radial burn. Otherwise, if False, allows the grain to also burn
radial burn. If False, allows the grain to also burn

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is important to add at least an integration test to this new implementation.

Copy link
Member

@Gui-FernandesBR Gui-FernandesBR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great PR.

I recommend keeping this PR to solidmotor (possibly renaming it).
Later you could extend the feature to also cover hybrid motors.

Also, I believe two other steps are important:

  1. Update the Motor page on our documentation to include this new feature
  2. Include new tests!!

@Gui-FernandesBR
Copy link
Member

But if you really want to include hybrid motors here, not a problem

@Gui-FernandesBR Gui-FernandesBR linked an issue May 16, 2025 that may be closed by this pull request
@Gui-FernandesBR Gui-FernandesBR requested a review from Copilot May 16, 2025 21:05
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces an enhancement to the SolidMotor class allowing users to enable only radial burning by setting the "only_radial_burn" parameter.

  • Added the "only_radial_burn" parameter in the constructor with accompanying documentation.
  • Updated geometry_dot, geometry_jacobian, and burn_area methods to reflect the new burning mode.
  • Modified serialization methods and the changelog to include the new parameter.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
rocketpy/motors/solid_motor.py Added "only_radial_burn" parameter and updated geometry-related methods accordingly.
CHANGELOG.md Documented the enhancement to enable only radial burning.

grain_outer_radius**2
- grain_inner_radius**2
+ grain_inner_radius * grain_height
if self.only_radial_burn:
Copy link
Preview

Copilot AI May 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding an inline comment to explain why grain_height_derivative is set to 0 when only_radial_burn is active to improve clarity for future maintainers.

Copilot uses AI. Check for mistakes.

grain_outer_radius**2
- grain_inner_radius**2
+ grain_inner_radius * grain_height
if self.only_radial_burn:
Copy link
Preview

Copilot AI May 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment in the Jacobian computation explaining the rationale for zeroing out the height derivatives when only_radial_burn is True.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

ENH: Enable only radial burning
3 participants