Skip to content

Commit 8ebbc90

Browse files
committed
Sugestions Update
Sugestions made by @phmbressan implemented
1 parent cb3c3a2 commit 8ebbc90

File tree

4 files changed

+36
-8
lines changed

4 files changed

+36
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ Attention: The newest changes should be on top -->
3232

3333
### Added
3434
- ENH: Enable only radial burning [#815](https://github.com/RocketPy-Team/RocketPy/pull/815)
35-
- ENH: Controller (AirBrakes) and Sensors Encoding [#849] (https://github.com/RocketPy-Team/RocketPy/pull/849)
36-
- EHN: Addition of ensemble variable to ECMWF dictionaries [#842] (https://github.com/RocketPy-Team/RocketPy/pull/842)
3735
- ENH: Tank Fluids with Variable Density from Temperature and Pressure [#852](https://github.com/RocketPy-Team/RocketPy/pull/852)
3836
- ENH: Controller (AirBrakes) and Sensors Encoding [#849](https://github.com/RocketPy-Team/RocketPy/pull/849)
3937
- EHN: Addition of ensemble variable to ECMWF dictionaries [#842](https://github.com/RocketPy-Team/RocketPy/pull/842)
@@ -479,4 +477,4 @@ You can install this version by running `pip install rocketpy==1.0.1`
479477
### Fixed
480478

481479
- BUG: Remove NoseCone Warning [#428](https://github.com/RocketPy-Team/RocketPy/pull/428)
482-
- BUG: motor coordinates [#423](https://github.com/RocketPy-Team/RocketPy/pull/423)
480+
- BUG: motor coordinates [#423](https://github.com/RocketPy-Team/RocketPy/pull/423)

rocketpy/motors/hybrid_motor.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,11 @@ class HybridMotor(Motor):
193193
HybridMotor.reference_pressure : int, float
194194
Atmospheric pressure in Pa at which the thrust data was recorded.
195195
It will allow to obtain the net thrust in the Flight class.
196-
"""
197-
196+
SolidMotor.only_radial_burn : bool
197+
If True, grain regression is restricted to radial burn only (inner radius growth).
198+
Grain length remains constant throughout the burn. Default is False.
199+
"""
200+
# pylint: disable=too-many-arguments
198201
def __init__( # pylint: disable=too-many-arguments
199202
self,
200203
thrust_source,
@@ -314,6 +317,11 @@ class Function. Thrust units are Newtons.
314317
"nozzle_to_combustion_chamber".
315318
reference_pressure : int, float, optional
316319
Atmospheric pressure in Pa at which the thrust data was recorded.
320+
only_radial_burn : boolean, optional
321+
If True, inhibits the grain from burning axially, only computing
322+
radial burn. If False, allows the grain to also burn
323+
axially. May be useful for axially inhibited grains or hybrid motors.
324+
Default is False.
317325
318326
Returns
319327
-------

rocketpy/motors/solid_motor.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,10 @@ class SolidMotor(Motor):
193193
SolidMotor.reference_pressure : int, float
194194
Atmospheric pressure in Pa at which the thrust data was recorded.
195195
It will allow to obtain the net thrust in the Flight class.
196+
SolidMotor.only_radial_burn : bool
197+
If True, grain regression is restricted to radial burn only (inner radius growth).
198+
Grain length remains constant throughout the burn. Default is False.
196199
"""
197-
198200
# pylint: disable=too-many-arguments
199201
def __init__(
200202
self,
@@ -413,6 +415,10 @@ def exhaust_velocity(self):
413415
return Function(
414416
self.total_impulse / self.propellant_initial_mass
415417
).set_discrete_based_on_model(self.thrust)
418+
419+
@property
420+
def only_radial_burn(self):
421+
return self._only_radial_burn
416422

417423
@property
418424
def propellant_initial_mass(self):

tests/unit/test_solidmotor.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,15 @@ def test_reshape_thrust_curve_asserts_resultant_thrust_curve_correct(
282282

283283

284284
def test_only_radial_burn_parameter_effect(cesaroni_m1670):
285-
# Tests if the only_radial_burn flag is properly set
285+
"""Tests the effect of the only_radial_burn parameter on burn area
286+
calculation. When enabled, the burn area should only account for
287+
the radial surface of the grains (no axial regression).
288+
289+
Parameters
290+
----------
291+
cesaroni_m1670 : rocketpy.SolidMotor
292+
The SolidMotor object used in the test.
293+
"""
286294
motor = cesaroni_m1670
287295
motor.only_radial_burn = True
288296
assert motor.only_radial_burn is True
@@ -298,7 +306,15 @@ def test_only_radial_burn_parameter_effect(cesaroni_m1670):
298306

299307

300308
def test_evaluate_geometry_updates_properties(cesaroni_m1670):
301-
# Checks if after instantiation, grain_inner_radius and grain_height are valid functions
309+
"""Tests if the grain geometry evaluation correctly updates SolidMotor
310+
properties after instantiation. It ensures that grain geometry
311+
functions are created and behave as expected.
312+
313+
Parameters
314+
----------
315+
cesaroni_m1670 : rocketpy.SolidMotor
316+
The SolidMotor object used in the test.
317+
"""
302318
motor = cesaroni_m1670
303319

304320
assert hasattr(motor, "grain_inner_radius")

0 commit comments

Comments
 (0)