35 pts, _, lengths =
_solved(CG.length)
36 Rt = math.sqrt(CG.A_throat / math.pi)
37 assert lengths[
"entrance_arc"] == pytest.approx(1.5 * Rt * math.sin(math.pi / 4), rel=1e-12)
38 x_face, x_throat = pts[:, 0].
min(), pts[np.argmin(pts[:, 1]), 0]
39 assert lengths[
"face_to_throat"] == pytest.approx(x_throat - x_face, abs=1e-6)
40 assert lengths[
"face_to_throat"] == pytest.approx(0.15399, abs=5e-5)
44 for stored
in (CG.length, CG.length + 0.01,
None):
46 x, y = pts[:, 0], pts[:, 1]
48 V = float(np.sum(np.pi * 0.5 * (y[ch][1:] ** 2 + y[ch][:-1] ** 2) * np.diff(x[ch])))
49 assert V / CG.A_throat == pytest.approx(CG.volume / CG.A_throat, abs=1e-4)
60 Pc, g = 2.99e6, 1.1375
61 p = calculate_chamber_pressure_profile(Pc, CG.Lstar, 2.8, g, 373.6, 3226.0, CG.A_throat,
62 chamber_diameter=CG.chamber_diameter, volume=CG.volume)
63 crit = (2 / (g + 1)) ** (g / (g - 1))
64 assert p[
"P_injection"] == Pc
65 assert p[
"P_throat"] == pytest.approx(Pc * crit, rel=0.01)
67 assert p[
"P0_nozzle"] == pytest.approx(Pc / 1.002971, rel=2e-4)
68 assert all(b <= a
for a, b
in zip(p[
"pressures"], p[
"pressures"][1:]))