Skip to content

heating

st_heat(stellarator, f_output)

Routine to calculate the auxiliary heating power in a stellarator

This routine calculates the auxiliary heating power for a stellarator device.

Parameters:

Name Type Description Default
stellarator
required
f_output bool
required
Source code in process/models/stellarator/heating.py
 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 st_heat(stellarator, f_output: bool):
    """Routine to calculate the auxiliary heating power
    in a stellarator

    This routine calculates the auxiliary heating power for
    a stellarator device.

    Parameters
    ----------
    stellarator :

    f_output:


    """
    f_p_beam_injected_ions = None
    if stellarator_variables.isthtr == 1:
        current_drive_variables.p_hcd_ecrh_injected_total_mw = (
            current_drive_variables.p_hcd_primary_extra_heat_mw
        )
        current_drive_variables.p_hcd_injected_ions_mw = 0
        current_drive_variables.p_hcd_injected_electrons_mw = (
            current_drive_variables.p_hcd_ecrh_injected_total_mw
        )
        current_drive_variables.eta_hcd_primary_injector_wall_plug = (
            current_drive_variables.eta_ecrh_injector_wall_plug
        )
        current_drive_variables.p_hcd_electric_total_mw = (
            current_drive_variables.p_hcd_injected_ions_mw
            + current_drive_variables.p_hcd_injected_electrons_mw
        ) / current_drive_variables.eta_hcd_primary_injector_wall_plug

    elif stellarator_variables.isthtr == 2:
        current_drive_variables.p_hcd_lowhyb_injected_total_mw = (
            current_drive_variables.p_hcd_primary_extra_heat_mw
        )
        current_drive_variables.p_hcd_injected_ions_mw = 0
        current_drive_variables.p_hcd_injected_electrons_mw = (
            current_drive_variables.p_hcd_lowhyb_injected_total_mw
        )
        current_drive_variables.eta_hcd_primary_injector_wall_plug = (
            current_drive_variables.eta_lowhyb_injector_wall_plug
        )
        heat_transport_variables.p_hcd_electric_total_mw = (
            current_drive_variables.p_hcd_injected_ions_mw
            + current_drive_variables.p_hcd_injected_electrons_mw
        ) / current_drive_variables.eta_hcd_primary_injector_wall_plug

    elif stellarator_variables.isthtr == 3:
        (
            _effnbss,
            f_p_beam_injected_ions,
            current_drive_variables.f_p_beam_shine_through,
        ) = stellarator.current_drive.culnbi()
        current_drive_variables.p_hcd_beam_injected_total_mw = (
            current_drive_variables.p_hcd_primary_extra_heat_mw
            * (1 - current_drive_variables.f_p_beam_orbit_loss)
        )
        current_drive_variables.p_beam_orbit_loss_mw = (
            current_drive_variables.p_hcd_primary_extra_heat_mw
            * current_drive_variables.f_p_beam_orbit_loss
        )
        current_drive_variables.p_hcd_injected_ions_mw = (
            current_drive_variables.p_hcd_beam_injected_total_mw * f_p_beam_injected_ions
        )
        current_drive_variables.p_hcd_injected_electrons_mw = (
            current_drive_variables.p_hcd_beam_injected_total_mw
            * (1 - f_p_beam_injected_ions)
        )
        current_drive_variables.eta_hcd_primary_injector_wall_plug = (
            current_drive_variables.eta_beam_injector_wall_plug
        )
        current_drive_variables.p_hcd_electric_total_mw = (
            current_drive_variables.p_hcd_injected_ions_mw
            + current_drive_variables.p_hcd_injected_electrons_mw
        ) / current_drive_variables.eta_hcd_primary_injector_wall_plug
    else:
        logger.error(f"isthtr {stellarator_variables.isthtr}")
        logger.error(f"isthtr type {type(stellarator_variables.isthtr)}")
        raise ProcessValueError(
            "Illegal value for isthtr", isthtr=stellarator_variables.isthtr
        )

    #  Total injected power

    current_drive_variables.p_hcd_injected_total_mw = (
        current_drive_variables.p_hcd_injected_electrons_mw
        + current_drive_variables.p_hcd_injected_ions_mw
    )

    #  Calculate neutral beam current

    if abs(current_drive_variables.p_hcd_beam_injected_total_mw) > 1e-8:
        current_drive_variables.c_beam_total = (
            1e-3
            * (current_drive_variables.p_hcd_beam_injected_total_mw * 1e6)
            / current_drive_variables.e_beam_kev
        )
    else:
        current_drive_variables.c_beam_total = 0

    #  Ratio of fusion to input (injection+ohmic) power

    if (
        abs(
            current_drive_variables.p_hcd_injected_total_mw
            + current_drive_variables.p_beam_orbit_loss_mw
            + physics_variables.p_plasma_ohmic_mw
        )
        < 1e-6
    ):
        current_drive_variables.big_q_plasma = 1e18
    else:
        current_drive_variables.big_q_plasma = physics_variables.p_fusion_total_mw / (
            current_drive_variables.p_hcd_injected_total_mw
            + current_drive_variables.p_beam_orbit_loss_mw
            + physics_variables.p_plasma_ohmic_mw
        )

    if f_output:
        output(stellarator, f_p_beam_injected_ions)

