RadCluster
Graph-based cluster dynamics for irradiated materials
Loading...
Searching...
No Matches
Functions | Variables
py_utils.defect_production Namespace Reference

Functions

 normalisation_constant (f_cl, s, m_max)
 
 compute_epsilon (f_cl, s, m_max)
 
 _spec_get (spec, key)
 
 _merge_spec (spec, over)
 
 production_rates (G, spectrum, I_max, V_max, G_He_r, spec_over=None)
 

Variables

dict FISSION
 
dict FUSION
 
dict _KEY_ALIASES = {'m1': 'i_cascade', 'n1': 'v_cascade'}
 

Detailed Description

defect_production.py — Cascade defect production fractions for bcc Fe / EUROFER97.

Implements the power-law cluster number distributions for SIA and vacancy
clusters produced in displacement cascades, for fission and fusion spectra.

Physics reference
-----------------
Ghoniem, N.M. (2026), Sections 1-2 (Rate_Equations.pdf):
  Eqs. 1-13, Tables 2 and 5.

Production rates [atom frac / s]
---------------------------------
For SIA clusters (i = 2..i_cascade):
  P_i^SIA = η · G · ε_i^SIA       (Eq. 12)
  ε_i^SIA = C_i · i^{−s_i}        (Eq. 7)
  C_i     = f_i^cl / Σ_{i=2}^{i_cascade} i^{1−s_i}   (Eq. 9)

For vacancy clusters (v = 2..v_cascade):
  P_v^VAC = η · G · ε_v^VAC       (Eq. 13)
  ε_v^VAC = C_v · v^{−s_v}        (Eq. 8)
  C_v     = f_v^cl / Σ_{v=2}^{v_cascade} v^{1−s_v}   (Eq. 10)

Point-defect production (monomer):
  P_1^SIA = η · G · (1 − Σ_{m≥2} m·ε_m^SIA)  (Eq. 11 — surviving free SIAs)
  P_1^VAC = η · G · (1 − Σ_{m≥2} m·ε_m^VAC)  (Eq. 11 — surviving free vacancies)

The monomer term absorbs the EXACT remaining cascade mass over the
actually-used (possibly truncated) ε array.  When the size grid is not
truncated (I_max ≥ i_cascade) the sum equals f_i^cl by construction, so this
reduces to the textbook P_1 = η·G·(1 − f_i^cl); when I_max < i_cascade it
guarantees exact atom conservation Σ_{m≥1} m·P_m = η·G.

Function Documentation

◆ _merge_spec()

py_utils.defect_production._merge_spec (   spec,
  over 
)
protected
Module-default cascade spec overlaid with workbook values.

``over`` is ``InputData.production_fission`` / ``production_fusion`` — the
Production sheet as loaded from Excel.  Only keys that are present AND
numerically valid override the module default, so a blank cell or a text
entry (e.g. 'user', '~10') falls back to the table value rather than
poisoning the spectrum with NaN.

Before this existed, ``production_rates`` read the module dicts directly and
the Production sheet was never consulted: eta / f_cl_i / f_cl_v / s_i / s_v /
i_cascade / v_cascade were silently un-settable from the workbook.

Definition at line 142 of file defect_production.py.

◆ _spec_get()

py_utils.defect_production._spec_get (   spec,
  key 
)
protected
Get a value from a spectrum dict, supporting old key aliases.

Definition at line 128 of file defect_production.py.

◆ compute_epsilon()

py_utils.defect_production.compute_epsilon (   f_cl,
  s,
  m_max 
)
Compute production fractions ε_m = C · m^{−s} for m = 2..m_max.

The fraction of surviving defects in clusters of size m is m·ε_m,
summing to f_cl over all cluster sizes.

Parameters
----------
f_cl  : float  — total clustering fraction
s     : float  — power-law exponent
m_max : int    — maximum cluster size

Returns
-------
epsilon : ndarray [m_max+1]
    epsilon[0] = 0 (size 0 unused)
    epsilon[1] = 0 (monomer handled separately)
    epsilon[m] = C · m^{−s}  for m = 2..m_max

Notes
-----
Array length is m_max+1 so that epsilon[m] = ε_m (1-indexed access).

Definition at line 97 of file defect_production.py.

◆ normalisation_constant()

py_utils.defect_production.normalisation_constant (   f_cl,
  s,
  m_max 
)
Compute the normalisation constant C such that:
  Σ_{m=2}^{m_max} m · C · m^{−s} = f_cl

C = f_cl / Σ_{m=2}^{m_max} m^{1−s}   (Eqs. 9-10)

Parameters
----------
f_cl  : float  — clustering fraction
s     : float  — power-law exponent
m_max : int    — maximum cluster size

Returns
-------
C : float

Definition at line 75 of file defect_production.py.

◆ production_rates()

py_utils.defect_production.production_rates (   G,
  spectrum,
  I_max,
  V_max,
  G_He_r,
  spec_over = None 
)
Compute cascade production rates P_i^SIA [s^-1] and P_v^VAC [s^-1]
scaled by displacement rate G [dpa/s].

Returns arrays indexed from 1:
  Pr_SIA[i]  = η·G·ε_i^SIA  for i=2..i_cascade; P_1 absorbs exact remainder
  Pr_VAC[v]  = η·G·ε_v^VAC  for v=2..v_cascade; P_1 absorbs exact remainder

Parameters
----------
G       : float [dpa/s]
spectrum : str  'fission' | 'fusion'
I_max   : int  — maximum SIA cluster size tracked
V_max   : int  — maximum vacancy cluster size tracked
G_He_r  : float [appm He/dpa]
    He production rate.  SINGLE AUTHORITATIVE SOURCE — supplied by the
    caller from the Excel Reactions-sheet value loaded into
    InputData.derived['G_He_r'].  No hard-coded fallback lives here.

Returns
-------
Pr_SIA : ndarray [I_max+1]   (index 0 unused; Pr_SIA[1]=monomer)
Pr_VAC : ndarray [V_max+1]   (index 0 unused; Pr_VAC[1]=monomer)
G_He   : float [atom frac/s]  — He transmutation production rate

Definition at line 172 of file defect_production.py.

Variable Documentation

◆ _KEY_ALIASES

dict py_utils.defect_production._KEY_ALIASES = {'m1': 'i_cascade', 'n1': 'v_cascade'}
protected

Definition at line 72 of file defect_production.py.

◆ FISSION

dict py_utils.defect_production.FISSION
Initial value:
1= {
2 'label': 'Fission',
3 'eta': 0.30, # survival efficiency η (Table 2)
4 'f_cl_i': 0.58, # SIA clustering fraction (Table 2)
5 's_i': 1.6, # SIA power-law exponent (Table 2, Eq. 7)
6 'i_cascade': 20, # max SIA cluster size from cascade (Table 2)
7 'f_cl_v': 0.15, # vacancy clustering fraction (Table 2)
8 's_v': 2.5, # vacancy power-law exponent (Table 2, Eq. 8)
9 'v_cascade': 10, # max vacancy cluster size from cascade (Table 2)
10 'b0_res': 0.01, # re-solution parameter b_0 [dpa^-1/He] (Table 29)
11 # NOTE: G_He_r (He production rate) is NOT stored here. The single
12 # authoritative source is the Excel Reactions-sheet 'G_He_r', loaded into
13 # InputData.derived['G_He_r']; production_rates() takes it as an explicit
14 # argument. (Stage-2 fix: eliminated the duplicate hard-coded value.)
15}

Definition at line 41 of file defect_production.py.

◆ FUSION

dict py_utils.defect_production.FUSION
Initial value:
1= {
2 'label': 'Fusion',
3 'eta': 0.28, # survival efficiency η (Table 2)
4 'f_cl_i': 0.65, # SIA clustering fraction (Table 2)
5 's_i': 1.5, # SIA power-law exponent (Table 2, Eq. 7)
6 'i_cascade': 50, # max SIA cluster size from cascade (Table 2)
7 'f_cl_v': 0.20, # vacancy clustering fraction (Table 2)
8 's_v': 2.3, # vacancy power-law exponent (Table 2, Eq. 8)
9 'v_cascade': 20, # max vacancy cluster size from cascade (Table 2)
10 'b0_res': 0.10, # re-solution parameter b_0 [dpa^-1/He] (Table 29)
11 # NOTE: G_He_r is NOT stored here — see the corresponding note in FISSION.
12}

Definition at line 58 of file defect_production.py.