Skip to content

radiation_power

Module for calculating radiation power densities in tokamak plasmas.

This module provides functions to compute synchrotron and impurity radiation power densities for plasma systems.

RadpwrData dataclass

DataClass which holds the output of the function radpwr

Source code in process/models/physics/radiation_power.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@dataclass
class RadpwrData:
    """DataClass which holds the output of the function radpwr"""

    pden_plasma_sync_vol_avg_mw: float
    "Volume-averaged synchrotron radiation power density [MW/m³]"
    pden_plasma_core_rad_vol_avg_mw: float
    "Volume-averaged core radiation power density [MW/m³]"
    pden_plasma_core_rad_reduced_vol_avg_mw: float
    "Volume-averaged reduced core radiation power density [MW/m³]"
    pden_plasma_edge_rad_vol_avg_mw: float
    "Volume-averaged edge radiation power density [MW/m³]"
    pden_plasma_rad_vol_avg_mw: float
    "Volume-averaged total radiation power density [MW/m³]"

pden_plasma_sync_vol_avg_mw instance-attribute

Volume-averaged synchrotron radiation power density [MW/m³]

pden_plasma_core_rad_vol_avg_mw instance-attribute

Volume-averaged core radiation power density [MW/m³]

pden_plasma_core_rad_reduced_vol_avg_mw instance-attribute

Volume-averaged reduced core radiation power density [MW/m³]

pden_plasma_edge_rad_vol_avg_mw instance-attribute

Volume-averaged edge radiation power density [MW/m³]

pden_plasma_rad_vol_avg_mw instance-attribute

Volume-averaged total radiation power density [MW/m³]

PlasmaRadiation

Bases: Model

Class representing the photon radiation properties of a plasma. Includes line, bremsstrahlung, recombination and synchrotron radiation.

Source code in process/models/physics/radiation_power.py
 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
