33 _s = sys.stdout, sys.stderr
34 sys.stdout = sys.stderr = io.StringIO()
37 I=200, V=200, solver_mode=
"full_system",
38 physics_option=
"full_CD_fission", C_floor=1e-25,
39 he_kinetics=
"quasi_steady_state", i_mobile=5, v_mobile=2)
43 sim.input_data.reactions[
"T"] = 700.0 + 273.15
44 sim.input_data.reactions[
"E_a0_conv"] = 0.8
45 sim.input_data._calculate_derived()
47 cfg = {
"t_span": (1e-6, 1e0),
"n_points": 8,
"log_time":
True,
48 "rtol": 1e-7,
"atol": 1e-28,
49 "solver_method": {
"linsol":
"dense"}}
51 cfg[
"loop_conversion"] = 1
52 r = sim.run_adaptive(solver_config=cfg, save_output=
False)
54 sys.stdout, sys.stderr = _s
61 def check(name, cond, *info):
65 print(f
" {'PASS' if cond else 'FAIL'} {name} {info if info else ''}")
67 r =
_run(loop_conversion=1)
68 t = np.asarray(r[
"t"])
69 dfp = np.asarray(r[
"delta_FP"])
70 dfps = np.asarray(r[
"delta_FP_sia"])
73 check(
"conversion ON produced <100>",
74 "y_sia100" in r
and float(np.max(r[
"y_sia100"])) > 0.0)
75 check(
"dFP < 1e-3 in accumulated regime (t>=1e-3)",
76 np.all(dfp[late] < 1e-3), float(np.max(dfp[late])))
77 check(
"dFP_sia < 1e-3 in accumulated regime",
78 np.all(dfps[late] < 1e-3), float(np.max(dfps[late])))
79 check(
"dFP converges to <= 1e-6 by final time",
80 dfp[-1] < 1e-6, float(dfp[-1]))
81 check(
"dFP decreases after the startup transient",
82 dfp[-1] < dfp[1], (float(dfp[1]), float(dfp[-1])))
85 y = r[
"y"]; y100 = r[
"y_sia100"]; sz = np.arange(1, 201)
86 S_I = float(np.dot(sz, np.maximum(y[:200, -1], 0.0))
87 + np.dot(sz, np.maximum(y100[:, -1], 0.0)))
89 prod = eta * G * t[-1]
90 check(
"total SIA inventory finite & < cumulative production",
91 np.isfinite(S_I)
and 0.0 < S_I < prod, (S_I, prod))
93 print(f
"\n{'ALL PASS' if not fails else str(fails) + ' FAILED'}")
94 print(f
" [info] final dFP={dfp[-1]:.2e} dFP_sia={dfps[-1]:.2e} "
95 f
"S_I={S_I:.3e} (cascade prod {prod:.3e})")
96 return 1
if fails
else 0