d0fus 2.7.2__tar.gz → 2.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {d0fus-2.7.2 → d0fus-2.8.0}/D0FUS_BIB/D0FUS_figures.py +16 -15
  2. {d0fus-2.7.2 → d0fus-2.8.0}/D0FUS_BIB/D0FUS_parameterization.py +1 -1
  3. {d0fus-2.7.2 → d0fus-2.8.0}/D0FUS_BIB/D0FUS_physical_functions.py +89 -31
  4. {d0fus-2.7.2 → d0fus-2.8.0}/D0FUS_EXE/D0FUS_run.py +8 -2
  5. {d0fus-2.7.2 → d0fus-2.8.0}/PKG-INFO +1 -1
  6. {d0fus-2.7.2 → d0fus-2.8.0}/d0fus.egg-info/PKG-INFO +1 -1
  7. {d0fus-2.7.2 → d0fus-2.8.0}/pyproject.toml +1 -1
  8. {d0fus-2.7.2 → d0fus-2.8.0}/D0FUS.py +0 -0
  9. {d0fus-2.7.2 → d0fus-2.8.0}/D0FUS_BIB/D0FUS_cost_data.py +0 -0
  10. {d0fus-2.7.2 → d0fus-2.8.0}/D0FUS_BIB/D0FUS_cost_functions.py +0 -0
  11. {d0fus-2.7.2 → d0fus-2.8.0}/D0FUS_BIB/D0FUS_import.py +0 -0
  12. {d0fus-2.7.2 → d0fus-2.8.0}/D0FUS_BIB/D0FUS_machine_presets.py +0 -0
  13. {d0fus-2.7.2 → d0fus-2.8.0}/D0FUS_BIB/D0FUS_radial_build_functions.py +0 -0
  14. {d0fus-2.7.2 → d0fus-2.8.0}/D0FUS_EXE/D0FUS_genetic.py +0 -0
  15. {d0fus-2.7.2 → d0fus-2.8.0}/D0FUS_EXE/D0FUS_popcon.py +0 -0
  16. {d0fus-2.7.2 → d0fus-2.8.0}/D0FUS_EXE/D0FUS_scan.py +0 -0
  17. {d0fus-2.7.2 → d0fus-2.8.0}/D0FUS_EXE/D0FUS_uncertainty.py +0 -0
  18. {d0fus-2.7.2 → d0fus-2.8.0}/LICENSE +0 -0
  19. {d0fus-2.7.2 → d0fus-2.8.0}/README.md +0 -0
  20. {d0fus-2.7.2 → d0fus-2.8.0}/d0fus.egg-info/SOURCES.txt +0 -0
  21. {d0fus-2.7.2 → d0fus-2.8.0}/d0fus.egg-info/dependency_links.txt +0 -0
  22. {d0fus-2.7.2 → d0fus-2.8.0}/d0fus.egg-info/entry_points.txt +0 -0
  23. {d0fus-2.7.2 → d0fus-2.8.0}/d0fus.egg-info/requires.txt +0 -0
  24. {d0fus-2.7.2 → d0fus-2.8.0}/d0fus.egg-info/top_level.txt +0 -0
  25. {d0fus-2.7.2 → d0fus-2.8.0}/setup.cfg +0 -0
