27PC, THRUST, D_EXIT = 2.965e6, 8000.0, 0.1165
28ANGLES_DEG = [45.0, 40.0, 35.0, 30.0, 25.0]
32 """Wall angle of the entrance arc's first segment, in degrees (negative = converging)."""
33 a_t = area_throat_calc(PC, THRUST, force_coeffcient_default)
34 pts, _, _ = rao(a_t, area_exit_calc(D_EXIT), method=
"top", do_plot=
False,
35 steps=3000, convergent_half_angle_rad=theta_rad)
38 return float(np.degrees(np.arctan2(d[1], d[0])))
41@pytest.mark.parametrize("deg", ANGLES_DEG)
63 """The straight convergent section is actually drawn at the requested half-angle."""
64 theta = np.deg2rad(deg)
65 pts, _, _ = chamber_geometry_calc(
66 pc_design=PC, thrust_design=THRUST, diameter_inner=0.1651,
67 diameter_exit=D_EXIT, l_star=0.85, steps=600, theta=theta)
69 throat = int(np.argmin(p[:, 1]))
70 d = np.diff(p[:throat + 1], axis=0)
71 keep = np.abs(d[:, 0]) > 1e-12
72 slopes = d[keep, 1] / d[keep, 0]
74 target = -np.tan(theta)
75 on_cone = np.abs(slopes - target) < 1e-6
76 assert on_cone.sum() > 10, f
"no straight {deg} deg convergent run found in the contour"
85 """Omitting theta must be identical to passing 45 deg -- no silent behaviour change."""
86 kw = dict(pc_design=PC, thrust_design=THRUST, diameter_inner=0.1651,
87 diameter_exit=D_EXIT, l_star=0.85, steps=200)
88 a, _, la = chamber_geometry_calc(**kw)
89 b, _, lb = chamber_geometry_calc(**kw, theta=np.pi / 4.0)
90 assert np.array_equal(np.asarray(a), np.asarray(b))