class PlasmaRadiation(Model):
    """Class representing the photon radiation properties of a plasma. Includes line,
    bremsstrahlung, recombination and synchrotron radiation.
    """

    def __init__(
        self,
        plasma_profile: PlasmaProfile,
        data_structure: DataStructure,
    ):
        self.outfile = constants.NOUT
        self.mfile = constants.MFILE
        self.plasma_profile = plasma_profile
        self.data = data_structure
        self.impurity_rad = impurity.ImpurityRadiation(
            plasma_profile=self.plasma_profile, data_structure=self.data
        )

    def run(self) -> None:
        """Run the plasma radiation calculation and update the data structure."""
        radpwrdata = self.calculate_radiation_powers(
            nd_plasma_electron_on_axis=self.data.physics.nd_plasma_electron_on_axis,
            rminor=self.data.physics.rminor,
            b_plasma_toroidal_on_axis=self.data.physics.b_plasma_toroidal_on_axis,
            aspect=self.data.physics.aspect,
            alphan=self.data.physics.alphan,
            alphat=self.data.physics.alphat,
            tbeta=self.data.physics.tbeta,
            temp_plasma_electron_on_axis_kev=self.data.physics.temp_plasma_electron_on_axis_kev,
            f_sync_reflect=self.data.physics.f_sync_reflect,
            rmajor=self.data.physics.rmajor,
            kappa=self.data.physics.kappa,
            vol_plasma=self.data.physics.vol_plasma,
        )
        self.data.physics.pden_plasma_sync_vol_avg_mw = (
            radpwrdata.pden_plasma_sync_vol_avg_mw
        )
        self.data.physics.pden_plasma_core_rad_reduced_vol_avg_mw = (
            radpwrdata.pden_plasma_core_rad_reduced_vol_avg_mw
        )
        self.data.physics.pden_plasma_core_rad_vol_avg_mw = (
            radpwrdata.pden_plasma_core_rad_vol_avg_mw
        )
        self.data.physics.pden_plasma_edge_rad_vol_avg_mw = (
            radpwrdata.pden_plasma_edge_rad_vol_avg_mw
        )
        self.data.physics.pden_plasma_rad_vol_avg_mw = (
            radpwrdata.pden_plasma_rad_vol_avg_mw
        )

        self.data.physics.p_plasma_sync_mw = (
            self.data.physics.pden_plasma_sync_vol_avg_mw * self.data.physics.vol_plasma
        )
        self.data.physics.p_plasma_core_rad_reduced_mw = (
            self.data.physics.pden_plasma_core_rad_reduced_vol_avg_mw
            * self.data.physics.vol_plasma
        )

        self.data.physics.p_plasma_core_rad_mw = (
            self.data.physics.pden_plasma_core_rad_vol_avg_mw
            * self.data.physics.vol_plasma
        )
        self.data.physics.p_plasma_edge_rad_mw = (
            self.data.physics.pden_plasma_edge_rad_vol_avg_mw
            * self.data.physics.vol_plasma
        )
        self.data.physics.p_plasma_rad_mw = (
            self.data.physics.pden_plasma_rad_vol_avg_mw * self.data.physics.vol_plasma
        )

        self.data.physics.f_p_plasma_rad_sync = (
            self.data.physics.p_plasma_sync_mw / self.data.physics.p_plasma_rad_mw
            if self.data.physics.p_plasma_rad_mw > 0.0
            else 0.0
        )
        self.data.physics.f_p_plasma_rad_ions = (
            1.0 - self.data.physics.f_p_plasma_rad_sync
        )
        self.data.physics.f_p_plasma_rad_impurities = (
            self.data.physics.p_plasma_rad_impurities_mw
            / self.data.physics.p_plasma_rad_mw
            if self.data.physics.p_plasma_rad_mw > 0.0
            else 0.0
        )

    def output(self) -> None:
        """Subroutine to output the plasma radiation information"""
        po.oheadr(self.outfile, "Plasma Radiation (excluding SOL):")

        po.osubhd(self.outfile, "Synchrotron Radiation:")

        po.ovarre(
            self.outfile,
            "Plasma total synchrotron radiation power (Pₛₙ) [MW]",
            "(p_plasma_sync_mw)",
            self.data.physics.p_plasma_sync_mw,
            "OP ",
        )
        po.ovarre(
            self.outfile,
            "Plasma volume-averaged synchrotron radiation power density [MW/m³]",
            "(pden_plasma_sync_vol_avg_mw)",
            self.data.physics.pden_plasma_sync_vol_avg_mw,
            "OP ",
        )
        po.ovarre(
            self.outfile,
            "Synchrotron wall reflectivity factor",
            "(f_sync_reflect)",
            self.data.physics.f_sync_reflect,
        )
        po.ovarre(
            self.outfile,
            "Fraction of plasma radiation power due to synchrotron radiation",
            "(f_p_plasma_rad_sync)",
            self.data.physics.f_p_plasma_rad_sync,
            "OP ",
        )

        po.oblnkl(self.outfile)
        po.ocmmnt(self.outfile, "----------------------------")
        po.osubhd(self.outfile, "Line, Recombination & Bremsstrahlung Radiation:")

        self.output_species_radiation_power_density()

        po.oblnkl(self.outfile)
        po.ovarre(
            self.outfile,
            "Fraction of plasma radiation power due to presence of ions",
            "(f_p_plasma_rad_ions)",
            self.data.physics.f_p_plasma_rad_ions,
            "OP ",
        )
        po.oblnkl(self.outfile)
        po.ovarre(
            self.outfile,
            "Plasma radiation power due to impurities, Z>2 (Pᵧ,ᵢₘₚ) [MW]",
            "(p_plasma_rad_impurities_mw)",
            self.data.physics.p_plasma_rad_impurities_mw,
            "OP ",
        )
        po.ovarre(
            self.outfile,
            "Fraction of plasma radiation power due to impurities, Z>2",
            "(f_p_plasma_rad_impurities)",
            self.data.physics.f_p_plasma_rad_impurities,
            "OP ",
        )
        po.oblnkl(self.outfile)
        po.ocmmnt(self.outfile, "----------------------------")
        po.osubhd(self.outfile, "Core region:")

        po.ocmmnt(
            self.outfile, "Note: Only the core region contains the synchrotron radiation"
        )
        po.oblnkl(self.outfile)
        po.ovarre(
            self.outfile,
            "Plasma normalised minor radius defining 'core' region (ρᵢₙₙₑᵣ)",
            "(radius_plasma_core_norm)",
            self.data.impurity_radiation.radius_plasma_core_norm,
        )
        po.ovarre(
            self.outfile,
            "Fractional scaling of radiation power along core profile",
            "(f_p_plasma_core_rad_reduction)",
            self.data.impurity_radiation.f_p_plasma_core_rad_reduction,
        )
        po.oblnkl(self.outfile)
        po.ovarre(
            self.outfile,
            "Plasma reduced core radiation power (Pᵧ,ᵢₙₙₑᵣ) [MW]",
            "(p_plasma_core_rad_reduced_mw)",
            self.data.physics.p_plasma_core_rad_reduced_mw,
            "OP ",
        )
        po.ovarre(
            self.outfile,
            "Plasma core radiation power (Pᵧ,ᵢₙₙₑᵣ) [MW]",
            "(p_plasma_core_rad_mw)",
            self.data.physics.p_plasma_core_rad_mw,
            "OP ",
        )
        po.oblnkl(self.outfile)
        po.ocmmnt(
            self.outfile,
            "Note: Volume-averaged quantities are calculated over the whole plasma",
        )
        po.oblnkl(self.outfile)
        po.ovarre(
            self.outfile,
            "Volume-averaged total reduced core radiation power per volume [MW/m³]",
            "(pden_plasma_core_rad_reduced_vol_avg_mw)",
            self.data.physics.pden_plasma_core_rad_reduced_vol_avg_mw,
            "OP ",
        )
        po.ovarre(
            self.outfile,
            "Volume-averaged total core radiation power per volume [MW/m³]",
            "(pden_plasma_core_rad_vol_avg_mw)",
            self.data.physics.pden_plasma_core_rad_vol_avg_mw,
            "OP ",
        )
        po.oblnkl(self.outfile)
        po.ocmmnt(self.outfile, "----------------------------")
        po.osubhd(self.outfile, "Edge region:")
        po.ovarre(
            self.outfile,
            "Plasma total radiation power from edge region (Pᵧ,ₒᵤₜₑᵣ) [MW] ",
            "(p_plasma_edge_rad_mw)",
            self.data.physics.p_plasma_edge_rad_mw,
            "OP ",
        )
        po.oblnkl(self.outfile)
        po.ocmmnt(
            self.outfile,
            "Note: Volume-averaged quantities are calculated over the whole plasma",
        )
        po.oblnkl(self.outfile)
        po.ovarre(
            self.outfile,
            "Volume-averaged total edge radiation power per volume [MW/m³]",
            "(pden_plasma_edge_rad_vol_avg_mw)",
            self.data.physics.pden_plasma_edge_rad_vol_avg_mw,
            "OP ",
        )

        if self.data.stellarator.istell != StellaratorModel.DISABLED:
            po.ovarre(
                self.outfile,
                "SOL radiation power as imposed by f_rad (MW)",
                "(psolradmw)",
                self.data.physics.psolradmw,
                "OP ",
            )

        po.oblnkl(self.outfile)
        po.ocmmnt(self.outfile, "----------------------------")
        po.osubhd(self.outfile, "Totals:")

        po.ovarre(
            self.outfile,
            "Plasma total radiation power from inside last closed flux surface "
            "(Pᵧ) [MW]",
            "(p_plasma_rad_mw)",
            self.data.physics.p_plasma_rad_mw,
            "OP ",
        )
        po.ovarre(
            self.outfile,
            "Separatrix radiation fraction (fᵧ)",
            "(f_p_plasma_separatrix_rad)",
            self.data.physics.f_p_plasma_separatrix_rad,
            "OP ",
        )
        po.oblnkl(self.outfile)
        po.ovarre(
            self.outfile,
            "Plasma total volume-averaged radiation power per unit volume [MW/m³]",
            "(pden_plasma_rad_vol_avg_mw)",
            self.data.physics.pden_plasma_rad_vol_avg_mw,
            "OP ",
        )

        po.oblnkl(self.outfile)
        po.ocmmnt(self.outfile, "----------------------------")

    def output_species_radiation_power_density(self) -> None:
        """Output the specific radiation power of each supported ion species."""
        species_powers = self.impurity_rad.calculate_species_radiation_powers()
        for (symbol, (_, p_mw)), attribute in zip(
            species_powers.items(),
            SPECIES_POWER_ATTRIBUTES,
            strict=True,
        ):
            po.ovarre(
                self.outfile,
                f"{symbol} total radiation power [MW]",
                f"({attribute})",
                p_mw,
                "OP ",
            )

    def calculate_radiation_powers(
        self,
        nd_plasma_electron_on_axis: float,
        rminor: float,
        b_plasma_toroidal_on_axis: float,
        aspect: float,
        alphan: float,
        alphat: float,
        tbeta: float,
        temp_plasma_electron_on_axis_kev: float,
        f_sync_reflect: float,
        rmajor: float,
        kappa: float,
        vol_plasma: float,
    ) -> RadpwrData:
        """Calculate the radiation powers in [MW/m³] by calling relevant routines.

        This function computes the radiation power densities for the plasma, including
        impurity radiation and synchrotron radiation. It returns a dataclass containing
        the calculated radiation power densities.

        Parameters
        ----------
        nd_plasma_electron_on_axis : float
            Central electron density [m⁻³].
        rminor : float
            Minor radius of the plasma [m].
        b_plasma_toroidal_on_axis : float
            Toroidal magnetic field [T].
        aspect : float
            Aspect ratio of the plasma [-].
        alphan : float
            Alpha parameter for density profile [-].
        alphat : float
            Alpha parameter for temperature profile [-].
        tbeta : float
            Beta parameter for temperature profile [-].
        temp_plasma_electron_on_axis_kev : float
            Central electron temperature [keV].
        f_sync_reflect : float
            Fraction of synchrotron radiation reflected.
        rmajor : float
            Major radius of the plasma [m].
        kappa : float
            Elongation of the plasma [-].
        vol_plasma : float
            Plasma volume [m³].

        Returns
        -------
        RadpwrData
            A dataclass containing the radiation power densities in [MW/m³].

        References
        ----------
        [1] F. Albajar, J. Johner, and G. Granata, “Improved calculation of synchrotron
        radiation losses in realistic tokamak plasmas,” Nuclear Fusion, vol. 41,
        no. 6, pp. 665-678, Jun. 2001,
        doi: https://doi.org/10.1088/0029-5515/41/6/301.

        [2] I. Fidone, G Giruzzi, and G. Granata, “Synchrotron radiation loss in tokamaks
        of arbitrary geometry,” Nuclear Fusion, vol. 41, no. 12, pp. 1755-1758,
        Dec. 2001, doi: https://doi.org/10.1088/0029-5515/41/12/102.
        """
        imp_rad = self.impurity_rad
        imp_rad.calculate_imprad()

        # Synchrotron radiation power/volume; assumed to be from core only.
        pden_plasma_sync_vol_avg_mw = self.psync_albajar_fidone(
            nd_plasma_electron_on_axis=nd_plasma_electron_on_axis,
            rminor=rminor,
            b_plasma_toroidal_on_axis=b_plasma_toroidal_on_axis,
            aspect=aspect,
            alphan=alphan,
            alphat=alphat,
            tbeta=tbeta,
            temp_plasma_electron_on_axis_kev=temp_plasma_electron_on_axis_kev,
            f_sync_reflect=f_sync_reflect,
            rmajor=rmajor,
            kappa=kappa,
            vol_plasma=vol_plasma,
        )

        # Total core radiation power/volume.
        pden_plasma_core_rad_reduced_vol_avg_mw = (
            imp_rad.pden_impurity_core_rad_reduced_vol_avg_mw
            + pden_plasma_sync_vol_avg_mw
        )

        # Total core radiation power/volume.
        pden_plasma_core_rad_vol_avg_mw = (
            imp_rad.pden_impurity_core_rad_vol_avg_mw + pden_plasma_sync_vol_avg_mw
        )

        # Total radiation power/volume.
        pden_plasma_rad_vol_avg_mw = (
            imp_rad.pden_impurity_rad_total_vol_avg_mw + pden_plasma_sync_vol_avg_mw
        )

        return RadpwrData(
            pden_plasma_sync_vol_avg_mw=pden_plasma_sync_vol_avg_mw,
            pden_plasma_core_rad_vol_avg_mw=pden_plasma_core_rad_vol_avg_mw,
            pden_plasma_core_rad_reduced_vol_avg_mw=pden_plasma_core_rad_reduced_vol_avg_mw,
            pden_plasma_edge_rad_vol_avg_mw=imp_rad.pden_impurity_rad_edge_vol_avg_mw,
            pden_plasma_rad_vol_avg_mw=pden_plasma_rad_vol_avg_mw,
        )

    @staticmethod
    def psync_albajar_fidone(
        nd_plasma_electron_on_axis: float,
        rminor: float,
        b_plasma_toroidal_on_axis: float,
        aspect: float,
        alphan: float,
        alphat: float,
        tbeta: float,
        temp_plasma_electron_on_axis_kev: float,
        f_sync_reflect: float,
        rmajor: float,
        kappa: float,
        vol_plasma: float,
    ) -> float:
        """Calculate the synchrotron radiation power in [MW/m³].

        This function computes the synchrotron radiation power density for the plasma
        based on the plasma shape, major and minor radii, electron density, and
        temperature profiles.

        Parameters
        ----------
        nd_plasma_electron_on_axis : float
            Central electron density [m⁻³].
        rminor : float
            Minor radius of the plasma [m].
        b_plasma_toroidal_on_axis : float
            Toroidal magnetic field [T].
        aspect : float
            Aspect ratio of the plasma [-].
        alphan : float
            Alpha parameter for density profile [-].
        alphat : float
            Alpha parameter for temperature profile [-].
        tbeta : float
            Beta parameter for temperature profile [-].
        temp_plasma_electron_on_axis_kev : float
            Central electron temperature [keV].
        f_sync_reflect : float
            Fraction of synchrotron radiation reflected [-].
        rmajor : float
            Major radius of the plasma [m].
        kappa : float
            Elongation of the plasma [-].
        vol_plasma : float
            Plasma volume [m³].

        Returns
        -------
        float
            Synchrotron radiation power per unit volume [MW/m³].

        References
        ----------
        [1] F. Albajar, J. Johner, and G. Granata, “Improved calculation of synchrotron
        radiation losses in realistic tokamak plasmas,” Nuclear Fusion, vol. 41, no. 6,
        pp. 665-678, Jun. 2001, doi: https://doi.org/10.1088/0029-5515/41/6/301.

        [2] I. Fidone, G Giruzzi, and G. Granata, “Synchrotron radiation loss in
        tokamaks of arbitrary geometry,” Nuclear Fusion, vol. 41, no. 12, pp. 1755-1758,
        Dec. 2001, doi: https://doi.org/10.1088/0029-5515/41/12/102.
        """
        # Variable names are created to closely match those from the reference papers.

        ne0_20 = 1.0e-20 * nd_plasma_electron_on_axis

        p_a0 = 6.04e3 * (rminor * ne0_20) / b_plasma_toroidal_on_axis

        g_function = 0.93 * (1.0 + 0.85 * np.exp(-0.82 * aspect))

        k_function = (
            (alphan + 3.87 * alphat + 1.46) ** -0.79
            * (1.98 + alphat) ** 1.36
            * tbeta**2.14
            * (tbeta**1.53 + 1.87 * alphat - 0.16) ** -1.33
        )

        dum = (
            1.0
            + 0.12
            * (temp_plasma_electron_on_axis_kev / p_a0**0.41)
            * (1.0 - f_sync_reflect) ** 0.41
        ) ** -1.51

        p_sync_mw = (
            3.84e-8
            * (1.0 - f_sync_reflect) ** 0.62
            * rmajor
            * rminor**1.38
            * kappa**0.79
            * b_plasma_toroidal_on_axis**2.62
            * ne0_20**0.38
            * temp_plasma_electron_on_axis_kev
            * (16.0 + temp_plasma_electron_on_axis_kev) ** 2.61
            * dum
            * g_function
            * k_function
        )

        # pden_plasma_sync_vol_avg_mw should be per unit volume; Albajar gives
        # it as total

        return p_sync_mw / vol_plasma

