d0fus 2.3.4__tar.gz → 2.4.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 (24) hide show
  1. {d0fus-2.3.4 → d0fus-2.4.0}/D0FUS_BIB/D0FUS_cost_data.py +3 -6
  2. {d0fus-2.3.4 → d0fus-2.4.0}/D0FUS_BIB/D0FUS_cost_functions.py +122 -132
  3. {d0fus-2.3.4 → d0fus-2.4.0}/D0FUS_BIB/D0FUS_figures.py +970 -316
  4. {d0fus-2.3.4 → d0fus-2.4.0}/D0FUS_BIB/D0FUS_parameterization.py +583 -2
  5. {d0fus-2.3.4 → d0fus-2.4.0}/D0FUS_BIB/D0FUS_physical_functions.py +1028 -496
  6. {d0fus-2.3.4 → d0fus-2.4.0}/D0FUS_BIB/D0FUS_radial_build_functions.py +674 -0
  7. {d0fus-2.3.4 → d0fus-2.4.0}/D0FUS_EXE/D0FUS_genetic.py +100 -23
  8. {d0fus-2.3.4 → d0fus-2.4.0}/D0FUS_EXE/D0FUS_run.py +963 -43
  9. {d0fus-2.3.4 → d0fus-2.4.0}/D0FUS_EXE/D0FUS_scan.py +455 -11
  10. {d0fus-2.3.4 → d0fus-2.4.0}/D0FUS_EXE/D0FUS_uncertainty.py +74 -242
  11. {d0fus-2.3.4 → d0fus-2.4.0}/PKG-INFO +1 -1
  12. {d0fus-2.3.4 → d0fus-2.4.0}/d0fus.egg-info/PKG-INFO +1 -1
  13. {d0fus-2.3.4 → d0fus-2.4.0}/pyproject.toml +1 -1
  14. {d0fus-2.3.4 → d0fus-2.4.0}/D0FUS.py +0 -0
  15. {d0fus-2.3.4 → d0fus-2.4.0}/D0FUS_BIB/D0FUS_import.py +0 -0
  16. {d0fus-2.3.4 → d0fus-2.4.0}/D0FUS_EXE/D0FUS_popcon.py +0 -0
  17. {d0fus-2.3.4 → d0fus-2.4.0}/LICENSE +0 -0
  18. {d0fus-2.3.4 → d0fus-2.4.0}/README.md +0 -0
  19. {d0fus-2.3.4 → d0fus-2.4.0}/d0fus.egg-info/SOURCES.txt +0 -0
  20. {d0fus-2.3.4 → d0fus-2.4.0}/d0fus.egg-info/dependency_links.txt +0 -0
  21. {d0fus-2.3.4 → d0fus-2.4.0}/d0fus.egg-info/entry_points.txt +0 -0
  22. {d0fus-2.3.4 → d0fus-2.4.0}/d0fus.egg-info/requires.txt +0 -0
  23. {d0fus-2.3.4 → d0fus-2.4.0}/d0fus.egg-info/top_level.txt +0 -0
  24. {d0fus-2.3.4 → d0fus-2.4.0}/setup.cfg +0 -0
@@ -100,12 +100,9 @@ C_waste_sfd = 5 # Radioactive waste disposal [$/MWh]
100
100
 
101
101
  C_fa_sfd = 7.5 # Annual fuel cost [2010 M$ / yr]
102
102
 
103
- # -- Blanket and divertor target lifetime limits (Table III) --
104
- # Refs: Gilbert et al., NF 57 (2017) 046015; Pitts et al., NME 20 (2019) 100696.
105
-
106
- T_load_bl_sfd = 15 # Blanket max neutron fluence [MW yr / m^2]
107
- T_load_tt_sfd = 10 # Divertor max heat fluence [MW yr / m^2]
108
- load_factor_tt_sfd = 10 / 3 # Thermal / neutron flux ratio [-]
103
+ # Component lifetimes are now computed by f_blanket_lifetime_fpy /
104
+ # f_divertor_lifetime_fpy in D0FUS_physical_functions.py using parameters
105
+ # from GlobalConfig (dpa_lim, C_dpa, epsilon_div, f_peak).
109
106
 
110
107
  # -- Heat transfer system cost scaling (Table IV) --
111
108
  # C_heat = C_ref * (P_th / P_ref)^x
@@ -102,50 +102,16 @@ def f_unit_cost_scaling(quantity, unit_cost):
102
102
  cost = quantity * unit_cost
