49 rho, mu, dh = 1140.0, 2e-4, 1.6e-3
50 cd_of =
lambda Re, p: 0.8
51 kw = dict(n_holes=24, n_ports=1, D_h=0.05, r_ring=0.035, A_hole=math.pi * dh ** 2 / 4, d_hole=dh,
52 rho=rho, mu=mu, K_ent=0.5, C_R=1.0, roughness=0.0)
53 wide = _RingManifold(A_ch=1.0, **kw)
55 per_hole = 0.8 * kw[
"A_hole"] * math.sqrt(2 * rho * (P - Pc))
56 total, holes, _ = wide.march(24 * per_hole, P, Pc, cd_of)
57 assert total == pytest.approx(24 * per_hole, rel=1e-6)
58 assert max(holes) /
min(holes) == pytest.approx(1.0, abs=1e-6)
63 rho, mu, A_ch, dh = 1000.0, 1e-3, 2e-5, 1.5e-3
64 net = _RingManifold(n_holes=2, n_ports=1, A_ch=A_ch, D_h=4e-3, r_ring=0.03,
65 A_hole=math.pi * dh ** 2 / 4, d_hole=dh, rho=rho, mu=mu, K_ent=0.5, C_R=0.0,
67 m, P, Pc = 0.05, 1.0e6, 0.2e6
68 u = (m / 2) / (rho * A_ch)
69 p = P - 1.5 * 0.5 * rho * u * u
70 s = 2 * math.pi * 0.03 / 2
71 p -= _churchill_f(rho * u * 4e-3 / mu, 0.0) * (0.5 * s / 4e-3) * 0.5 * rho * u * u
72 q = 0.8 * math.pi * dh ** 2 / 4 * math.sqrt(2 * rho * (p - Pc))
73 total, holes, _ = net.march(m, P, Pc,
lambda Re, pp: 0.8)
74 assert holes[0] == pytest.approx(q, rel=1e-12)
75 assert total == pytest.approx(2 * q, rel=1e-12)
88 cfg = load_config(
"configs/ethalox_6500N.yaml")
89 dc = cfg.discharge[
"oxidizer"]
90 A, d = 24 * math.pi * 1.6e-3 ** 2 / 4, 1.6e-3
92 P_tank, Pc, Pv = 3.6e6, 101325.0, 101325.0
93 m0, Cd0, *_ = _stream_flow(Pc, P_tank, 1140.0, A, d, 2e-4, dc, 90.0, 0.80, feed)
94 m1, Cd1, *_ = _stream_flow(Pc, P_tank, 1140.0, A, d, 2e-4, dc, 90.0, 0.80, feed,
95 cav=(Pv, contraction_coefficient(0.0)))
96 K = (P_tank - Pv) / (P_tank - Pc)
97 assert Cd1 == pytest.approx(0.62 * math.sqrt(K), rel=1e-6)
100 m2, Cd2, *_ = _stream_flow(2.6e6, P_tank, 1140.0, A, d, 2e-4, dc, 90.0, 0.80, feed,
101 cav=(Pv, contraction_coefficient(0.0)))
102 m3, Cd3, *_ = _stream_flow(2.6e6, P_tank, 1140.0, A, d, 2e-4, dc, 90.0, 0.80, feed)
103 assert m2 == pytest.approx(m3, rel=1e-12)
107 """At Pc = 1 atm the LOX holes cavitate; the numba injector must give the Python flow."""
108 from engine
import accel
111 if not accel.available():
112 pytest.skip(
"numba unavailable")
113 cfg = load_config(
"configs/ethalox_6500N.yaml")
114 if getattr(cfg.injector,
"plate",
None)
is not None:
115 cfg.injector.plate.manifold_model =
"plenum"
116 assert accel.can_handle(cfg)
118 got = accel.solve(cfg, P, P, 101325.0)
119 mO, mF, d = get_injector_model(cfg).solve(P, P, 101325.0)
120 assert d[
"Cd_O"] < 0.7
121 assert got[0] == pytest.approx(mO, rel=1e-9)
122 assert got[1] == pytest.approx(mF, rel=1e-9)