outfile = constants.NOUT instance-attribute

mfile = constants.MFILE instance-attribute

plasma_profile = plasma_profile instance-attribute

data = data_structure instance-attribute

impurity_rad = impurity.ImpurityRadiation(plasma_profile=self.plasma_profile, data_structure=self.data) instance-attribute

run()

Run the plasma radiation calculation and update the data structure.

Source code in process/models/physics/radiation_power.py
 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
def run(self) -> None:
    """Run the plasma radiation calculation and update the data structure."""
    radpwrdata = self.calculate_radiation_powers(
        nd_plasma_electron_on_axis=self.data.physics.nd_plasma_electron_on_axis,
        rminor=self.data.physics.rminor,
        b_plasma_toroidal_on_axis=self.data.physics.b_plasma_toroidal_on_axis,
        aspect=self.data.physics.aspect,
        alphan=self.data.physics.alphan,
        alphat=self.data.physics.alphat,
        tbeta=self.data.physics.tbeta,
        temp_plasma_electron_on_axis_kev=self.data.physics.temp_plasma_electron_on_axis_kev,
        f_sync_reflect=self.data.physics.f_sync_reflect,
        rmajor=self.data.physics.rmajor,
        kappa=self.data.physics.kappa,
        vol_plasma=self.data.physics.vol_plasma,
    )
    self.data.physics.pden_plasma_sync_vol_avg_mw = (
        radpwrdata.pden_plasma_sync_vol_avg_mw
    )
    self.data.physics.pden_plasma_core_rad_reduced_vol_avg_mw = (
        radpwrdata.pden_plasma_core_rad_reduced_vol_avg_mw
    )
    self.data.physics.pden_plasma_core_rad_vol_avg_mw = (
        radpwrdata.pden_plasma_core_rad_vol_avg_mw
    )
    self.data.physics.pden_plasma_edge_rad_vol_avg_mw = (
        radpwrdata.pden_plasma_edge_rad_vol_avg_mw
    )
    self.data.physics.pden_plasma_rad_vol_avg_mw = (
        radpwrdata.pden_plasma_rad_vol_avg_mw
    )

    self.data.physics.p_plasma_sync_mw = (
        self.data.physics.pden_plasma_sync_vol_avg_mw * self.data.physics.vol_plasma
    )
    self.data.physics.p_plasma_core_rad_reduced_mw = (
        self.data.physics.pden_plasma_core_rad_reduced_vol_avg_mw
        * self.data.physics.vol_plasma
    )

    self.data.physics.p_plasma_core_rad_mw = (
        self.data.physics.pden_plasma_core_rad_vol_avg_mw
        * self.data.physics.vol_plasma
    )
    self.data.physics.p_plasma_edge_rad_mw = (
        self.data.physics.pden_plasma_edge_rad_vol_avg_mw
        * self.data.physics.vol_plasma
    )
    self.data.physics.p_plasma_rad_mw = (
        self.data.physics.pden_plasma_rad_vol_avg_mw * self.data.physics.vol_plasma
    )

    self.data.physics.f_p_plasma_rad_sync = (
        self.data.physics.p_plasma_sync_mw / self.data.physics.p_plasma_rad_mw
        if self.data.physics.p_plasma_rad_mw > 0.0
        else 0.0
    )
    self.data.physics.f_p_plasma_rad_ions = (
        1.0 - self.data.physics.f_p_plasma_rad_sync
    )
    self.data.physics.f_p_plasma_rad_impurities = (
        self.data.physics.p_plasma_rad_impurities_mw
        / self.data.physics.p_plasma_rad_mw
        if self.data.physics.p_plasma_rad_mw > 0.0
        else 0.0
    )