103
103
  return cost
104
104
 
105
- #%% 2. Technology & Operation related general functions
105
+ # f_pp_availability, f_pp_capacity_factor, f_critical_neutron_load,
106
+ # f_op_time_before_load_limit have been moved to D0FUS_physical_functions.py.
107
+ # They are imported above and remain accessible via this module for backward
108
+ # compatibility with the Whyte model and any external callers.
106
109
 
107
- def f_pp_availability(T_op_limit, dt_rep):
108
- """
109
- Power plant availability fraction.
110
-
111
- Simple model: the plant operates for T_op_limit years, then is shut
112
- down for dt_rep years for scheduled component replacement.
113
- Refs: Sheffield (2016) Section III.B; Entler (2018) Section 5.
114
-
115
- Parameters
116
- ----------
117
- T_op_limit : float Maximum operation time before replacement [yr].
118
- dt_rep : float Scheduled replacement/maintenance downtime [yr].
119
-
120
- Returns
121
- -------
122
- Av : float Plant availability [-], in (0, 1).
123
- """
124
- Av = T_op_limit / (T_op_limit + dt_rep)
125
- return Av
126
-
127
- def f_pp_capacity_factor(Av, Util_factor, Dwell_factor):
128
- """
129
- Power plant capacity factor.
130
-
131
- CF = Av * Util_factor * Dwell_factor.
132
- - Av: hardware availability (replacement cycle).
133
- - Util_factor: fraction of available time at nominal power.
134
- - Dwell_factor: duty cycle correction for pulsed operation
135
- (1.0 for steady-state, < 1.0 for pulsed).
136
-
137
- Parameters
138
- ----------
139
- Av : float Plant availability [-].
140
- Util_factor : float Utilisation factor [-].
141
- Dwell_factor : float Dwell time factor [-] (1.0 = steady-state).
110
+ #%% 3. Cost functions - Dennis Whyte 2024 adapted model
142
111
 
143
- Returns
144
- -------
145
- CF : float Capacity factor [-], in (0, 1).
146
- """
147
- CF = Av * Util_factor * Dwell_factor
148
- return CF
112
+ # ── Neutron-load lifetime and availability (D0FUS branch home: cost module) ──
113
+ # These feed f_costs_Whyte (MIT/Whyte cost model). Kept in cost_functions
114
+ # by design; the formulas are identical to any copy elsewhere.
149
115
 
150
116
  def f_critical_neutron_load(F_dpa, L_dpa, S):
151
117
  """
@@ -173,6 +139,7 @@ def f_critical_neutron_load(F_dpa, L_dpa, S):
173
139
  X_crit_load = (L_dpa * S) / F_dpa
174
140
  return X_crit_load
175
141
 
142
+
176
143
  def f_op_time_before_load_limit(X_crit_load, Util_factor, Dwell_factor, Load_nn):
177
144
  """
178
145
  Maximum operation time before reaching the neutron load limit [yr].
@@ -196,6 +163,52 @@ def f_op_time_before_load_limit(X_crit_load, Util_factor, Dwell_factor, Load_nn)
196
163
 
197
164
  #%% 3. Cost functions - Dennis Whyte 2024 adapted model
198
165
 
166
+
167
+ def f_pp_availability(T_op_limit, dt_rep):
168
+ """
169
+ Power plant availability fraction.
170
+
171
+ Simple model: the plant operates for T_op_limit years, then is shut
172
+ down for dt_rep years for scheduled component replacement.
173
+ Refs: Sheffield (2016) Section III.B; Entler (2018) Section 5.
174
+
175
+ Parameters
176
+ ----------
177
+ T_op_limit : float Maximum operation time before replacement [yr].
178
+ dt_rep : float Scheduled replacement/maintenance downtime [yr].
179
+
180
+ Returns
181
+ -------
182
+ Av : float Plant availability [-], in (0, 1).
183
+ """
184
+ Av = T_op_limit / (T_op_limit + dt_rep)
185
+ return Av
186
+
187
+
188
+ def f_pp_capacity_factor(Av, Util_factor, Dwell_factor):
189
+ """
190
+ Power plant capacity factor.
191
+
192
+ CF = Av * Util_factor * Dwell_factor.
193
+ - Av: hardware availability (replacement cycle).
194
+ - Util_factor: fraction of available time at nominal power.
195
+ - Dwell_factor: duty cycle correction for pulsed operation
196
+ (1.0 for steady-state, < 1.0 for pulsed).
197
+
198
+ Parameters
199
+ ----------
200
+ Av : float Plant availability [-].
201
+ Util_factor : float Utilisation factor [-].
202
+ Dwell_factor : float Dwell time factor [-] (1.0 = steady-state).
203
+
204
+ Returns
205
+ -------
206
+ CF : float Capacity factor [-], in (0, 1).
207
+ """
208
+ CF = Av * Util_factor * Dwell_factor
209
+ return CF
210
+
211
+
199
212
  def f_costs_Whyte(F_dpa, L_dpa, S, Util_factor, Dwell_factor, dt_rep,
200
213
  discount_rate, T_life, Gamma_n, P_elec):
