Skip to content

denisty_limits

st_denisty_limits(stellarator, f_output)

Routine to reiterate the physics loop

This routine reiterates some physics modules.

Parameters:

Name Type Description Default
stellarator
required
f_output
required
Source code in process/models/stellarator/denisty_limits.py
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
def st_denisty_limits(stellarator, f_output):
    """Routine to reiterate the physics loop

    This routine reiterates some physics modules.

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

    f_output :


    """

    #  Set the required value for icc=5
    physics_variables.nd_plasma_electrons_max = st_sudo_density_limit(
        physics_variables.b_plasma_toroidal_on_axis,
        physics_variables.p_plasma_loss_mw,
        physics_variables.rmajor,
        physics_variables.rminor,
    )

    # Calculates the ECRH parameters

    ne0_max_ECRH, bt_ecrh = st_d_limit_ecrh(
        stellarator_variables.max_gyrotron_frequency,
        physics_variables.b_plasma_toroidal_on_axis,
    )

    ne0_max_ECRH = min(physics_variables.nd_plasma_electron_on_axis, ne0_max_ECRH)
    bt_ecrh = min(physics_variables.b_plasma_toroidal_on_axis, bt_ecrh)

    if f_output:
        output(
            stellarator,
            bt_ecrh,
            ne0_max_ECRH,
        )

st_sudo_density_limit(b_plasma_toroidal_on_axis, powht, rmajor, rminor)

Routine to calculate the Sudo density limit in a stellarator

This routine calculates the density limit for a stellarator. S.Sudo, Y.Takeiri, H.Zushi et al., Scalings of Energy Confinement and Density Limit in Stellarator/Heliotron Devices, Nuclear Fusion vol.30, 11 (1990).

Parameters:

Name Type Description Default
b_plasma_toroidal_on_axis

Toroidal field on axis (T)

required
powht

Absored heating power (MW)

required
rmajor

Plama major radius (m)

required
rminor

Plama minor radius (m)

required

Returns:

Name Type Description
dlimit

Maximum volume-averaged plasma density (/m3)

Source code in process/models/stellarator/denisty_limits.py
 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
def st_sudo_density_limit(b_plasma_toroidal_on_axis, powht, rmajor, rminor):
    """Routine to calculate the Sudo density limit in a stellarator

    This routine calculates the density limit for a stellarator.
    S.Sudo, Y.Takeiri, H.Zushi et al., Scalings of Energy Confinement
    and Density Limit in Stellarator/Heliotron Devices, Nuclear Fusion
    vol.30, 11 (1990).

    Parameters
    ----------
    b_plasma_toroidal_on_axis :
        Toroidal field on axis (T)
    powht :
        Absored heating power (MW)
    rmajor :
        Plama major radius (m)
    rminor :
        Plama minor radius (m)

    Returns
    -------
    dlimit :
        Maximum volume-averaged plasma density (/m3)

    """
    arg = powht * b_plasma_toroidal_on_axis / (rmajor * rminor * rminor)

    if arg <= 0.0e0:
        raise ProcessValueError(
            "Negative square root imminent",
            arg=arg,
            powht=powht,
            bt=b_plasma_toroidal_on_axis,
            rmajor=rmajor,
            rminor=rminor,
        )

    #  Maximum line-averaged electron density

    dnlamx = 0.25e20 * np.sqrt(arg)

    #  Scale the result so that it applies to the volume-averaged
    #  electron density

    nd_plasma_electron_max_array = (
        dnlamx
        * physics_variables.nd_plasma_electrons_vol_avg
        / physics_variables.nd_plasma_electron_line
    )

    physics_variables.nd_plasma_electrons_max = nd_plasma_electron_max_array

    return nd_plasma_electron_max_array

st_d_limit_ecrh(gyro_frequency_max, bt_input)

Routine to calculate the density limit due to an ECRH heating scheme on axis depending on an assumed maximal available gyrotron frequency.

This routine calculates the density limit due to an ECRH heating scheme on axis

Parameters:

Name Type Description Default
gyro_frequency_max