output()

Subroutine to output the plasma radiation information

Source code in process/models/physics/radiation_power.py
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
def output(self) -> None:
    """Subroutine to output the plasma radiation information"""
    po.oheadr(self.outfile, "Plasma Radiation (excluding SOL):")

    po.osubhd(self.outfile, "Synchrotron Radiation:")

    po.ovarre(
        self.outfile,
        "Plasma total synchrotron radiation power (Pₛₙ) [MW]",
        "(p_plasma_sync_mw)",
        self.data.physics.p_plasma_sync_mw,
        "OP ",
    )
    po.ovarre(
        self.outfile,
        "Plasma volume-averaged synchrotron radiation power density [MW/m³]",
        "(pden_plasma_sync_vol_avg_mw)",
        self.data.physics.pden_plasma_sync_vol_avg_mw,
        "OP ",
    )
    po.ovarre(
        self.outfile,
        "Synchrotron wall reflectivity factor",
        "(f_sync_reflect)",
        self.data.physics.f_sync_reflect,
    )
    po.ovarre(
        self.outfile,
        "Fraction of plasma radiation power due to synchrotron radiation",
        "(f_p_plasma_rad_sync)",
        self.data.physics.f_p_plasma_rad_sync,
        "OP ",
    )

    po.oblnkl(self.outfile)
    po.ocmmnt(self.outfile, "----------------------------")
    po.osubhd(self.outfile, "Line, Recombination & Bremsstrahlung Radiation:")

    self.output_species_radiation_power_density()

    po.oblnkl(self.outfile)
    po.ovarre(
        self.outfile,
        "Fraction of plasma radiation power due to presence of ions",
        "(f_p_plasma_rad_ions)",
        self.data.physics.f_p_plasma_rad_ions,
        "OP ",
    )
    po.oblnkl(self.outfile)
    po.ovarre(
        self.outfile,
        "Plasma radiation power due to impurities, Z>2 (Pᵧ,ᵢₘₚ) [MW]",
        "(p_plasma_rad_impurities_mw)",
        self.data.physics.p_plasma_rad_impurities_mw,
        "OP ",
    )
    po.ovarre(
        self.outfile,
        "Fraction of plasma radiation power due to impurities, Z>2",
        "(f_p_plasma_rad_impurities)",
        self.data.physics.f_p_plasma_rad_impurities,
        "OP ",
    )
    po.oblnkl(self.outfile)
    po.ocmmnt(self.outfile, "----------------------------")
    po.osubhd(self.outfile, "Core region:")

    po.ocmmnt(
        self.outfile, "Note: Only the core region contains the synchrotron radiation"
    )
    po.oblnkl(self.outfile)
    po.ovarre(
        self.outfile,
        "Plasma normalised minor radius defining 'core' region (ρᵢₙₙₑᵣ)",
        "(radius_plasma_core_norm)",
        self.data.impurity_radiation.radius_plasma_core_norm,
    )
    po.ovarre(
        self.outfile,
        "Fractional scaling of radiation power along core profile",
        "(f_p_plasma_core_rad_reduction)",
        self.data.impurity_radiation.f_p_plasma_core_rad_reduction,
    )
    po.oblnkl(self.outfile)
    po.ovarre(
        self.outfile,
        "Plasma reduced core radiation power (Pᵧ,ᵢₙₙₑᵣ) [MW]",
        "(p_plasma_core_rad_reduced_mw)",
        self.data.physics.p_plasma_core_rad_reduced_mw,
        "OP ",
    )
    po.ovarre(
        self.outfile,
        "Plasma core radiation power (Pᵧ,ᵢₙₙₑᵣ) [MW]",
        "(p_plasma_core_rad_mw)",
        self.data.physics.p_plasma_core_rad_mw,
        "OP ",
    )
    po.oblnkl(self.outfile)
    po.ocmmnt(
        self.outfile,
        "Note: Volume-averaged quantities are calculated over the whole plasma",
    )
    po.oblnkl(self.outfile)
    po.ovarre(
        self.outfile,
        "Volume-averaged total reduced core radiation power per volume [MW/m³]",
        "(pden_plasma_core_rad_reduced_vol_avg_mw)",
        self.data.physics.pden_plasma_core_rad_reduced_vol_avg_mw,
        "OP ",
    )
    po.ovarre(
        self.outfile,
        "Volume-averaged total core radiation power per volume [MW/m³]",
        "(pden_plasma_core_rad_vol_avg_mw)",
        self.data.physics.pden_plasma_core_rad_vol_avg_mw,
        "OP ",
    )
    po.oblnkl(self.outfile)
    po.ocmmnt(self.outfile, "----------------------------")
    po.osubhd(self.outfile, "Edge region:")
    po.ovarre(
        self.outfile,
        "Plasma total radiation power from edge region (Pᵧ,ₒᵤₜₑᵣ) [MW] ",
        "(p_plasma_edge_rad_mw)",
        self.data.physics.p_plasma_edge_rad_mw,
        "OP ",
    )
    po.oblnkl(self.outfile)
    po.ocmmnt(
        self.outfile,
        "Note: Volume-averaged quantities are calculated over the whole plasma",
    )
    po.oblnkl(self.outfile)
    po.ovarre(
        self.outfile,
        "Volume-averaged total edge radiation power per volume [MW/m³]",
        "(pden_plasma_edge_rad_vol_avg_mw)",
        self.data.physics.pden_plasma_edge_rad_vol_avg_mw,
        "OP ",
    )

    if self.data.stellarator.istell != StellaratorModel.DISABLED:
        po.ovarre(
            self.outfile,
            "SOL radiation power as imposed by f_rad (MW)",
            "(psolradmw)",
            self.data.physics.psolradmw,
            "OP ",
        )

    po.oblnkl(self.outfile)
    po.ocmmnt(self.outfile, "----------------------------")
    po.osubhd(self.outfile, "Totals:")

    po.ovarre(
        self.outfile,
        "Plasma total radiation power from inside last closed flux surface "
        "(Pᵧ) [MW]",
        "(p_plasma_rad_mw)",
        self.data.physics.p_plasma_rad_mw,
        "OP ",
    )
    po.ovarre(
        self.outfile,
        "Separatrix radiation fraction (fᵧ)",
        "(f_p_plasma_separatrix_rad)",
        self.data.physics.f_p_plasma_separatrix_rad,
        "OP ",
    )
    po.oblnkl(self.outfile)
    po.ovarre(
        self.outfile,
        "Plasma total volume-averaged radiation power per unit volume [MW/m³]",
        "(pden_plasma_rad_vol_avg_mw)",
        self.data.physics.pden_plasma_rad_vol_avg_mw,
        "OP ",
    )

    po.oblnkl(self.outfile)
    po.ocmmnt(self.outfile, "----------------------------")

