Write the results to the main output file (OUT.DAT).
Write the program results to a file, in a tidy format.
Parameters:
| Name |
Type |
Description |
Default |
models
|
Models
|
physics and engineering model objects
|
required
|
_outfile
|
int
|
Fortran output unit identifier
|
required
|
Source code in process/core/output.py
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 | def write(models, _outfile):
"""Write the results to the main output file (OUT.DAT).
Write the program results to a file, in a tidy format.
Parameters
----------
models : process.main.Models
physics and engineering model objects
_outfile : int
Fortran output unit identifier
"""
# ensure we are capturing warnings that occur in the 'output' stage as these are warnings
# that occur at our solution point. So we clear existing warnings
logging_model_handler.start_capturing()
logging_model_handler.clear_logs()
# Call stellarator output routine instead if relevant
if data_structure.stellarator_variables.istell != 0:
models.stellarator.output()
return
# Call IFE output routine instead if relevant
if data_structure.ife_variables.ife != 0:
models.ife.output()
return
# Costs model
# Cost switch values
# No. | model
# ---- | ------
# 0 | 1990 costs model
# 1 | 2015 Kovari model
# 2 | Custom model
models.costs.output()
# Availability model
models.availability.output()
# Physics model
models.physics.output()
# Detailed physics, currently only done at final point as values are not used
# by any other functions
models.physics_detailed.output()
# TODO what is this? Not in caller.py?
models.current_drive.output()
# Pulsed reactor model
models.pulse.output()
models.divertor.output()
# Machine Build Model
models.build.output()
# Cryostat build
models.cryostat.output()
# Toroidal field coil copper model
if data_structure.tfcoil_variables.i_tf_sup == TFConductorModel.WATER_COOLED_COPPER:
models.copper_tf_coil.output()
# Toroidal field coil superconductor model
if data_structure.tfcoil_variables.i_tf_sup == TFConductorModel.SUPERCONDUCTING:
models.sctfcoil.output()
# Toroidal field coil aluminium model
if (
data_structure.tfcoil_variables.i_tf_sup
== TFConductorModel.HELIUM_COOLED_ALUMINIUM
):
models.aluminium_tf_coil.output()
# Tight aspect ratio machine model
if (
data_structure.physics_variables.itart == 1
and data_structure.tfcoil_variables.i_tf_sup != TFConductorModel.SUPERCONDUCTING
):
models.tfcoil.output()
# Poloidal field coil model
models.pfcoil.output()
# Structure Model
models.structure.output()
# Blanket model
# Blanket switch values
# No. | model
# ---- | ------
# 1 | CCFE HCPB model
# 2 | KIT HCPB model
# 3 | CCFE HCPB model with Tritium Breeding Ratio calculation
# 4 | KIT HCLL model
# 5 | DCLL model
models.shield.output()
models.vacuum_vessel.output()
# First wall geometry
models.fw.output()
if data_structure.fwbs_variables.i_blanket_type == 1:
# CCFE HCPB model
models.ccfe_hcpb.output()
elif data_structure.fwbs_variables.i_blanket_type == 5:
# DCLL model
models.dcll.output()
# FISPACT and LOCA model (not used)- removed
# Power model
models.power.output()
# Vacuum model
models.vacuum.output()
# Buildings model
models.buildings.output()
# Water usage in secondary cooling system
models.water_use.output()
# stop capturing warnings so that Outfile does not end up with
# a lot of non-model logs
logging_model_handler.stop_capturing()
|