Maximal available Gyrotron frequency (1/s) NOT (rad/s)

required
bt_input

Maximal magnetic field on axis (T)

required

Returns:

Name Type Description
dlimit_ecrh

Maximum peak plasma density by ECRH constraints (/m3)

bt_max

Maximum allowable b field for ecrh heating (T)

Source code in process/models/stellarator/denisty_limits.py
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
def st_d_limit_ecrh(gyro_frequency_max, bt_input):
    """Routine to calculate the density limit due to an ECRH heating scheme on axis
    depending on an assumed maximal available gyrotron frequency.

    This routine calculates the density limit due to an ECRH heating scheme on axis

    Parameters
    ----------
    gyro_frequency_max :
        Maximal available Gyrotron frequency (1/s) NOT (rad/s)
    bt_input :
        Maximal magnetic field on axis (T)

    Returns
    -------
    dlimit_ecrh:
        Maximum peak plasma density by ECRH constraints (/m3)
    bt_max:
        Maximum allowable b field for ecrh heating (T)

    """
    gyro_frequency = min(1.76e11 * bt_input, gyro_frequency_max * 2.0e0 * np.pi)

    # Restrict b field to the maximal available gyrotron frequency
    bt_max = (gyro_frequency_max * 2.0e0 * np.pi) / 1.76e11

    #                      me*e0/e^2       * w^2
    ne0_max = max(0.0e0, 3.142077e-4 * gyro_frequency**2)

    # Check if parabolic profiles are used:
    if physics_variables.i_plasma_pedestal == 0:
        # Parabolic profiles used, use analytical formula:
        dlimit_ecrh = ne0_max
    else:
        logger.error(
            "It was used physics_variables.i_plasma_pedestal = 1 in a stellarator routine."
        )

    return dlimit_ecrh, bt_max

power_at_ignition_point(stellarator, gyro_frequency_max, te0_available)

Routine to calculate if the plasma is ignitable with the current values for the B field. Assumes current ECRH achievable peak temperature (which is inaccurate as the cordey pass should be calculated)

This routine calculates the density limit due to an ECRH heating scheme on axis Assumes current peak temperature (which is inaccurate as the cordey pass should be calculated) Maybe use this: https://doi.org/10.1088/0029-5515/49/8/085026

Parameters:

Name Type Description Default
stellarator

An object containing stellarator configuration and output handle

required
gyro_frequency_max

Maximal available Gyrotron frequency (1/s) NOT (rad/s)

required
te0_available

Reachable peak electron temperature, reached by ECRH (KEV)

required

Returns:

Name Type Description
powerht_out

Heating Power at ignition point (MW)

pscalingmw_out

Heating Power loss at ignition point (MW)