output_species_radiation_power_density()

Output the specific radiation power of each supported ion species.

Source code in process/models/physics/radiation_power.py
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
def output_species_radiation_power_density(self) -> None:
    """Output the specific radiation power of each supported ion species."""
    species_powers = self.impurity_rad.calculate_species_radiation_powers()
    for (symbol, (_, p_mw)), attribute in zip(
        species_powers.items(),
        SPECIES_POWER_ATTRIBUTES,
        strict=True,
    ):
        po.ovarre(
            self.outfile,
            f"{symbol} total radiation power [MW]",
            f"({attribute})",
            p_mw,
            "OP ",
        )

calculate_radiation_powers(nd_plasma_electron_on_axis, rminor, b_plasma_toroidal_on_axis, aspect, alphan, alphat, tbeta, temp_plasma_electron_on_axis_kev, f_sync_reflect, rmajor, kappa, vol_plasma)

Calculate the radiation powers in [MW/m³] by calling relevant routines.

This function computes the radiation power densities for the plasma, including impurity radiation and synchrotron radiation. It returns a dataclass containing the calculated radiation power densities.

Parameters:

Name Type Description Default
nd_plasma_electron_on_axis float

Central electron density [m⁻³].

required
rminor float

Minor radius of the plasma [m].

required
b_plasma_toroidal_on_axis float

