52 inp =
InputData(I=1000, V=1000, physics_option=
"full_CD_fission")
53 inp.diffusion[
"i_mobile"] = 5
54 inp.derived[
"i_mobile"] = 5
55 inp.diffusion[
"v_mobile"] = 2
56 inp.derived[
"v_mobile"] = 2
57 inp.reactions[
"C_floor"] = 1e-25
58 inp.reactions[
"he_kinetics"] =
"quasi_steady_state"
60 rag, layout = build_eurofer_rag(inp, rr, equations=
"discrete", cascade=
"fission")
62 pop_names = {(p.polarity.label, p.name)
for p
in rag.populations}
63 check(
"3 populations incl. bulk-111 / bulk-100",
64 (
"sia",
"bulk-111")
in pop_names
and (
"sia",
"bulk-100")
in pop_names
65 and len(rag.populations) == 3, sorted(pop_names))
67 labels = {e.label: e
for e
in rag.edges}
68 check(
"unary INTER_POPULATION edge present",
69 labels.get(
"loop_111to100_unary")
is not None and
70 labels[
"loop_111to100_unary"].edge_class
is EdgeClass.INTER_POPULATION)
71 junc = labels.get(
"SIA111_junction")
72 check(
"junction COALESCENCE -> bulk-100",
73 junc
is not None and junc.edge_class
is EdgeClass.COALESCENCE
and
74 junc.product_population
is not None and
75 junc.product_population.name ==
"bulk-100")
76 absb = labels.get(
"SIA100_absorb")
77 check(
"absorption COALESCENCE on bulk-100",
78 absb
is not None and absb.edge_class
is EdgeClass.COALESCENCE
and
79 absb.population.name ==
"bulk-100" and
80 absb.partner_population.name ==
"bulk-111")
81 check(
"SIA100 state block present", layout.has(
"SIA100"),
82 layout.block(
"SIA100").length
if layout.has(
"SIA100")
else None)
84 check(
"rag.validate() passes",
True)
91 p111 = rag.add_population(
Population(
"bulk-111", Polarity.SIA, n_min=1, mobile_max=N))
92 p100 = rag.add_population(
Population(
"bulk-100", Polarity.SIA, n_min=1, mobile_max=0))
93 rag.set_monomer_population(p111)
97 Kfull = np.full((N, N), 0.02)
98 phi = np.zeros((N, N)); phi[2:, 2:] = 0.4
99 Gamma = np.zeros(N); Gamma[2:5] = 0.03
100 Kabs = np.full((N, N), 0.015)
101 rag.register_kernel(
"Kg", Kg)
102 rag.register_kernel(
"K_self", (1.0 - phi) * Kfull)
103 rag.register_kernel(
"K_junc", phi * Kfull)
104 rag.register_kernel(
"Gamma", Gamma)
105 rag.register_kernel(
"Kabs", Kabs)
107 rag.add_edge(
Edge(EdgeClass.GROWTH,
"grow111", p111, kernel=
"Kg"))
108 rag.add_edge(
Edge(EdgeClass.COALESCENCE,
"self111", p111, kernel=
"K_self"))
109 rag.add_edge(
Edge(EdgeClass.COALESCENCE,
"junction", p111,
110 kernel=
"K_junc", product_population=p100))
111 rag.add_edge(
Edge(EdgeClass.INTER_POPULATION,
"unary", p111,
112 kernel=
"Gamma", product_population=p100))
113 rag.add_edge(
Edge(EdgeClass.COALESCENCE,
"absorb", p100,
114 kernel=
"Kabs", partner_population=p111))
117 layout.add_discrete(
"SIA111", N, population=p111)
118 layout.add_discrete(
"SIA100", N, population=p100)
120 gw =
GraphWalker(rag, layout, boundary=
"reflection")
124 y[layout.slice(
"SIA111")] = np.array([1.0, 0.6, 0.4, 0.25, 0.15, 0.08, 0.03, 0.0])
125 y[layout.slice(
"SIA100")] = np.array([0.0, 0.0, 0.2, 0.15, 0.1, 0.05, 0.0, 0.0])
126 dydt = gw.assemble(0.0, y)
128 sizes = np.arange(1, N + 1)
129 d111 = dydt[layout.slice(
"SIA111")]
130 d100 = dydt[layout.slice(
"SIA100")]
131 content_rate = float(np.dot(sizes, d111) + np.dot(sizes, d100))
132 check(
"all SIA-conserving edges compose -> total content flat",
133 abs(content_rate) < ATOL, content_rate)
134 check(
"dydt finite", np.all(np.isfinite(dydt)))
136 check(
"bulk-100 net content increases",
137 float(np.dot(sizes, d100)) > ATOL, float(np.dot(sizes, d100)))