Source code in process/models/stellarator/denisty_limits.py
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
def power_at_ignition_point(stellarator, gyro_frequency_max, te0_available):
    """Routine to calculate if the plasma is ignitable with the current values for the B field. Assumes
    current ECRH achievable peak temperature (which is inaccurate as the cordey pass should be calculated)

    This routine calculates the density limit due to an ECRH heating scheme on axis
    Assumes current peak temperature (which is inaccurate as the cordey pass should be calculated)
    Maybe use this: https://doi.org/10.1088/0029-5515/49/8/085026

    Parameters
    ----------
    stellarator :
        An object containing stellarator configuration and output handle
    gyro_frequency_max :
        Maximal available Gyrotron frequency (1/s) NOT (rad/s)

    te0_available :
        Reachable peak electron temperature, reached by ECRH (KEV)

    Returns
    -------
    powerht_out:
        Heating Power at ignition point (MW)
    pscalingmw_out:
        Heating Power loss at ignition point (MW)

    """
    te_old = copy(physics_variables.temp_plasma_electron_vol_avg_kev)
    # Volume averaged physics_variables.te from te0_achievable
    physics_variables.temp_plasma_electron_vol_avg_kev = te0_available / (
        1.0e0 + physics_variables.alphat
    )
    ne0_max, bt_ecrh_max = st_d_limit_ecrh(
        gyro_frequency_max, physics_variables.b_plasma_toroidal_on_axis
    )
    # Now go to point where ECRH is still available
    # In density..
    dene_old = copy(physics_variables.nd_plasma_electrons_vol_avg)
    physics_variables.nd_plasma_electrons_vol_avg = min(
        dene_old, ne0_max / (1.0e0 + physics_variables.alphan)
    )

    # And B-field..
    bt_old = copy(physics_variables.b_plasma_toroidal_on_axis)
    physics_variables.b_plasma_toroidal_on_axis = min(
        bt_ecrh_max, physics_variables.b_plasma_toroidal_on_axis
    )

    stellarator.st_phys(False)
    stellarator.st_phys(
        False
    )  # The second call seems to be necessary for all values to "converge" (and is sufficient)

    powerht_out = max(
        copy(physics_variables.p_plasma_loss_mw), 0.00001e0
    )  # the radiation module sometimes returns negative heating power
    pscalingmw_out = copy(physics_variables.pscalingmw)

    # Reverse it and do it again because anything more efficiently isn't suitable with the current implementation
    # This is bad practice but seems to be necessary as of now:
    physics_variables.temp_plasma_electron_vol_avg_kev = te_old
    physics_variables.nd_plasma_electrons_vol_avg = dene_old
    physics_variables.b_plasma_toroidal_on_axis = bt_old

    # The second call seems to be necessary for all values to "converge" (and is sufficient)
    stellarator.st_phys(False)
    stellarator.st_phys(False)

    return powerht_out, pscalingmw_out

output(stellarator, bt_ecrh, ne0_max_ECRH)

Source code in process/models/stellarator/denisty_limits.py
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
def output(stellarator, bt_ecrh, ne0_max_ECRH):
    po.oheadr(stellarator.outfile, "ECRH Ignition at lower values. Information:")

    po.ovarre(
        stellarator.outfile,
        "Maximal available gyrotron freq (input)",
        "(max_gyro_frequency)",
        stellarator_variables.max_gyrotron_frequency,
    )

    po.ovarre(
        stellarator.outfile,
        "Operating point: bfield",
        "(b_plasma_toroidal_on_axis)",
        physics_variables.b_plasma_toroidal_on_axis,
    )

    po.ovarre(
        stellarator.outfile,
        "Operating point: Peak density",
        "(nd_plasma_electron_on_axis)",
        physics_variables.nd_plasma_electron_on_axis,
    )
    po.ovarre(
        stellarator.outfile,
        "Operating point: Peak temperature",
        "(temp_plasma_electron_on_axis_kev)",
        physics_variables.temp_plasma_electron_on_axis_kev,
    )

    po.ovarre(stellarator.outfile, "Ignition point: bfield (T)", "(bt_ecrh)", bt_ecrh)
    po.ovarre(
        stellarator.outfile,
        "Ignition point: density (/m3)",
        "(ne0_max_ECRH)",
        ne0_max_ECRH,
    )
    po.ovarre(
        stellarator.outfile,
        "Maximum reachable ECRH temperature (pseudo) (KEV)",
        "(te0_ecrh_achievable)",
        stellarator_variables.te0_ecrh_achievable,
    )

    powerht_local, pscalingmw_local = power_at_ignition_point(
        stellarator,
        stellarator_variables.max_gyrotron_frequency,
        stellarator_variables.te0_ecrh_achievable,
    )
    po.ovarre(
        stellarator.outfile,
        "Ignition point: Heating Power (MW)",
        "(powerht_ecrh)",
        powerht_local,
    )
    po.ovarre(
        stellarator.outfile,
        "Ignition point: Loss Power (MW)",
        "(pscalingmw_ecrh)",
        pscalingmw_local,
    )

    if powerht_local >= pscalingmw_local:
        po.ovarin(
            stellarator.outfile, "Operation point ECRH ignitable?", "(ecrh_bool)", 1
        )
    else:
        po.ovarin(
            stellarator.outfile, "Operation point ECRH ignitable?", "(ecrh_bool)", 0
        )