Repository navigation
Expand file tree
/
Copy pathife.py
More file actions
2488 lines (2175 loc) · 85.4 KB
/
Copy pathife.py
File metadata and controls
2488 lines (2175 loc) · 85.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""Module containing Inertial Fusion Energy device routines
This module contains routines for calculating the
parameters of an Inertial Fusion Energy power plant.
"""
import numpy as np
from process.core import constants, process_output
from process.core.exceptions import ProcessValueError
from process.core.model import Model
from process.data_structure.ife_variables import MAXMAT
MATERIALS = [
"void",
"steel",
"carbon",
"FLiBe",
"Li2O",
"concrete",
"helium",
"xenon",
"lithium",
]
class IFE(Model):
"""Module containing Inertial Fusion Energy device routines
N/A
This module contains routines for calculating the
parameters of an Inertial Fusion Energy power plant.
"""
def __init__(self, availability, costs):
"""Initialises the IFE module's variables
Parameters
----------
availability :
A pointer to the availability model, allowing use of availability's
variables/methods
costs :
A pointer to the costs model, allowing the use of costs'
variables/methods
"""
self.outfile: int = constants.NOUT
self.availability = availability
self.costs = costs
def output(self):
"""Outputs IFE information"""
self.run(output=True)
def run(self, output: bool = False):
"""Routine to output the physics and engineering information
relevant to inertial fusion energy power plants
This routine outputs the physics and engineering information
relevant to inertial fusion energy power plants.
F/MI/PJK/LOGBOOK12, p.66
Parameters
----------
output:
indicate whether output should be written to the output file, or not
"""
# Device build
self.ifebld(output=output)
# IFE physics
self.ifephy(output=output)
# Device structure
self.ifestr()
# Target data
self.ifetgt()
# First wall, blanket and shield
self.ifefbs(output=output)
# Primary thermal power
self.ifepw1()
# Vacuum system
self.ifevac()
# Buildings
self.ifebdg(output=output)
# AC power requirements
self.ifeacp(output=output)
# Secondary thermal power
self.ifepw2(output=output)
# Plant availability
# TODO: should availability.run be called
# rather than availability.avail?
self.availability.avail(output=output)
# Costs
self.costs.run()
if output:
self.costs.output()
def ifebld(self, output: bool = False):
"""Routine to create the build of an inertial fusion energy device
and to calculate the material volumes for the device core
This routine constructs the build of an inertial fusion energy device
and calculates the material volumes for the device core.
Parameters
----------
output:
boolean to control writing of output to outfile/mfile
"""
match self.data.ife.ifetyp:
case 1:
self.osibld()
case 2:
self.sombld()
case 3:
self.hylbld()
case 4:
self.bld2019()
case _:
self.genbld()
if not output:
return
radial_build_data = [
["Device centreline", None, 0.0, 0.0],
["Chamber", "chrad", self.data.ife.chrad, self.data.ife.r1],
["First Wall", "fwdr", self.data.ife.fwdr, self.data.ife.r2],
["Void 1", "v1dr", self.data.ife.v1dr, self.data.ife.r3],
["Blanket", "bldr", self.data.ife.bldr, self.data.ife.r4],
["Void 2", "v2dr", self.data.ife.v2dr, self.data.ife.r5],
["Shield", "shdr", self.data.ife.shdr, self.data.ife.r6],
["Void 3", "v3dr", self.data.ife.v3dr, self.data.ife.r7],
]
process_output.oheadr(self.outfile, "Radial build")
process_output.write(
self.outfile, "\t" * 20 + "Thickness (m)" + "\t" * 2 + "Height (m)"
)
for title, _name, thickness, radius in radial_build_data:
process_output.obuild(self.outfile, title, thickness, radius)
for title, name, thickness, _radius in radial_build_data:
if name is None:
continue
process_output.ovarre(self.outfile, f"{title} (m)", f"({name})", thickness)
vertical_build_data = [
["Base of device", None, 0.0, -self.data.ife.zl7],
["Void 3 lower", "v3dzl", self.data.ife.v3dzl, -self.data.ife.zl6],
["Shield lower", "shdzl", self.data.ife.shdzl, -self.data.ife.zl5],
["Void 2 lower", "v2dzl", self.data.ife.v2dzl, -self.data.ife.zl4],
["Blanket lower", "bldzl", self.data.ife.bldzl, -self.data.ife.zl3],
["Void 1 lower", "v1dzl", self.data.ife.v1dzl, -self.data.ife.zl2],
["First wall lower", "fwdzl", self.data.ife.fwdzl, -self.data.ife.zl1],
["Chamber lower", "chdzl", self.data.ife.chdzl, 0.0],
["Chamber upper", "chdzu", self.data.ife.chdzu, self.data.ife.zu1],
["First wall upper", "fwdzu", self.data.ife.fwdzu, self.data.ife.zu2],
["Void 1 upper", "v1dzu", self.data.ife.v1dzu, self.data.ife.zu3],
["Blanket upper", "bldzu", self.data.ife.bldzu, self.data.ife.zu4],
["Void 2 upper", "v2dzu", self.data.ife.v2dzu, self.data.ife.zu5],
["Shield upper", "shdzu", self.data.ife.shdzu, self.data.ife.zu6],
["Void 3 upper", "v3dzu", self.data.ife.v3dzu, self.data.ife.zu7],
]
if self.data.ife.ifetyp == 4:
process_output.oheadr(self.outfile, "Vertical build - Midplane")
process_output.write(
self.outfile, "\t" * 20 + "Thickness (m)" + "\t" * 3 + "Radius (m)"
)
for title, _name, thickness, radius in vertical_build_data[:11]:
process_output.obuild(self.outfile, title, thickness, radius)
process_output.obuild(
self.outfile,
"Blanket upper",
self.data.ife.bldzu - self.data.ife.bldzu,
self.data.ife.zu4 - self.data.ife.bldzu,
)
process_output.obuild(
self.outfile,
"Void 2 upper",
self.data.ife.v2dzu,
self.data.ife.zu5 - self.data.ife.bldzu,
)
process_output.obuild(
self.outfile,
"Shield upper",
self.data.ife.shdzu,
self.data.ife.zu6 - self.data.ife.bldzu,
)
process_output.obuild(
self.outfile,
"Void 3 upper",
self.data.ife.v3dzu + self.data.ife.bldzu,
self.data.ife.zu7,
)
process_output.oheadr(self.outfile, "Vertical build - Edge")
process_output.write(
self.outfile, "\t" * 20 + "Thickness (m)" + "\t" * 3 + "Height (m)"
)
for title, _name, thickness, radius in vertical_build_data:
process_output.obuild(self.outfile, title, thickness, radius)
else:
process_output.oheadr(self.outfile, "Vertical build")
process_output.write(
self.outfile, "\t" * 20 + "Thickness (m)" + "\t" * 3 + "Height (m)"
)
for title, _name, thickness, radius in vertical_build_data:
process_output.obuild(self.outfile, title, thickness, radius)
for title, name, thickness, _radius in vertical_build_data:
if name is None:
continue
process_output.ovarre(
self.outfile, f"{title} (m)", f"({name})", thickness
)
process_output.write(
self.outfile,
"\t" * 6
+ "Chamber".ljust(10)
+ "1st wall".ljust(10)
+ "Void 1".ljust(10)
+ "Blanket".ljust(10)
+ "Void 2".ljust(10)
+ "Shield".ljust(10)
+ "Void 3".ljust(10),
)
material_row_gen = _material_string_generator(
self.data.ife.chmatv,
self.data.ife.fwmatv,
self.data.ife.v1matv,
self.data.ife.blmatv,
self.data.ife.v2matv,
self.data.ife.shmatv,
self.data.ife.v3matv,
)
for i in range(len(MATERIALS)):
process_output.write(self.outfile, material_row_gen(i))
def osibld(self):
"""Routine to create the build of an inertial fusion energy
device, based on the design of the OSIRIS study,
and to calculate the material volumes for the device core
This routine constructs the build of an inertial fusion energy
device, based on the design of the OSIRIS study, and to calculate
the material volumes for the device core.
"""
# Careful choice of thicknesses, and assuming that the FLiBe
# inlet radius is small, allows the generic build calculation
# to be roughly applicable.
self.genbld()
# First wall area: no true first wall at bottom of chamber
self.data.first_wall.a_fw_total = (
2.0 * np.pi * self.data.ife.r1 * (self.data.ife.zu1 + self.data.ife.zl1)
+ np.pi * self.data.ife.r1 * self.data.ife.r1
)
def sombld(self):
"""Routine to create the build of an inertial fusion energy
device, based on the design of the SOMBRERO study,
and to calculate the material volumes for the device core
This routine constructs the build of an inertial fusion energy
device, based on the design of the SOMBRERO study, and to calculate
the material volumes for the device core.
Sviatoslavsky et al, Fusion Technology vol.21 (1992) 1470
"""
# Radial build
self.data.ife.r1 = self.data.ife.chrad
self.data.ife.r2 = self.data.ife.r1 + self.data.ife.fwdr
self.data.ife.r3 = self.data.ife.r2 + self.data.ife.v1dr
self.data.ife.r4 = self.data.ife.r3 + self.data.ife.bldr
self.data.ife.r5 = self.data.ife.r4 + self.data.ife.v2dr
self.data.ife.r6 = self.data.ife.r5 + self.data.ife.shdr
self.data.ife.r7 = self.data.ife.r6 + self.data.ife.v3dr
# Vertical build (below midplane)
self.data.ife.zl1 = self.data.ife.chdzl
self.data.ife.zl2 = self.data.ife.zl1 + self.data.ife.fwdzl
self.data.ife.zl3 = self.data.ife.zl2 + self.data.ife.v1dzl
self.data.ife.zl4 = self.data.ife.zl3 + self.data.ife.bldzl
self.data.ife.zl5 = self.data.ife.zl4 + self.data.ife.v2dzl
self.data.ife.zl6 = self.data.ife.zl5 + self.data.ife.shdzl
self.data.ife.zl7 = self.data.ife.zl6 + self.data.ife.v3dzl
# Vertical build (above midplane)
self.data.ife.zu1 = self.data.ife.chdzu
self.data.ife.zu2 = self.data.ife.zu1 + self.data.ife.fwdzu
self.data.ife.zu3 = self.data.ife.zu2 + self.data.ife.v1dzu
self.data.ife.zu4 = self.data.ife.zu3 + self.data.ife.bldzu
self.data.ife.zu5 = self.data.ife.zu4 + self.data.ife.v2dzu
self.data.ife.zu6 = self.data.ife.zu5 + self.data.ife.shdzu
self.data.ife.zu7 = self.data.ife.zu6 + self.data.ife.v3dzu
# The SOMBRERO chamber is made up of a cylindrical first wall/
# blanket, with conical regions above and below. Outside this is
# a cylindrical shield.
# Component volumes
# The following notation applies below:
# J=1 : side part
# J=2 : top part
# J=3 : bottom part
# Chamber : CHCYLH is the height of the cylindrical part
chcylh = self.data.ife.chdzu + self.data.ife.chdzl - 2.0 * self.data.ife.chrad
self.data.ife.chvol = (
np.pi
* self.data.ife.r1
* self.data.ife.r1
* (chcylh + (2.0 / 3.0) * self.data.ife.chrad)
)
# First wall
self.data.ife.fwvol[0] = (
np.pi
* (self.data.ife.r2 * self.data.ife.r2 - self.data.ife.r1 * self.data.ife.r1)
* chcylh
)
self.data.ife.fwvol[1] = (
(1.0 / 3.0)
* np.pi
* (
self.data.ife.r2
* self.data.ife.r2
* (self.data.ife.chrad + self.data.ife.fwdzu)
- self.data.ife.r1 * self.data.ife.r1 * self.data.ife.chrad
)
)
self.data.ife.fwvol[2] = (
(1.0 / 3.0)
* np.pi
* (
self.data.ife.r2
* self.data.ife.r2
* (self.data.ife.chrad + self.data.ife.fwdzl)
- self.data.ife.r1 * self.data.ife.r1 * self.data.ife.chrad
)
)
# First void
self.data.ife.v1vol[0] = (
np.pi
* (self.data.ife.r3 * self.data.ife.r3 - self.data.ife.r2 * self.data.ife.r2)
* chcylh
)
self.data.ife.v1vol[1] = (
(1.0 / 3.0)
* np.pi
* (
self.data.ife.r3
* self.data.ife.r3
* (self.data.ife.chrad + self.data.ife.fwdzu + self.data.ife.v1dzu)
- self.data.ife.r2
* self.data.ife.r2
* (self.data.ife.chrad + self.data.ife.fwdzu)
)
)
self.data.ife.v1vol[2] = (
(1.0 / 3.0)
* np.pi
* (
self.data.ife.r3
* self.data.ife.r3
* (self.data.ife.chrad + self.data.ife.fwdzl + self.data.ife.v1dzl)
- self.data.ife.r2
* self.data.ife.r2
* (self.data.ife.chrad + self.data.ife.fwdzl)
)
)
# Blanket: SOMTDR and SOMBDR are the radii of the cylindrical
# sections at the top/bottom of the blanket
# DDZ = Height of top cylindrical section (by similar triangles)
# DVOL = Volume of top cylindrical section, less the internal cone
self.data.ife.blvol[0] = (
np.pi
* (self.data.ife.r4 * self.data.ife.r4 - self.data.ife.r3 * self.data.ife.r3)
* chcylh
)
self.data.ife.blvol[1] = (
(1.0 / 3.0)
* np.pi
* (
self.data.ife.r4
* self.data.ife.r4
* (
self.data.ife.chrad
+ self.data.ife.fwdzu
+ self.data.ife.v1dzu
+ self.data.ife.bldzu
)
- self.data.ife.r3
* self.data.ife.r3
* (self.data.ife.chrad + self.data.ife.fwdzu + self.data.ife.v1dzu)
)
)
ddz = (
(
self.data.ife.chrad
+ self.data.ife.fwdzu
+ self.data.ife.v1dzu
+ self.data.ife.bldzu
)
/ (
self.data.ife.chrad
+ self.data.ife.fwdr
+ self.data.ife.v1dr
+ self.data.ife.bldr
)
* self.data.ife.somtdr
)
dvol = (
2.0 * (1.0 / 3.0) * np.pi * self.data.ife.somtdr * self.data.ife.somtdr * ddz
)
self.data.ife.blvol[1] += dvol
# Ditto for bottom region...
self.data.ife.blvol[2] = (
(1.0 / 3.0)
* np.pi
* (
self.data.ife.r4
* self.data.ife.r4
* (
self.data.ife.chrad
+ self.data.ife.fwdzl
+ self.data.ife.v1dzl
+ self.data.ife.bldzl
)
- self.data.ife.r3
* self.data.ife.r3
* (self.data.ife.chrad + self.data.ife.fwdzl + self.data.ife.v1dzl)
)
)
ddz = (
(
self.data.ife.chrad
+ self.data.ife.fwdzl
+ self.data.ife.v1dzl
+ self.data.ife.bldzl
)
/ (
self.data.ife.chrad
+ self.data.ife.fwdr
+ self.data.ife.v1dr
+ self.data.ife.bldr
)
* self.data.ife.sombdr
)
dvol = (
2.0 * (1.0 / 3.0) * np.pi * self.data.ife.sombdr * self.data.ife.sombdr * ddz
)
self.data.ife.blvol[2] += dvol
# Second void
self.data.ife.v2vol[0] = (
np.pi
* (self.data.ife.r5 * self.data.ife.r5 - self.data.ife.r4 * self.data.ife.r4)
* chcylh
)
self.data.ife.v2vol[1] = np.pi * self.data.ife.r5 * self.data.ife.r5 * (
self.data.ife.zu5 - self.data.ife.chdzu + self.data.ife.chrad
) - (
self.data.ife.fwvol[1]
+ self.data.ife.v1vol[1]
+ self.data.ife.blvol[1]
+ (
(1.0 / 3.0)
* np.pi
* self.data.ife.r1
* self.data.ife.r1
* self.data.ife.chrad
)
)
self.data.ife.v2vol[2] = np.pi * self.data.ife.r5 * self.data.ife.r5 * (
self.data.ife.zl5 - self.data.ife.chdzl + self.data.ife.chrad
) - (
self.data.ife.fwvol[2]
+ self.data.ife.v1vol[2]
+ self.data.ife.blvol[2]
+ (
(1.0 / 3.0)
* np.pi
* self.data.ife.r1
* self.data.ife.r1
* self.data.ife.chrad
)
)
# Shield
self.data.ife.shvol[0] = (
np.pi
* (self.data.ife.r6 * self.data.ife.r6 - self.data.ife.r5 * self.data.ife.r5)
* (self.data.ife.zu6 + self.data.ife.zl6)
)
self.data.ife.shvol[1] = (
np.pi
* self.data.ife.r5
* self.data.ife.r5
* (self.data.ife.zu6 - self.data.ife.zu5)
)
self.data.ife.shvol[2] = (
np.pi
* self.data.ife.r5
* self.data.ife.r5
* (self.data.ife.zl6 - self.data.ife.zl5)
)
# Third void
self.data.ife.v3vol[0] = (
np.pi
* (self.data.ife.r7 * self.data.ife.r7 - self.data.ife.r6 * self.data.ife.r6)
* (self.data.ife.zu7 + self.data.ife.zl7)
)
self.data.ife.v3vol[1] = (
np.pi
* self.data.ife.r6
* self.data.ife.r6
* (self.data.ife.zu7 - self.data.ife.zu6)
)
self.data.ife.v3vol[2] = (
np.pi
* self.data.ife.r6
* self.data.ife.r6
* (self.data.ife.zl7 - self.data.ife.zl6)
)
# Material volumes
for i in range(MAXMAT):
self.data.ife.chmatv[i] = max(
0.0, self.data.ife.chvol * self.data.ife.chmatf[i]
)
for j in range(3):
self.data.ife.fwmatv[j, i] = max(
0.0, self.data.ife.fwvol[j] * self.data.ife.fwmatf[j, i]
)
self.data.ife.v1matv[j, i] = max(
0.0, self.data.ife.v1vol[j] * self.data.ife.v1matf[j, i]
)
self.data.ife.blmatv[j, i] = max(
0.0, self.data.ife.blvol[j] * self.data.ife.blmatf[j, i]
)
self.data.ife.v2matv[j, i] = max(
0.0, self.data.ife.v2vol[j] * self.data.ife.v2matf[j, i]
)
self.data.ife.shmatv[j, i] = max(
0.0, self.data.ife.shvol[j] * self.data.ife.shmatf[j, i]
)
self.data.ife.v3matv[j, i] = max(
0.0, self.data.ife.v3vol[j] * self.data.ife.v3matf[j, i]
)
# First wall area
self.data.first_wall.a_fw_total = (
2.0
* np.pi
* self.data.ife.r1
* ((self.data.ife.zu1 + self.data.ife.zl1) + self.data.ife.r1 * np.sqrt(2.0))
)
def hylbld(self):
"""Routine to create the build of an inertial fusion energy
device, based on the design of the HYLIFE-II study,
and to calculate the material volumes for the device core
"""
# Radial build
self.data.ife.r1 = self.data.ife.chrad
self.data.ife.r2 = self.data.ife.r1 + self.data.ife.fwdr
self.data.ife.r3 = self.data.ife.r2 + self.data.ife.v1dr
self.data.ife.r4 = self.data.ife.r3 + self.data.ife.bldr
self.data.ife.r5 = self.data.ife.r4 + self.data.ife.v2dr
self.data.ife.r6 = self.data.ife.r5 + self.data.ife.shdr
self.data.ife.r7 = self.data.ife.r6 + self.data.ife.v3dr
# Vertical build (below midplane)
self.data.ife.zl1 = self.data.ife.chdzl
self.data.ife.zl2 = self.data.ife.zl1 + self.data.ife.fwdzl
self.data.ife.zl3 = self.data.ife.zl2 + self.data.ife.v1dzl
self.data.ife.zl4 = self.data.ife.zl3 + self.data.ife.bldzl
self.data.ife.zl5 = self.data.ife.zl4 + self.data.ife.v2dzl
self.data.ife.zl6 = self.data.ife.zl5 + self.data.ife.shdzl
self.data.ife.zl7 = self.data.ife.zl6 + self.data.ife.v3dzl
# Vertical build (above midplane)
self.data.ife.zu1 = self.data.ife.chdzu
self.data.ife.zu2 = self.data.ife.zu1 + self.data.ife.fwdzu
self.data.ife.zu3 = self.data.ife.zu2 + self.data.ife.v1dzu
self.data.ife.zu4 = self.data.ife.zu3 + self.data.ife.bldzu
self.data.ife.zu5 = self.data.ife.zu4 + self.data.ife.v2dzu
self.data.ife.zu6 = self.data.ife.zu5 + self.data.ife.shdzu
self.data.ife.zu7 = self.data.ife.zu6 + self.data.ife.v3dzu
# The HYLIFE-II chamber is assumed to be mostly cylindrical, but
# with a conical region below the midplane that causes the Flibe
# to flow downwards and outwards towards the outlet.
# Component volumes
# The following notation applies below:
# J=1 : side part
# J=2 : top part
# J=3 : bottom part
self.data.ife.chvol = (
np.pi
* self.data.ife.r1
* self.data.ife.r1
* (
(self.data.ife.zu1 + self.data.ife.zl5)
- (1 / 3) * (self.data.ife.zl5 - self.data.ife.zl1)
)
)
# First wall
# FLIRAD is the radius of the Flibe inlet
self.data.ife.fwvol[0] = (
np.pi
* (self.data.ife.r2 * self.data.ife.r2 - self.data.ife.r1 * self.data.ife.r1)
* (self.data.ife.zu2 + self.data.ife.zl5)
)
self.data.ife.fwvol[1] = (
np.pi
* (
self.data.ife.r1 * self.data.ife.r1
- self.data.ife.flirad * self.data.ife.flirad
)
* (self.data.ife.zu2 - self.data.ife.zu1)
)
self.data.ife.fwvol[2] = (
(1 / 3)
* np.pi
* (
self.data.ife.r2
* self.data.ife.r2
* (self.data.ife.zl5 - self.data.ife.zl1)
- self.data.ife.r1
* self.data.ife.r1
* (self.data.ife.zl5 - self.data.ife.zl2)
)
)
# First void
self.data.ife.v1vol[0] = (
np.pi
* (self.data.ife.r3 * self.data.ife.r3 - self.data.ife.r2 * self.data.ife.r2)
* (self.data.ife.zu2 + self.data.ife.zl3)
)
self.data.ife.v1vol[1] = (
np.pi
* (
self.data.ife.r4 * self.data.ife.r4
- self.data.ife.flirad * self.data.ife.flirad
)
* (self.data.ife.zu3 - self.data.ife.zu2)
)
self.data.ife.v1vol[2] = (
(1 / 3)
* np.pi
* self.data.ife.r1
* self.data.ife.r1
* (self.data.ife.zl3 - self.data.ife.zl2)
)
# Blanket
self.data.ife.blvol[0] = (
np.pi
* (self.data.ife.r4 * self.data.ife.r4 - self.data.ife.r3 * self.data.ife.r3)
* (self.data.ife.zu2 + self.data.ife.zl3)
)
self.data.ife.blvol[1] = (
np.pi
* (
self.data.ife.r4 * self.data.ife.r4
- self.data.ife.flirad * self.data.ife.flirad
)
* (self.data.ife.zu4 - self.data.ife.zu3)
)
self.data.ife.blvol[2] = (
np.pi
* self.data.ife.r4
* self.data.ife.r4
* (self.data.ife.zl4 - self.data.ife.zl3)
)
# Second void
self.data.ife.v2vol[0] = (
np.pi
* (self.data.ife.r5 * self.data.ife.r5 - self.data.ife.r4 * self.data.ife.r4)
* (self.data.ife.zu4 + self.data.ife.zl4)
)
self.data.ife.v2vol[1] = (
np.pi
* (
self.data.ife.r5 * self.data.ife.r5
- self.data.ife.flirad * self.data.ife.flirad
)
* (self.data.ife.zu5 - self.data.ife.zu4)
)
self.data.ife.v2vol[2] = (
np.pi
* self.data.ife.r5
* self.data.ife.r5
* (self.data.ife.zl5 - self.data.ife.zl4)
)
# Shield
self.data.ife.shvol[0] = (
np.pi
* (self.data.ife.r6 * self.data.ife.r6 - self.data.ife.r5 * self.data.ife.r5)
* (self.data.ife.zu5 + self.data.ife.zl5)
)
self.data.ife.shvol[1] = (
np.pi
* self.data.ife.r6
* self.data.ife.r6
* (self.data.ife.zu6 - self.data.ife.zu5)
)
self.data.ife.shvol[2] = (
np.pi
* self.data.ife.r6
* self.data.ife.r6
* (self.data.ife.zl6 - self.data.ife.zl5)
)
# Third void
self.data.ife.v3vol[0] = (
np.pi
* (self.data.ife.r7 * self.data.ife.r7 - self.data.ife.r6 * self.data.ife.r6)
* (self.data.ife.zu6 + self.data.ife.zl6)
)
self.data.ife.v3vol[1] = (
np.pi
* self.data.ife.r7
* self.data.ife.r7
* (self.data.ife.zu7 - self.data.ife.zu6)
)
self.data.ife.v3vol[2] = (
np.pi
* self.data.ife.r7
* self.data.ife.r7
* (self.data.ife.zl7 - self.data.ife.zl6)
)
# Material volumes
for i in range(MAXMAT + 1):
self.data.ife.chmatv[i] = max(
0.0, self.data.ife.chvol * self.data.ife.chmatf[i]
)
for j in range(3):
self.data.ife.fwmatv[j, i] = max(
0.0, self.data.ife.fwvol[j] * self.data.ife.fwmatf[j, i]
)
self.data.ife.v1matv[j, i] = max(
0.0, self.data.ife.v1vol[j] * self.data.ife.v1matf[j, i]
)
self.data.ife.blmatv[j, i] = max(
0.0, self.data.ife.blvol[j] * self.data.ife.blmatf[j, i]
)
self.data.ife.v2matv[j, i] = max(
0.0, self.data.ife.v2vol[j] * self.data.ife.v2matf[j, i]
)
self.data.ife.shmatv[j, i] = max(
0.0, self.data.ife.shvol[j] * self.data.ife.shmatf[j, i]
)
self.data.ife.v3matv[j, i] = max(
0.0, self.data.ife.v3vol[j] * self.data.ife.v3matf[j, i]
)
# First wall area
self.data.first_wall.a_fw_total = (
2.0 * np.pi * self.data.ife.r1 * (self.data.ife.zu1 + self.data.ife.zl5)
)
self.data.first_wall.a_fw_total += np.pi * (
self.data.ife.r1 * self.data.ife.r1
- self.data.ife.flirad * self.data.ife.flirad
)
self.data.first_wall.a_fw_total += (
np.pi
* self.data.ife.r1
* np.sqrt(
self.data.ife.r1 * self.data.ife.r1
+ (self.data.ife.zl3 - self.data.ife.zl1) ** 2
)
)
def bld2019(self):
"""Routine to create the build of a 2019 inertial fusion energy
device, and to calculate the material volumes for the device core
This routine constructs the build of a modern inertial fusion energy
device, assumed to be cylindrically-symmetric, with a pool at bottom
and top corners and with a lower shield at the centre. See diagram
attached to Issue #907.
Issue #907
Raises
------
ProcessValueError
If inputs are not appropriate for 2019 IFE build
"""
# Check input
if self.data.ife.fwdr > 0 or self.data.ife.v1dr > 0:
raise ProcessValueError("fwdr and v1dr should be zero for 2019 IFE build")
if self.data.ife.fwdzu > 0 or self.data.ife.v1dzu > 0 or self.data.ife.v2dzu > 0:
raise ProcessValueError(
"fwdzu, v1dzu and v2dzu should be zero for 2019 IFE build"
)
if self.data.ife.fwdzl > 0 or self.data.ife.v1dzl > 0 or self.data.ife.v2dzu > 0:
raise ProcessValueError(
"fwdzl, v1dzl and v2dzl should be zero for 2019 IFE build"
)
# Lithium Pump
# Velocity
vel = np.sqrt(
2.0
* constants.ACCELERATION_GRAVITY
* (self.data.ife.chdzu + self.data.ife.bldzu)
)
# Lithium Fraction
self.data.ife.blmatf[0, 8] = 0.91 * np.sqrt(
self.data.ife.bldzu / (self.data.ife.chdzu + self.data.ife.bldzu)
)
self.data.ife.blmatf[0, 0] = 1.0 - self.data.ife.blmatf[0, 8]
# Spatial Thickness
self.data.ife.bldr = self.data.ife.bldrc / self.data.ife.blmatf[0, 8]
# Area
acurt = np.pi * (
(self.data.ife.chrad + self.data.ife.bldr) ** 2.0 - self.data.ife.chrad**2.0
)
# Mass Flow
mdot = 512.0 * vel * self.data.ife.blmatf[0, 8] * acurt
# Pump Power (MW)
self.data.ife.lipmw = (
1e-6
* mdot
* constants.ACCELERATION_GRAVITY
* (
self.data.ife.chdzl
+ self.data.ife.chdzu
+ self.data.ife.bldzu
+ self.data.ife.bldzl
)
/ self.data.ife.etali
)
# Fall Time
self.data.ife.taufall = (
2.0 * (self.data.ife.chdzl + self.data.ife.chdzu + self.data.ife.bldzu) / vel
)
self.data.ife.rrmax = 1.0 / self.data.ife.taufall
# TBR and Emult model was for spherical lithium
# Remove reactor head
phi = np.arctan(self.data.ife.chrad / self.data.ife.chdzu)
sang = 1.0 - np.cos(phi)
li_frac = 1.0 - 0.5 * sang
# TBR
self.data.fwbs.tbr = (
3.7418
* (1.0 / (1.0 + np.exp(-2.6366 * self.data.ife.bldrc)) - 0.5)
* li_frac
)
# Energy Multiplication
self.data.fwbs.f_p_blkt_multiplication = (
2.2414
* (1.0 / (1.0 + np.exp(-3.0038 * self.data.ife.bldrc)) - 0.5)
* li_frac
)
# Radial build
self.data.ife.r1 = self.data.ife.chrad
self.data.ife.r2 = self.data.ife.r1 + self.data.ife.fwdr
self.data.ife.r3 = self.data.ife.r2 + self.data.ife.v1dr
self.data.ife.r4 = self.data.ife.r3 + self.data.ife.bldr
self.data.ife.r5 = self.data.ife.r4 + self.data.ife.v2dr
self.data.ife.r6 = self.data.ife.r5 + self.data.ife.shdr
self.data.ife.r7 = self.data.ife.r6 + self.data.ife.v3dr
# Vertical build (below midplane)
self.data.ife.zl1 = self.data.ife.chdzl
self.data.ife.zl2 = self.data.ife.zl1 + self.data.ife.fwdzl
self.data.ife.zl3 = self.data.ife.zl2 + self.data.ife.v1dzl
self.data.ife.zl4 = self.data.ife.zl3 + self.data.ife.bldzl
self.data.ife.zl5 = self.data.ife.zl4 + self.data.ife.v2dzl
self.data.ife.zl6 = self.data.ife.zl5 + self.data.ife.shdzl
self.data.ife.zl7 = self.data.ife.zl6 + self.data.ife.v3dzl
# Vertical build (above midplane)
self.data.ife.zu1 = self.data.ife.chdzu
self.data.ife.zu2 = self.data.ife.zu1 + self.data.ife.fwdzu
self.data.ife.zu3 = self.data.ife.zu2 + self.data.ife.v1dzu
self.data.ife.zu4 = self.data.ife.zu3 + self.data.ife.bldzu
self.data.ife.zu5 = self.data.ife.zu4 + self.data.ife.v2dzu
self.data.ife.zu6 = self.data.ife.zu5 + self.data.ife.shdzu
self.data.ife.v3dzu = (
(self.data.ife.zu6 + self.data.ife.zl6)
+ self.data.buildings.trcl
+ self.data.buildings.stcl
+ 5.1
+ 9.41e-6 * 1.0e5
)
self.data.ife.zu7 = self.data.ife.zu6 + self.data.ife.v3dzu
# Component volumes
# The following notation applies below:
# J=1 : side part
# J=2 : top part
# J=3 : bottom part
# Chamber
chvol = (
np.pi
* self.data.ife.r1
* self.data.ife.r1
* (self.data.ife.zu1 + self.data.ife.zl1)
)
# First wall
self.data.ife.fwvol[0] = (
np.pi
* (self.data.ife.r2 * self.data.ife.r2 - self.data.ife.r1 * self.data.ife.r1)
* (self.data.ife.zu1 + self.data.ife.zl1)
)
self.data.ife.fwvol[1] = (
np.pi
* self.data.ife.r2
* self.data.ife.r2
* (self.data.ife.zu2 - self.data.ife.zu1)
)
self.data.ife.fwvol[2] = (
np.pi
* self.data.ife.r2
* self.data.ife.r2
* (self.data.ife.zl2 - self.data.ife.zl1)
)
# First void
self.data.ife.v1vol[0] = (
np.pi
* (self.data.ife.r3 * self.data.ife.r3 - self.data.ife.r2 * self.data.ife.r2)
* (self.data.ife.zu2 + self.data.ife.zl2)
)
self.data.ife.v1vol[1] = (
np.pi
* self.data.ife.r3
* self.data.ife.r3
* (self.data.ife.zu3 - self.data.ife.zu2)
)
self.data.ife.v1vol[2] = (
np.pi
* self.data.ife.r3
* self.data.ife.r3
* (self.data.ife.zl3 - self.data.ife.zl2)
)
# Blanket
# Radial Blanket - between void 2 and chamber
self.data.ife.blvol[0] = (
np.pi
* (self.data.ife.r4 * self.data.ife.r4 - self.data.ife.r3 * self.data.ife.r3)