output(stellarator, f_p_beam_injected_ions=None)

Source code in process/models/stellarator/heating.py
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
def output(stellarator, f_p_beam_injected_ions=None):
    po.oheadr(stellarator.outfile, "Auxiliary Heating System")

    if stellarator_variables.isthtr == 1:
        po.ocmmnt(stellarator.outfile, "Electron Cyclotron Resonance Heating")
    elif stellarator_variables.isthtr == 2:
        po.ocmmnt(stellarator.outfile, "Lower Hybrid Heating")
    elif stellarator_variables.isthtr == 3:
        po.ocmmnt(stellarator.outfile, "Neutral Beam Injection Heating")

    if physics_variables.i_plasma_ignited == 1:
        po.ocmmnt(
            stellarator.outfile,
            "Ignited plasma; injected power only used for start-up phase",
        )

    po.oblnkl(stellarator.outfile)

    po.ovarre(
        stellarator.outfile,
        "Auxiliary power supplied to plasma (MW)",
        "(p_hcd_primary_extra_heat_mw)",
        current_drive_variables.p_hcd_primary_extra_heat_mw,
    )
    po.ovarre(
        stellarator.outfile,
        "Fusion gain factor Q",
        "(big_q_plasma)",
        current_drive_variables.big_q_plasma,
    )

    if abs(current_drive_variables.p_hcd_beam_injected_total_mw) > 1e-8:
        po.ovarre(
            stellarator.outfile,
            "Neutral beam energy (KEV)",
            "(enbeam)",
            current_drive_variables.enbeam,
        )
        po.ovarre(
            stellarator.outfile,
            "Neutral beam current (A)",
            "(c_beam_total)",
            current_drive_variables.c_beam_total,
        )
        po.ovarre(
            stellarator.outfile,
            "Fraction of beam energy to ions",
            "(f_p_beam_injected_ions)",
            f_p_beam_injected_ions,
        )
        po.ovarre(
            stellarator.outfile,
            "Neutral beam shine-through fraction",
            "(f_p_beam_shine_through)",
            current_drive_variables.f_p_beam_shine_through,
        )
        po.ovarre(
            stellarator.outfile,
            "Neutral beam orbit loss power (MW)",
            "(p_beam_orbit_loss_mw)",
            current_drive_variables.p_beam_orbit_loss_mw,
        )
        po.ovarre(
            stellarator.outfile,
            "Beam duct shielding thickness (m)",
            "(dx_beam_shield)",
            current_drive_variables.dx_beam_shield,
        )
        po.ovarre(
            stellarator.outfile,
            "R injection tangent / R-major",
            "(f_radius_beam_tangency_rmajor)",
            current_drive_variables.f_radius_beam_tangency_rmajor,
        )
        po.ovarre(
            stellarator.outfile,
            "Beam centreline tangency radius (m)",
            "(radius_beam_tangency)",
            current_drive_variables.radius_beam_tangency,
        )
        po.ovarre(
            stellarator.outfile,
            "Maximum possible tangency radius (m)",
            "(radius_beam_tangency_max)",
            current_drive_variables.radius_beam_tangency_max,
        )
        po.ovarre(
            stellarator.outfile,
            "Beam decay lengths to centre",
            "(n_beam_decay_lengths_core)",
            current_drive_variables.n_beam_decay_lengths_core,
        )