8000 Last update #801 · caioessouza/RocketPy@550e149 · GitHub
[go: up one dir, main page]

Skip to content

Commit 550e149

Browse files
committed
Last update RocketPy-Team#801
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.
1 parent 4f32f88 commit 550e149

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

rocketpy/motors/solid_motor.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class Function. Thrust units are Newtons.
302302
"nozzle_to_combustion_chamber".
303303
only_radial_burn : boolean, optional
304304
If True, inhibits the grain from burning axially, only computing
305-
radial burn. Otherwise, if False, allows the grain to also burn
305+
radial burn. Otherwise, if False, allows the grain to also burn
306306
axially. May be useful for axially inhibited grains or hybrid motors.
307307
Default is False.
308308
@@ -343,10 +343,11 @@ class Function. Thrust units are Newtons.
343343
)
344344
self.grain_initial_mass = self.grain_density * self.grain_initial_volume
345345

346-
self.evaluate_geometry()
347-
348346
# Burn surface definition
349347
self.only_radial_burn = only_radial_burn
348+
349+
self.evaluate_geometry()
350+
350351
# Initialize plots and prints object
351352
self.prints = _SolidMotorPrints(self)
352353
self.plots = _SolidMotorPlots(self)
@@ -489,6 +490,10 @@ def geometry_dot(t, y):
489490
grain_inner_radius, grain_height = y
490491
if self.only_radial_burn:
491492
burn_area = 2 * np.pi * (grain_inner_radius * grain_height)
493+
494+
grain_inner_radius_derivative = -volume_diff / burn_area
495+
grain_height_derivative = 0
496+
492497
else:
493498
burn_area = (
494499
2
@@ -500,8 +505,8 @@ def geometry_dot(t, y):
500505
)
501506
)
502507

503-
grain_inner_radius_derivative = -volume_diff / burn_area
504-
grain_height_derivative = -2 * grain_inner_radius_derivative
508+
grain_inner_radius_derivative = -volume_diff / burn_area
509+
grain_height_derivative = -2 * grain_inner_radius_derivative
505510

506511
return [grain_inner_radius_derivative, grain_height_derivative]
507512

@@ -520,7 +525,7 @@ def geometry_jacobian(t, y):
520525
inner_radius_derivative_wrt_inner_radius = factor * (
521526
grain_height - 2 * grain_inner_radius
522527
)
523-
inner_radius_derivative_wrt_height = factor * grain_inner_radius
528+
inner_radius_derivative_wrt_height = 0
524529
height_derivative_wrt_inner_radius = 0
525530
height_derivative_wrt_height = 0
526531

0 commit comments

Comments
 (0)
0