Toroidal magnetic field [T].

required
aspect float

Aspect ratio of the plasma [-].

required
alphan float

Alpha parameter for density profile [-].

required
alphat float

Alpha parameter for temperature profile [-].

required
tbeta float

Beta parameter for temperature profile [-].

required
temp_plasma_electron_on_axis_kev float

Central electron temperature [keV].

required
f_sync_reflect float

Fraction of synchrotron radiation reflected.

required
rmajor float

Major radius of the plasma [m].

required
kappa float

Elongation of the plasma [-].

required
vol_plasma float

Plasma volume [m³].

required

Returns:

Type Description
RadpwrData

A dataclass containing the radiation power densities in [MW/m³].

References

[1] F. Albajar, J. Johner, and G. Granata, “Improved calculation of synchrotron radiation losses in realistic tokamak plasmas,” Nuclear Fusion, vol. 41, no. 6, pp. 665-678, Jun. 2001, doi: https://doi.org/10.1088/0029-5515/41/6/301.

[2] I. Fidone, G Giruzzi, and G. Granata, “Synchrotron radiation loss in tokamaks of arbitrary geometry,” Nuclear Fusion, vol. 41, no. 12, pp. 1755-1758, Dec. 2001, doi: https://doi.org/10.1088/0029-5515/41/12/102.

Source code in process/models/physics/radiation_power.py
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
def calculate_radiation_powers(
    self,
    nd_plasma_electron_on_axis: float,
    rminor: float,
    b_plasma_toroidal_on_axis: float,
    aspect: float,
    alphan: float,
    alphat: float,
    tbeta: float,
    temp_plasma_electron_on_axis_kev: float,
    f_sync_reflect: float,
    rmajor: float,
    kappa: float,
    vol_plasma: float,
) -> RadpwrData:
    """Calculate the radiation powers in [MW/m³] by calling relevant routines.

    This function computes the radiation power densities for the plasma, including
    impurity radiation and synchrotron radiation. It returns a dataclass containing
    the calculated radiation power densities.

    Parameters
    ----------
    nd_plasma_electron_on_axis : float
        Central electron density [m⁻³].
    rminor : float
        Minor radius of the plasma [m].
    b_plasma_toroidal_on_axis : float
        Toroidal magnetic field [T].
    aspect : float
        Aspect ratio of the plasma [-].
    alphan : float
        Alpha parameter for density profile [-].
    alphat : float
        Alpha parameter for temperature profile [-].
    tbeta : float
        Beta parameter for temperature profile [-].
    temp_plasma_electron_on_axis_kev : float
        Central electron temperature [keV].
    f_sync_reflect : float
        Fraction of synchrotron radiation reflected.
    rmajor : float
        Major radius of the plasma [m].
    kappa : float
        Elongation of the plasma [-].
    vol_plasma : float
        Plasma volume [m³].

    Returns
    -------
    RadpwrData
        A dataclass containing the radiation power densities in [MW/m³].

    References
    ----------
    [1] F. Albajar, J. Johner, and G. Granata, “Improved calculation of synchrotron
    radiation losses in realistic tokamak plasmas,” Nuclear Fusion, vol. 41,
    no. 6, pp. 665-678, Jun. 2001,
    doi: https://doi.org/10.1088/0029-5515/41/6/301.

    [2] I. Fidone, G Giruzzi, and G. Granata, “Synchrotron radiation loss in tokamaks
    of arbitrary geometry,” Nuclear Fusion, vol. 41, no. 12, pp. 1755-1758,
    Dec. 2001, doi: https://doi.org/10.1088/0029-5515/41/12/102.
    """
    imp_rad = self.impurity_rad
    imp_rad.calculate_imprad()

    # Synchrotron radiation power/volume; assumed to be from core only.
    pden_plasma_sync_vol_avg_mw = self.psync_albajar_fidone(
        nd_plasma_electron_on_axis=nd_plasma_electron_on_axis,
        rminor=rminor,
        b_plasma_toroidal_on_axis=b_plasma_toroidal_on_axis,
        aspect=aspect,
        alphan=alphan,
        alphat=alphat,
        tbeta=tbeta,
        temp_plasma_electron_on_axis_kev=temp_plasma_electron_on_axis_kev,
        f_sync_reflect=f_sync_reflect,
        rmajor=rmajor,
        kappa=kappa,
        vol_plasma=vol_plasma,
    )

    # Total core radiation power/volume.
    pden_plasma_core_rad_reduced_vol_avg_mw = (
        imp_rad.pden_impurity_core_rad_reduced_vol_avg_mw
        + pden_plasma_sync_vol_avg_mw
    )

    # Total core radiation power/volume.
    pden_plasma_core_rad_vol_avg_mw = (
        imp_rad.pden_impurity_core_rad_vol_avg_mw + pden_plasma_sync_vol_avg_mw
    )

    # Total radiation power/volume.
    pden_plasma_rad_vol_avg_mw = (
        imp_rad.pden_impurity_rad_total_vol_avg_mw + pden_plasma_sync_vol_avg_mw
    )

    return RadpwrData(
        pden_plasma_sync_vol_avg_mw=pden_plasma_sync_vol_avg_mw,
        pden_plasma_core_rad_vol_avg_mw=pden_plasma_core_rad_vol_avg_mw,
        pden_plasma_core_rad_reduced_vol_avg_mw=pden_plasma_core_rad_reduced_vol_avg_mw,
        pden_plasma_edge_rad_vol_avg_mw=imp_rad.pden_impurity_rad_edge_vol_avg_mw,
        pden_plasma_rad_vol_avg_mw=pden_plasma_rad_vol_avg_mw,
    )

psync_albajar_fidone(nd_plasma_electron_on_axis, rminor, b_plasma_toroidal_on_axis, aspect, alphan, alphat, tbeta, temp_plasma_electron_on_axis_kev, f_sync_reflect, rmajor, kappa, vol_plasma) staticmethod

Calculate the synchrotron radiation power in [MW/m³].

This function computes the synchrotron radiation power density for the plasma based on the plasma shape, major and minor radii, electron density, and temperature profiles.

Parameters:

Name Type Description Default
nd_plasma_electron_on_axis float

Central electron density [m⁻³].

required
rminor float

Minor radius of the plasma [m].

required
b_plasma_toroidal_on_axis float

Toroidal magnetic field [T].

required
aspect float

Aspect ratio of the plasma [-].

required
alphan float

Alpha parameter for density profile [-].

required
alphat float

Alpha parameter for temperature profile [-].

required
tbeta float

Beta parameter for temperature profile [-].

required
temp_plasma_electron_on_axis_kev float

Central electron temperature [keV].

required
f_sync_reflect float

Fraction of synchrotron radiation reflected [-].

required
rmajor float

Major radius of the plasma [m].

required
kappa float

Elongation of the plasma [-].

required
vol_plasma float

Plasma volume [m³].

required

Returns:

Type Description
float

Synchrotron radiation power per unit volume [MW/m³].

References

[1] F. Albajar, J. Johner, and G. Granata, “Improved calculation of synchrotron radiation losses in realistic tokamak plasmas,” Nuclear Fusion, vol. 41, no. 6, pp. 665-678, Jun. 2001, doi: https://doi.org/10.1088/0029-5515/41/6/301.

[2] I. Fidone, G Giruzzi, and G. Granata, “Synchrotron radiation loss in tokamaks of arbitrary geometry,” Nuclear Fusion, vol. 41, no. 12, pp. 1755-1758, Dec. 2001, doi: https://doi.org/10.1088/0029-5515/41/12/102.

Source code in process/models/physics/radiation_power.py
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
@staticmethod
def psync_albajar_fidone(
    nd_plasma_electron_on_axis: float,
    rminor: float,
    b_plasma_toroidal_on_axis: float,
    aspect: float,
    alphan: float,
    alphat: float,
    tbeta: float,
    temp_plasma_electron_on_axis_kev: float,
    f_sync_reflect: float,
    rmajor: float,
    kappa: float,
    vol_plasma: float,
) -> float:
    """Calculate the synchrotron radiation power in [MW/m³].

    This function computes the synchrotron radiation power density for the plasma
    based on the plasma shape, major and minor radii, electron density, and
    temperature profiles.

    Parameters
    ----------
    nd_plasma_electron_on_axis : float
        Central electron density [m⁻³].
    rminor : float
        Minor radius of the plasma [m].
    b_plasma_toroidal_on_axis : float
        Toroidal magnetic field [T].
    aspect : float
        Aspect ratio of the plasma [-].
    alphan : float
        Alpha parameter for density profile [-].
    alphat : float
        Alpha parameter for temperature profile [-].
    tbeta : float
        Beta parameter for temperature profile [-].
    temp_plasma_electron_on_axis_kev : float
        Central electron temperature [keV].
    f_sync_reflect : float
        Fraction of synchrotron radiation reflected [-].
    rmajor : float
        Major radius of the plasma [m].
    kappa : float
        Elongation of the plasma [-].
    vol_plasma : float
        Plasma volume [m³].

    Returns
    -------
    float
        Synchrotron radiation power per unit volume [MW/m³].

    References
    ----------
    [1] F. Albajar, J. Johner, and G. Granata, “Improved calculation of synchrotron
    radiation losses in realistic tokamak plasmas,” Nuclear Fusion, vol. 41, no. 6,
    pp. 665-678, Jun. 2001, doi: https://doi.org/10.1088/0029-5515/41/6/301.

    [2] I. Fidone, G Giruzzi, and G. Granata, “Synchrotron radiation loss in
    tokamaks of arbitrary geometry,” Nuclear Fusion, vol. 41, no. 12, pp. 1755-1758,
    Dec. 2001, doi: https://doi.org/10.1088/0029-5515/41/12/102.
    """
    # Variable names are created to closely match those from the reference papers.

    ne0_20 = 1.0e-20 * nd_plasma_electron_on_axis

    p_a0 = 6.04e3 * (rminor * ne0_20) / b_plasma_toroidal_on_axis

    g_function = 0.93 * (1.0 + 0.85 * np.exp(-0.82 * aspect))

    k_function = (
        (alphan + 3.87 * alphat + 1.46) ** -0.79
        * (1.98 + alphat) ** 1.36
        * tbeta**2.14
        * (tbeta**1.53 + 1.87 * alphat - 0.16) ** -1.33
    )

    dum = (
        1.0
        + 0.12
        * (temp_plasma_electron_on_axis_kev / p_a0**0.41)
        * (1.0 - f_sync_reflect) ** 0.41
    ) ** -1.51

    p_sync_mw = (
        3.84e-8
        * (1.0 - f_sync_reflect) ** 0.62
        * rmajor
        * rminor**1.38
        * kappa**0.79
        * b_plasma_toroidal_on_axis**2.62
        * ne0_20**0.38
        * temp_plasma_electron_on_axis_kev
        * (16.0 + temp_plasma_electron_on_axis_kev) ** 2.61
        * dum
        * g_function
        * k_function
    )

    # pden_plasma_sync_vol_avg_mw should be per unit volume; Albajar gives
    # it as total

    return p_sync_mw / vol_plasma