@@ -121,7 +121,7 @@ def test_hybrid_motor_center_of_mass(hybrid_motor, spherical_oxidizer_tank):
121121 propellant_center_of_mass = propellant_balance / (grain_mass + oxidizer_mass )
122122 center_of_mass = balance / (grain_mass + oxidizer_mass + DRY_MASS )
123123
124- for t in np .linspace (0 , 100 , 100 ):
124+ for t in np .linspace (0 , BURN_TIME , 100 ):
125125 assert pytest .approx (
126126 hybrid_motor .center_of_propellant_mass (t )
127127 ) == propellant_center_of_mass (t )
@@ -170,9 +170,45 @@ def test_hybrid_motor_inertia(hybrid_motor, spherical_oxidizer_tank):
170170 + DRY_MASS * (- hybrid_motor .center_of_mass + CENTER_OF_DRY_MASS ) ** 2
171171 )
172172
173- for t in np .linspace (0 , 100 , 100 ):
173+ for t in np .linspace (0 , BURN_TIME , 100 ):
174174 assert pytest .approx (hybrid_motor .propellant_I_11 (t )) == propellant_inertia (t )
175175 assert pytest .approx (hybrid_motor .I_11 (t )) == inertia (t )
176176
177177 # Assert cylindrical symmetry
178178 assert pytest .approx (hybrid_motor .propellant_I_22 (t )) == propellant_inertia (t )
179+
180+ def test_hybrid_motor_only_radial_burn_behavior (hybrid_motor ):
181+ """
182+ Test if only_radial_burn flag in HybridMotor propagates to its SolidMotor
183+ and affects burn_area calculation.
184+ """
185+ motor = hybrid_motor
186+
187+ # Activates the radial burning
188+ motor .solid .only_radial_burn = True
189+ assert motor .solid .only_radial_burn is True
190+
191+ # Calculates the expected initial area
192+ burn_area_radial = (
193+ 2
194+ * np .pi
195+ * (motor .solid .grain_inner_radius (0 ) * motor .solid .grain_height (0 ))
196+ * motor .solid .grain_number
197+ )
198+
199+ assert np .isclose (motor .solid .burn_area (0 ), burn_area_radial , atol = 1e-12 )
200+
201+ # Deactivates the radial burning and recalculate the geometry
202+ motor .solid .only_radial_burn = False
203+ motor .solid .evaluate_geometry ()
204+ assert motor .solid .only_radial_burn is False
205+
206+ # In this case the burning area also considers tha bases of the grain
207+ inner_radius = motor .solid .grain_inner_radius (0 )
208+ outer_radius = motor .solid .grain_outer_radius
209+ burn_area_total = (
210+ burn_area_radial
211+ + 2 * np .pi * (outer_radius ** 2 - inner_radius ** 2 ) * motor .solid .grain_number
212+ )
213+ assert np .isclose (motor .solid .burn_area (0 ), burn_area_total , atol = 1e-12 )
214+ assert motor .solid .burn_area (0 ) > burn_area_radial
0 commit comments