201
214
  """
@@ -320,7 +333,8 @@ def f_COE_computation_Whyte(C_fixed, C_elements_rep, CF, P_elec):
320
333
 
321
334
  def f_costs_Sheffield(discount_rate, contingency, T_life, T_build,
322
335
  P_t, P_e, P_aux, Gamma_n,
323
- Util_factor, Dwell_factor, dt_rep,
336
+ T_op_limit, CF,
337
+ t_life_bl_yr, t_life_div_yr,
324
338
  V_FI, V_pc, V_sg, V_bl, S_tt,
325
339
  Supra_cost_factor):
326
340
  """
@@ -335,22 +349,25 @@ def f_costs_Sheffield(discount_rate, contingency, T_life, T_build,
335
349
 
336
350
  Parameters
337
351
  ----------
338
- discount_rate : float Real discount rate [-].
339
- contingency : float Contingency fraction [-].
340
- T_life : int Plant operational lifetime [yr].
341
- T_build : int Construction time [yr].
342
- P_t : float Thermal power output [MWth].
343
- P_e : float Net electric power output [MWe].
344
- P_aux : float Auxiliary heating power to plasma [MW].
345
- Gamma_n : float Neutron wall load [MW/m^2].
346
- Util_factor : float Utilisation factor [-].
347
- Dwell_factor : float Dwell factor [-] (1.0 for steady-state).
348
- dt_rep : float Replacement downtime [yr].
349
- V_FI : float Fusion island bounding volume [m^3].
350
- V_pc : float Primary coil volume (TF + CS) [m^3].
351
- V_sg : float Shield and gaps volume [m^3].
352
- V_bl : float Blanket volume [m^3].
353
- S_tt : float Divertor target surface [m^2].
352
+ discount_rate : float Real discount rate [-].
353
+ contingency : float Contingency fraction [-].
354
+ T_life : int Plant operational lifetime [yr].
355
+ T_build : int Construction time [yr].
356
+ P_t : float Thermal power output [MWth].
357
+ P_e : float Net electric power output [MWe].
358
+ P_aux : float Auxiliary heating power to plasma [MW].
359
+ Gamma_n : float Neutron wall load [MW/m^2].
360
+ T_op_limit : float Operation time per replacement cycle [yr]
361
+ (pre-computed by f_availability_schedule).
362
+ CF : float Capacity factor [-]
363
+ (pre-computed by f_availability_schedule).
364
+ t_life_bl_yr : float Blanket calendar lifetime [yr].
365
+ t_life_div_yr : float Divertor calendar lifetime [yr].
366
+ V_FI : float Fusion island bounding volume [m^3].
367
+ V_pc : float Primary coil volume (TF + CS) [m^3].
368
+ V_sg : float Shield and gaps volume [m^3].
369
+ V_bl : float Blanket volume [m^3].
370
+ S_tt : float Divertor target surface [m^2].
354
371
  Supra_cost_factor : float SC coil cost multiplier vs Cu [-].
355
372
 
356
373
  Returns
@@ -386,31 +403,10 @@ def f_costs_Sheffield(discount_rate, contingency, T_life, T_build,
386
403
  x_bld_sfd, V_FI, C_FI)
387
404
  (C_CO, C_ind) = f_total_capital_cost_Sheffield(C_D, T_build, contingency)
388
405
 
389
- # Thermal/neutron flux and component lifetimes
390
- T_load_bl = T_load_bl_sfd
391
- Load_bl = Gamma_n
392
- ###########################################################################
393
- #### DIVERTOR TARGETS REPLACEMENTS NEGLECTED HERE BECAUSE OF ABSENCE OF ###
394
- ## MODEL TO COMPUTE FLUX TO DIVERTOR AND ITS LIFETIME : FOR FUTURE WORK ? #
395
- ###########################################################################
396
- T_load_tt = 1e20 # effectively infinite -> no divertor replacement
397
- Load_tt = load_factor_tt_sfd * Load_bl
398
-
399
- # Maximum operation time
400
- T_op_limit_bl = f_op_time_before_load_limit(T_load_bl, Util_factor,
401
- Dwell_factor, Load_bl)
402
- T_op_limit_tt = f_op_time_before_load_limit(T_load_tt, Util_factor,
403
- Dwell_factor, Load_tt)
404
- T_op_limit = min(T_op_limit_bl, T_op_limit_tt)
405
-
406
- # Availability and capacity factor
407
- Av = f_pp_availability(T_op_limit, dt_rep)
408
- CF = f_pp_capacity_factor(Av, Util_factor, Dwell_factor)
409
-
410
- # OpEx [2010 M$/yr]
411
- C_F = f_annual_consumables_costs_Sheffield(CF, T_life, 0.1, C_bl, Load_bl,
412
- T_load_bl, 0.2, C_tt, Load_tt,
413
- T_load_tt, 0.1, C_aux, C_fa_sfd)
406
+ # OpEx [2010 M$/yr] component lifetimes from physical model
407
+ C_F = f_annual_consumables_costs_Sheffield(T_life, 0.1, C_bl, t_life_bl_yr,
408
+ 0.2, C_tt, t_life_div_yr,
409
+ 0.1, C_aux, C_fa_sfd)
414
410
  C_OM = f_annual_OandM_costs_Sheffield(C_OM_sfd, P_e, P_OM_sfd, x_OM_sfd)
415
411
 
416
412
  # Cost of electricity [2010 $/MWh]
@@ -524,37 +520,32 @@ def f_annual_OandM_costs_Sheffield(c_scale_OM, P_e, P_scale_OM, x_scale_OM):
524
520
  C_OM = c_scale_OM * (P_e / P_scale_OM)**x_scale_OM
525
521
  return C_OM
526
522
 
527
- def f_annual_consumables_costs_Sheffield(CF, T_life, failure_bl, C_bl, Load_bl,
528
- T_load_bl, failure_tt, C_tt, Load_tt,
529
- T_load_tt, f_aaux, C_aux, C_fa):
523
+ def f_annual_consumables_costs_Sheffield(T_life, failure_bl, C_bl, t_life_bl_yr,
524
+ failure_tt, C_tt, t_life_div_yr,
525
+ f_aaux, C_aux, C_fa):
530
526
  """
531
- Annual consumable costs: blanket + target replacements + aux fraction + fuel.
527
+ Annual consumable costs: blanket + divertor replacements + aux fraction + fuel.
532
528
  Sheffield (2016) Section III.C.
533
529
 
534
530
  Parameters
535
531
  ----------
536
- CF : float Capacity factor [-].
537
- T_life : float Plant lifetime [yr].
538
- failure_bl : float Blanket failure surcharge fraction [-].
539
- C_bl : float Blanket cost [2010 M$].
540
- Load_bl : float Neutron load on blanket [MW/m^2].
541
- T_load_bl : float Blanket max fluence [MW yr/m^2].
542
- failure_tt : float Target failure surcharge fraction [-].
543
- C_tt : float Target cost [2010 M$].
544
- Load_tt : float Heat load on targets [MW/m^2].
545
- T_load_tt : float Target max fluence [MW yr/m^2].
546
- f_aaux : float Annual fraction of aux system cost [-].
547
- C_aux : float Aux heating system cost [2010 M$].
548
- C_fa : float Annual fuel cost [2010 M$/yr].
532
+ T_life : float Plant lifetime [yr].
533
+ failure_bl : float Blanket failure surcharge fraction [-].
534
+ C_bl : float Blanket cost [2010 M$].
535
+ t_life_bl_yr : float Blanket calendar lifetime [yr].
536
+ failure_tt : float Divertor failure surcharge fraction [-].
537
+ C_tt : float Divertor target cost [2010 M$].
538
+ t_life_div_yr : float Divertor calendar lifetime [yr].
539
+ f_aaux : float Annual fraction of aux system cost [-].
540
+ C_aux : float Aux heating system cost [2010 M$].
541
+ C_fa : float Annual fuel cost [2010 M$/yr].
549
542
 
550
543
  Returns
551
544
  -------
552
545
  C_F : float Annual consumable cost [2010 M$/yr].
553
546
  """
554
- C_ba = f_annual_rep_cost_Sheffield(failure_bl, C_bl, CF,
555
- T_life, Load_bl, T_load_bl)
556
- C_ta = f_annual_rep_cost_Sheffield(failure_tt, C_tt, CF,
557
- T_life, Load_tt, T_load_tt)
547
+ C_ba = f_annual_rep_cost_Sheffield(failure_bl, C_bl, T_life, t_life_bl_yr)
548
+ C_ta = f_annual_rep_cost_Sheffield(failure_tt, C_tt, T_life, t_life_div_yr)
558
549
  C_F = C_ba + C_ta + f_aaux * C_aux + C_fa
559
550
  return C_F
560
551
 
@@ -618,29 +609,27 @@ def f_interest_charge_construction_Sheffield(T_build):
618
609
  f_CAPO = 1.011**(T_build + 0.61)
619
610
  return f_CAPO
620
611
 
621
- def f_annual_rep_cost_Sheffield(failure, C_init, CF, T_life, Load_nom, T_load):
612
+ def f_annual_rep_cost_Sheffield(failure, C_init, T_life, t_comp_yr):
622
613
  """
623
614
  Annual replacement cost of a single component over the plant lifetime.
624
615
  Sheffield (2016) Section III.C.
625
616
 
626
- Number of replacements = CF * T_life * Load_nom / T_load - 1
627
- (subtracting the initial set included in CapEx).
617
+ N_rep = T_life / t_comp_yr (replacements over plant life, including initial).
618
+ Annual cost = (1 + failure) * C_init * max(N_rep - 1, 0) / T_life.
628
619
 
629
620
  Parameters
630
621
  ----------
631
- failure : float Failure surcharge fraction [-].
632
- C_init : float Component initial cost [2010 M$].
633
- CF : float Capacity factor [-].
634
- T_life : float Plant lifetime [yr].
635
- Load_nom : float Nominal flux on component [MW/m^2].
636
- T_load : float Maximum tolerable fluence [MW yr/m^2].
622
+ failure : float Failure surcharge fraction [-].
623
+ C_init : float Component initial cost [2010 M$].
624
+ T_life : float Plant lifetime [yr].
625
+ t_comp_yr : float Component calendar lifetime [yr].
637
626
 
638
627
  Returns
639
628
  -------
640
629
  C_a : float Annualised replacement cost [2010 M$/yr].
641
630
  """
642
- C_others = (CF * T_life * Load_nom / T_load - 1) * C_init / T_life
643
- C_a = (1 + failure) * C_others
631
+ N_rep = T_life / t_comp_yr
632
+ C_a = (1 + failure) * max(N_rep - 1.0, 0.0) * C_init / T_life
644
633
  return C_a
645
634
 
646
635
 
@@ -697,22 +686,23 @@ if __name__ == "__main__":
697
686
  print(f" Ref: Jo et al., Energies 14 (2021) 6817")
698
687
  print(SEP)
699
688
  res_shf = f_costs_Sheffield(
700
- discount_rate = 0.07,
701
- contingency = 0.15,
702
- T_life = 40,
703
- T_build = 8,
704
- P_t = 4150.0,
705
- P_e = 1200.0,
706
- P_aux = 200.0,
707
- Gamma_n = 1.0,
708
- Util_factor = 0.85,
709
- Dwell_factor = 1.0,
710
- dt_rep = 1.5,
711
- V_FI = 5000.0,
712
- V_pc = 800.0,
713
- V_sg = 600.0,
714
- V_bl = 400.0,
715
- S_tt = 50.0,
689
+ discount_rate = 0.07,
690
+ contingency = 0.15,
691
+ T_life = 40,
692
+ T_build = 8,
693
+ P_t = 4150.0,
694
+ P_e = 1200.0,
695
+ P_aux = 200.0,
696
+ Gamma_n = 1.0,
697
+ T_op_limit = 5.0, # representative blanket cycle ~5 yr
698
+ CF = 0.70, # Av * Util * Dwell
699
+ t_life_bl_yr = 5.0, # blanket calendar lifetime [yr]
700
+ t_life_div_yr = 3.0, # divertor calendar lifetime [yr]
701
+ V_FI = 5000.0,
702
+ V_pc = 800.0,
703
+ V_sg = 600.0,
704
+ V_bl = 400.0,
705
+ S_tt = 50.0,
716
706
  Supra_cost_factor = 2.0,
717
707
  )
718
708
  T_op, CF, C_CO, COE = res_shf[0], res_shf[1], res_shf[2], res_shf[3]