@@ -1063,28 +1063,29 @@ def plot_Lz_cooling(
1063
1063
 
1064
1064
  # Helium ash fraction against C_alpha, tabulated from full D0FUS runs.
1065
1065
  # Each entry is (C_alpha, f_He [%]) obtained by rerunning the corresponding
1066
- # benchmark deck with C_Alpha substituted and nothing else changed. The scan
1067
- # is reproduced by verif_Calpha/scan_calpha.py. Evaluating the standalone
1068
- # reservoir formula instead would answer a different question: at a fixed
1069
- # hand-picked reference point, without impurity dilution, without pedestal
1070
- # and with a cylindrical volume weight, it returns 4.6 % for C_alpha = 5,
1071
- # whereas the converged ITER deck returns 2.7 % at that value.
1072
- _HE_SCAN_ITER = [(3, 1.601), (4, 2.163), (5, 2.742), (6, 3.341), (7, 3.965),
1073
- (7.5, 4.287), (8, 4.618), (9, 5.308)]
1066
+ # benchmark deck with C_Alpha substituted and nothing else changed (script
1067
+ # scan_calpha.py in the analysis notes; 8 s per point). Tabulated with the
1068
+ # v2.8 ash balance, i.e. the alpha source of the reservoir equation is the
1069
+ # density-weighted reactivity integral of f_nbar (P_fus / E_fus exactly).
1070
+ # Before v2.8 the source dropped the n_hat^2 weight and the table read
1071
+ # 4.29 % at C_alpha = 7.5; the same 4.29 % is now obtained at C_alpha = 5.7,
1072
+ # which is the new ITER deck calibration (Shimada 2007 projection).
1073
+ _HE_SCAN_ITER = [(3, 2.132), (4, 2.896), (5, 3.697), (5.7, 4.285),
1074
+ (6, 4.546), (6.5, 4.992)]
1074
1075
  # EU-DEMO 2017 deck, kept for the record but no longer plotted: the range to
1075
1076
  # expect for a DEMO-class device is not known with anything like the
1076
1077
  # confidence of the ITER projection, so showing it would invite more
1077
- # commentary than it is worth. Its deck value is C_alpha = 10, returning
1078
- # 8.8 %, against a European baseline that assumes c_He = 10 %.
1079
- _HE_SCAN_DEMO = [(3, 2.472), (4, 3.318), (5, 4.177), (6, 5.052), (7, 5.944),
1080
- (7.5, 6.398), (8, 6.858), (9, 7.795), (10, 8.763),
1081
- (11, 9.767), (12, 10.818), (14, 13.124)]
1082
- _HE_ITER_LAST_FEASIBLE = 9 # beyond this the 500 MW ITER point does not close
1078
+ # commentary than it is worth. With the v2.8 balance its deck value
1079
+ # C_alpha = 7.6 returns ~10 %, the European baseline assumption (the
1080
+ # pre-v2.8 deck used C_alpha = 10 for 8.8 %).
1081
+ _HE_SCAN_DEMO = [(3, 3.670), (4, 4.947), (5, 6.263), (6, 7.627), (7, 9.053),
1082
+ (8, 10.564), (9, 12.200), (10, 14.038)]
1083
+ _HE_ITER_LAST_FEASIBLE = 6.5 # beyond this the 500 MW ITER point does not close
1083
1084
 
1084
1085
 
1085
1086
  def plot_He_fraction(
1086
1087
  iter_scan: list | None = None,
1087
- C_Alpha_ITER: float = 7.5,
1088
+ C_Alpha_ITER: float = 5.7,
1088
1089
  save_dir: str | None = None,
1089
1090
  ) -> None:
1090
1091
  """
@@ -215,7 +215,7 @@ class GlobalConfig:
215
215
  # D-T+He plasma with Z_eff ~ 1 + 2 f_He (~1.1).
216
216
  # float -> manual override (legacy behaviour, e.g. Zeff = 2.0).
217
217
  r_synch : float = 0.5 # Synchrotron radiation wall reflectivity [-]
218
- C_Alpha : float = 7.5 # Helium ash confinement ratio τ_He*/τ_E [-], calibrated deck by deck (default 7.5 = ITER calibration; PROCESS provides only a lower bound, 5)
218
+ C_Alpha : float = 5.7 # Helium ash confinement ratio τ_He*/τ_E [-], calibrated deck by deck (default 5.7 = ITER calibration with the v2.8 ash balance, 4.3 % He; PROCESS provides only a lower bound, 5)
219
219
  # Impurity line radiation (0D bulk-plasma estimate).
220
220
  # Comma-separated species ('W', 'Ar', 'Ne', 'C', 'N', 'Kr') with matching
221
221
  # concentrations n_imp/n_e. Empty string = disabled (pure D-T).
@@ -166,7 +166,12 @@ if __name__ == "__main__":
166
166
  rho_ped=0.95, n_ped_frac=0.99, T_ped_frac=0.55,
167
167
  # Composition and radiation (deck section 4)
168
168
  Zeff=1.65, imp={'W': 2e-5, 'Ne': 7e-3}, r_synch=0.6,
169
- rho_rad_core=0.75, C_Alpha=5.0,
169
+ # C_Alpha: value at which the v2.8 ash balance (density-weighted
170
+ # reactivity, Miller volume weight) returns the frozen f_alpha of
171
+ # the 2026-06 deck. That deck was converged with the pre-v2.8
172
+ # balance at C_Alpha = 5.0; the two are related by the profile
173
+ # factor <sigma.v n_hat^2> / <sigma.v> and the volume weight.
174
+ rho_rad_core=0.75, C_Alpha=3.8119,
170
175
  # Current-drive deposition (deck section 11)
171
176
  A_beam=2, E_beam_keV=1000.0, rho_NBI=0.30, rho_EC=0.40,
172
177
  angle_NBI_deg=20.0,
@@ -184,7 +189,7 @@ if __name__ == "__main__":
184
189
  eta_LH=0.310283, eta_EC=0.0463759, eta_NBI=0.292349, I_CD=1.62962,
185
190
  Q=9.98184, P_sep=87.8792, P_LH_th=73.522,
186
191
  B_pol=0.715156, lambda_q_mm=1.12391, Gamma_n=0.58196,
187
- tau_alpha=15.7193,
192
+ tau_alpha=11.9840, # = C_Alpha * tauE with the v2.8 chain C_Alpha
188
193
  )
189
194
 
190
195
  #%% Geometry formulas
@@ -8003,9 +8008,17 @@ if __name__ == "__main__":
8003
8008
  # ── Helium ash accumulation model ─────────────────────────────────────────────
8004
8009
 
8005
8010
  def _sigmav_vol(T_bar, nu_T, rho_ped=1.0, T_ped_frac=0.0, N=200,
8006
- Vprime_data=None, tau_i_e=1.0):
8011
+ Vprime_data=None, tau_i_e=1.0,
8012
+ nu_n=None, n_ped_frac=0.0):
8007
8013
  """
8008
- Volume-averaged DT reactivity ⟨σv⟩_vol = ∫₀¹ ⟨σv⟩[T(ρ)] · w(ρ) dρ.
8014
+ Density-weighted, volume-averaged DT reactivity
8015
+
8016
+ I_fus = ∫₀¹ ⟨σv⟩[T_i(ρ)] · n̂²(ρ) · w(ρ) dρ
8017
+
8018
+ where n̂(ρ) = n(ρ)/n̄ is the normalised density profile and w(ρ) the
8019
+ volume weight. This is the same normalised reactivity integral as in
8020
+ `f_nbar`, so that the alpha source seen by the helium-ash balance is
8021
+ the one that produces P_fus.
8009
8022
 
8010
8023
  Shared helper for f_He_fraction and f_tau_alpha, avoiding redundant
8011
8024
  profile and reactivity evaluations when both are called on the same
@@ -8021,10 +8034,20 @@ def _sigmav_vol(T_bar, nu_T, rho_ped=1.0, T_ped_frac=0.0, N=200,
8021
8034
  Vprime_data : tuple or None
8022
8035
  (rho_grid, Vprime, V_total) from precompute_Vprime().
8023
8036
  None → cylindrical weight 2ρ (Academic mode).
8037
+ tau_i_e : float T_i / T_e ratio; the reactivity is evaluated on
8038
+ T_i = tau_i_e · T_e.
8039
+ nu_n : float or None
8040
+ Density peaking exponent. None → the density weight n̂² is
8041
+ dropped (legacy behaviour, kept for reference only: it
8042
+ under-counts the alpha source by the factor
8043
+ ⟨σv n̂²⟩ / ⟨σv⟩, 1.2 for a flat ITER-like density and 1.6 for a
8044
+ peaked DEMO-like one).
8045
+ n_ped_frac : float n_ped / n̄ (used only when nu_n is not None).
8024
8046
 
8025
8047
  Returns
8026
8048
  -------
8027
- float Volume-averaged reactivity [m³ s⁻¹].
8049
+ float Normalised reactivity integral I_fus [m³ s⁻¹]. With nu_n = None
8050
+ it reduces to the plain volume average ⟨σv⟩_vol.
8028
8051
  """
8029
8052
  if Vprime_data is not None:
8030
8053
  # refined mode: Miller weight V'(ρ)/V
@@ -8032,18 +8055,27 @@ def _sigmav_vol(T_bar, nu_T, rho_ped=1.0, T_ped_frac=0.0, N=200,
8032
8055
  T = f_Tprof(T_bar, nu_T, rho_grid, rho_ped, T_ped_frac,
8033
8056
  Vprime_data)
8034
8057
  sv = f_sigmav(tau_i_e * T) # reactivity on T_i = tau_i_e * T_e
8035
- return float(np.trapezoid(sv * Vprime, rho_grid)) / V_total
8058
+ if nu_n is not None:
8059
+ n_hat = f_nprof(1.0, nu_n, rho_grid, rho_ped, n_ped_frac,
8060
+ Vprime_data)
8061
+ sv = sv * n_hat**2
8062
+ integrand = np.nan_to_num(sv * Vprime, nan=0.0, posinf=0.0)
8063
+ return float(np.trapezoid(integrand, rho_grid)) / V_total
8036
8064
  else:
8037
8065
  # Academic mode: cylindrical weight 2ρ dρ
8038
8066
  rho = np.linspace(0.0, 1.0, N)
8039
8067
  T = f_Tprof(T_bar, nu_T, rho, rho_ped, T_ped_frac)
8040
8068
  sv = f_sigmav(tau_i_e * T) # reactivity on T_i = tau_i_e * T_e
8041
- return float(np.trapezoid(sv * 2.0 * rho, rho))
8069
+ if nu_n is not None:
8070
+ n_hat = f_nprof(1.0, nu_n, rho, rho_ped, n_ped_frac)
8071
+ sv = sv * n_hat**2
8072
+ integrand = np.nan_to_num(sv * 2.0 * rho, nan=0.0, posinf=0.0)
8073
+ return float(np.trapezoid(integrand, rho))
8042
8074
 
8043
8075
 
8044
8076
  def f_He_fraction(n_bar, T_bar, tauE, C_Alpha, nu_T,
8045
8077
  rho_ped=1.0, T_ped_frac=0.0, Vprime_data=None, tau_i_e=1.0,
8046
- f_imp=0.0):
8078
+ f_imp=0.0, nu_n=None, n_ped_frac=0.0):
8047
8079
  """
8048
8080
  Estimate the equilibrium helium ash fraction f_α = n_α / n_e.
8049
8081
 
@@ -8072,7 +8104,7 @@ def f_He_fraction(n_bar, T_bar, tauE, C_Alpha, nu_T,
8072
8104
  C_Alpha : float
8073
8105
  Helium ash confinement ratio τ_α*/τ_E (dimensionless), lumping
8074
8106
  transport and wall recycling. Calibrated deck by deck; the ITER
8075
- deck calibration C_α = 7.5 returns f_α = 4.3 %.
8107
+ deck calibration C_α = 5.7 returns f_α = 4.3 % (see Notes).
8076
8108
  nu_T : float
8077
8109
  Temperature profile peaking exponent (core power-law)
8078
8110
  rho_ped : float, optional
@@ -8082,6 +8114,13 @@ def f_He_fraction(n_bar, T_bar, tauE, C_Alpha, nu_T,
8082
8114
  Vprime_data : tuple or None
8083
8115
  (rho_grid, Vprime, V_total) from precompute_Vprime().
8084
8116
  None → cylindrical weight (Academic mode).
8117
+ nu_n : float or None
8118
+ Density peaking exponent. Must match the value passed to f_nbar
8119
+ so that the alpha source of the ash balance is the one producing
8120
+ P_fus. None keeps the legacy volume average ⟨σv⟩_vol without the
8121
+ n̂² weight (not recommended, see Notes).
8122
+ n_ped_frac : float
8123
+ n_ped / n̄ (used only when nu_n is not None).
8085
8124
 
8086
8125
  Returns
8087
8126
  -------
@@ -8098,27 +8137,44 @@ def f_He_fraction(n_bar, T_bar, tauE, C_Alpha, nu_T,
8098
8137
  Notes
8099
8138
  -----
8100
8139
  Steady-state reservoir balance (Sarazin et al. 2020, Appendix B),
8101
- generalised here to impurity dilution. With
8102
- C = n_bar <sigma.v>_vol * C_alpha * tau_E
8140
+ generalised here to impurity dilution and to peaked profiles. With
8141
+ C = n_bar * I_fus * C_alpha * tau_E,
8142
+ I_fus = int sigma.v[T(rho)] n_hat(rho)^2 w(rho) drho
8103
8143
  the balance (C/4)(1 - f_imp - 2 f_alpha)^2 = f_alpha has the
8104
8144
  physical root
8105
8145
  f_alpha = s * (C_s + 1 - sqrt(2 C_s + 1)) / (2 C_s),
8106
8146
  with s = 1 - f_imp and C_s = C * s,
8107
8147
  reducing to (C + 1 - sqrt(2C + 1))/(2C) for f_imp = 0.
8108
- The correction lowers f_alpha by about 13 % at ITER-like impurity
8109
- content (f_imp ~ 0.07); the closed form is verified against a
8110
- direct root solve in test_verifications.py.
8111
- <sigma.v>_vol is the volume-averaged D-T reactivity using the
8112
- volume weight consistent with the geometry mode (cylindrical
8113
- 2 rho drho in Academic mode, Miller V'(rho)/V in Refined mode).
8148
+ The impurity correction lowers f_alpha by about 13 % at ITER-like
8149
+ impurity content (f_imp ~ 0.07).
8150
+ I_fus is the normalised reactivity integral of f_nbar, evaluated
8151
+ with the volume weight of the geometry mode (cylindrical 2 rho drho
8152
+ in Academic mode, Miller V'(rho)/V in Refined mode). Writing the
8153
+ source as n_bar^2 I_fus V / 4 makes the alpha production of the ash
8154
+ balance identical to P_fus / E_fus, which is the only consistent
8155
+ choice once P_fus is an input.
8156
+
8157
+ History. Up to v2.7.2 the source was written n_bar^2 <sigma.v>_vol,
8158
+ i.e. without the n_hat^2 weight. Because sigma.v and n_hat^2 are both
8159
+ peaked, this under-counted the alpha source by the factor
8160
+ <sigma.v n_hat^2> / <sigma.v> (1.23 for the flat ITER density,
8161
+ 1.59 for the SF Plant V2 point), so that a deck C_alpha = 7 behaved
8162
+ as an effective tau*_He/tau_E of 4.4. The v2.8 correction restores
8163
+ C_alpha as the true tau*_He/tau_E; the ITER deck calibration moved
8164
+ from C_alpha = 7.5 to 5.7 to keep f_alpha = 4.3 % (Shimada 2007).
8165
+ Cross-checked against METIS on the SF Plant V2 point (Sept 2026):
8166
+ at equal tau*_He/tau_E the two codes give the same f_He and P_fus.
8114
8167
 
8115
8168
  References
8116
8169
  ----------
8117
8170
  Y. Sarazin et al., Nucl. Fusion 60 (2020) 016010, Appendix B.
8118
8171
  """
8119
- # Volume-averaged reactivity via shared helper (uses T_i = tau_i_e * T_e)
8172
+ # Density-weighted reactivity integral I_fus (same as in f_nbar),
8173
+ # evaluated on T_i = tau_i_e * T_e. nu_n = None falls back to the
8174
+ # legacy <sigma.v>_vol (see Notes).
8120
8175
  sigmav_vol = _sigmav_vol(T_bar, nu_T, rho_ped, T_ped_frac,
8121
- Vprime_data=Vprime_data, tau_i_e=tau_i_e)
8176
+ Vprime_data=Vprime_data, tau_i_e=tau_i_e,
8177
+ nu_n=nu_n, n_ped_frac=n_ped_frac)
8122
8178
  C = n_bar * 1e20 * sigmav_vol * C_Alpha * tauE
8123
8179
  # Impurity-diluted closed form: solves (C/4)(1 - f_imp - 2 f)^2 = f;
8124
8180
  # reduces to the historical expression for f_imp = 0.
@@ -8142,7 +8198,7 @@ def f_tau_alpha(n_bar, T_bar, tauE, C_Alpha, nu_T,
8142
8198
  balance solved in `f_He_fraction`. Conversely, substituting f_α
8143
8199
  back into the particle balance yields the same identity:
8144
8200
 
8145
- τ*_α = 4 f_α / [ n_e (1 − 2f_α)² ⟨σv⟩_vol ] = C_α · τ_E
8201
+ τ*_α = 4 f_α / [ n_e (1 − 2f_α)² I_fus ] = C_α · τ_E
8146
8202
 
8147
8203
  so the two routes are algebraically equivalent.
8148
8204
 
@@ -9183,12 +9239,13 @@ if __name__ == "__main__":
9183
9239
  # ITER-1989 guideline formula at the PUBLISHED 95 % shaping and 15 MA
9184
9240
  # reproduces the ITER design value q95 = 3.0.
9185
9241
  # Helium ash: f_alpha solves the Sarazin steady-state balance with
9186
- # the deck removal efficiency C_alpha = 5 (tau*_alpha = C_alpha
9187
- # tau_E) at the chain tau_E. The value must close on the f_alpha
9188
- # forward reference injected in chain 2, which is the convergence
9189
- # criterion of the production solver. The production solver evaluates
9190
- # the ash balance with the cylindrical volume weight even in refined
9191
- # geometry (see D0FUS_run.py); the chain mirrors that call exactly.
9242
+ # the removal efficiency C_alpha (tau*_alpha = C_alpha tau_E) at the
9243
+ # chain tau_E. The value must close on the f_alpha forward reference
9244
+ # injected in chain 2, which is the convergence criterion of the
9245
+ # production solver. Since v2.8 the production solver evaluates the
9246
+ # ash balance with the density-weighted reactivity integral of
9247
+ # f_nbar and the Miller volume weight (see D0FUS_run.py); the chain
9248
+ # mirrors that call exactly, hence the ITER['C_Alpha'] value.
9192
9249
  _q95 = f_q95(ITER['B0'], ITER['Ip'], ITER['R0'], ITER['a'],
9193
9250
  ITER['kappa'], ITER['delta'], ITER['kappa95'],
9194
9251
  ITER['delta95'], Option_q95='Sauter')
@@ -9199,7 +9256,9 @@ if __name__ == "__main__":
9199
9256
  _fa = f_He_fraction(ITER['nbar'], ITER['Tbar'], ITER['tauE'],
9200
9257
  ITER['C_Alpha'], ITER['nu_T'],
9201
9258
  rho_ped=ITER['rho_ped'],
9202
- T_ped_frac=ITER['T_ped_frac'], tau_i_e=1.0)
9259
+ T_ped_frac=ITER['T_ped_frac'], tau_i_e=1.0,
9260
+ nu_n=ITER['nu_n'], n_ped_frac=ITER['n_ped_frac'],
9261
+ Vprime_data=ITER_Vpd)
9203
9262
  _ta = f_tau_alpha(ITER['nbar'], ITER['Tbar'], ITER['tauE'],
9204
9263
  ITER['C_Alpha'], ITER['nu_T'],
9205
9264
  rho_ped=ITER['rho_ped'],
@@ -9213,7 +9272,7 @@ if __name__ == "__main__":
9213
9272
  ("Gamma_n, Miller wall [MW/m2]", _Gam, FROZEN['Gamma_n'], 2e-3,
9214
9273
  "deck frozen"),
9215
9274
  ("Gamma_n [MW/m2]", _Gam, 0.57, 0.05, "Shimada 2007"),
9216
- ("f_He closure (C_alpha = 5) [-]", _fa, FROZEN['f_alpha'], 1e-3,
9275
+ ("f_He closure (chain C_alpha) [-]", _fa, FROZEN['f_alpha'], 1e-3,
9217
9276
  "solver fixed point"),
9218
9277
  ("f_He, IPB exhaust assumption [%]", _fa * 100, "4.4", None,
9219
9278
  "IPB 1999"),
@@ -9261,9 +9320,8 @@ if __name__ == "__main__":
9261
9320
 
9262
9321
  import D0FUS_BIB.D0FUS_figures as figs
9263
9322
  # plot_He_fraction takes separate ITER/DEMO removal efficiencies
9264
- # (C_Alpha_ITER=5.0, C_Alpha_DEMO=7.0 by default); defaults match the
9265
- # chain above (C_alpha = 5).
9266
- figs.plot_He_fraction(C_Alpha_ITER=ITER['C_Alpha'])
9323
+ # (C_Alpha_ITER = 5.7 by default, the v2.8 ITER deck calibration).
9324
+ figs.plot_He_fraction(C_Alpha_ITER=5.7)
9267
9325
 
9268
9326
  #%%
9269
9327
 
@@ -1145,11 +1145,17 @@ def run(config: GlobalConfig = None, verbose: int = 0) -> tuple:
1145
1145
  f"I_Ohm={I_Ohm_loc:.2f}, P_Ohm={P_Ohm_loc:.3f}, "
1146
1146
  f"Q={Q_loc:.2f}")
1147
1147
 
1148
- # Helium ash fraction from confinement time
1148
+ # Helium ash fraction from confinement time. The density profile
1149
+ # (nu_n, n_ped_frac) and the volume weight (Vprime_data) are the
1150
+ # ones used by f_nbar above, so that the alpha source of the ash
1151
+ # balance is exactly P_fus / E_fus (v2.8 correction: the former
1152
+ # call dropped the n_hat^2 weight and the Miller weight, which
1153
+ # under-counted the source by 1.2 to 1.6).
1149
1154
  new_fa_loc = f_He_fraction(
1150
1155
  nbar_loc, Tbar, tau_E_loc, C_Alpha, nu_T,
1151
1156
  rho_ped=rho_ped, T_ped_frac=T_ped_frac, tau_i_e=tau_i_e,
1152
- f_imp=f_imp_dilution)
1157
+ f_imp=f_imp_dilution, nu_n=nu_n, n_ped_frac=n_ped_frac,
1158
+ Vprime_data=Vprime_data)
1153
1159
 
1154
1160
  if _dbg:
1155
1161
  print(f" new_f_alpha={new_fa_loc:.6f} (input={f_alpha:.6f})")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: d0fus
3
- Version: 2.7.2
3
+ Version: 2.8.0
4
4
  Summary: Design 0-dimensional for Fusion Systems - Tokamak power plant design and optimization tool
5
5
  Author-email: Timothé Auclair <timothe.auclair@gmail.com>
6
6
  Maintainer-email: Timothé Auclair <timothe.auclair@gmail.com>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: d0fus
3
- Version: 2.7.2
3
+ Version: 2.8.0
4
4
  Summary: Design 0-dimensional for Fusion Systems - Tokamak power plant design and optimization tool
5
5
  Author-email: Timothé Auclair <timothe.auclair@gmail.com>
6
6
  Maintainer-email: Timothé Auclair <timothe.auclair@gmail.com>
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "d0fus"
7
- version = "2.7.2"
7
+ version = "2.8.0"
8
8
  description = "Design 0-dimensional for Fusion Systems - Tokamak power plant design and optimization tool"
9
9
  readme = "README.md"
10
10
  license = {text = "CeCILL-C"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes